Commit Graph

3410 Commits

Author SHA1 Message Date
Nick 33496e9c68 Add nice!nano board support 2020-06-05 19:58:54 -05:00
Lucian Copeland 93cffaa87e Fix pin macros typo, add extra flash protection 2020-06-05 16:43:08 -04:00
Lucian Copeland ad0971fb25 Override HAL_Delay and HAL_GetTick 2020-06-05 13:56:32 -04:00
Scott Shawcroft 6400113bb9
Merge pull request #3001 from hierophect/mimxrt-teensy-boot
mimxrt10xx: Disable pin_reset on 1060 boards
2020-06-05 10:28:53 -07:00
Lucian Copeland a0977cac7b Merge remote-tracking branch 'upstream/master' into stm32-LSE-startup-fix 2020-06-04 16:15:38 -04:00
Lucian Copeland 74effeeefd Add temporary fix warning 2020-06-04 13:30:07 -04:00
Lucian Copeland d14e34449b Rework LSE clock init, allow clock overrides 2020-06-04 13:21:29 -04:00
Lucian Copeland c93ccd1e91 Disable pin resets on the 1060 2020-06-03 12:07:08 -04:00
Diego Elio Pettenò dd5d7c86d2 Fix up end of file and trailing whitespace.
This can be enforced by pre-commit, but correct it separately to make it easier to review.
2020-06-03 10:56:35 +01:00
Lucian Copeland b5b9a56918 Update teensy 4.0/4.1 pin protections 2020-06-02 18:05:59 -04:00
Scott Shawcroft db04fd1725
Merge pull request #2933 from simmel-project/wdt-nrf
Add Watchdog timer and add support for NRF watchdog
2020-06-02 10:33:24 -07:00
Sean Cross ed8a52d1db litex: remove call to `board_init()`
These calls were all moved into `main.c`, however this call was not
removed from litex. As a result, litex was calling `board_init()` twice.

This is currently not a problem, as `fomu` is able to be initialized
twice without issue, however future boards may have issue with this.

This fixes #2991.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-06-02 10:19:40 +08:00
Scott Shawcroft 959f7297da
Merge remote-tracking branch 'adafruit/master' into wdt-nrf 2020-06-01 17:01:16 -07:00
Scott Shawcroft 4146d6f872
Merge pull request #2890 from jepler/nrf-audio-tick
nrf: put supervisor enable/disable tick in place
2020-06-01 15:51:22 -07:00
Scott Shawcroft dd2cd6f002
Merge pull request #2979 from hierophect/stm32-remove-crystals
STM32: Set correct crystal settings on Discovery boards
2020-06-01 15:21:39 -07:00
Scott Shawcroft 323cca8910
Merge remote-tracking branch 'adafruit/master' into wdt-nrf 2020-06-01 15:18:12 -07:00
Lucian Copeland 75eb44f234 Note temporary issue with Nucleo boards 2020-06-01 12:26:08 -04:00
Kamil Tomaszewski ce337eaa27 Fix port_get_raw_ticks 2020-06-01 11:35:46 +02:00
Dan Halbert 4667d4de8c
Merge pull request #2975 from dhalbert/aesio-nrf52840
enable aesio on all nRF52840 boards
2020-05-29 14:07:30 -04:00
Lucian Copeland 0fe7efdf36 Set correct crystal settings on Discovery boards 2020-05-29 14:01:34 -04:00
Scott Shawcroft ddcae19254
Merge pull request #2964 from hierophect/mimxrt-busio-cleanup
mimxrt10xx: Busio cleanup and bugfixes
2020-05-29 10:42:16 -07:00
Scott Shawcroft 2fd7a43f2f
Merge remote-tracking branch 'adafruit/master' into wdt-nrf 2020-05-29 10:16:24 -07:00
Lucian Copeland fe75c7793c Fix SWO/Analog overlap, style changes 2020-05-29 12:19:37 -04:00
Dan Halbert 0d2fee95e2 enable aesio on all nRF52840 boards 2020-05-29 11:06:30 -04:00
Scott Shawcroft 2fb4fa3289
Spill registers before scanning the stack.
From the change:

    // xtensa has more registers than an instruction can address. The 16 that
    // can be addressed are called the "window". When a function is called or
    // returns the window rotates. This allows for more efficient function calls
    // because ram doesn't need to be used. It's only used if the window wraps
    // around onto itself. At that point values are "spilled" to empty spots in
    // the stack that were set aside. When the window rotates back around (on
    // function return), the values are restored into the register from ram.

    // So, in order to read the values in the stack scan we must make sure all
    // of the register values we care about have been spilled to RAM. Luckily,
    // there is a HAL call to do it. There is a bit of a race condition here
    // because the register value could change after it's been restored but that
    // is unlikely to happen with a heap pointer while we do a GC.

