summaryrefslogtreecommitdiff
path: root/ports/nrf
AgeCommit message (Collapse)Author
2020-06-05Add nice!nano board supportNick
2020-06-03Fix up end of file and trailing whitespace.Diego Elio Pettenò
This can be enforced by pre-commit, but correct it separately to make it easier to review.
2020-06-01Merge remote-tracking branch 'adafruit/master' into wdt-nrfScott Shawcroft
2020-06-01Merge pull request #2890 from jepler/nrf-audio-tickScott Shawcroft
nrf: put supervisor enable/disable tick in place
2020-06-01Merge remote-tracking branch 'adafruit/master' into wdt-nrfScott Shawcroft
2020-05-29Merge remote-tracking branch 'adafruit/master' into wdt-nrfScott Shawcroft
2020-05-29enable aesio on all nRF52840 boardsDan Halbert
2020-05-28A number of small ESP32S2 fixes:Scott Shawcroft
* Fix flash writes that don't end on a sector boundary. Fixes #2944 * Fix enum incompatibility with IDF. * Fix printf output so it goes out debug UART. * Increase stack size to 8k. * Fix sleep of less than a tick so it doesn't crash.
2020-05-27Merge remote-tracking branch 'adafruit/master' into wdt-nrfScott Shawcroft
2020-05-27Correct HiiBot BlueFi USB_PIDDan Halbert
Donated a PID set for HiiBot BlueFi.
2020-05-27watchdog: use common_hal_watchdog_* patternSean Cross
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 <sean@xobs.io>
2020-05-27nrf: add ticks (not subticks) to overflow count during resetSean Cross
Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27nrf: set WDT priority to 2Sean Cross
The previous setting of `1` meant that the bluetooth system couldn't be used when the watchdog timer was enabled. Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27nrf: pca10100: disable some unused features to shrink imageSean Cross
This removes some features that are largely unused in order to get the image to fit. Recommended in https://github.com/adafruit/circuitpython/pull/2933#issuecomment-632859678 Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27nrf: simmel: shrink filesystem to fit watchdog timerSean Cross
The watchdog timer has increased the amount of code and text that's required. Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27nrf: port: save rtc value across rebootsSean Cross
As part of the reset process, save the current tick count to an uninitialized memory location. That way, the current tick value will be preserved across reboots. A reboot will cause us to lose a certain number of ticks, depending on how long a reboot takes, however if reboots are infrequent then this will not be a large amount of time lost. Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27nrf: microcontroller: use port reset pathSean Cross
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 <sean@xobs.io>
2020-05-27watchdog: move timeout exception to shared-bindingsSean Cross
Make this exception globally available to all platforms that have enabled the watchdog timer. Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27nrf: reset watchdog as part of port_reset()Sean Cross
Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27nrf: common-hal: finish reworking exceptionsSean Cross
This finishes the rework of the exception handler, which is once again stored inside the watchdog timer module. This also implements a `watchdog_reset()` that is used to disable the RAISE watchdog, if one is enabled. Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27Revert "add WatchDogTimeout exception"Sean Cross
This reverts commit 561e7e619095869f58fc728d428f3ff20e8bfc40.
2020-05-27nrf: watchdog: use nrfx_wdt driverSean Cross
Instead of directly poking registers, use `nrfx_wdt`. Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27nrf: boot into safe mode sometimes for watchdog resetSean Cross
If the watchdog resets the system and we're plugged into USB, boot into safe mode. Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27watchdogtimer: refactor to new apiSean Cross
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 <sean@xobs.io>
2020-05-27add WatchDogTimeout exceptionSean Cross
This adds an exception to be raised when the WatchDogTimer times out. Note that this currently causes a HardFault, and it's not clear why it's not behaving properly. Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27nrf: discard arm exception sectionsSean Cross
Since these exceptions are unused, don't include them in the output binary. Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27nrf: watchdog: implement software watchdogtimerSean Cross
This adds a software WatchDogTimer implementation that can be used for testing. Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27watchdog: rename module from `wdt` and move to `microcontroller`Sean Cross
This also places it under the `microcontroller` object. Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27nrf: enable wdt for all platformsSean Cross
Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27nrf: simmel: enable wdt supportSean Cross
This enables WDT support for Simmel. Other platforms cannot yet use WDT because it overflows their flash storage. Enable CIRCUITPY_WDT support for the nrf target. Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27nrf: add watchdog moduleSean Cross
Add common-hal bindings to allow the watchdog module to be used on nrf platforms. Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27nrf: ld: add ARM.exidx to output imageSean Cross
With the WDT changes, building Circuit Python results in the following error: /opt/gcc-arm-none-eabi-9-2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: section .ARM.exidx LMA [00000000000621c8,00000000000621cf] overlaps section .data LMA [00000000000621c8,0000000000062383] This is because unwinding data is getting generated, but has nowhere to go. Re-enable this data in the linker script so it is saved. Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-26Merge remote-tracking branch 'adafruit/master' into esp32s2_digitalioScott Shawcroft
2020-05-26Merge pull request #2955 from BradChan/masterDan Halbert
Add hiibot_bluefi board definitions
2020-05-21Merge branch 'master' into esp32s2_digitalioScott Shawcroft
2020-05-21nrf: nvm: assume sd is not enabled if interrupts are offSean Cross
If interrupts are disabled, then calling sd_* functions will hardfault. Instead, assume that it's safe to write if interrupts are disabled. Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-21nrf: port: add memory barrier before wfiSean Cross
ARM recommends issuing a DSB instruction propr to issuing WFI, as it is required on many parts suchas Cortex-M7. This is effectively a no-op on the Cortex-M4 used in most NRF parts, however it ensures that we won't be surprised when new parts come out. See http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dai0321a/BIHICBGB.html for more information. Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-21nrf: disable interrupts before running wfiSean Cross
In order to ensure we don't have any outstanding requests, disable interrupts prior to issuing `WFI`. As part of this process, check to see if there are any pending USB requests, and only execute the `WFI` if there is no pending data. This fixes #2855 on NRF. Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-20Merge pull request #2932 from simmel-project/nrf-rtc-resetScott Shawcroft
nrf: reset rtc as part of port_reset()
2020-05-20Merge remote-tracking branch 'adafruit/master' into esp32s2_digitalioScott Shawcroft
2020-05-20Update digitalio api for other portsScott Shawcroft
2020-05-20nrf: reset rtc as part of port_reset()Sean Cross
On NRF, the `rtc_reset()` function is never called. As a result, calls to `time.time()` return a cryptic error> ``` >>> import time >>> time.time() '' object has no attribute 'datetime' >>> ``` This is because `MP_STATE_VM(rtc_time_source)` is not initialized due to `rtc_reset()` never being called. If `CIRCUITPY_RTC` is enabled, call `rtc_reset()` as part of the `reset_port()` call. This ensures that `time.time()` works as expected. Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-19Merge pull request #2910 from tannewt/esp32s2Scott Shawcroft
Add initial ESP32S2 support
2020-05-19nrf: _bleio: clean up timeout calculationSean Cross
The timeout value is calculated by the common-hal layer now, so we don't need to be quite so clever about calculating it here. Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-19bleio: adapter: add advertising timeout and statusSean Cross
Add a field to allow specifying a timeout when initiating advertising. As part of this, add a new property to determine if the device is still advertising. Additionally, have the `anonymous` property require a timeout, and set the timeout to the maximum possible value if no timeout is specified. Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-19_bleio: support anonymous advertisingSean Cross
Add a new parameter to the `start_advertising()` function to enable anonymous advertising. This forces a call to `sd_ble_gap_privacy_set()` with `privacy_mode` set to `BLE_GAP_PRIVACY_MODE_DEVICE_PRIVACY` and `private_addr_type` set to `BLE_GAP_ADDR_TYPE_RANDOM_PRIVATE_RESOLVABLE`. With this, addresses will cycle at a predefined rate (currently once every 15 minutes). Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-18Merge pull request #2837 from k0d/serial-debugScott Shawcroft
Add support for a debug console, such as ST-Link VCP.
2020-05-19Enable showing the console on a debug uartMark Olsson
2020-05-18Merge remote-tracking branch 'adafruit/master' into esp32s2Scott Shawcroft
2020-05-18nrf: port: call common_hal_rtc_init() during initSean Cross
Call the new function to set the RTC, or reset it if the offset is not valid. Signed-off-by: Sean Cross <sean@xobs.io>