| Age | Commit message (Collapse) | Author |
|
|
|
This can be enforced by pre-commit, but correct it separately to make it easier to review.
|
|
|
|
nrf: put supervisor enable/disable tick in place
|
|
|
|
|
|
|
|
* 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.
|
|
|
|
Donated a PID set for HiiBot BlueFi.
|
|
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>
|
|
Signed-off-by: Sean Cross <sean@xobs.io>
|
|
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>
|
|
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>
|
|
The watchdog timer has increased the amount of code and text that's
required.
Signed-off-by: Sean Cross <sean@xobs.io>
|
|
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>
|
|
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>
|
|
Make this exception globally available to all platforms that have
enabled the watchdog timer.
Signed-off-by: Sean Cross <sean@xobs.io>
|
|
Signed-off-by: Sean Cross <sean@xobs.io>
|
|
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>
|
|
This reverts commit 561e7e619095869f58fc728d428f3ff20e8bfc40.
|
|
Instead of directly poking registers, use `nrfx_wdt`.
Signed-off-by: Sean Cross <sean@xobs.io>
|
|
If the watchdog resets the system and we're plugged into USB, boot into
safe mode.
Signed-off-by: Sean Cross <sean@xobs.io>
|
|
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>
|
|
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>
|
|
Since these exceptions are unused, don't include them in the output
binary.
Signed-off-by: Sean Cross <sean@xobs.io>
|
|
This adds a software WatchDogTimer implementation that can be used for
testing.
Signed-off-by: Sean Cross <sean@xobs.io>
|
|
This also places it under the `microcontroller` object.
Signed-off-by: Sean Cross <sean@xobs.io>
|
|
Signed-off-by: Sean Cross <sean@xobs.io>
|
|
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>
|
|
Add common-hal bindings to allow the watchdog module to be used
on nrf platforms.
Signed-off-by: Sean Cross <sean@xobs.io>
|
|
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>
|
|
|
|
Add hiibot_bluefi board definitions
|
|
|
|
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>
|
|
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>
|
|
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>
|
|
nrf: reset rtc as part of port_reset()
|
|
|
|
|
|
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>
|
|
Add initial ESP32S2 support
|
|
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>
|
|
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>
|
|
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>
|
|
Add support for a debug console, such as ST-Link VCP.
|
|
|
|
|
|
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>
|