Fixes #2907
2020-05-28 18:34:14 -07:00
Scott Shawcroft 796373b8be
A number of small ESP32S2 fixes:
* 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-28 15:43:55 -07:00
Scott Shawcroft a9419b5d46
Update ESP IDF 2020-05-28 15:38:48 -07:00
Lucian Copeland 9ee278d2ac Merge remote-tracking branch 'upstream/master' into mimxrt-busio-cleanup 2020-05-28 12:24:37 -04:00
Lucian Copeland fd00bb8b7f Fix pin reset flash conflict error 2020-05-28 12:15:21 -04:00
Scott Shawcroft 9380c34cf7
Merge remote-tracking branch 'adafruit/master' into wdt-nrf 2020-05-27 10:47:08 -07:00
Scott Shawcroft 0db8b888d3
Merge pull request #2934 from hierophect/mimxrt-uart-oneway
mimxrt10xx: add one-directional UART
2020-05-27 10:38:00 -07:00
Lucian Copeland a59798ed49 Merge branch 'mimxrt-uart-oneway' into mimxrt-busio-cleanup 2020-05-27 12:31:16 -04:00
Lucian Copeland 9f5520135c translations 2020-05-27 11:54:52 -04:00
Lucian Copeland a25e10ed59 Merge branch 'mimxrt-uart-oneway' of https://github.com/hierophect/circuitpython into mimxrt-uart-oneway 2020-05-27 11:49:11 -04:00
Lucian Copeland 1e914ac2b0 Change exception text and type 2020-05-27 11:48:52 -04:00
Dan Halbert d06a7c4671
Correct HiiBot BlueFi USB_PID
Donated a PID set for HiiBot BlueFi.
2020-05-27 11:47:15 -04:00
Lucian Copeland 53fb699436 Add pin resetting across boards, fix array size detection issue 2020-05-27 11:45:15 -04:00
arturo182 ad988013f0
Merge pull request #2961 from arturo182/i2c-exception
mimxrt10xx: Change exception type to match other ports
2020-05-27 11:24:46 +02:00
Sean Cross aac5a4f178 watchdog: use common_hal_watchdog_* pattern
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-27 11:38:29 +08:00
Sean Cross e470376c12 nrf: add ticks (not subticks) to overflow count during reset
Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27 11:28:50 +08:00
Sean Cross 296ba101ec nrf: set WDT priority to 2
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-27 11:28:50 +08:00
Sean Cross d0f1b59be5 nrf: pca10100: disable some unused features to shrink image
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-27 11:28:50 +08:00
Sean Cross 33001f4e19 nrf: simmel: shrink filesystem to fit watchdog timer
The watchdog timer has increased the amount of code and text that's
required.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27 11:28:50 +08:00
Sean Cross daf7c2857d nrf: port: save rtc value across reboots
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-27 11:28:49 +08:00
Sean Cross 5edc29c6a5 nrf: microcontroller: use port reset path
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-27 11:28:49 +08:00
Sean Cross c7efc94a33 watchdog: move timeout exception to shared-bindings
Make this exception globally available to all platforms that have
enabled the watchdog timer.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27 11:28:49 +08:00
Sean Cross c5c13a8ba1 nrf: reset watchdog as part of port_reset()
Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27 11:28:49 +08:00
Sean Cross 108409c6cd nrf: common-hal: finish reworking exceptions
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-27 11:28:49 +08:00
Sean Cross bd086a102e Revert "add WatchDogTimeout exception"
This reverts commit 561e7e619095869f58fc728d428f3ff20e8bfc40.
2020-05-27 11:28:49 +08:00
Sean Cross 589cb1af6d nrf: watchdog: use nrfx_wdt driver
Instead of directly poking registers, use `nrfx_wdt`.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27 11:28:49 +08:00
Sean Cross e738f5eaa1 nrf: boot into safe mode sometimes for watchdog reset
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-27 11:28:49 +08:00
Sean Cross 08362c9cab watchdogtimer: refactor to new api
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-27 11:28:49 +08:00
Sean Cross ae950bc050 add WatchDogTimeout exception
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-27 11:28:49 +08:00
Sean Cross 0169ea5155 nrf: discard arm exception sections
Since these exceptions are unused, don't include them in the output
binary.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27 11:28:49 +08:00
Sean Cross 8f46133917 nrf: watchdog: implement software watchdogtimer
This adds a software WatchDogTimer implementation that can be used for
testing.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27 11:28:49 +08:00
Sean Cross 595f6387c2 watchdog: rename module from `wdt` and move to `microcontroller`
This also places it under the `microcontroller` object.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27 11:28:49 +08:00
Sean Cross c23f151b6b nrf: enable wdt for all platforms
Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-27 11:28:48 +08:00
Sean Cross fbe1c05832 nrf: simmel: enable wdt support
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-27 11:28:48 +08:00
Sean Cross abd01c5fbb nrf: add watchdog module
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-27 11:28:48 +08:00
Sean Cross 17ef2df2ca nrf: ld: add ARM.exidx to output image
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-27 11:28:48 +08:00
Dan Halbert 3574670226
Merge pull request #2931 from tannewt/esp32s2_digitalio
Finish digitalio and pin use tracking for ESP32S2
2020-05-26 19:18:45 -04:00
Scott Shawcroft c917270da7
Merge pull request #2956 from hathach/fix-samd-wfi
fix racing issue for SAMD when executing WFI
2020-05-26 14:54:24 -07:00
Scott Shawcroft ffe0e0edc3
Merge pull request #2938 from DavePutz/issue2894
Add an increment to tcc_refcount to allow deinit to work correctly
2020-05-26 14:39:59 -07:00
arturo182 d6c59c4de0 mimxrt10xx: Change exception type to match other ports 2020-05-26 22:36:30 +02:00
Scott Shawcroft 665fe7a839
Merge pull request #2945 from pewpew-game/fluff_m0
Add support for Fluff M0
2020-05-26 13:18:55 -07:00
Scott Shawcroft 2ffd70417d
Merge remote-tracking branch 'adafruit/master' into esp32s2_digitalio 2020-05-26 13:09:57 -07:00
Dan Halbert 19f0d82048
Merge pull request #2955 from BradChan/master
Add hiibot_bluefi board definitions
2020-05-26 15:37:35 -04:00
Radomir Dopieralski 4974c933b1 Fix swapped SCK and MISO in Fluff M0 2020-05-26 03:29:05 +02:00
Dan Halbert f1436410bd
Merge pull request #2951 from jepler/remove-modules-to-fit-translations
Remove modules to fit translations
2020-05-25 09:51:57 -04:00
hathach e79340601f fix racing issue for SAMD when executing WFI 2020-05-25 20:51:02 +07:00
Jeff Epler 5cffd7e88d trinket_m0_haxpress: disable RTC to make build fit with upcoming translations 2020-05-23 20:48:38 -05:00
Jeff Epler eb85304d04 escornabot: disable RTC to make build fit with upcoming translations 2020-05-23 20:48:38 -05:00
Jeff Epler 03866c0598 meowmeow: disable modules to make build fit with upcoming translations 2020-05-23 20:41:25 -05:00
Jeff Epler 2ed40075a5 pyruler: disable RTC to make build fit with upcoming translations 2020-05-23 20:36:33 -05:00
Lucian Copeland d95022f7bb Merge remote-tracking branch 'upstream/master' into mimxrt-busio-cleanup 2020-05-22 13:33:08 -04:00
Radomir Dopieralski 4c01ddcbab Add support for Fluff M0 2020-05-22 18:51:12 +02:00
hierophect fe10a45533
Merge branch 'master' into mimxrt-uart-oneway 2020-05-22 11:32:41 -04:00
Lucian Copeland 75b5142954 Minor style changes and translations 2020-05-22 11:31:52 -04:00
jerryneedell 93df3b89e8 allow PORT specifcation for esp32s2 flashing 2020-05-22 09:54:29 -04:00
DavePutz 2e05f628f0
Add an increment to tcc_refcount to allow deinits to work properly 2020-05-21 11:08:26 -05:00
Scott Shawcroft 3bb6a32a20
Merge branch 'master' into esp32s2_digitalio 2020-05-21 08:52:39 -07:00
Sean Cross 67cf005ee5 nrf: nvm: assume sd is not enabled if interrupts are off
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-21 22:04:20 +08:00
Sean Cross fd4ef233c6 nrf: port: add memory barrier before wfi
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-21 21:46:37 +08:00
Sean Cross 77cf4dce8f nrf: disable interrupts before running wfi
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-21 21:43:52 +08:00
jason 4f54514be4 Initial version 2020-05-20 21:11:06 -05:00
Scott Shawcroft c32214ccc7
Merge pull request #2932 from simmel-project/nrf-rtc-reset
nrf: reset rtc as part of port_reset()
2020-05-20 11:39:16 -07:00
Scott Shawcroft a43876ad1e
Fix esp wrover 2020-05-20 11:37:29 -07:00
Scott Shawcroft 0af5dd59f2
Merge pull request #2898 from hierophect/mimxrt-claiming
MIMXRT: Implement pin claiming, pin reset, and pin protections
2020-05-20 11:32:22 -07:00
Scott Shawcroft ba724fffb4
Merge remote-tracking branch 'adafruit/master' into esp32s2_digitalio 2020-05-20 10:48:27 -07:00
Lucian Copeland 66c09efae2 Add UART one-way instance search, fix bugs in stm32 implementation 2020-05-20 12:48:01 -04:00
Scott Shawcroft fd0420d432
Update digitalio api for other ports 2020-05-20 09:23:42 -07:00
Sean Cross 4cca455c9b 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>
2020-05-20 16:44:18 +08:00
Scott Shawcroft 80517c4cf6
First try at critical section support 2020-05-19 17:49:17 -07:00
Scott Shawcroft 49090d1378
Fully implement digitalio and pin-in-use tracking.
Fixes #2901
2020-05-19 17:46:29 -07:00
Scott Shawcroft 916ca9f8a6
Merge pull request #2910 from tannewt/esp32s2
Add initial ESP32S2 support
2020-05-19 12:53:23 -07:00
Lucian Copeland 38fd9c25f2 Re-add APA102 2020-05-19 15:33:34 -04:00
Scott Shawcroft acf4b1bede
Remove reverse methods from per-board defs 2020-05-19 11:43:57 -07:00
Lucian Copeland b310b04007 Remove pin/port distinction 2020-05-19 14:20:07 -04:00
Scott Shawcroft 9eb85a5feb
shrink Xinabox CS11 by turning off unused pins 2020-05-19 10:55:02 -07:00
Lucian Copeland 2acd173e14 Implement core requested changes 2020-05-19 13:54:47 -04:00
Sean Cross c1bcc25b88 nrf: _bleio: clean up timeout calculation
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-19 21:56:39 +08:00
Sean Cross 34f91f01c6 bleio: adapter: add advertising timeout and status
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 15:01:19 +08:00
Sean Cross cfe65742a3 _bleio: support anonymous advertising
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-19 15:01:18 +08:00
Scott Shawcroft 2c2b53303d
Merge pull request #2837 from k0d/serial-debug
Add support for a debug console, such as ST-Link VCP.
2020-05-18 18:13:31 -07:00
Scott Shawcroft 03b6f7b87b
Add commend about FreeRTOS stack canary 2020-05-18 17:28:13 -07:00
Scott Shawcroft 164628282d
Update TinyUSB and shorten USB task delay 2020-05-18 17:27:49 -07:00
Mark Olsson 007c92ee6a Enable showing the console on a debug uart 2020-05-19 02:02:52 +02:00
Scott Shawcroft cf690bd390
Merge remote-tracking branch 'adafruit/master' into esp32s2 2020-05-18 16:46:41 -07:00
Scott Shawcroft 32617d5f2f
Merge pull request #2925 from arturo182/imx-spi
mimxrt1010: Increase max SPI speed
2020-05-18 15:22:42 -07:00
Scott Shawcroft ebfc1f2599
Merge pull request #2926 from arturo182/imx-temperature-fix
mimxrt10xx: Fix cpu.temperature crash
2020-05-18 15:20:21 -07:00
Scott Shawcroft af68ddebef
Merge pull request #2924 from simmel-project/nrf-rtc-persist
NRF: Persist RTC offset across reboots
2020-05-18 15:06:42 -07:00
Scott Shawcroft 9811c1fe4b
Merge pull request #2896 from theacodes/add-bytearray-decode
Add bytearray.decode() for CPython compatibility
2020-05-18 14:38:45 -07:00
arturo182 058a73128c mimxrt10xx: Fix cpu.temperature crash
Fixes #2514
2020-05-18 22:30:50 +02:00
arturo182 f92d53eaab mimxrt1010: Increase max SPI speed 2020-05-18 22:07:38 +02:00
Sean Cross 9f7c26c60d nrf: port: call common_hal_rtc_init() during init
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>
2020-05-18 11:52:30 +08:00
Sean Cross 83680c41db nrf: rtc: persist rtc offset across reboots
Store the RTC value in the .uninitialized section, but make sure to
flank it with some known values.  That way we can determine if the RTC
value has been initialized, or if it's random uninitialized garbage.

