<feed xmlns='http://www.w3.org/2005/Atom'>
<title>suspect-devices/circuitpython/ports/nrf/common-hal/microcontroller, branch encoding</title>
<subtitle>CircuitPython - a Python implementation for teaching coding with microcontrollers</subtitle>
<id>https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=encoding</id>
<link rel='self' href='https://git.suspectdevices.com/suspect-devices/circuitpython/atom?h=encoding'/>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/'/>
<updated>2020-07-15T14:26:47+00:00</updated>
<entry>
<title>nRF: Always use sd_nvic_critical_region calls</title>
<updated>2020-07-15T14:26:47+00:00</updated>
<author>
<name>Jeff Epler</name>
<email>jepler@gmail.com</email>
</author>
<published>2020-07-14T22:34:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=dc74ae83da6f519a36d75388b5be9923a10bf063'/>
<id>urn:sha1:dc74ae83da6f519a36d75388b5be9923a10bf063</id>
<content type='text'>
The motivation for doing this is so that we can allow
common_hal_mcu_disable_interrupts in IRQ context, something that works
on other ports, but not on nRF with SD enabled.  This is because
when SD is enabled, calling sd_softdevice_is_enabled in the context
of an interrupt with priority 2 or 3 causes a HardFault.  We have chosen
to give the USB interrupt priority 2 on nRF, the highest priority that
is compatible with SD.

Since at least SoftDevice s130 v2.0.1, sd_nvic_critical_region_enter/exit
have been implemented as inline functions and are safe to call even if
softdevice is not enabled.  Reference kindly provided by danh:
 https://devzone.nordicsemi.com/f/nordic-q-a/29553/sd_nvic_critical_region_enter-exit-missing-in-s130-v2

Switching to these as the default/only way to enable/disable interrupts
simplifies things, and fixes several problems and potential problems:
 * Interrupts at priority 2 or 3 could not call common_hal_mcu_disable_interrupts
   because the call to sd_softdevice_is_enabled would HardFault
 * Hypothetically, the state of sd_softdevice_is_enabled
   could change from the disable to the enable call, meaning the calls
   would not match (__disable_irq() could be balanced with
   sd_nvic_critical_region_exit).

This also fixes a problem I believe would exist if disable() were called
twice when SD is enabled.  There is a single "is_nested_critical_region"
flag, and the second call would set it to 1.  Both of the enable()
calls that followed would call critical_region_exit(1), and interrupts
would not properly be reenabled.  In the new version of the code,
we use our own nesting_count value to track the intended state, so
now nested disable()s only call critical_region_enter() once, only
updating is_nested_critical_region once; and only the second enable()
call will call critical_region_exit, with the right value of i_n_c_r.

Finally, in port_sleep_until_interrupt, if !sd_enabled, we really do
need to __disable_irq, rather than using the common_hal_mcu routines;
the reason why is documented in a comment.
</content>
</entry>
<entry>
<title>watchdog: use common_hal_watchdog_* pattern</title>
<updated>2020-05-27T03:38:29+00:00</updated>
<author>
<name>Sean Cross</name>
<email>sean@xobs.io</email>
</author>
<published>2020-05-27T03:25:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=aac5a4f178f311eb2aaf7d58135e9df49f80f7c4'/>
<id>urn:sha1:aac5a4f178f311eb2aaf7d58135e9df49f80f7c4</id>
<content type='text'>
This pulls all common functionality into `shared-bindings` and keeps
platform-specific code inside `nrf`. Additionally, this performs most
validation in the `shared-bindings` site.

The only validation that occurs inside platform-specific `common-hal`
code is related to timeout limits that are platform-specific.

Additionally, all documentation is now inside the `shared-bindings`
directory.

Signed-off-by: Sean Cross &lt;sean@xobs.io&gt;
</content>
</entry>
<entry>
<title>nrf: microcontroller: use port reset path</title>
<updated>2020-05-27T03:28:49+00:00</updated>
<author>
<name>Sean Cross</name>
<email>sean@xobs.io</email>
</author>
<published>2020-05-22T11:34:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=5edc29c6a592fc70f6d273dc89c3dd1be8afcb13'/>
<id>urn:sha1:5edc29c6a592fc70f6d273dc89c3dd1be8afcb13</id>
<content type='text'>
For `microcontroller.reset()`, don't manually call NVIC_SystemReset().
Instead, call the `port_reset()` in case the port wants to do any
cleanup.