As part of this, add a `common_hal_rtc_init()` routine to determine if
the value is correct, or reset it to 0 if it is not valid.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-18 11:52:27 +08:00
Sean Cross 3b5f5ddaa6 nrf: port: move saved word into .uninitialized section
Circuit Python supports saving a single word of data across reboots.
Previously, this data was placed immediately following the .bss.

However, this appeared to not work, as Circuit Python zeroes out the
heap when it starts up, and the heap begins immediately after the .bss.

Switch to using the new .uninitialized section in order to store this
word across resets.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-18 11:52:25 +08:00
Sean Cross 192bb155fa nrf: port: move the heap after .uninitialized
Previously, it was placed following .bss.  However, now that there is a
new section after .bss, the heap must be moved forward.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-18 11:52:20 +08:00
Sean Cross f002c784c0 nrf: linker: add a new .uninitialized section
This section immediately follows the .bss section, and is designed to
contain uninitialized variables that should persist across reboots.

The section is placed directly after .bss, under the theory that the
size of Circuit Python's .bss + .data is bigger than the bootloader's
.bss + .data, so there is less likely to be a conflict.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-18 11:52:17 +08:00
cyz 4f7b4241a2 add hiibot_bluefi 2020-05-18 09:42:37 +08:00
Dan Halbert e175a64036
disable rotaryio in CPX crickit 2020-05-15 20:35:12 -04:00
Scott Shawcroft a57da6b808
Add port_fixed_stack for more spresence 2020-05-15 17:22:41 -07:00
Scott Shawcroft 8edb8e87c8
Turn reverse methods off for trinket haxpress 2020-05-15 17:22:22 -07:00
Scott Shawcroft 86f865afe0
Turn reverse methods off for cpx_crickit 2020-05-15 16:42:22 -07:00
Scott Shawcroft 3c1469b0a5
Add port_fixed_stack for more builds 2020-05-15 16:22:33 -07:00
Scott Shawcroft 6aaab005c5
Initial ESP32S2 port.
Basic blinky works but doesn't check pins.
2020-05-15 15:36:16 -07:00
Dan Halbert a3ca9401b4
Shrink crickit build 2020-05-15 18:29:37 -04:00
Lucian Copeland 99538c2414 Implement pin claiming, pin reset, and pin protections 2020-05-15 15:16:51 -04:00
Scott Shawcroft 0d8bca92e2
Merge pull request #2810 from dherrada/master
Pyi integration
2020-05-15 10:31:05 -07:00
Scott Shawcroft db4dbe0752
Merge pull request #2889 from jepler/gamepad-tick
Gamepad, GamepadShift: Fix after lower-power by enabling supervisor tick
2020-05-13 11:53:23 -07:00
Jeff Epler eb876e21c3 nrf: code style 2020-05-13 10:40:41 -05:00
Jeff Epler 011acf41c0 nrf: Ensure ticks enabled while playing audio 2020-05-13 10:40:36 -05:00
Jeff Epler adef45403b samd: audio dma: enable/disable supervisor tick as needed 2020-05-13 10:29:36 -05:00
Scott Shawcroft 7546d47f77
Merge remote-tracking branch 'adafruit/master' into improve_verification 2020-05-13 08:23:55 -07:00
Scott Shawcroft 80129c5a21
Disable countio on trinket haxpress 2020-05-12 18:55:49 -07:00
Scott Shawcroft cde6651721
Merge remote-tracking branch 'adafruit/master' into improve_verification 2020-05-12 18:23:59 -07:00
Scott Shawcroft 277e8d528b
Merge branch 'master' into Optical-Encoder-Module 2020-05-12 18:22:57 -07:00
Scott Shawcroft 4e8de3c554
Swap sphinx to autoapi and the inline stubs 2020-05-12 17:28:24 -07:00
warriorofwire 5a80f5e606 nerf vectorio on a ton of m0 and overcommitted m4 boards due to translation text size 2020-05-12 15:23:00 -07:00
Scott Shawcroft d274074f01
Merge remote-tracking branch 'adafruit/master' into vectorio 2020-05-12 12:29:05 -07:00
Scott Shawcroft bc40034a08
Merge branch 'master' into Optical-Encoder-Module 2020-05-12 12:12:51 -07:00
Scott Shawcroft f7303e6bd0
Merge pull request #2754 from maholli/non-standard-nvm
Add non-standard nvm to QSPI for external flash support
2020-05-12 11:56:33 -07:00
Daniel Pollard 62bdfb74e3 removed lib from catwan_usbstick - updated transalations overflowed 2020-05-12 16:40:23 +10:00
Daniel Pollard 5e5461e77e removed countio from catwan_usbstick build 2020-05-12 16:32:35 +10:00
Daniel Pollard ee2cb703c8 merged master 2020-05-12 14:41:28 +10:00
Sean Cross ffaeeda749 nrf: simmel: decrease flash filesystem size
The flash filesystem must be reduced in order to allow the current
build to fit.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-12 09:31:51 +08:00
Sean Cross f7fcd43516 nrf: simmel: disable SPIM3
Disable the SPIM3 controller to avoid needing to dedicate 8 kB to
the SPIM3 block.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-12 09:31:51 +08:00
Sean Cross 370fc7293a nrf: support disabling SPIM3
SPIM3 is faster than all other SPI blocks, and is capable of generating
a 32 MHz clock.  However, it cannot be used at the same time as the BLE
radio without dedicating an additional 8 kB of RAM to it.

Therefore, some boards may want to disable this.  Support pre-defining
NRFX_SPIM3_ENABLED on the command line to disable it on some bords.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-12 09:31:51 +08:00
Sean Cross 79c055f958 nrf: simmel: enable aesio
This adds AES support to simmel.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-12 09:31:51 +08:00
Sean Cross 235098efb8 nrf: simmel: correct CSn pin
The CSn pin is pin 6 on bank 1, not bank 0.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-12 09:31:51 +08:00
Scott Shawcroft 62b835ad76
Merge pull request #2833 from xiongyihui/pitaya-go
add nRF52840 based Makerdiary Pitaya Go
2020-05-11 16:34:27 -07:00
Scott Shawcroft 4937d5f1ca
Merge pull request #2866 from hierophect/stm32-lsetimeout
STM32: Fix LSE hang at startup
2020-05-11 16:23:09 -07:00
Scott Shawcroft 55f78bfb70
Merge pull request #2878 from WarriorOfWire/ujson-stream-protocol
ujson: work with mp stream protocol for fast & easy read
2020-05-11 15:40:27 -07:00
Scott Shawcroft 801d9655e5
Merge pull request #2881 from DavePutz/Issue2872
Added call to rtc_reset() to fix Issue #2872
2020-05-11 15:30:32 -07:00
Lucian Copeland 94949fb46f Add recovery domain write access, adjust stack 2020-05-11 18:02:40 -04:00
Scott Shawcroft 61450cbd56
Add Teensy 4.1 board definition 2020-05-11 13:58:58 -07:00
Lucian Copeland 248704b262 Merge remote-tracking branch 'upstream/master' into stm32-lsetimeout 2020-05-11 14:18:37 -04:00
DavePutz 407938bf3a
Added a check for platforms supporting RTC before calling rtc_reset()
Added an #if CIRCUITPY_RTC check  for platforms supporting RTC
2020-05-11 12:03:44 -05:00
DavePutz 2ddfab315c
Added call to rtc_reset() in rtc_init()
Fix for issue #2872. The rtc_time_source had not been initialized; causing a time.time() call to fail.
2020-05-11 11:31:18 -05:00
warriorofwire eb3d5fa453 ujson: do not eat trailing whitespace
Ujson should only worry about whitespace before JSON.  This becomes apparent when you are using MP stream protocol to read directly from input buffers.