Signed-off-by: Sean Cross &lt;sean@xobs.io&gt;
</content>
</entry>
<entry>
<title>watchdogtimer: refactor to new api</title>
<updated>2020-05-27T03:28:49+00:00</updated>
<author>
<name>Sean Cross</name>
<email>sean@xobs.io</email>
</author>
<published>2020-05-22T04:35:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=08362c9cabce24ffdc2bd6018ab7fc3e9e6e4801'/>
<id>urn:sha1:08362c9cabce24ffdc2bd6018ab7fc3e9e6e4801</id>
<content type='text'>
This refactors the WatchDogTimer API to use the format proposed in
https://github.com/adafruit/circuitpython/pull/2933#issuecomment-632268227

Signed-off-by: Sean Cross &lt;sean@xobs.io&gt;
</content>
</entry>
<entry>
<title>watchdog: rename module from `wdt` and move to `microcontroller`</title>
<updated>2020-05-27T03:28:49+00:00</updated>
<author>
<name>Sean Cross</name>
<email>sean@xobs.io</email>
</author>
<published>2020-05-21T05:47:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=595f6387c2a4f1c919cfab80b07493820ac0051b'/>
<id>urn:sha1:595f6387c2a4f1c919cfab80b07493820ac0051b</id>
<content type='text'>
This also places it under the `microcontroller` object.

Signed-off-by: Sean Cross &lt;sean@xobs.io&gt;
</content>
</entry>
<entry>
<title>nrf: add support for nrf52833</title>
<updated>2020-04-21T04:29:56+00:00</updated>
<author>
<name>Sean Cross</name>
<email>sean@xobs.io</email>
</author>
<published>2020-04-17T02:35:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=3ed5b87b8fea218c0485282ed1cf9fdf5a6f687f'/>
<id>urn:sha1:3ed5b87b8fea218c0485282ed1cf9fdf5a6f687f</id>
<content type='text'>
This adds preliminary support for the nRF52833, which is a variant of
the nRF52840 with half the RAM, half the flash, and fewer peripherals.

Signed-off-by: Sean Cross &lt;sean@xobs.io&gt;
</content>
</entry>
<entry>
<title>nrf: protomatter port</title>
<updated>2020-04-14T23:24:58+00:00</updated>
<author>
<name>Jeff Epler</name>
<email>jepler@gmail.com</email>
</author>
<published>2020-04-01T16:57:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=1d8a073c05c36133e02d839ed187b9d7abf24d79'/>
<id>urn:sha1:1d8a073c05c36133e02d839ed187b9d7abf24d79</id>
<content type='text'>
</content>
</entry>
<entry>
<title>track vm_used_ble better</title>
<updated>2020-01-30T14:52:06+00:00</updated>
<author>
<name>Dan Halbert</name>
<email>halbert@halwitz.org</email>
</author>
<published>2020-01-30T14:52:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=87f73e2729be3158ea3bb030644cbc42a4913c4c'/>
<id>urn:sha1:87f73e2729be3158ea3bb030644cbc42a4913c4c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>upgrade nrfx API to v2</title>
<updated>2019-12-17T14:39:52+00:00</updated>
<author>
<name>hathach</name>
<email>thach@tinyusb.org</email>
</author>
<published>2019-12-17T14:39:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=894cad2e177cf1af5258ce07a78acb386c34ef68'/>
<id>urn:sha1:894cad2e177cf1af5258ce07a78acb386c34ef68</id>
<content type='text'>
</content>
</entry>
<entry>
<title>wip</title>
<updated>2019-12-06T03:45:53+00:00</updated>
<author>
<name>Dan Halbert</name>
<email>halbert@halwitz.org</email>
</author>
<published>2019-12-06T03:45:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.suspectdevices.com/suspect-devices/circuitpython/commit/?id=40434d691934cf7f5792f91ce0288beb568bab85'/>
<id>urn:sha1:40434d691934cf7f5792f91ce0288beb568bab85</id>
<content type='text'>
</content>
</entry>
</feed>