When you attempt to read(1) on a UART (and possibly other protocols) you have to wait for either the byte or the timeout.

Fixes:
- Waiting for a timeout after you have completed reading a correct and complete JSON off the input.
- Raising an OSError after reading a correct and complete JSON off the input.
- Eating more data than semantically owned off the input buffer.
- Blocking to start parsing JSON until the entire JSON body has been loaded into a potentially large, contiguous Python object.

Code you would write before:
```
line = board_busio_uart_port.read_line()
json_dict = json.loads(line)
```
or reaching for fixed buffers and swapping them around in Python.

Code that did not work before that does now:
```
json_dict = json.load(board_busio_uart_port)
```

- This removes the need for intermediate copies of data when reading JSON from micropython stream protocol inputs.
- It also increases total application speed by parsing JSON concurrently with receiving on boards that read from UART via DMA.
- It simplifies code that users write while improving their apps.
2020-05-10 20:45:42 -07:00
warriorofwire 206d0e598a Add vectorio: for drawing shapes
vectorio builds on m4 express feather

Concrete shapes are composed into a VectorShape which is put into a displayio Group for display.

VectorShape provides transpose and x/y positioning for shape implementations.

Included Shapes:

* Circle
  - A radius; Circle is positioned at its axis in the VectorShape.
  - You can freely modify the radius to grow and shrink the circle in-place.

* Polygon
  - An ordered list of points.
  - Beteween each successive point an edge is inferred.  A final edge closing the shape is inferred between the last
    point and the first point.
  - You can modify the points in a Polygon.  The points' coordinate system is relative to (0, 0) so if you'd like a
      top-center justified 10x20 rectangle you can do points [(-5, 0), (5, 0), (5, 20), (0, 20)] and your VectorShape
      x and y properties will position the rectangle relative to its top center point

* Rectangle
  A width and a height.
2020-05-09 15:38:22 -07:00
Max Holliday e6df8e0989 Merge branch 'master' into non-standard-nvm 2020-05-09 12:22:50 -07:00
Dan Halbert 8d00d99ca0
Shrink hallowing_m0_express to fit ko build 2020-05-08 22:51:21 -04:00
Lucian Copeland 5249a7b02c Add timeout and adjustment to LSI 2020-05-08 12:36:39 -04:00
Jeff Epler 182ae10080 Fix build after #2831 (stm32f4xx rgbmatrix) broke it 2020-05-07 18:32:50 -05:00
Scott Shawcroft c3b3eb4c21
Merge pull request #2831 from jepler/rgbmatrix-stm
stm: enable RGBMatrix
2020-05-06 08:35:25 -07:00
Scott Shawcroft 4519ddebeb
Merge pull request #2841 from hierophect/mimxrt-spi-oneway
mimxrt10xx: add one-directional SPI
2020-05-06 08:32:21 -07:00
Daniel Pollard 7f1be814c8 changed build variables as per advice 2020-05-06 09:04:15 +10:00
Lucian Copeland a1330747e8 text fixes, postpone warning disable 2020-05-05 12:46:30 -04:00
hierophect c311b5c002
Merge pull request #2842 from hierophect/stm32-h7-displayio
STM32: Add displayio to F7/H7
2020-05-05 12:37:08 -04:00
Daniel Pollard f63ee9fb9b excluded countio from other smaller boards 2020-05-05 16:15:57 +10:00
Daniel Pollard d5c24b99b8 hallowing m0 - exclude countio 2020-05-05 16:04:28 +10:00
Daniel Pollard bfa5cd9c13 refactor countio based on feedback 2020-05-05 15:23:38 +10:00
Dan Halbert b7836aeac6 address review comments 2020-05-04 19:51:08 -04:00
Dan Halbert bae7a5e433 make translate again 2020-05-04 17:26:59 -04:00
Dan Halbert 602eabe668
Squeeze hallowing_m0_express build slightly
ko build is a little too big.
2020-05-04 17:18:53 -04:00
Dan Halbert c377d4bea7
Merge branch 'master' into non-standard-nvm 2020-05-04 16:08:45 -04:00
Dan Halbert d6c6f9f4f0 add PacketBuffer .incoming_ and .outgoing_packet_length 2020-05-04 15:59:45 -04:00
Dan Halbert 4d7e341e44
Merge pull request #2844 from xobs/add-nrf-pca10100
nrf: add pca10100
2020-05-04 10:51:01 -04:00
Sean Cross b128399d1e nrf: simmel: enable CIRCUITPY_USB_HID
Simmel had USB HID disabled in order to save space.  However, the board
configuration did not set USB_DEVICES, causing it to inherit the default
device bouquet of MSC,CDC,MIDI,HID.  This in turn caused HID to be included
in the USB Configuration Descriptor.

For some reason, this was not a problem in an earlier version of tinyusb or
circuitpython.  However, in the most recent version this has rightfully
caused asserts to appear during configuration.

Re-enable USB_HID for now, as it doesn't add too much in terms of space.
We may disable it again later on if we become pressed for space.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-04 15:37:53 +08:00
Sean Cross cb4fc894d7 nrf: add pca10100
This is the nRF52833-DK board.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-05-04 15:07:49 +08:00
Lucian Copeland 61b0994631 Fix flag typo 2020-05-01 14:46:06 -04:00
Lucian Copeland bc581fbdfb Add-unidirectional-SPI 2020-05-01 13:15:38 -04:00
Yihui Xiong 7dd3ddc06b use Nordic's VID which seems to be allowed
https://devzone.nordicsemi.com/f/nordic-q-a/50638/usb-pid-for-nrf52840
2020-05-01 06:10:43 +00:00
Scott Shawcroft a863b0a349
Fix openmv_h7 build 2020-04-30 13:46:12 -07:00
Scott Shawcroft 1ca90572f1
Merge remote-tracking branch 'adafruit/master' into lower_power 2020-04-30 13:25:31 -07:00
hierophect 10c5bf666e
Merge pull request #2836 from hierophect/stm32-openmv-pid
STM32: Add correct PID for the OpenMV
2020-04-30 16:07:34 -04:00
Lucian Copeland 06b62721b3 Increase H7 filesystem size 2020-04-30 15:49:17 -04:00
Scott Shawcroft 74a2d0944a
Merge pull request #2834 from Teknikio/fix/bluebird_pinout
Update teknikio bluebird pin assignments
2020-04-30 11:50:02 -07:00
Lucian Copeland 435aa3d055 Add correct PID for the OpenMV 2020-04-30 14:49:47 -04:00
Lucian Copeland 4f71bd295d Make PulseIO optional within DisplayIO 2020-04-30 14:47:50 -04:00
Scott Shawcroft f44e1d6a8d
Merge pull request #2828 from simmel-project/add-simmel
WIP: add simmel board
2020-04-30 11:40:34 -07:00
Lucian Copeland 89ff5589c4 Add the OpenMV-H7 R1 board 2020-04-30 12:39:20 -04:00
Jeff Epler e5be728c1c stm: enable protomatter
Testing performed: on stm32f405 feather, all pins change in plausible ways
on a logic probe.  Didn't actually drive a display yet.
2020-04-30 08:58:58 -05:00
JoeBakalor 36a71560c2 update teknikio bluebird pin assignments 2020-04-30 09:58:27 -04:00
Yihui Xiong 4393a88fb6 add nRF52840 based Makerdiary Pitaya Go 2020-04-30 07:38:20 +00:00
Dan Halbert 241d7e2ae6 change many ifndefs to ?= 2020-04-29 23:31:34 -04:00
Dan Halbert f3078511a6 further cleanup and bug fixing 2020-04-29 23:18:08 -04:00
Sean Cross 6aac9233db nrf: bluetooth: add s147 v7.0.1 softdevice hexfile
This was not added as part of the initial v7.0.1 patchset because
.hex files are in this project's .gitignore, and so git ignored it.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-04-30 10:43:46 +08:00
Dan Halbert 180f5c6a94 Merge remote-tracking branch 'adafruit/master' into ringbuf-fixes 2020-04-29 22:11:22 -04:00
Dan Halbert 3d62f87e29 back to '.packet_size' for compatiblity 2020-04-29 22:10:56 -04:00
Dan Halbert 84cee1ab8d rename and improve PacketBuffer packet length property 2020-04-29 17:49:31 -04:00
Scott Shawcroft 3799c34564
Disable bitbangio on CPX Crickit so we have room for lower_power.
Enable pixelbuf in its place because we'll need it soon.
2020-04-29 13:57:09 -07:00
Scott Shawcroft a30ff70b4e
Merge remote-tracking branch 'adafruit/master' into lower_power 2020-04-29 10:51:21 -07:00
Sean Cross 1d0781bf12 nrf: add simmel board
This adds support for Simmel, an nRF52833-based bluetooth tracking
board designed to aid in pandemic tracing.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-04-29 11:40:00 +08:00
Scott Shawcroft 2d7cf4b792
Merge pull request #2819 from hierophect/stm32-readme
STM32: Add port readme, make flash
2020-04-28 12:32:03 -07:00
Max Holliday b2de5a9df9 fixing my goofy gcc-arm local stuff 2020-04-28 12:24:10 -07:00
Max Holliday 6c4decd4e2 decoupling chip specific functions from EXTERNAL_FLASH_QSPI_SINGLE 2020-04-28 11:51:07 -07:00
Max Holliday baad9c11df Merge branch 'master' into non-standard-nvm_cleanup 2020-04-28 11:42:58 -07:00
TG-Techie b9e494b85a add submodule to TG-Watch02A 2020-04-28 00:03:02 -04:00
Scott Shawcroft b7804f450b
Fix stm32746g_discovery
Also, rename it so that matches the other board names.
2020-04-27 20:34:42 -07:00
Scott Shawcroft e45de39998
Fix nucleo_f746zg build 2020-04-27 20:28:05 -07:00
TG-Techie 76b466a38a add submodule to TG-Watch02A 2020-04-27 22:49:30 -04:00
Lucian Copeland 2a0e176a77 Add readme and dfu-flashing 2020-04-27 20:51:47 -04:00
Scott Shawcroft de42e4af02
Merge remote-tracking branch 'adafruit/master' into lower_power 2020-04-27 17:43:32 -07:00
Scott Shawcroft 40a1f3edbc
Merge pull request #2811 from jepler/update-ulab
ulab: actually update the submodule
2020-04-27 17:41:43 -07:00
Scott Shawcroft 755d404edf
Merge remote-tracking branch 'adafruit/master' into lower_power 2020-04-27 16:45:10 -07:00
Dan Halbert faa50df05f
Merge pull request #2817 from jepler/stm-linker-scripts
Standardize on FLASH_FIRMWARE section name in linker scripts
2020-04-27 18:43:26 -04:00
Jeff Epler 7f0f0b30d3 linker scripts: Re-align at ":"
With "git show -b" you can verify that this is a whitespace only change
because the diff will be empty.
2020-04-27 17:17:42 -05:00
Max Holliday 86943ca8a1 Merge remote-tracking branch 'adafruit/master' 2020-04-27 13:51:51 -07:00
Jeff Epler 7eff89e9f9 linker scripts: Re-align at ":"
With "git show -b" you can verify that this is a whitespace only change
because the diff will be empty.
2020-04-27 12:47:52 -05:00
hierophect d9e4155815
Merge branch 'master' into stm32f7_os 2020-04-27 12:58:15 -04:00
Mark Olsson 31d8e46063 Enables os on STM32F7
os.uname() works
os.urandom() doesn't work yet, will enable in another PR
2020-04-27 18:18:43 +02:00
Mark Olsson f9096d83ac Enables PulseIO on STM32F7
Tested on nucleo_f746zg
2020-04-27 17:55:07 +02:00
Jeff Epler 6f6dc835d2 litex: Use FLASH_FIRMWARE instead of FLASH in linker scripts
for compatibility with the build_memory_info script
2020-04-27 09:12:45 -05:00
Jeff Epler 808b456927 mimxrt10xx: Use FLASH_FIRMWARE instead of FLASH_TEXT in linker scripts
for compatibility with the build_memory_info script

This change was scripted:
    git grep -l FLASH_TEXT | xargs sed -i s/FLASH_TEXT/FLASH_FIRMWARE/
2020-04-27 08:07:47 -05:00
Jeff Epler aff42defda stm: Use FLASH_FIRMWARE instead of FLASH_TEXT in linker scripts
for compatibility with the build_memory_info script

This change was scripted:
    git grep -l FLASH_TEXT | xargs sed -i s/FLASH_TEXT/FLASH_FIRMWARE/
2020-04-27 08:07:28 -05:00
Jeff Epler 485f667141 ulab: disable on espruino pico
this non-"express" board is nearly full.  Right now it's actually possible
just to disable the "compare" module, but as this leaves it packed
pretty full I prefer to fully disable it in order to avoid the topic
returning again soon.
2020-04-27 07:47:05 -05:00
Scott Shawcroft 9e4b94f466
Merge pull request #2805 from tannewt/update_tinyusb
Update tinyusb
2020-04-26 20:55:36 -07:00
hierophect 652a5de242
Merge pull request #2809 from k0d/stm32f767xx_fix
Adds missing declarations in periph.h for stm32f767xx
2020-04-25 14:16:34 -04:00
Mark Olsson 8814dd038e Adds missing declarations in periph.h for stm32f767xx 2020-04-25 19:50:48 +02:00
Scott Shawcroft 67c053e9c4
Add USB include for LiteX 2020-04-24 17:24:05 -07:00
Scott Shawcroft 5c7f6e6211
Remove empty #if and add missing includes. 2020-04-24 11:48:55 -07:00
Mark Olsson 91fbbcab19 adds support for the stm32f746g_disco board 2020-04-24 16:43:39 +02:00
Dan Halbert 5a22a5d016
Merge pull request #2598 from hierophect/stm32-docfix
Add stm to docs matrix
2020-04-24 10:07:15 -04:00
Dan Halbert 982a755eae
Merge pull request #2801 from simmel-project/nrf-s140-7.0.1
Add NRF S140 7.0.1
2020-04-23 21:59:51 -04:00
Lucian Copeland bd0df9e3bc Minor redundancy fix 2020-04-23 17:43:35 -04:00
Lucian Copeland c6c77726e7 Merge remote-tracking branch 'upstream/master' into stm32-docfix 2020-04-23 13:39:48 -04:00
Lucian Copeland 8791ca6af3 implement requested changes 2020-04-23 13:33:41 -04:00
hierophect ead7c6c887
Merge pull request #2785 from k0d/ports_nucleo_f746zg
STM32: adds support for stm32f746xx MCU and the nucleo_f746zg board
2020-04-23 12:32:44 -04:00
Mark Olsson 83cc9783cc STM32: adds support for stm32f746xx MCU and the nucleo_f746zg board 2020-04-23 10:48:27 +02:00
Scott Shawcroft f13de32208
Add HSE_VALUE for STM feather. 2020-04-22 14:37:24 -07:00
Lucian Copeland d0a2106547 Remove old build flags, add fixes for shared_matrix 2020-04-22 16:06:08 -04:00
Scott Shawcroft b277944cf0
Fix STM so it matches the correct RTC fields. 2020-04-22 11:10:51 -07:00
Sean Cross 689dd61379 nrf: nrf52833: use s140 v7.0.1
Previously, we were using v6.1.1 which worked, but was unsupported.
v7.0.1 is the first version of s140 that supports the nRF52833.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-04-22 13:34:11 +08:00
Sean Cross 09bef7b0e1 nrf: bluetooth: add s140 v7.0.1
This is the first version with official support for nRF52833.

Signed-off-by: Sean Cross <sean@xobs.io>
2020-04-22 13:33:39 +08:00
Dan Halbert 2f86e31501 fix calculation of nrf firmware size 2020-04-22 00:52:54 -04:00
Dan Halbert fbc8719fad ringbuf tested 2020-04-21 22:40:12 -04:00
Dan Halbert 77cd93ac2d merge from adafruit 2020-04-21 17:47:51 -04:00
Dan Halbert 38ec3bc574 further ringbuf cleanup 2020-04-21 17:38:20 -04:00