From fc19e03128aeeb94a22fdff097e4d0576d768986 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sun, 6 Oct 2019 21:30:26 -0400 Subject: [PATCH 01/78] WIP: bonding --- ports/nrf/README.md | 86 ++----------------- ports/nrf/bluetooth/ble_uart.c | 4 +- ports/nrf/boards/adafruit_nrf52840_s140_v6.ld | 1 + ports/nrf/boards/common.ld | 17 ++-- ports/nrf/mpconfigport.h | 10 --- ports/nrf/supervisor/serial.c | 10 +-- py/circuitpy_mpconfig.mk | 14 ++- supervisor/supervisor.mk | 51 +++++------ 8 files changed, 63 insertions(+), 130 deletions(-) diff --git a/ports/nrf/README.md b/ports/nrf/README.md index 5f6d037204..64f5b8aff5 100644 --- a/ports/nrf/README.md +++ b/ports/nrf/README.md @@ -2,43 +2,8 @@ This is a port of CircuitPython to the Nordic Semiconductor nRF52 series of chips. -## Supported Features - -* UART -* SPI -* LEDs -* Pins -* ADC -* I2C -* PWM -* Temperature -* RTC (Real Time Counter. Low-Power counter) -* BLE support including: - * Peripheral role - * Scanner role - * _REPL over Bluetooth LE_ (optionally using WebBluetooth) - * ubluepy: Bluetooth LE module for CircuitPython - * 1 non-connectable advertiser while in connection - -## Tested Hardware - -* nRF52840 - * [PCA10056](http://www.nordicsemi.com/eng/Products/nRF52840-Preview-DK) - -## Board Specific Instructions - -For board-specific instructions on building and flashing CircuitPython, see -the following links: - -> **NOTE**: These board specific readmes may be more up to date than the - generic board-neutral documentation further down. - -* Adafruit Feather nRF52840: `boards/feather_nrf52840_express/README.md`: 1MB Flash, 256KB SRAM -* Nordic PCA10056 (uses nRF52840): `boards/pca10056/README.md` -* MakerDiary nRF52840 MDK: `boards/makerdiary_nrf52840_mdk/README.md` -* MakerDiary nRF52840 MDK USB Dongle: `boards/makerdiary_nrf52840_mdk_usb_dongle/README.md` - -For all other board targets, see the generic notes below. +> **NOTE**: There are board-specific READMEs that may be more up to date than the + generic board-neutral documentation below. ## Compile and Flash @@ -46,41 +11,17 @@ Prerequisite steps for building the nrf port: git clone .git circuitpython cd circuitpython - git submodule update --init + git submodule update --init --recursive make -C mpy-cross +Some boards have UF2 bootloaders and can simply be flashed in the normal way, by copying +firmware.uf2 to the BOOT drive. + To build and flash issue the following command inside the ports/nrf/ folder: make BOARD=pca10056 make BOARD=pca10056 flash -## Compile and Flash with Bluetooth Stack - -First prepare the bluetooth folder by downloading Bluetooth LE stacks and headers: - - ./bluetooth/download_ble_stack.sh - -If the Bluetooth stacks has been downloaded, compile the target with the following command: - - make BOARD=pca10040 SD=s132 - -The **make sd** will trigger a flash of the bluetooth stack before that application is flashed. Note that **make sd** will perform a full erase of the chip, which could cause 3rd party bootloaders to also be wiped. - - make BOARD=pca10040 SD=s132 sd - -Note: further tuning of features to include in bluetooth or even setting up the device to use REPL over Bluetooth can be configured in the `bluetooth_conf.h`. - -## Target Boards and Make Flags - -Target Board (BOARD) | Bluetooth Stack (SD) | Bluetooth Support | Flash Util --------------------------|-------------------------|------------------------|------------------------------- -pca10056 | s140 | Peripheral and Scanner | [Segger](#segger-targets) -feather_nrf52840_express | s140 | Peripheral and Scanner | UF2 bootloader -makerdiary_nrf52840_mdk | s140 | Peripheral and Scanner | pyocd or ARM mbed DAPLink -makerdiary_nrf52840_mdk_usb_dongle | s140 | Peripheral and Scanner | DFU bootloader & nrfutil -electronut_labs_papyr | s140 | Peripheral and Scanner | UF2 bootloader -electronut_labs_blip | s140 | Peripheral and Scanner | Black Magic Probe - ## Segger Targets Install the necessary tools to flash and debug using Segger: @@ -107,22 +48,7 @@ run follow command to install [adafruit-nrfutil](https://github.com/adafruit/Ada * dfu-gen: Generates a Firmware zip to be used by the DFU flash application. * dfu-flash: Triggers the DFU flash application to upload the firmware from the generated Firmware zip file. -Example on how to generate and flash feather_nrf52840 target: - - make BOARD=feather_nrf52840 SD=s140 - make BOARD=feather_nrf52840 SD=s140 dfu-gen dfu-flash - -## Bluetooth LE REPL - -The port also implements a BLE REPL driver. This feature is disabled by default, as it will deactivate the UART REPL when activated. As some of the nRF devices only have one UART, using the BLE REPL free's the UART instance such that it can be used as a general UART peripheral not bound to REPL. - -The configuration can be enabled by editing the `bluetooth_conf.h` and set `MICROPY_PY_BLE_NUS` to 1. When enabled you have different options to test it: * [NUS Console for Linux](https://github.com/tralamazza/nus_console) (recommended) * [WebBluetooth REPL](https://glennrub.github.io/webbluetooth/micropython/repl/) (experimental) - -Other: -* nRF UART application for IPhone/Android - -WebBluetooth mode can also be configured by editing `bluetooth_conf.h` and set `BLUETOOTH_WEBBLUETOOTH_REPL` to 1. This will alternate advertisement between Eddystone URL and regular connectable advertisement. The Eddystone URL will point the phone or PC to download [WebBluetooth REPL](https://glennrub.github.io/webbluetooth/micropython/repl/) (experimental), which subsequently can be used to connect to the Bluetooth REPL from the PC or Phone browser. diff --git a/ports/nrf/bluetooth/ble_uart.c b/ports/nrf/bluetooth/ble_uart.c index 787a2a1174..1e7a319bdd 100644 --- a/ports/nrf/bluetooth/ble_uart.c +++ b/ports/nrf/bluetooth/ble_uart.c @@ -40,7 +40,7 @@ #include "shared-bindings/_bleio/Service.h" #include "shared-bindings/_bleio/UUID.h" -#if (MICROPY_PY_BLE_NUS == 1) +#if CIRCUITPY_SERIAL_BLE static const char default_name[] = "CP-REPL"; // max 8 chars or uuid won't fit in adv data static const char NUS_UUID[] = "6e400001-b5a3-f393-e0a9-e50e24dcca9e"; @@ -190,4 +190,4 @@ void mp_hal_stdout_tx_strn(const char *str, size_t len) { } } -#endif // MICROPY_PY_BLE_NUS +#endif // CIRCUITPY_SERIAL_BLE diff --git a/ports/nrf/boards/adafruit_nrf52840_s140_v6.ld b/ports/nrf/boards/adafruit_nrf52840_s140_v6.ld index 2587a19e34..90b8862cf0 100644 --- a/ports/nrf/boards/adafruit_nrf52840_s140_v6.ld +++ b/ports/nrf/boards/adafruit_nrf52840_s140_v6.ld @@ -24,6 +24,7 @@ MEMORY FLASH_ISR (rx) : ORIGIN = 0x00026000, LENGTH = 0x001000 FLASH_TEXT (rx) : ORIGIN = 0x00027000, LENGTH = 0x086000 FLASH_FATFS (r) : ORIGIN = 0x000AD000, LENGTH = 0x040000 + FLASH_CONFIG (r): ORIGIN = 0x000ED000, LENGTH = 0x007000 /* 0x2000000 - RAM:ORIGIN is reserved for Softdevice */ RAM (xrw) : ORIGIN = 0x20004000, LENGTH = 0x20040000 - 0x20004000 diff --git a/ports/nrf/boards/common.ld b/ports/nrf/boards/common.ld index df81aae583..dfb355a76f 100644 --- a/ports/nrf/boards/common.ld +++ b/ports/nrf/boards/common.ld @@ -2,6 +2,10 @@ __fatfs_flash_start_addr = ORIGIN(FLASH_FATFS); __fatfs_flash_length = LENGTH(FLASH_FATFS); +/* Flash region for configuration information (bonding info, keys, etc.) */ +__config_flash_start_addr = ORIGIN(FLASH_CONFIG); +__config_flash_length = LENGTH(FLASH_CONFIG); + /* define output sections */ SECTIONS { @@ -13,7 +17,7 @@ SECTIONS . = ALIGN(4); } >FLASH_ISR - + /* The program code and other data goes into FLASH */ .text : { @@ -28,7 +32,7 @@ SECTIONS . = ALIGN(4); _etext = .; /* define a global symbol at end of code */ } >FLASH_TEXT - + /* .ARM.extab : { @@ -42,10 +46,10 @@ SECTIONS __exidx_end = .; } >FLASH */ - + /* used by the startup to initialize data */ _sidata = .; - + /* This is the initialized data section The program executes knowing that the data is in the RAM but the loader puts the initial values in the FLASH (inidata). @@ -60,8 +64,8 @@ SECTIONS . = ALIGN(4); _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM - + } >RAM + /* Uninitialized data section */ .bss : { @@ -105,4 +109,3 @@ SECTIONS .ARM.attributes 0 : { *(.ARM.attributes) } } - diff --git a/ports/nrf/mpconfigport.h b/ports/nrf/mpconfigport.h index 0b755a156b..9c3d02f44d 100644 --- a/ports/nrf/mpconfigport.h +++ b/ports/nrf/mpconfigport.h @@ -38,16 +38,6 @@ #define MICROPY_PY_UBINASCII (1) #define MICROPY_PY_UJSON (1) -// TODO this is old BLE stuff -#if BLUETOOTH_SD - #define MICROPY_PY_BLEIO (1) - #define MICROPY_PY_BLE_NUS (0) -#else - #ifndef MICROPY_PY_BLEIO - #define MICROPY_PY_BLEIO (0) - #endif -#endif - // 24kiB stack #define CIRCUITPY_DEFAULT_STACK_SIZE 0x6000 diff --git a/ports/nrf/supervisor/serial.c b/ports/nrf/supervisor/serial.c index 6fd89eb3ea..b19e9267cc 100644 --- a/ports/nrf/supervisor/serial.c +++ b/ports/nrf/supervisor/serial.c @@ -28,15 +28,15 @@ #include "supervisor/serial.h" -#if (MICROPY_PY_BLE_NUS == 1) +#if CIRCUITPY_SERIAL_BLE #include "ble_uart.h" -#else +#elif CIRCUITPY_SERIAL_UART #include #include "nrf_gpio.h" #include "nrfx_uarte.h" #endif -#if (MICROPY_PY_BLE_NUS == 1) +#if CIRCUITPY_SERIAL_BLE void serial_init(void) { ble_uart_init(); @@ -58,7 +58,7 @@ void serial_write(const char *text) { ble_uart_stdout_tx_str(text); } -#elif !defined(NRF52840_XXAA) +#elif CIRCUITPY_SERIAL_UART uint8_t serial_received_char; nrfx_uarte_t serial_instance = NRFX_UARTE_INSTANCE(0); @@ -124,4 +124,4 @@ void serial_write_substring(const char *text, uint32_t len) { } } -#endif +#endif // CIRCUITPY_SERIAL_UART diff --git a/py/circuitpy_mpconfig.mk b/py/circuitpy_mpconfig.mk index c5756f4880..d54e626e2f 100644 --- a/py/circuitpy_mpconfig.mk +++ b/py/circuitpy_mpconfig.mk @@ -23,7 +23,6 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. - # mpconfigboard.mk files can specify: # CIRCUITPY_FULL_BUILD = 1 (which is the default) # or @@ -284,8 +283,21 @@ CIRCUITPY_USTACK = 0 endif CFLAGS += -DCIRCUITPY_USTACK=$(CIRCUITPY_USTACK) +# Non-module conditionals ifndef CIRCUITPY_BITBANG_APA102 CIRCUITPY_BITBANG_APA102 = 0 endif CFLAGS += -DCIRCUITPY_BITBANG_APA102=$(CIRCUITPY_BITBANG_APA102) + +# REPL over BLE +ifndef CIRCUITPY_SERIAL_BLE +CIRCUITPY_SERIAL_BLE = 0 +endif +CFLAGS += -DCIRCUITPY_SERIAL_BLE=$(CIRCUITPY_SERIAL_BLE) + +# REPL over UART +ifndef CIRCUITPY_SERIAL_UART +CIRCUITPY_SERIAL_UART = 0 +endif +CFLAGS += -DCIRCUITPY_SERIAL_UART=$(CIRCUITPY_SERIAL_UART) diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index ee47be4b00..90b0e85d57 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -46,7 +46,7 @@ ifdef EXTERNAL_FLASH_DEVICES else ifeq ($(DISABLE_FILESYSTEM),1) SRC_SUPERVISOR += supervisor/stub/internal_flash.c - else + else SRC_SUPERVISOR += supervisor/internal_flash.c endif endif @@ -58,30 +58,31 @@ ifeq ($(USB),FALSE) SRC_SUPERVISOR += supervisor/serial.c endif else - SRC_SUPERVISOR += lib/tinyusb/src/common/tusb_fifo.c \ - lib/tinyusb/src/device/usbd.c \ - lib/tinyusb/src/device/usbd_control.c \ - lib/tinyusb/src/class/msc/msc_device.c \ - lib/tinyusb/src/class/cdc/cdc_device.c \ - lib/tinyusb/src/class/hid/hid_device.c \ - lib/tinyusb/src/class/midi/midi_device.c \ - lib/tinyusb/src/tusb.c \ - supervisor/shared/serial.c \ - supervisor/usb.c \ - supervisor/shared/usb/usb_desc.c \ - supervisor/shared/usb/usb.c \ - supervisor/shared/usb/usb_msc_flash.c \ - shared-bindings/usb_hid/__init__.c \ - shared-bindings/usb_hid/Device.c \ - shared-bindings/usb_midi/__init__.c \ - shared-bindings/usb_midi/PortIn.c \ - shared-bindings/usb_midi/PortOut.c \ - shared-module/usb_hid/__init__.c \ - shared-module/usb_hid/Device.c \ - shared-module/usb_midi/__init__.c \ - shared-module/usb_midi/PortIn.c \ - shared-module/usb_midi/PortOut.c \ - $(BUILD)/autogen_usb_descriptor.c + SRC_SUPERVISOR += \ + lib/tinyusb/src/common/tusb_fifo.c \ + lib/tinyusb/src/device/usbd.c \ + lib/tinyusb/src/device/usbd_control.c \ + lib/tinyusb/src/class/msc/msc_device.c \ + lib/tinyusb/src/class/cdc/cdc_device.c \ + lib/tinyusb/src/class/hid/hid_device.c \ + lib/tinyusb/src/class/midi/midi_device.c \ + lib/tinyusb/src/tusb.c \ + supervisor/shared/serial.c \ + supervisor/usb.c \ + supervisor/shared/usb/usb_desc.c \ + supervisor/shared/usb/usb.c \ + supervisor/shared/usb/usb_msc_flash.c \ + shared-bindings/usb_hid/__init__.c \ + shared-bindings/usb_hid/Device.c \ + shared-bindings/usb_midi/__init__.c \ + shared-bindings/usb_midi/PortIn.c \ + shared-bindings/usb_midi/PortOut.c \ + shared-module/usb_hid/__init__.c \ + shared-module/usb_hid/Device.c \ + shared-module/usb_midi/__init__.c \ + shared-module/usb_midi/PortIn.c \ + shared-module/usb_midi/PortOut.c \ + $(BUILD)/autogen_usb_descriptor.c CFLAGS += -DUSB_AVAILABLE endif From 7b79ac37399927070e1931022f5759393202ed3d Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Sun, 20 Oct 2019 23:50:12 -0400 Subject: [PATCH 02/78] Parameterize linker script --- main.c | 2 +- ports/atmel-samd/Makefile | 22 ++++- .../boards/arduino_mkr1300/mpconfigboard.h | 4 - .../boards/arduino_mkr1300/mpconfigboard.mk | 1 - .../boards/arduino_mkrzero/mpconfigboard.h | 4 - .../boards/arduino_mkrzero/mpconfigboard.mk | 1 - .../boards/arduino_zero/mpconfigboard.h | 4 - .../boards/arduino_zero/mpconfigboard.mk | 1 - .../boards/bast_pro_mini_m0/mpconfigboard.h | 3 +- .../boards/bast_pro_mini_m0/mpconfigboard.mk | 1 - .../capablerobot_usbhub/mpconfigboard.h | 9 -- .../capablerobot_usbhub/mpconfigboard.mk | 1 - .../boards/catwan_usbstick/mpconfigboard.h | 4 - .../boards/catwan_usbstick/mpconfigboard.mk | 1 - .../circuitplayground_express/mpconfigboard.h | 6 -- .../mpconfigboard.mk | 1 - .../mpconfigboard.h | 6 -- .../mpconfigboard.mk | 1 - .../mpconfigboard.h | 6 -- .../mpconfigboard.mk | 1 - ports/atmel-samd/boards/common.template.ld | 89 +++++++++++++++++++ .../atmel-samd/boards/cp32-m4/mpconfigboard.h | 8 -- .../boards/cp32-m4/mpconfigboard.mk | 1 - .../boards/datalore_ip_m4/mpconfigboard.h | 8 -- .../boards/datalore_ip_m4/mpconfigboard.mk | 1 - .../boards/datum_distance/mpconfigboard.h | 4 - .../boards/datum_distance/mpconfigboard.mk | 1 - .../boards/datum_imu/mpconfigboard.h | 4 - .../boards/datum_imu/mpconfigboard.mk | 1 - .../boards/datum_light/mpconfigboard.h | 4 - .../boards/datum_light/mpconfigboard.mk | 1 - .../boards/datum_weather/mpconfigboard.h | 4 - .../boards/datum_weather/mpconfigboard.mk | 1 - .../boards/escornabot_makech/mpconfigboard.h | 6 -- .../boards/escornabot_makech/mpconfigboard.mk | 1 - .../feather_m0_adalogger/mpconfigboard.h | 4 - .../feather_m0_adalogger/mpconfigboard.mk | 1 - .../boards/feather_m0_basic/mpconfigboard.h | 4 - .../boards/feather_m0_basic/mpconfigboard.mk | 1 - .../boards/feather_m0_express/mpconfigboard.h | 7 -- .../feather_m0_express/mpconfigboard.mk | 1 - .../mpconfigboard.h | 6 -- .../mpconfigboard.mk | 1 - .../boards/feather_m0_rfm69/mpconfigboard.h | 4 - .../boards/feather_m0_rfm69/mpconfigboard.mk | 1 - .../boards/feather_m0_rfm9x/mpconfigboard.h | 4 - .../boards/feather_m0_rfm9x/mpconfigboard.mk | 1 - .../feather_m0_supersized/mpconfigboard.h | 6 -- .../feather_m0_supersized/mpconfigboard.mk | 1 - .../boards/feather_m4_express/mpconfigboard.h | 8 -- .../feather_m4_express/mpconfigboard.mk | 1 - .../feather_radiofruit_zigbee/mpconfigboard.h | 6 -- .../mpconfigboard.mk | 1 - .../boards/gemma_m0/mpconfigboard.h | 4 - .../boards/gemma_m0/mpconfigboard.mk | 1 - .../grandcentral_m4_express/mpconfigboard.h | 8 -- .../grandcentral_m4_express/mpconfigboard.mk | 1 - .../hallowing_m0_express/mpconfigboard.h | 6 -- .../hallowing_m0_express/mpconfigboard.mk | 1 - .../hallowing_m4_express/mpconfigboard.h | 8 -- .../hallowing_m4_express/mpconfigboard.mk | 1 - .../itsybitsy_m0_express/mpconfigboard.h | 6 -- .../itsybitsy_m0_express/mpconfigboard.mk | 2 - .../itsybitsy_m4_express/mpconfigboard.h | 8 -- .../itsybitsy_m4_express/mpconfigboard.mk | 1 - .../boards/kicksat-sprite/mpconfigboard.h | 2 - .../boards/kicksat-sprite/mpconfigboard.mk | 1 - .../boards/meowmeow/mpconfigboard.h | 6 -- .../boards/meowmeow/mpconfigboard.mk | 1 - .../boards/metro_m0_express/mpconfigboard.h | 6 -- .../boards/metro_m0_express/mpconfigboard.mk | 1 - .../metro_m4_airlift_lite/mpconfigboard.h | 8 -- .../metro_m4_airlift_lite/mpconfigboard.mk | 1 - .../boards/metro_m4_express/mpconfigboard.h | 8 -- .../boards/metro_m4_express/mpconfigboard.mk | 1 - .../boards/mini_sam_m4/mpconfigboard.h | 8 -- .../boards/mini_sam_m4/mpconfigboard.mk | 1 - .../boards/monster_m4sk/mpconfigboard.h | 8 -- .../boards/monster_m4sk/mpconfigboard.mk | 1 - .../boards/pewpew10/mpconfigboard.h | 5 -- .../boards/pewpew10/mpconfigboard.mk | 1 - .../boards/pewpew_m4/mpconfigboard.h | 9 -- .../boards/pewpew_m4/mpconfigboard.mk | 1 - .../boards/pirkey_m0/mpconfigboard.h | 4 - .../boards/pirkey_m0/mpconfigboard.mk | 1 - .../atmel-samd/boards/pybadge/mpconfigboard.h | 8 -- .../boards/pybadge/mpconfigboard.mk | 1 - .../boards/pybadge_airlift/mpconfigboard.h | 8 -- .../boards/pybadge_airlift/mpconfigboard.mk | 1 - .../atmel-samd/boards/pygamer/mpconfigboard.h | 8 -- .../boards/pygamer/mpconfigboard.mk | 1 - .../boards/pygamer_advance/mpconfigboard.h | 8 -- .../boards/pygamer_advance/mpconfigboard.mk | 1 - .../boards/pyportal/mpconfigboard.h | 8 -- .../boards/pyportal/mpconfigboard.mk | 1 - .../boards/pyportal_titano/mpconfigboard.h | 8 -- .../boards/pyportal_titano/mpconfigboard.mk | 1 - .../atmel-samd/boards/pyruler/mpconfigboard.h | 4 - .../boards/pyruler/mpconfigboard.mk | 1 - .../boards/robohatmm1_m0/mpconfigboard.h | 8 -- .../boards/robohatmm1_m0/mpconfigboard.mk | 1 - .../boards/robohatmm1_m4/mpconfigboard.h | 8 -- .../boards/robohatmm1_m4/mpconfigboard.mk | 1 - ports/atmel-samd/boards/sam32/mpconfigboard.h | 5 +- .../atmel-samd/boards/sam32/mpconfigboard.mk | 1 - .../samd21x18-bootloader-crystalless.ld | 73 +-------------- ...8-bootloader-external-flash-crystalless.ld | 73 +-------------- .../samd21x18-bootloader-external-flash.ld | 73 +-------------- .../atmel-samd/boards/samd21x18-bootloader.ld | 73 +-------------- .../boards/samd21x18-external-flash.ld | 72 +-------------- ports/atmel-samd/boards/samd21x18.ld | 72 +-------------- .../samd51x18-bootloader-external-flash.ld | 73 +-------------- .../samd51x19-bootloader-external-flash.ld | 73 +-------------- .../atmel-samd/boards/samd51x19-bootloader.ld | 73 +-------------- .../samd51x20-bootloader-external-flash.ld | 73 +-------------- .../atmel-samd/boards/samd51x20-bootloader.ld | 74 +-------------- .../boards/samd51x20-external-flash.ld | 72 +-------------- ports/atmel-samd/boards/samd51x20.ld | 72 +-------------- .../boards/serpente/mpconfigboard.h | 7 -- .../boards/serpente/mpconfigboard.mk | 1 - .../boards/snekboard/mpconfigboard.h | 7 -- .../boards/snekboard/mpconfigboard.mk | 1 - .../boards/sparkfun_lumidrive/mpconfigboard.h | 4 - .../sparkfun_lumidrive/mpconfigboard.mk | 1 - .../sparkfun_redboard_turbo/mpconfigboard.h | 10 +-- .../sparkfun_redboard_turbo/mpconfigboard.mk | 1 - .../sparkfun_samd21_dev/mpconfigboard.h | 4 - .../sparkfun_samd21_dev/mpconfigboard.mk | 1 - .../sparkfun_samd21_mini/mpconfigboard.h | 4 - .../sparkfun_samd21_mini/mpconfigboard.mk | 1 - .../stringcar_m0_express/mpconfigboard.h | 7 -- .../stringcar_m0_express/mpconfigboard.mk | 2 - .../boards/trellis_m4_express/mpconfigboard.h | 8 -- .../trellis_m4_express/mpconfigboard.mk | 1 - .../boards/trinket_m0/mpconfigboard.h | 4 - .../boards/trinket_m0/mpconfigboard.mk | 2 +- .../trinket_m0_haxpress/mpconfigboard.h | 6 -- .../trinket_m0_haxpress/mpconfigboard.mk | 1 - ports/atmel-samd/boards/uchip/mpconfigboard.h | 4 +- .../atmel-samd/boards/uchip/mpconfigboard.mk | 1 - .../atmel-samd/boards/ugame10/mpconfigboard.h | 6 -- .../boards/ugame10/mpconfigboard.mk | 1 - .../common-hal/microcontroller/__init__.c | 1 - ports/atmel-samd/ld_defines.c | 14 +++ ports/atmel-samd/mpconfigport.h | 37 +++++++- ports/atmel-samd/mpconfigport.mk | 4 + ports/atmel-samd/tick.c | 2 +- ports/cxd56/tick.c | 2 +- ports/nrf/boards/adafruit_nrf52840_s140_v6.ld | 3 +- .../mpconfigboard.h | 6 -- ports/nrf/boards/common.ld | 4 + .../electronut_labs_blip/mpconfigboard.h | 6 -- .../electronut_labs_papyr/mpconfigboard.h | 6 -- .../feather_nrf52840_express/mpconfigboard.h | 6 -- .../makerdiary_nrf52840_mdk/mpconfigboard.h | 6 -- .../mpconfigboard.h | 6 -- .../metro_nrf52840_express/mpconfigboard.h | 6 -- .../nrf/boards/particle_argon/mpconfigboard.h | 6 -- .../nrf/boards/particle_boron/mpconfigboard.h | 6 -- .../nrf/boards/particle_xenon/mpconfigboard.h | 6 -- ports/nrf/boards/pca10056/mpconfigboard.h | 2 - ports/nrf/boards/pca10059/mpconfigboard.h | 2 - .../sparkfun_nrf52840_mini/mpconfigboard.h | 2 - ports/nrf/common-hal/_bleio/Adapter.c | 9 ++ .../nrf/common-hal/microcontroller/__init__.c | 5 +- ports/nrf/common-hal/nvm/ByteArray.c | 15 +--- ports/nrf/common-hal/nvm/ByteArray.h | 2 + ports/nrf/mpconfigport.h | 4 + ports/nrf/peripherals/nrf/nvm.h | 4 - ports/nrf/supervisor/internal_flash.c | 3 +- ports/nrf/tick.c | 2 +- .../boards/feather_f405/mpconfigboard.h | 3 - .../boards/pyboard_v11/mpconfigboard.h | 3 - .../stm32f411ve_discovery/mpconfigboard.h | 6 -- .../stm32f412zg_discovery/mpconfigboard.h | 4 - ports/stm32f4/tick.c | 2 +- py/circuitpy_defns.mk | 1 - py/circuitpy_mpconfig.h | 13 ++- tools/gen_ld_files.py | 47 ++++++++++ 179 files changed, 272 insertions(+), 1490 deletions(-) create mode 100644 ports/atmel-samd/boards/common.template.ld create mode 100644 ports/atmel-samd/ld_defines.c create mode 100755 tools/gen_ld_files.py diff --git a/main.c b/main.c index 6b56f5ff6f..4683bcf004 100755 --- a/main.c +++ b/main.c @@ -199,7 +199,7 @@ void cleanup_after_vm(supervisor_allocation* heap) { bool run_code_py(safe_mode_t safe_mode) { bool serial_connected_at_start = serial_connected(); - #ifdef CIRCUITPY_AUTORELOAD_DELAY_MS + #if CIRCUITPY_AUTORELOAD_DELAY_MS > 0 if (serial_connected_at_start) { serial_write("\n"); if (autoreload_is_enabled()) { diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 11e6874edd..16aed16158 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -292,12 +292,17 @@ SRC_SHARED_MODULE_EXPANDED = $(addprefix shared-bindings/, $(SRC_SHARED_MODULE)) $(addprefix shared-module/, $(SRC_SHARED_MODULE)) \ $(addprefix shared-module/, $(SRC_SHARED_MODULE_INTERNAL)) +# There may be duplicates between SRC_COMMON_HAL_EXPANDED and SRC_SHARED_MODULE_EXPANDED, +# because a few modules have files both in common-hal/ and shared-modules/. +# Doing a $(sort ...) removes duplicates as part of sorting. +SRC_COMMON_HAL_SHARED_MODULE_EXPANDED = $(sort $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED)) + + SRC_S = supervisor/$(CHIP_FAMILY)_cpu.s OBJ = $(PY_O) $(SUPERVISOR_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o)) OBJ += $(addprefix $(BUILD)/, $(SRC_ASF:.c=.o)) -OBJ += $(addprefix $(BUILD)/, $(SRC_COMMON_HAL_EXPANDED:.c=.o)) -OBJ += $(addprefix $(BUILD)/, $(SRC_SHARED_MODULE_EXPANDED:.c=.o)) +OBJ += $(addprefix $(BUILD)/, $(SRC_COMMON_HAL_SHARED_MODULE_EXPANDED:.c=.o)) ifeq ($(INTERNAL_LIBM),1) OBJ += $(addprefix $(BUILD)/, $(SRC_LIBM:.c=.o)) endif @@ -310,9 +315,18 @@ SRC_QSTR_PREPROCESSOR += peripherals/samd/$(CHIP_FAMILY)/clocks.c all: $(BUILD)/firmware.bin $(BUILD)/firmware.uf2 -$(BUILD)/firmware.elf: $(OBJ) +LD_FILE = $(BUILD)/$(notdir $(patsubst %.template.ld,%.ld,$(LD_TEMPLATE_FILE))) + +# ld_defines.pp is generated from ld_defines.c. See py/mkrules.mk. +# Run gen_ld_files.py over ALL *.template.ld files, not just LD_TEMPLATE_FILE, +# because it may include other template files. +$(LD_FILE): $(BUILD)/ld_defines.pp boards/*.template.ld + $(STEPECHO) "GEN $@" + $(Q)$(PYTHON3) $(TOP)/tools/gen_ld_files.py --defines $< --out_dir $(BUILD) boards/*.template.ld + +$(BUILD)/firmware.elf: $(OBJ) $(LD_FILE) $(STEPECHO) "LINK $@" - $(Q)$(CC) -o $@ $(LDFLAGS) $^ -Wl,--start-group $(LIBS) -Wl,--end-group + $(Q)$(CC) -o $@ $(LDFLAGS) $(OBJ) -Wl,--start-group $(LIBS) -Wl,--end-group $(Q)$(SIZE) $@ | $(PYTHON3) $(TOP)/tools/build_memory_info.py $(LD_FILE) $(BUILD)/firmware.bin: $(BUILD)/firmware.elf diff --git a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.h b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.h index a508d91913..226717c83b 100644 --- a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.h +++ b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.h @@ -7,10 +7,6 @@ #define MICROPY_HW_LED_STATUS (&pin_PB23) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA09) #define DEFAULT_I2C_BUS_SDA (&pin_PA08) diff --git a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk index a543468e52..bd682ade07 100644 --- a/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_mkr1300/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x2341 USB_PID = 0x8053 USB_PRODUCT = "Arduino MKR1300" diff --git a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.h b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.h index 02750e6469..4871b1798b 100644 --- a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.h +++ b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.h @@ -5,10 +5,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA09) #define DEFAULT_I2C_BUS_SDA (&pin_PA08) diff --git a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk index 5612eb88d7..894b9b0110 100644 --- a/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_mkrzero/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x239A USB_PID = 0x8050 USB_PRODUCT = "Arduino MKRZero" diff --git a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.h b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.h index ec201e6ef5..bf2a68c57a 100644 --- a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.h +++ b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.h @@ -10,10 +10,6 @@ #define MICROPY_PORT_B (PORT_PB03) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk index cbbf15a3ef..f94ec13b7c 100644 --- a/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk +++ b/ports/atmel-samd/boards/arduino_zero/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x2341 USB_PID = 0x824D USB_PRODUCT = "Arduino Zero" diff --git a/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.h b/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.h index 561240c69a..cbfb11d200 100644 --- a/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.h +++ b/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.h @@ -5,6 +5,7 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) +// No microcontroller.nvm #define CIRCUITPY_INTERNAL_NVM_SIZE 0 #define DEFAULT_I2C_BUS_SCL (&pin_PA08) @@ -17,8 +18,6 @@ #define DEFAULT_UART_BUS_RX (&pin_PA01) #define DEFAULT_UART_BUS_TX (&pin_PA00) -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000) - #define IGNORE_PIN_PA03 1 #define IGNORE_PIN_PA12 1 #define IGNORE_PIN_PA13 1 diff --git a/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk b/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk index 08e42aa4ef..c3f0750a9e 100644 --- a/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/bast_pro_mini_m0/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x1209 USB_PID = 0xBAB3 USB_PRODUCT = "Bast Pro Mini M0" diff --git a/ports/atmel-samd/boards/capablerobot_usbhub/mpconfigboard.h b/ports/atmel-samd/boards/capablerobot_usbhub/mpconfigboard.h index f4e40739b0..d359687e13 100644 --- a/ports/atmel-samd/boards/capablerobot_usbhub/mpconfigboard.h +++ b/ports/atmel-samd/boards/capablerobot_usbhub/mpconfigboard.h @@ -3,7 +3,6 @@ #define CIRCUITPY_MCU_FAMILY samd51 - #define MICROPY_HW_LED_STATUS (&pin_PA22) // These are pins not to reset. @@ -14,14 +13,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/capablerobot_usbhub/mpconfigboard.mk b/ports/atmel-samd/boards/capablerobot_usbhub/mpconfigboard.mk index f390a8681a..0ff6f58eab 100644 --- a/ports/atmel-samd/boards/capablerobot_usbhub/mpconfigboard.mk +++ b/ports/atmel-samd/boards/capablerobot_usbhub/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x04D8 USB_PID = 0xEDB3 USB_PRODUCT = "Programmable USB Hub" diff --git a/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.h b/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.h index 7a32bf023f..b92c2a65e3 100644 --- a/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.h +++ b/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.h @@ -7,14 +7,10 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - #define DEFAULT_SPI_BUS_SCK (&pin_PA19) #define DEFAULT_SPI_BUS_MOSI (&pin_PA18) #define DEFAULT_SPI_BUS_MISO (&pin_PA22) -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define IGNORE_PIN_PA00 1 #define IGNORE_PIN_PA01 1 #define IGNORE_PIN_PA02 1 diff --git a/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk b/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk index 2399aad5c5..adae4beb27 100644 --- a/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk +++ b/ports/atmel-samd/boards/catwan_usbstick/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x1209 USB_PID = 0xBAB2 USB_PRODUCT = "CatWAN USBStick" diff --git a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h index e6a7e06769..0ed5262ab5 100644 --- a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h @@ -22,12 +22,6 @@ #define SPEAKER_ENABLE_PIN (&pin_PA30) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define CALIBRATE_CRYSTALLESS 1 // Explanation of how a user got into safe mode. diff --git a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk index 3c43776f5b..cdbdf44f80 100644 --- a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash-crystalless.ld USB_VID = 0x239A USB_PID = 0x8019 USB_PRODUCT = "CircuitPlayground Express" diff --git a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h index ca6f9b7734..2db5129291 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h @@ -22,12 +22,6 @@ #define SPEAKER_ENABLE_PIN (&pin_PA30) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define CALIBRATE_CRYSTALLESS 1 // Explanation of how a user got into safe mode. diff --git a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk index f456515f9a..a6ed28aa71 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash-crystalless.ld USB_VID = 0x239A USB_PID = 0x8019 USB_PRODUCT = "CircuitPlayground Express with Crickit libraries" diff --git a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h index 333fc79f9b..a1d5b0a671 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h @@ -22,12 +22,6 @@ #define SPEAKER_ENABLE_PIN (&pin_PA30) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define CALIBRATE_CRYSTALLESS 1 // Explanation of how a user got into safe mode. diff --git a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk index f0c9c6b8c4..b5a7c2424d 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash-crystalless.ld USB_VID = 0x239A USB_PID = 0x8019 USB_PRODUCT = "CircuitPlayground Express with displayio" diff --git a/ports/atmel-samd/boards/common.template.ld b/ports/atmel-samd/boards/common.template.ld new file mode 100644 index 0000000000..e02bbfab02 --- /dev/null +++ b/ports/atmel-samd/boards/common.template.ld @@ -0,0 +1,89 @@ +/* Template for SAMD21/SAMD51 linking. dollar-sign-curly-bracket items are replaced with strings. */ + +/* Specify the memory areas */ +MEMORY +{ + /* CIRCUITPY_BOOTLOADER_SIZE is size of bootloader, if any. + * SAMD21 Arduino and UF2 bootloaders are 8KiB. SAMD51 UF2 is 6KiB. + * FLASH_SIZE is defined in ASF4. + * RAM_SIZE is defined in mpconfigport.h, from constants from ASF4. + * CIRCUITPY_INTERNAL_CONFIG_SIZE is size of an optional hidden config area, used currently + * for crystalless USB timing calibration. + * CIRCUITPY_INTERNAL_NVM_SIZE is the size of microntroller.nvm. + */ + FLASH (rx) : ORIGIN = 0x00000000 + ${BOOTLOADER_SIZE}, LENGTH = ${FLASH_SIZE} - ${BOOTLOADER_SIZE} - ${CIRCUITPY_INTERNAL_CONFIG_SIZE} - ${CIRCUITPY_INTERNAL_NVM_SIZE} + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = ${RAM_SIZE} +} + +/* top end of the stack */ +/* stack must be double-word (8 byte) aligned */ +_estack = ORIGIN(RAM) + LENGTH(RAM) - 8; +_bootloader_dbl_tap = ORIGIN(RAM) + LENGTH(RAM) - 4; + +/* define output sections */ +SECTIONS +{ + /* The program code and other data goes into FLASH */ + .text : + { + . = ALIGN(4); + _sfixed = .; + KEEP(*(.vectors)) /* isr vector table */ + *(.text) /* .text sections (code) */ + *(.text*) /* .text* sections (code) */ + *(.rodata) /* .rodata sections (constants, strings, etc.) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + + . = ALIGN(4); + } >FLASH + + .ARM.exidx : + { + *(.ARM.exidx*) + *(.gnu.linkonce.armexidx.*) + _etext = .; /* define a global symbol at end of code */ + _sidata = .; /* start of .data section */ + } > FLASH + + /* This is the initialized data section + The program executes knowing that the data is in the RAM + but the loader puts the initial values in the FLASH (inidata). + It is one task of the startup to copy the initial values from FLASH to RAM. */ + .data : AT ( _sidata ) + { + . = ALIGN(4); + _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialize the .data section in RAM */ + *(.ramfunc) + *(.ramfunc*) + *(.data) /* .data sections */ + *(.data*) /* .data* sections */ + + . = ALIGN(4); + _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialize the .data section in RAM */ + } >RAM + + /* Uninitialized data section */ + .bss : + { + . = ALIGN(4); + _sbss = .; + _szero = .; /* define a global symbol at bss start; used by startup code */ + *(.bss) + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ezero = .; /* define a global symbol at bss end; used by startup code */ + _ebss = .; + } >RAM + + /* this just checks there is enough RAM for the requested stack. */ + .stack : + { + . = ALIGN(4); + . = . + ${CIRCUITPY_DEFAULT_STACK_SIZE}; + . = ALIGN(4); + } >RAM + + .ARM.attributes 0 : { *(.ARM.attributes) } +} diff --git a/ports/atmel-samd/boards/cp32-m4/mpconfigboard.h b/ports/atmel-samd/boards/cp32-m4/mpconfigboard.h index 9e329b3ed9..8664a6a0ec 100644 --- a/ports/atmel-samd/boards/cp32-m4/mpconfigboard.h +++ b/ports/atmel-samd/boards/cp32-m4/mpconfigboard.h @@ -12,14 +12,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PB09) #define DEFAULT_I2C_BUS_SDA (&pin_PB08) diff --git a/ports/atmel-samd/boards/cp32-m4/mpconfigboard.mk b/ports/atmel-samd/boards/cp32-m4/mpconfigboard.mk index 86a7719b84..25ec501627 100644 --- a/ports/atmel-samd/boards/cp32-m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/cp32-m4/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x20-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8021 USB_PRODUCT = "CP32-M4" diff --git a/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.h b/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.h index 99167d31bc..f560cfa493 100644 --- a/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.h +++ b/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.h @@ -20,14 +20,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_PB03) diff --git a/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.mk b/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.mk index aa5f47d400..b2823e30c3 100644 --- a/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datalore_ip_m4/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x4097 USB_PID = 0x0001 USB_PRODUCT = "Datalore IP M4" diff --git a/ports/atmel-samd/boards/datum_distance/mpconfigboard.h b/ports/atmel-samd/boards/datum_distance/mpconfigboard.h index e02e437805..74706ba040 100644 --- a/ports/atmel-samd/boards/datum_distance/mpconfigboard.h +++ b/ports/atmel-samd/boards/datum_distance/mpconfigboard.h @@ -10,10 +10,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk b/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk index a7bb8293d4..4f6c7ab82e 100644 --- a/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_distance/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x04D8 USB_PID = 0xEE8C USB_PRODUCT = "datum-Distance" diff --git a/ports/atmel-samd/boards/datum_imu/mpconfigboard.h b/ports/atmel-samd/boards/datum_imu/mpconfigboard.h index b87739dd0e..3cc218f9e0 100644 --- a/ports/atmel-samd/boards/datum_imu/mpconfigboard.h +++ b/ports/atmel-samd/boards/datum_imu/mpconfigboard.h @@ -10,10 +10,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk b/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk index 507c83b041..336a1b832f 100644 --- a/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_imu/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x04D8 USB_PID = 0xEE8D USB_PRODUCT = "datum-IMU" diff --git a/ports/atmel-samd/boards/datum_light/mpconfigboard.h b/ports/atmel-samd/boards/datum_light/mpconfigboard.h index 2a91c112dd..33e80d06d0 100644 --- a/ports/atmel-samd/boards/datum_light/mpconfigboard.h +++ b/ports/atmel-samd/boards/datum_light/mpconfigboard.h @@ -10,10 +10,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/datum_light/mpconfigboard.mk b/ports/atmel-samd/boards/datum_light/mpconfigboard.mk index 4bb227ba4e..7ec2efcf96 100644 --- a/ports/atmel-samd/boards/datum_light/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_light/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x04D8 USB_PID = 0xEE8E USB_PRODUCT = "datum-Light" diff --git a/ports/atmel-samd/boards/datum_weather/mpconfigboard.h b/ports/atmel-samd/boards/datum_weather/mpconfigboard.h index 45619197b9..328a6860c4 100644 --- a/ports/atmel-samd/boards/datum_weather/mpconfigboard.h +++ b/ports/atmel-samd/boards/datum_weather/mpconfigboard.h @@ -10,10 +10,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk b/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk index 411aee6254..d3ec1b0fdd 100644 --- a/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk +++ b/ports/atmel-samd/boards/datum_weather/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x04D8 USB_PID = 0xEE8F USB_PRODUCT = "datum-Weather" diff --git a/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h b/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h index f27cb533b2..3a984188fa 100644 --- a/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h +++ b/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.h @@ -8,12 +8,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define CALIBRATE_CRYSTALLESS 1 // Explanation of how a user got into safe mode. diff --git a/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk b/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk index a2c182e683..dedd49ff71 100644 --- a/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk +++ b/ports/atmel-samd/boards/escornabot_makech/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x1209 USB_PID = 0xBAB6 USB_PRODUCT = "Escornabot Makech" diff --git a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.h b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.h index eb1b905851..a0fde67ef6 100644 --- a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.h +++ b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.h @@ -8,10 +8,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA22) #define DEFAULT_I2C_BUS_SDA (&pin_PA23) diff --git a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk index a88dbd563e..134abf7236 100644 --- a/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_adalogger/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x239A USB_PID = 0x8015 USB_PRODUCT = "Feather M0 Adalogger" diff --git a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.h b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.h index a16cee0b4c..41a4bde212 100644 --- a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.h +++ b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.h @@ -8,10 +8,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk index 076f1f8ff0..3643743509 100644 --- a/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_basic/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x239A USB_PID = 0x8015 USB_PRODUCT = "Feather M0" diff --git a/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.h b/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.h index e6cd1c729b..5421dc8890 100644 --- a/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.h @@ -15,13 +15,6 @@ #define MICROPY_PORT_B ( 0 ) #define MICROPY_PORT_C ( 0 ) - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_PA23) diff --git a/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk index 5b89f1be4f..cdee7b7946 100644 --- a/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_express/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8023 USB_PRODUCT = "Feather M0 Express" diff --git a/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.h b/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.h index 77146889e5..ee61e1d87d 100644 --- a/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.h +++ b/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.h @@ -15,12 +15,6 @@ #define MICROPY_PORT_B ( 0 ) #define MICROPY_PORT_C ( 0 ) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_PA23) diff --git a/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk index 5793d82e55..d5e03b49d4 100644 --- a/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_express_crickit/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8023 USB_PRODUCT = "Feather M0 Express" diff --git a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.h b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.h index 19a5147587..2a319a4129 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.h +++ b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.h @@ -8,10 +8,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk index 83d794d047..40a461b279 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm69/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x239A USB_PID = 0x8015 USB_PRODUCT = "Feather M0 RFM69" diff --git a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.h b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.h index d3db098e54..850033dbe4 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.h +++ b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.h @@ -8,10 +8,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk index a84e14f55f..736161047a 100644 --- a/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_rfm9x/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x239A USB_PID = 0x8015 USB_PRODUCT = "Feather M0 RFM9x" diff --git a/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.h b/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.h index 5ad265bf14..2d9f88e2e1 100644 --- a/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.h +++ b/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.h @@ -17,12 +17,6 @@ #define MICROPY_PORT_B ( 0 ) #define MICROPY_PORT_C ( 0 ) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk index c5fef4373c..cb13adb76d 100644 --- a/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m0_supersized/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8023 USB_PRODUCT = "Feather M0 Supersized" diff --git a/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.h b/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.h index f65ea8db78..ba16d17ee4 100644 --- a/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.h @@ -16,14 +16,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define EXTERNAL_FLASH_QSPI_DUAL #define BOARD_HAS_CRYSTAL 1 diff --git a/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk index 176ebac82c..d736941df3 100644 --- a/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_m4_express/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8026 USB_PRODUCT = "Feather M4 Express" diff --git a/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.h b/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.h index 7df31f3a93..2afe358178 100755 --- a/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.h +++ b/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.h @@ -14,12 +14,6 @@ #define MICROPY_PORT_B ( 0 ) #define MICROPY_PORT_C ( 0 ) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_PA13) diff --git a/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk b/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk index c4a3a5a19e..05c305b1a2 100755 --- a/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk +++ b/ports/atmel-samd/boards/feather_radiofruit_zigbee/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8023 USB_PRODUCT = "Feather RadioFruit Zigbee" diff --git a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.h b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.h index 5f09ab4d2f..b6d8f946bc 100644 --- a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.h +++ b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.h @@ -10,16 +10,12 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - #define DEFAULT_I2C_BUS_SCL (&pin_PA05) #define DEFAULT_I2C_BUS_SDA (&pin_PA04) #define DEFAULT_UART_BUS_RX (&pin_PA05) #define DEFAULT_UART_BUS_TX (&pin_PA04) -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define IGNORE_PIN_PA03 1 #define IGNORE_PIN_PA06 1 #define IGNORE_PIN_PA07 1 diff --git a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk index 6f44a22f84..d649386328 100644 --- a/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/gemma_m0/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x239A USB_PID = 0x801D USB_PRODUCT = "Gemma M0" diff --git a/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.h b/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.h index bc8f5a134a..bab0550148 100644 --- a/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.h @@ -21,14 +21,6 @@ #define MICROPY_PORT_C ( PORT_PC24 | PORT_PC30 | PORT_PC31 ) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_PB21) diff --git a/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk index 423761c3f7..49331a705d 100644 --- a/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/grandcentral_m4_express/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x20-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8032 USB_PRODUCT = "Grand Central M4 Express" diff --git a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.h b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.h index d5c2745009..e5ac346daf 100644 --- a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.h @@ -16,12 +16,6 @@ #define MICROPY_PORT_B ( PORT_PB22 | PORT_PB23 ) #define MICROPY_PORT_C ( 0 ) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA17) #define DEFAULT_I2C_BUS_SDA (&pin_PA16) diff --git a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk index 988d10d1cd..af4a5a2932 100644 --- a/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/hallowing_m0_express/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0xD1ED USB_PRODUCT = "HalloWing M0 Express" diff --git a/ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.h b/ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.h index 654632db5d..a0c726e726 100644 --- a/ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.h @@ -16,14 +16,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA13) #define DEFAULT_I2C_BUS_SDA (&pin_PA12) diff --git a/ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.mk index 0d891abc82..9379ed3fe0 100644 --- a/ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/hallowing_m4_express/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x804A USB_PRODUCT = "Hallowing M4 Express" diff --git a/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.h b/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.h index 6f9f661d94..db5e2a4df2 100644 --- a/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.h @@ -16,12 +16,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk index 2b64e90275..4d516c75b6 100644 --- a/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/itsybitsy_m0_express/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash-crystalless.ld USB_VID = 0x239A USB_PID = 0x8012 USB_PRODUCT = "ItsyBitsy M0 Express" @@ -21,4 +20,3 @@ CIRCUITPY_RTC = 0 CFLAGS_INLINE_LIMIT = 60 SUPEROPT_GC = 0 - diff --git a/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.h b/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.h index 9e4d4a10c9..98920b54f2 100644 --- a/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.h @@ -17,14 +17,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA13) #define DEFAULT_I2C_BUS_SDA (&pin_PA12) diff --git a/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk index 5cab5bf43a..7ce45d0a1a 100644 --- a/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x802C USB_PRODUCT = "ItsyBitsy M4 Express" diff --git a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h index 194542b055..6664524d24 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h +++ b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h @@ -14,8 +14,6 @@ #define CIRCUITPY_INTERNAL_NVM_SIZE 0 -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - 0x010000) - #define DEFAULT_I2C_BUS_SCL (&pin_PA17) #define DEFAULT_I2C_BUS_SDA (&pin_PA16) diff --git a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk index 706e551c5d..6d6571a2ae 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk +++ b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader.ld USB_VID = 0x04D8 USB_PID = 0xED94 USB_PRODUCT = "kicksat-sprite" diff --git a/ports/atmel-samd/boards/meowmeow/mpconfigboard.h b/ports/atmel-samd/boards/meowmeow/mpconfigboard.h index 1304b6dfbf..80d3678630 100644 --- a/ports/atmel-samd/boards/meowmeow/mpconfigboard.h +++ b/ports/atmel-samd/boards/meowmeow/mpconfigboard.h @@ -8,12 +8,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define CALIBRATE_CRYSTALLESS 1 // Explanation of how a user got into safe mode. diff --git a/ports/atmel-samd/boards/meowmeow/mpconfigboard.mk b/ports/atmel-samd/boards/meowmeow/mpconfigboard.mk index 894e19a6bb..4b452ecbfe 100644 --- a/ports/atmel-samd/boards/meowmeow/mpconfigboard.mk +++ b/ports/atmel-samd/boards/meowmeow/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x1209 USB_PID = 0xBAB1 USB_PRODUCT = "Meow Meow" diff --git a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.h b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.h index bfa254b95e..04565feb40 100644 --- a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.h @@ -21,12 +21,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_PA23) diff --git a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk index d3f35ba8b0..b52b1343fb 100644 --- a/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/metro_m0_express/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8014 USB_PRODUCT = "Metro M0 Express" diff --git a/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.h b/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.h index e89b0322a1..9fa4018046 100644 --- a/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.h +++ b/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.h @@ -18,14 +18,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_PB03) diff --git a/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.mk b/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.mk index 98d85ba826..78e27b422f 100644 --- a/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.mk +++ b/ports/atmel-samd/boards/metro_m4_airlift_lite/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8038 USB_PRODUCT = "Metro M4 Airlift Lite" diff --git a/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.h b/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.h index 2a8878874d..7f8dbb1d2b 100644 --- a/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.h @@ -20,14 +20,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_PB03) diff --git a/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.mk index 68b6f64065..4f01f3edd1 100644 --- a/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/metro_m4_express/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8021 USB_PRODUCT = "Metro M4 Express" diff --git a/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.h b/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.h index c4563964f8..08ab7e16b9 100644 --- a/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.h +++ b/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.h @@ -17,14 +17,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA13) #define DEFAULT_I2C_BUS_SDA (&pin_PA12) diff --git a/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk b/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk index 4bd1d6e522..eedfd2ecca 100644 --- a/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x1209 USB_PID = 0x2017 USB_PRODUCT = "Mini SAM M4" diff --git a/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.h b/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.h index fc77520f5f..42fb4548e0 100644 --- a/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.h +++ b/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.h @@ -13,14 +13,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA01) #define DEFAULT_I2C_BUS_SDA (&pin_PA00) diff --git a/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.mk b/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.mk index a3db7dc890..e61f3d2403 100644 --- a/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.mk +++ b/ports/atmel-samd/boards/monster_m4sk/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8048 USB_PRODUCT = "Monster M4SK" diff --git a/ports/atmel-samd/boards/pewpew10/mpconfigboard.h b/ports/atmel-samd/boards/pewpew10/mpconfigboard.h index 445ccc4355..6b3b4aa15c 100644 --- a/ports/atmel-samd/boards/pewpew10/mpconfigboard.h +++ b/ports/atmel-samd/boards/pewpew10/mpconfigboard.h @@ -5,11 +5,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - - #define IGNORE_PIN_PB00 1 #define IGNORE_PIN_PB01 1 #define IGNORE_PIN_PB02 1 diff --git a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk index e24a290519..c9aa26e3c8 100644 --- a/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew10/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x239A USB_PID = 0x801D USB_PRODUCT = "PewPew 10.2" diff --git a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.h b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.h index 1b3035e120..60cd8d754f 100644 --- a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.h +++ b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.h @@ -9,14 +9,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA01) #define DEFAULT_I2C_BUS_SDA (&pin_PA00) @@ -48,4 +40,3 @@ #define IGNORE_PIN_PB09 1 #define IGNORE_PIN_PB10 1 #define IGNORE_PIN_PB11 1 - diff --git a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk index 54ec3d1d0e..af7e3fb16c 100644 --- a/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pewpew_m4/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader.ld USB_VID = 0x1d50 USB_PID = 0x60e8 USB_PRODUCT = "PewPew M4" diff --git a/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.h b/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.h index 5a8eb9d147..866e21991b 100644 --- a/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.h +++ b/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.h @@ -8,10 +8,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define IGNORE_PIN_PA02 1 #define IGNORE_PIN_PA03 1 #define IGNORE_PIN_PA04 1 diff --git a/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk b/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk index 686c9099fc..c5b2c9eb58 100644 --- a/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pirkey_m0/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x239A USB_PID = 0x8028 USB_PRODUCT = "pIRKey M0" diff --git a/ports/atmel-samd/boards/pybadge/mpconfigboard.h b/ports/atmel-samd/boards/pybadge/mpconfigboard.h index 36115bc873..435185322a 100644 --- a/ports/atmel-samd/boards/pybadge/mpconfigboard.h +++ b/ports/atmel-samd/boards/pybadge/mpconfigboard.h @@ -14,14 +14,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA13) #define DEFAULT_I2C_BUS_SDA (&pin_PA12) diff --git a/ports/atmel-samd/boards/pybadge/mpconfigboard.mk b/ports/atmel-samd/boards/pybadge/mpconfigboard.mk index 7e2cb64398..05df09627c 100644 --- a/ports/atmel-samd/boards/pybadge/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pybadge/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8034 USB_PRODUCT = "PyBadge" diff --git a/ports/atmel-samd/boards/pybadge_airlift/mpconfigboard.h b/ports/atmel-samd/boards/pybadge_airlift/mpconfigboard.h index ade74786d3..229cfa3354 100644 --- a/ports/atmel-samd/boards/pybadge_airlift/mpconfigboard.h +++ b/ports/atmel-samd/boards/pybadge_airlift/mpconfigboard.h @@ -14,14 +14,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA13) #define DEFAULT_I2C_BUS_SDA (&pin_PA12) diff --git a/ports/atmel-samd/boards/pybadge_airlift/mpconfigboard.mk b/ports/atmel-samd/boards/pybadge_airlift/mpconfigboard.mk index 7e77b0feaf..242722870a 100644 --- a/ports/atmel-samd/boards/pybadge_airlift/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pybadge_airlift/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8043 USB_PRODUCT = "PyBadge AirLift" diff --git a/ports/atmel-samd/boards/pygamer/mpconfigboard.h b/ports/atmel-samd/boards/pygamer/mpconfigboard.h index 4720b22eb1..102c259567 100644 --- a/ports/atmel-samd/boards/pygamer/mpconfigboard.h +++ b/ports/atmel-samd/boards/pygamer/mpconfigboard.h @@ -13,14 +13,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA13) #define DEFAULT_I2C_BUS_SDA (&pin_PA12) diff --git a/ports/atmel-samd/boards/pygamer/mpconfigboard.mk b/ports/atmel-samd/boards/pygamer/mpconfigboard.mk index 0fce468d9f..70109e332e 100644 --- a/ports/atmel-samd/boards/pygamer/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pygamer/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x803E USB_PRODUCT = "PyGamer" diff --git a/ports/atmel-samd/boards/pygamer_advance/mpconfigboard.h b/ports/atmel-samd/boards/pygamer_advance/mpconfigboard.h index c05aa4f062..fbe946b72f 100644 --- a/ports/atmel-samd/boards/pygamer_advance/mpconfigboard.h +++ b/ports/atmel-samd/boards/pygamer_advance/mpconfigboard.h @@ -13,14 +13,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA13) #define DEFAULT_I2C_BUS_SDA (&pin_PA12) diff --git a/ports/atmel-samd/boards/pygamer_advance/mpconfigboard.mk b/ports/atmel-samd/boards/pygamer_advance/mpconfigboard.mk index 8711738d4f..7f3207ecd0 100644 --- a/ports/atmel-samd/boards/pygamer_advance/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pygamer_advance/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x803E USB_PRODUCT = "PyGamer Advance" diff --git a/ports/atmel-samd/boards/pyportal/mpconfigboard.h b/ports/atmel-samd/boards/pyportal/mpconfigboard.h index 43346488ba..2c4cf4f580 100644 --- a/ports/atmel-samd/boards/pyportal/mpconfigboard.h +++ b/ports/atmel-samd/boards/pyportal/mpconfigboard.h @@ -17,14 +17,6 @@ #define MICROPY_PORT_C ( 0 ) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PB03) #define DEFAULT_I2C_BUS_SDA (&pin_PB02) diff --git a/ports/atmel-samd/boards/pyportal/mpconfigboard.mk b/ports/atmel-samd/boards/pyportal/mpconfigboard.mk index f763c74fa4..149141a4e3 100644 --- a/ports/atmel-samd/boards/pyportal/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pyportal/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x20-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8036 USB_PRODUCT = "PyPortal" diff --git a/ports/atmel-samd/boards/pyportal_titano/mpconfigboard.h b/ports/atmel-samd/boards/pyportal_titano/mpconfigboard.h index 91c1188108..c463b56616 100644 --- a/ports/atmel-samd/boards/pyportal_titano/mpconfigboard.h +++ b/ports/atmel-samd/boards/pyportal_titano/mpconfigboard.h @@ -16,14 +16,6 @@ #define MICROPY_PORT_C ( 0 ) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PB03) #define DEFAULT_I2C_BUS_SDA (&pin_PB02) diff --git a/ports/atmel-samd/boards/pyportal_titano/mpconfigboard.mk b/ports/atmel-samd/boards/pyportal_titano/mpconfigboard.mk index 58b363779c..dbc2d5ae99 100644 --- a/ports/atmel-samd/boards/pyportal_titano/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pyportal_titano/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x20-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8054 USB_PRODUCT = "PyPortal Titano" diff --git a/ports/atmel-samd/boards/pyruler/mpconfigboard.h b/ports/atmel-samd/boards/pyruler/mpconfigboard.h index 171873b47c..4d0586d912 100644 --- a/ports/atmel-samd/boards/pyruler/mpconfigboard.h +++ b/ports/atmel-samd/boards/pyruler/mpconfigboard.h @@ -10,10 +10,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define IGNORE_PIN_PA12 1 #define IGNORE_PIN_PA13 1 #define IGNORE_PIN_PA16 1 diff --git a/ports/atmel-samd/boards/pyruler/mpconfigboard.mk b/ports/atmel-samd/boards/pyruler/mpconfigboard.mk index 9663944a38..220e48872a 100644 --- a/ports/atmel-samd/boards/pyruler/mpconfigboard.mk +++ b/ports/atmel-samd/boards/pyruler/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x239A USB_PID = 0x804C USB_PRODUCT = "PyRuler" diff --git a/ports/atmel-samd/boards/robohatmm1_m0/mpconfigboard.h b/ports/atmel-samd/boards/robohatmm1_m0/mpconfigboard.h index c6856c68f8..68991f9974 100644 --- a/ports/atmel-samd/boards/robohatmm1_m0/mpconfigboard.h +++ b/ports/atmel-samd/boards/robohatmm1_m0/mpconfigboard.h @@ -17,13 +17,6 @@ #define MICROPY_PORT_B ( 0 ) #define MICROPY_PORT_C ( 0 ) - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define CALIBRATE_CRYSTALLESS 1 #define DEFAULT_I2C_BUS_SCL (&pin_PA23) @@ -39,4 +32,3 @@ // USB is always used internally so skip the pin objects for it. #define IGNORE_PIN_PA24 1 #define IGNORE_PIN_PA25 1 - diff --git a/ports/atmel-samd/boards/robohatmm1_m0/mpconfigboard.mk b/ports/atmel-samd/boards/robohatmm1_m0/mpconfigboard.mk index e703fbfb9f..29cca569e6 100644 --- a/ports/atmel-samd/boards/robohatmm1_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/robohatmm1_m0/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash-crystalless.ld USB_VID = 0x1209 USB_PID = 0x4D43 USB_PRODUCT = "Robo HAT MM1 M0" diff --git a/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.h b/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.h index 64040a6586..c66873aeb2 100644 --- a/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.h +++ b/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.h @@ -21,14 +21,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.mk b/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.mk index 56f1617dbf..b2ea18e5f2 100644 --- a/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.mk +++ b/ports/atmel-samd/boards/robohatmm1_m4/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x1209 USB_PID = 0x4D43 USB_PRODUCT = "Robo HAT MM1 M4" diff --git a/ports/atmel-samd/boards/sam32/mpconfigboard.h b/ports/atmel-samd/boards/sam32/mpconfigboard.h index f6d3fb6b46..3c6f52ebcc 100644 --- a/ports/atmel-samd/boards/sam32/mpconfigboard.h +++ b/ports/atmel-samd/boards/sam32/mpconfigboard.h @@ -11,12 +11,9 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - +// No microcontroller.nvm #define CIRCUITPY_INTERNAL_NVM_SIZE 0 -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - 0x010000) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_PA04) diff --git a/ports/atmel-samd/boards/sam32/mpconfigboard.mk b/ports/atmel-samd/boards/sam32/mpconfigboard.mk index 12884a9cc8..0d6be64374 100644 --- a/ports/atmel-samd/boards/sam32/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sam32/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x20-bootloader.ld USB_VID = 0x04D8 USB_PID = 0xEDBE USB_PRODUCT = "SAM32" diff --git a/ports/atmel-samd/boards/samd21x18-bootloader-crystalless.ld b/ports/atmel-samd/boards/samd21x18-bootloader-crystalless.ld index 2adf4fa909..1ee745eb17 100644 --- a/ports/atmel-samd/boards/samd21x18-bootloader-crystalless.ld +++ b/ports/atmel-samd/boards/samd21x18-bootloader-crystalless.ld @@ -10,75 +10,4 @@ MEMORY RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K } -/* top end of the stack */ -/* stack must be double-word (8 byte) aligned */ -_estack = ORIGIN(RAM) + LENGTH(RAM) - 8; -_bootloader_dbl_tap = ORIGIN(RAM) + LENGTH(RAM) - 4; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _sidata ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialize the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialize the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 2K; /* Reserve a minimum of 2K for the stack. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd21-common.ld" diff --git a/ports/atmel-samd/boards/samd21x18-bootloader-external-flash-crystalless.ld b/ports/atmel-samd/boards/samd21x18-bootloader-external-flash-crystalless.ld index bddaae99da..d8f4cc2365 100644 --- a/ports/atmel-samd/boards/samd21x18-bootloader-external-flash-crystalless.ld +++ b/ports/atmel-samd/boards/samd21x18-bootloader-external-flash-crystalless.ld @@ -10,75 +10,4 @@ MEMORY RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K } -/* top end of the stack */ -/* stack must be double-word (8 byte) aligned */ -_estack = ORIGIN(RAM) + LENGTH(RAM) - 8; -_bootloader_dbl_tap = ORIGIN(RAM) + LENGTH(RAM) - 4; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _sidata ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 2K; /* Reserve a minimum of 2K for the stack. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd21-common.ld" diff --git a/ports/atmel-samd/boards/samd21x18-bootloader-external-flash.ld b/ports/atmel-samd/boards/samd21x18-bootloader-external-flash.ld index 4e677a079f..f663326d69 100644 --- a/ports/atmel-samd/boards/samd21x18-bootloader-external-flash.ld +++ b/ports/atmel-samd/boards/samd21x18-bootloader-external-flash.ld @@ -10,75 +10,4 @@ MEMORY RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K /* 32 KiB RAM */ } -/* top end of the stack */ -/* stack must be double-word (8 byte) aligned */ -_estack = ORIGIN(RAM) + LENGTH(RAM) - 8; -_bootloader_dbl_tap = ORIGIN(RAM) + LENGTH(RAM) - 4; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _etext ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 2K; /* Reserve a minimum of 2K for the stack. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd21-common.ld" diff --git a/ports/atmel-samd/boards/samd21x18-bootloader.ld b/ports/atmel-samd/boards/samd21x18-bootloader.ld index 2ef09ba9af..666ac79c47 100644 --- a/ports/atmel-samd/boards/samd21x18-bootloader.ld +++ b/ports/atmel-samd/boards/samd21x18-bootloader.ld @@ -11,75 +11,4 @@ MEMORY RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K } -/* top end of the stack */ -/* stack must be double-word (8 byte) aligned */ -_estack = ORIGIN(RAM) + LENGTH(RAM) - 8; -_bootloader_dbl_tap = ORIGIN(RAM) + LENGTH(RAM) - 4; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _sidata ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialize the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialize the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 2K; /* Reserve a minimum of 2K for the stack. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd21-common.ld" diff --git a/ports/atmel-samd/boards/samd21x18-external-flash.ld b/ports/atmel-samd/boards/samd21x18-external-flash.ld index a540bfde2a..6afdab7345 100644 --- a/ports/atmel-samd/boards/samd21x18-external-flash.ld +++ b/ports/atmel-samd/boards/samd21x18-external-flash.ld @@ -10,74 +10,4 @@ MEMORY RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K } -/* top end of the stack */ -_estack = ORIGIN(RAM) + LENGTH(RAM); -_bootloader_dbl_tap = 0; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _sidata ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 2K; /* Reserve a minimum of 2K for the stack. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd21-common.ld" diff --git a/ports/atmel-samd/boards/samd21x18.ld b/ports/atmel-samd/boards/samd21x18.ld index 139be86bb2..c035f5117e 100644 --- a/ports/atmel-samd/boards/samd21x18.ld +++ b/ports/atmel-samd/boards/samd21x18.ld @@ -10,74 +10,4 @@ MEMORY RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K } -/* top end of the stack */ -_estack = ORIGIN(RAM) + LENGTH(RAM); -_bootloader_dbl_tap = 0; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - -/* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _sidata ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 2K; /* Reserve a minimum of 2K for the stack. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd21-common.ld" diff --git a/ports/atmel-samd/boards/samd51x18-bootloader-external-flash.ld b/ports/atmel-samd/boards/samd51x18-bootloader-external-flash.ld index c0e812ce19..b22bef3f3a 100644 --- a/ports/atmel-samd/boards/samd51x18-bootloader-external-flash.ld +++ b/ports/atmel-samd/boards/samd51x18-bootloader-external-flash.ld @@ -10,75 +10,4 @@ MEMORY RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K } -/* top end of the stack */ -/* stack must be double-word (8 byte) aligned */ -_estack = ORIGIN(RAM) + LENGTH(RAM) - 8; -_bootloader_dbl_tap = ORIGIN(RAM) + LENGTH(RAM) - 4; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _sidata ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 10K; /* Reserve a minimum of 10K for the stack. nvm will temporarily store 8k on the stack when writing. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd51-common.ld" diff --git a/ports/atmel-samd/boards/samd51x19-bootloader-external-flash.ld b/ports/atmel-samd/boards/samd51x19-bootloader-external-flash.ld index 253a764c9b..f1493f2510 100644 --- a/ports/atmel-samd/boards/samd51x19-bootloader-external-flash.ld +++ b/ports/atmel-samd/boards/samd51x19-bootloader-external-flash.ld @@ -10,75 +10,4 @@ MEMORY RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 192K } -/* top end of the stack */ -/* stack must be double-word (8 byte) aligned */ -_estack = ORIGIN(RAM) + LENGTH(RAM) - 8; -_bootloader_dbl_tap = ORIGIN(RAM) + LENGTH(RAM) - 4; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _sidata ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 10K; /* Reserve a minimum of 10K for the stack. nvm will temporarily store 8k on the stack when writing. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd51-common.ld" diff --git a/ports/atmel-samd/boards/samd51x19-bootloader.ld b/ports/atmel-samd/boards/samd51x19-bootloader.ld index 56786a37af..c73db2ece9 100644 --- a/ports/atmel-samd/boards/samd51x19-bootloader.ld +++ b/ports/atmel-samd/boards/samd51x19-bootloader.ld @@ -10,75 +10,4 @@ MEMORY RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 192K } -/* top end of the stack */ -/* stack must be double-word (8 byte) aligned */ -_estack = ORIGIN(RAM) + LENGTH(RAM) - 8; -_bootloader_dbl_tap = ORIGIN(RAM) + LENGTH(RAM) - 4; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _sidata ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 10K; /* Reserve a minimum of 10K for the stack. nvm will temporarily store 8k on the stack when writing. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd51-common.ld" diff --git a/ports/atmel-samd/boards/samd51x20-bootloader-external-flash.ld b/ports/atmel-samd/boards/samd51x20-bootloader-external-flash.ld index 598915b1b7..ee28fdf1cc 100644 --- a/ports/atmel-samd/boards/samd51x20-bootloader-external-flash.ld +++ b/ports/atmel-samd/boards/samd51x20-bootloader-external-flash.ld @@ -10,75 +10,4 @@ MEMORY RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K } -/* top end of the stack */ -/* stack must be double-word (8 byte) aligned */ -_estack = ORIGIN(RAM) + LENGTH(RAM) - 8; -_bootloader_dbl_tap = ORIGIN(RAM) + LENGTH(RAM) - 4; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _sidata ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 10K; /* Reserve a minimum of 10K for the stack. nvm will temporarily store 8k on the stack when writing. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd51-common.ld" diff --git a/ports/atmel-samd/boards/samd51x20-bootloader.ld b/ports/atmel-samd/boards/samd51x20-bootloader.ld index 49d4d87914..ea0e0569f5 100644 --- a/ports/atmel-samd/boards/samd51x20-bootloader.ld +++ b/ports/atmel-samd/boards/samd51x20-bootloader.ld @@ -9,76 +9,4 @@ MEMORY FLASH (rx) : ORIGIN = 0x00000000 + 16K, LENGTH = 1M - 16K - 512K - 8K RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K } - -/* top end of the stack */ -/* stack must be double-word (8 byte) aligned */ -_estack = ORIGIN(RAM) + LENGTH(RAM) - 8; -_bootloader_dbl_tap = ORIGIN(RAM) + LENGTH(RAM) - 4; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _sidata ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 10K; /* Reserve a minimum of 10K for the stack. nvm will temporarily store 8k on the stack when writing. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd51-common.ld" diff --git a/ports/atmel-samd/boards/samd51x20-external-flash.ld b/ports/atmel-samd/boards/samd51x20-external-flash.ld index d3ed90476e..5212363fe1 100644 --- a/ports/atmel-samd/boards/samd51x20-external-flash.ld +++ b/ports/atmel-samd/boards/samd51x20-external-flash.ld @@ -9,74 +9,4 @@ MEMORY RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K } -/* top end of the stack */ -_estack = ORIGIN(RAM) + LENGTH(RAM); -_bootloader_dbl_tap = 0; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _sidata ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 10K; /* Reserve a minimum of 10K for the stack. nvm will temporarily store 8k on the stack when writing. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd51-common.ld" diff --git a/ports/atmel-samd/boards/samd51x20.ld b/ports/atmel-samd/boards/samd51x20.ld index e203c5b7a9..1f0b661720 100644 --- a/ports/atmel-samd/boards/samd51x20.ld +++ b/ports/atmel-samd/boards/samd51x20.ld @@ -10,74 +10,4 @@ MEMORY RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K } -/* top end of the stack */ -_estack = ORIGIN(RAM) + LENGTH(RAM); -_bootloader_dbl_tap = 0; - -/* define output sections */ -SECTIONS -{ - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - _sfixed = .; - KEEP(*(.vectors)) /* isr vector table */ - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - - . = ALIGN(4); - } >FLASH - - .ARM.exidx : - { - *(.ARM.exidx*) - *(.gnu.linkonce.armexidx.*) - _etext = .; /* define a global symbol at end of code */ - _sidata = .; /* start of .data section */ - } > FLASH - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT ( _sidata ) - { - . = ALIGN(4); - _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - *(.ramfunc) - *(.ramfunc*) - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _erelocate = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; - _szero = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ezero = .; /* define a global symbol at bss end; used by startup code */ - _ebss = .; - } >RAM - - /* this just checks there is enough RAM for a minimal stack */ - .stack : - { - . = ALIGN(4); - . = . + 10K; /* Reserve a minimum of 10K for the stack. nvm will temporarily store 8k on the stack when writing. */ - . = ALIGN(4); - } >RAM - - .ARM.attributes 0 : { *(.ARM.attributes) } -} +INCLUDE "samd51-common.ld" diff --git a/ports/atmel-samd/boards/serpente/mpconfigboard.h b/ports/atmel-samd/boards/serpente/mpconfigboard.h index 034e1f6c37..515bc14410 100644 --- a/ports/atmel-samd/boards/serpente/mpconfigboard.h +++ b/ports/atmel-samd/boards/serpente/mpconfigboard.h @@ -13,12 +13,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA09) #define DEFAULT_I2C_BUS_SDA (&pin_PA08) @@ -36,4 +30,3 @@ // Not connected #define IGNORE_PIN_PA13 1 #define IGNORE_PIN_PA28 1 - diff --git a/ports/atmel-samd/boards/serpente/mpconfigboard.mk b/ports/atmel-samd/boards/serpente/mpconfigboard.mk index 98e1e37297..a5adb17a1e 100644 --- a/ports/atmel-samd/boards/serpente/mpconfigboard.mk +++ b/ports/atmel-samd/boards/serpente/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash-crystalless.ld USB_VID = 0x239A USB_PID = 0x8058 USB_PRODUCT = "Serpente" diff --git a/ports/atmel-samd/boards/snekboard/mpconfigboard.h b/ports/atmel-samd/boards/snekboard/mpconfigboard.h index a349143d91..1c0804fe72 100644 --- a/ports/atmel-samd/boards/snekboard/mpconfigboard.h +++ b/ports/atmel-samd/boards/snekboard/mpconfigboard.h @@ -15,13 +15,6 @@ #define MICROPY_PORT_B ( 0 ) #define MICROPY_PORT_C ( 0 ) - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 0 #define DEFAULT_I2C_BUS_SCL (&pin_PA08) /* ANALOG 5 */ diff --git a/ports/atmel-samd/boards/snekboard/mpconfigboard.mk b/ports/atmel-samd/boards/snekboard/mpconfigboard.mk index db2e511abf..4faa041b1b 100644 --- a/ports/atmel-samd/boards/snekboard/mpconfigboard.mk +++ b/ports/atmel-samd/boards/snekboard/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x804E USB_PRODUCT = "snekboard" diff --git a/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.h b/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.h index 80cacfa9b0..d184945f35 100755 --- a/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.h +++ b/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.h @@ -13,10 +13,6 @@ #define MICROPY_PORT_B ( 0 ) #define MICROPY_PORT_C ( 0 ) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 //I2C diff --git a/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.mk index 9d0ef1c040..6a2afc306e 100755 --- a/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_lumidrive/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash.ld USB_VID = 0x1B4F USB_PID = 0x0017 USB_PRODUCT = "LUMIDrive Board" diff --git a/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.h b/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.h index cf7c3998bb..ae272d502b 100755 --- a/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.h +++ b/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.h @@ -15,20 +15,12 @@ #define SPI_FLASH_SCK_PIN &pin_PB23 #define SPI_FLASH_CS_PIN &pin_PA13 -#define MICROPY_PORT_A ( 0 ) +#define MICROPY_PORT_A ( 0 ) #define MICROPY_PORT_B ( 0 ) #define MICROPY_PORT_C ( 0 ) - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 - // I2C - also QWIIC #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk index e80ef62771..f2d4eccad9 100755 --- a/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_redboard_turbo/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash.ld USB_VID = 0x1B4F USB_PID = 0x0015 USB_PRODUCT = "RedBoard Turbo Board" diff --git a/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.h b/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.h index a50c61cf2d..13bb263803 100644 --- a/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.h +++ b/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.h @@ -5,10 +5,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk index c9d0baf11f..0c33ef960e 100644 --- a/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_samd21_dev/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x1B4F USB_PID = 0x8D23 USB_PRODUCT = "SparkFun SAMD21 Dev Breakout" diff --git a/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.h b/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.h index 6af7fa1918..2cfdd9e73b 100644 --- a/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.h +++ b/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.h @@ -5,10 +5,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA23) #define DEFAULT_I2C_BUS_SDA (&pin_PA22) diff --git a/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk b/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk index a6e216575e..d09785fb8a 100644 --- a/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk +++ b/ports/atmel-samd/boards/sparkfun_samd21_mini/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x1B4F USB_PID = 0x8D22 USB_PRODUCT = "SparkFun SAMD21 Mini Breakout" diff --git a/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.h b/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.h index 34ab8fcfbc..02a6e7f7ce 100644 --- a/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.h @@ -16,12 +16,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA05) #define DEFAULT_I2C_BUS_SDA (&pin_PA04) @@ -47,4 +41,3 @@ #define IGNORE_PIN_PA28 1 #define IGNORE_PIN_PA30 1 #define IGNORE_PIN_PA31 1 - diff --git a/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk b/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk index 17de6ac742..92129eb63f 100644 --- a/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/stringcar_m0_express/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash-crystalless.ld USB_VID = 0x239A USB_PID = 0x8060 USB_PRODUCT = "StringCar M0 Express" @@ -21,4 +20,3 @@ CIRCUITPY_RTC = 0 CFLAGS_INLINE_LIMIT = 60 SUPEROPT_GC = 0 - diff --git a/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.h b/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.h index 8ca1df1621..96b38810c3 100644 --- a/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.h @@ -16,14 +16,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define AUTORESET_DELAY_MS 500 - -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code -#define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PB08) #define DEFAULT_I2C_BUS_SDA (&pin_PB09) diff --git a/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.mk b/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.mk index ec37186c3a..3795208724 100644 --- a/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trellis_m4_express/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd51x19-bootloader-external-flash.ld USB_VID = 0x239A USB_PID = 0x8030 USB_PRODUCT = "Trellis M4 Express" diff --git a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.h b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.h index dd8bc03ccf..69517534ee 100644 --- a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.h +++ b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.h @@ -11,10 +11,6 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define IGNORE_PIN_PA03 1 #define IGNORE_PIN_PA04 1 #define IGNORE_PIN_PA11 1 diff --git a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk index b4a00b654a..0d41fa4bd7 100644 --- a/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trinket_m0/mpconfigboard.mk @@ -1,4 +1,4 @@ -LD_FILE = boards/samd21x18-bootloader.ld +LD_TEMPLATE_FILE = boards/common.template.ld USB_VID = 0x239A USB_PID = 0x801F USB_PRODUCT = "Trinket M0" diff --git a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.h b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.h index 369d84b8b8..af473b1288 100644 --- a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.h +++ b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.h @@ -18,12 +18,6 @@ #define CALIBRATE_CRYSTALLESS 1 -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_PA09) #define DEFAULT_I2C_BUS_SDA (&pin_PA08) diff --git a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk index c20358e19f..bd6c9c9ff7 100644 --- a/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk +++ b/ports/atmel-samd/boards/trinket_m0_haxpress/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash-crystalless.ld USB_VID = 0x239A USB_PID = 0x801F USB_PRODUCT="Trinket M0 Haxpress" diff --git a/ports/atmel-samd/boards/uchip/mpconfigboard.h b/ports/atmel-samd/boards/uchip/mpconfigboard.h index 6dcaf2965c..1877a41ef9 100644 --- a/ports/atmel-samd/boards/uchip/mpconfigboard.h +++ b/ports/atmel-samd/boards/uchip/mpconfigboard.h @@ -7,11 +7,9 @@ #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) +// No microcontroller.nvm #define CIRCUITPY_INTERNAL_NVM_SIZE 0 -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000) - - // USB is always used internally so skip the pin objects for it. #define IGNORE_PIN_PA24 1 #define IGNORE_PIN_PA25 1 diff --git a/ports/atmel-samd/boards/uchip/mpconfigboard.mk b/ports/atmel-samd/boards/uchip/mpconfigboard.mk index 109492b764..950910e48b 100644 --- a/ports/atmel-samd/boards/uchip/mpconfigboard.mk +++ b/ports/atmel-samd/boards/uchip/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader.ld USB_VID = 0x04D8 USB_PID = 0xED5F USB_PRODUCT = "uChip CircuitPython" diff --git a/ports/atmel-samd/boards/ugame10/mpconfigboard.h b/ports/atmel-samd/boards/ugame10/mpconfigboard.h index b5590d986c..550172a517 100644 --- a/ports/atmel-samd/boards/ugame10/mpconfigboard.h +++ b/ports/atmel-samd/boards/ugame10/mpconfigboard.h @@ -13,12 +13,6 @@ #define CALIBRATE_CRYSTALLESS 1 -// If you change this, then make sure to update the linker scripts as well to -// make sure you don't overwrite code. -#define CIRCUITPY_INTERNAL_NVM_SIZE 256 - -#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_SPI_BUS_SCK (&pin_PA07) #define DEFAULT_SPI_BUS_MISO (&pin_PA11) #define DEFAULT_SPI_BUS_MOSI (&pin_PA06) diff --git a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk index f0310b4aaa..1c43369076 100644 --- a/ports/atmel-samd/boards/ugame10/mpconfigboard.mk +++ b/ports/atmel-samd/boards/ugame10/mpconfigboard.mk @@ -1,4 +1,3 @@ -LD_FILE = boards/samd21x18-bootloader-external-flash-crystalless.ld USB_VID = 0x239A USB_PID = 0x801F USB_PRODUCT = "uGame10" diff --git a/ports/atmel-samd/common-hal/microcontroller/__init__.c b/ports/atmel-samd/common-hal/microcontroller/__init__.c index cb0751acef..41dee2b490 100644 --- a/ports/atmel-samd/common-hal/microcontroller/__init__.c +++ b/ports/atmel-samd/common-hal/microcontroller/__init__.c @@ -92,7 +92,6 @@ const mcu_processor_obj_t common_hal_mcu_processor_obj = { }, }; -// NVM is only available on Express boards for now. #if CIRCUITPY_INTERNAL_NVM_SIZE > 0 // The singleton nvm.ByteArray object. const nvm_bytearray_obj_t common_hal_mcu_nvm_obj = { diff --git a/ports/atmel-samd/ld_defines.c b/ports/atmel-samd/ld_defines.c new file mode 100644 index 0000000000..62838ca4b5 --- /dev/null +++ b/ports/atmel-samd/ld_defines.c @@ -0,0 +1,14 @@ +// Fake source file used only to capture #define values for use in ld template files. +#include "mpconfigport.h" + +// For each value needed in the LD file, create a C-like line: +// NAME_OF_VALUE; ///DEFINE_VALUE NAME_OF_VALUE +// The C preprocessor will replace NAME_OF_VALUE with the actual value. +// This will be post-processed by tools/gen_ld_files.py to extract the name and vlaue. + +BOOTLOADER_SIZE; ///DEFINE_VALUE BOOTLOADER_SIZE +RAM_SIZE; ///DEFINE_VALUE RAM_SIZE lambda f: f.rstrip("UL") +FLASH_SIZE; ///DEFINE_VALUE FLASH_SIZE lambda f: f.rstrip("UL") +CIRCUITPY_INTERNAL_CONFIG_SIZE; ///DEFINE_VALUE CIRCUITPY_INTERNAL_CONFIG_SIZE +CIRCUITPY_INTERNAL_NVM_SIZE; ///DEFINE_VALUE CIRCUITPY_INTERNAL_NVM_SIZE +CIRCUITPY_DEFAULT_STACK_SIZE; ///DEFINE_VALUE CIRCUITPY_DEFAULT_STACK_SIZE diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h index 4e15a6c308..21adb10028 100644 --- a/ports/atmel-samd/mpconfigport.h +++ b/ports/atmel-samd/mpconfigport.h @@ -31,6 +31,30 @@ #include "include/sam.h" #ifdef SAMD21 + +// Default is 0, set by py/circuitpy_mpconfig.h +#if INTERNAL_FLASH_FILESYSTEM +// 64kB +#define INTERNAL_FLASH_FILESYSTEM_SIZE (64*1024) +#endif + +#ifndef CIRCUITPY_INTERNAL_NVM_SIZE +#define CIRCUITPY_INTERNAL_NVM_SIZE (256) +#endif + +// if CALIBRATE_CRYSTALLESS is requested, make room for storing +// calibration data generated from external USB. +#ifndef CIRCUITPY_INTERNAL_CONFIG_SIZE + #ifdef CALIBRATE_CRYSTALLESS +#define CIRCUITPY_INTERNAL_CONFIG_SIZE (256) + #else +#define CIRCUITPY_INTERNAL_CONFIG_SIZE (0) + #endif +#endif + +// HMCRAMC0_SIZE is defined in the ASF4 include files for each SAMD21 chip. +#define RAM_SIZE HMCRAMC0_SIZE +#define BOOTLOADER_SIZE (8*1024) #define CIRCUITPY_MCU_FAMILY samd21 #define MICROPY_PY_SYS_PLATFORM "Atmel SAMD21" #define SPI_FLASH_MAX_BAUDRATE 8000000 @@ -54,9 +78,17 @@ X(EISDIR) \ X(EINVAL) \ -#endif +#endif // SAMD21 #ifdef SAMD51 + +#ifndef CIRCUITPY_INTERNAL_NVM_SIZE +#define CIRCUITPY_INTERNAL_NVM_SIZE (8192) +#endif + +// HSRAM_SIZE is defined in the ASF4 include files for each SAMD51 chip. +#define RAM_SIZE HSRAM_SIZE +#define BOOTLOADER_SIZE (16*1024) #define CIRCUITPY_MCU_FAMILY samd51 #define MICROPY_PY_SYS_PLATFORM "MicroChip SAMD51" #define SPI_FLASH_MAX_BAUDRATE 24000000 @@ -69,7 +101,8 @@ #define MICROPY_PY_UJSON (1) #define MICROPY_PY_REVERSE_SPECIAL_METHODS (1) // MICROPY_PY_UERRNO_LIST - Use the default -#endif + +#endif // SAMD51 // Turning off audioio, audiobusio, and touchio as necessary // due to limitations of chips is handled in mpconfigboard.mk diff --git a/ports/atmel-samd/mpconfigport.mk b/ports/atmel-samd/mpconfigport.mk index 88ddb49e01..63ddb5f23f 100644 --- a/ports/atmel-samd/mpconfigport.mk +++ b/ports/atmel-samd/mpconfigport.mk @@ -1,3 +1,7 @@ +# All linking can be done with this common templated linker script, which has +# parameters that vary based on chip and/or board. +LD_TEMPLATE_FILE = boards/common.template.ld + # Define an equivalent for MICROPY_LONGINT_IMPL, to pass to $(MPY-TOOL) in py/mkrules.mk # $(MPY-TOOL) needs to know what kind of longint to use (if any) to freeze long integers. # This should correspond to the MICROPY_LONGINT_IMPL definition in mpconfigport.h. diff --git a/ports/atmel-samd/tick.c b/ports/atmel-samd/tick.c index 4d7bb9dca7..6163a64d87 100644 --- a/ports/atmel-samd/tick.c +++ b/ports/atmel-samd/tick.c @@ -56,7 +56,7 @@ void SysTick_Handler(void) { #if CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS > 0 filesystem_tick(); #endif -#ifdef CIRCUITPY_AUTORELOAD_DELAY_MS +#if CIRCUITPY_AUTORELOAD_DELAY_MS > 0 autoreload_tick(); #endif #ifdef CIRCUITPY_GAMEPAD_TICKS diff --git a/ports/cxd56/tick.c b/ports/cxd56/tick.c index 6529db7901..6b93a3b659 100644 --- a/ports/cxd56/tick.c +++ b/ports/cxd56/tick.c @@ -39,7 +39,7 @@ void board_timerhook(void) #if CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS > 0 filesystem_tick(); #endif -#ifdef CIRCUITPY_AUTORELOAD_DELAY_MS +#if CIRCUITPY_AUTORELOAD_DELAY_MS > 0 autoreload_tick(); #endif } diff --git a/ports/nrf/boards/adafruit_nrf52840_s140_v6.ld b/ports/nrf/boards/adafruit_nrf52840_s140_v6.ld index 90b8862cf0..74e66754d8 100644 --- a/ports/nrf/boards/adafruit_nrf52840_s140_v6.ld +++ b/ports/nrf/boards/adafruit_nrf52840_s140_v6.ld @@ -19,11 +19,12 @@ /* Specify the memory areas (S140 6.x.x) */ MEMORY { - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x100000 + FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 1M FLASH_ISR (rx) : ORIGIN = 0x00026000, LENGTH = 0x001000 FLASH_TEXT (rx) : ORIGIN = 0x00027000, LENGTH = 0x086000 FLASH_FATFS (r) : ORIGIN = 0x000AD000, LENGTH = 0x040000 + FLASH_NVM (r) : ORIGIN = 0x000EC000, LENGTH = 0x001000 FLASH_CONFIG (r): ORIGIN = 0x000ED000, LENGTH = 0x007000 /* 0x2000000 - RAM:ORIGIN is reserved for Softdevice */ diff --git a/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h b/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h index 1e55cd0260..cc441eb0b0 100644 --- a/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h +++ b/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h @@ -55,12 +55,6 @@ #define SPI_FLASH_CS_PIN &pin_P0_15 #endif -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - -#define CIRCUITPY_INTERNAL_NVM_SIZE (4096) - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define DEFAULT_I2C_BUS_SCL (&pin_P0_04) #define DEFAULT_I2C_BUS_SDA (&pin_P0_05) diff --git a/ports/nrf/boards/common.ld b/ports/nrf/boards/common.ld index dfb355a76f..fade4b9e1b 100644 --- a/ports/nrf/boards/common.ld +++ b/ports/nrf/boards/common.ld @@ -6,6 +6,10 @@ __fatfs_flash_length = LENGTH(FLASH_FATFS); __config_flash_start_addr = ORIGIN(FLASH_CONFIG); __config_flash_length = LENGTH(FLASH_CONFIG); +/* Flash region for microcontroller.nvm region */ +__nvm_flash_start_addr = ORIGIN(FLASH_NVM); +__nvm_flash_length = LENGTH(FLASH_NVM); + /* define output sections */ SECTIONS { diff --git a/ports/nrf/boards/electronut_labs_blip/mpconfigboard.h b/ports/nrf/boards/electronut_labs_blip/mpconfigboard.h index 21e8c3ef61..6b0813e7d0 100644 --- a/ports/nrf/boards/electronut_labs_blip/mpconfigboard.h +++ b/ports/nrf/boards/electronut_labs_blip/mpconfigboard.h @@ -34,12 +34,6 @@ #define MICROPY_HW_MCU_NAME "nRF52840" #define MICROPY_PY_SYS_PLATFORM "ElectronutLabsPapyr" -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - -// TODO #define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_P0_11) diff --git a/ports/nrf/boards/electronut_labs_papyr/mpconfigboard.h b/ports/nrf/boards/electronut_labs_papyr/mpconfigboard.h index 7f5021fdca..594c3e54c9 100644 --- a/ports/nrf/boards/electronut_labs_papyr/mpconfigboard.h +++ b/ports/nrf/boards/electronut_labs_papyr/mpconfigboard.h @@ -33,12 +33,6 @@ #define MICROPY_HW_MCU_NAME "nRF52840" #define MICROPY_PY_SYS_PLATFORM "ElectronutLabsPapyr" -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - -// TODO #define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_P0_06) diff --git a/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h b/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h index 70ccffc3f3..130c5f3e8b 100644 --- a/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h +++ b/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h @@ -54,12 +54,6 @@ #define SPI_FLASH_CS_PIN &pin_P0_20 #endif -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - -#define CIRCUITPY_INTERNAL_NVM_SIZE (4096) - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_P0_11) diff --git a/ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.h b/ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.h index ed48364942..093a0df3bd 100644 --- a/ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.h +++ b/ports/nrf/boards/makerdiary_nrf52840_mdk/mpconfigboard.h @@ -40,12 +40,6 @@ #define MICROPY_QSPI_SCK NRF_GPIO_PIN_MAP(1, 3) #define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(1, 8) -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - -// TODO #define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 0 #define DEFAULT_UART_BUS_RX (&pin_P0_19) diff --git a/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.h b/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.h index d4096503d7..2128428b85 100644 --- a/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.h +++ b/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.h @@ -33,10 +33,4 @@ #define MICROPY_HW_MCU_NAME "nRF52840" #define MICROPY_PY_SYS_PLATFORM "MakerDiary52840MDKDongle" -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - -// TODO #define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 // according to the schematic we do diff --git a/ports/nrf/boards/metro_nrf52840_express/mpconfigboard.h b/ports/nrf/boards/metro_nrf52840_express/mpconfigboard.h index 520eef90d9..99ed5c785b 100644 --- a/ports/nrf/boards/metro_nrf52840_express/mpconfigboard.h +++ b/ports/nrf/boards/metro_nrf52840_express/mpconfigboard.h @@ -54,12 +54,6 @@ #define SPI_FLASH_CS_PIN &pin_P0_20 #endif -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - -#define CIRCUITPY_INTERNAL_NVM_SIZE (4096) - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_P0_16) diff --git a/ports/nrf/boards/particle_argon/mpconfigboard.h b/ports/nrf/boards/particle_argon/mpconfigboard.h index a4ecb2bb43..0d74869b1d 100644 --- a/ports/nrf/boards/particle_argon/mpconfigboard.h +++ b/ports/nrf/boards/particle_argon/mpconfigboard.h @@ -53,12 +53,6 @@ #define SPI_FLASH_CS_PIN &pin_P0_17 #endif -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - -// TODO #define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_P0_27) diff --git a/ports/nrf/boards/particle_boron/mpconfigboard.h b/ports/nrf/boards/particle_boron/mpconfigboard.h index 5e817311f9..61af22f580 100644 --- a/ports/nrf/boards/particle_boron/mpconfigboard.h +++ b/ports/nrf/boards/particle_boron/mpconfigboard.h @@ -53,12 +53,6 @@ #define SPI_FLASH_CS_PIN &pin_P0_17 #endif -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - -// TODO #define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_P0_27) diff --git a/ports/nrf/boards/particle_xenon/mpconfigboard.h b/ports/nrf/boards/particle_xenon/mpconfigboard.h index 6c8cc7cef2..c2dfffde85 100644 --- a/ports/nrf/boards/particle_xenon/mpconfigboard.h +++ b/ports/nrf/boards/particle_xenon/mpconfigboard.h @@ -53,12 +53,6 @@ #define SPI_FLASH_CS_PIN &pin_P0_17 #endif -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - -// TODO #define CIRCUITPY_INTERNAL_NVM_SIZE 8192 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) - #define BOARD_HAS_CRYSTAL 1 #define DEFAULT_I2C_BUS_SCL (&pin_P0_27) diff --git a/ports/nrf/boards/pca10056/mpconfigboard.h b/ports/nrf/boards/pca10056/mpconfigboard.h index 48ef7f1c39..eca339a7db 100644 --- a/ports/nrf/boards/pca10056/mpconfigboard.h +++ b/ports/nrf/boards/pca10056/mpconfigboard.h @@ -30,8 +30,6 @@ #define MICROPY_HW_MCU_NAME "nRF52840" #define MICROPY_PY_SYS_PLATFORM "nRF52840-DK" -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - #define MICROPY_HW_LED_STATUS (&pin_P0_13) #define DEFAULT_I2C_BUS_SCL (&pin_P0_27) diff --git a/ports/nrf/boards/pca10059/mpconfigboard.h b/ports/nrf/boards/pca10059/mpconfigboard.h index d5ce212292..eaca1bf210 100644 --- a/ports/nrf/boards/pca10059/mpconfigboard.h +++ b/ports/nrf/boards/pca10059/mpconfigboard.h @@ -29,5 +29,3 @@ #define MICROPY_PY_SYS_PLATFORM "nRF52840-DK" #define MICROPY_HW_LED_STATUS (&pin_P0_06) - -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 diff --git a/ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.h b/ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.h index a5ed69b2bd..20a99a6953 100644 --- a/ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.h +++ b/ports/nrf/boards/sparkfun_nrf52840_mini/mpconfigboard.h @@ -30,8 +30,6 @@ #define MICROPY_HW_MCU_NAME "nRF52840" #define MICROPY_PY_SYS_PLATFORM "SFE_NRF52840_Mini" -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - #define DEFAULT_I2C_BUS_SCL (&pin_P0_11) #define DEFAULT_I2C_BUS_SDA (&pin_P0_08) diff --git a/ports/nrf/common-hal/_bleio/Adapter.c b/ports/nrf/common-hal/_bleio/Adapter.c index a8e1f19059..76f08b5ed3 100644 --- a/ports/nrf/common-hal/_bleio/Adapter.c +++ b/ports/nrf/common-hal/_bleio/Adapter.c @@ -39,12 +39,21 @@ #include "supervisor/usb.h" #include "shared-bindings/_bleio/Adapter.h" #include "shared-bindings/_bleio/Address.h" +#include "shared-bindings/nvm/ByteArray.h" #define BLE_MIN_CONN_INTERVAL MSEC_TO_UNITS(15, UNIT_0_625_MS) #define BLE_MAX_CONN_INTERVAL MSEC_TO_UNITS(15, UNIT_0_625_MS) #define BLE_SLAVE_LATENCY 0 #define BLE_CONN_SUP_TIMEOUT MSEC_TO_UNITS(4000, UNIT_10_MS) +const nvm_bytearray_obj_t common_hal_bleio_nvm_obj = { + .base = { + .type = &nvm_bytearray_type, + }, + .len = CIRCUITPY_BLE_CONFIG_SIZE, + .start_address = CIRCUITPY_BLE_CONFIG_ADDRESS, +}; + STATIC void softdevice_assert_handler(uint32_t id, uint32_t pc, uint32_t info) { mp_raise_msg_varg(&mp_type_AssertionError, translate("Soft device assert, id: 0x%08lX, pc: 0x%08lX"), id, pc); diff --git a/ports/nrf/common-hal/microcontroller/__init__.c b/ports/nrf/common-hal/microcontroller/__init__.c index a6b1c4ba3b..eea3d43cec 100644 --- a/ports/nrf/common-hal/microcontroller/__init__.c +++ b/ports/nrf/common-hal/microcontroller/__init__.c @@ -76,11 +76,14 @@ const mcu_processor_obj_t common_hal_mcu_processor_obj = { }; #if CIRCUITPY_INTERNAL_NVM_SIZE > 0 + // The singleton nvm.ByteArray object. const nvm_bytearray_obj_t common_hal_mcu_nvm_obj = { .base = { .type = &nvm_bytearray_type, - }, + } + .start_address = CIRCUITPY_INTERNAL_NVM_ADDRESS, + .len = CIRCUITPY_INTERNAL_NVM_SIZE, }; #endif diff --git a/ports/nrf/common-hal/nvm/ByteArray.c b/ports/nrf/common-hal/nvm/ByteArray.c index ee270f79bb..416768101d 100644 --- a/ports/nrf/common-hal/nvm/ByteArray.c +++ b/ports/nrf/common-hal/nvm/ByteArray.c @@ -31,19 +31,12 @@ #include "peripherals/nrf/nvm.h" -// defined in linker -extern uint32_t __fatfs_flash_start_addr[]; -extern uint32_t __fatfs_flash_length[]; - -#define NVM_START_ADDR ((uint32_t)__fatfs_flash_start_addr + \ - (uint32_t)__fatfs_flash_length - CIRCUITPY_INTERNAL_NVM_SIZE) - uint32_t common_hal_nvm_bytearray_get_length(nvm_bytearray_obj_t *self) { - return CIRCUITPY_INTERNAL_NVM_SIZE; + return self->len; } static void write_page(uint32_t page_addr, uint32_t offset, uint32_t len, uint8_t *bytes) { - // Write a whole page to flash, buffering it first and then erasing and rewriting + // Write a whole page to flash, buffering it first and then erasing and rewriting // it since we can only clear a whole page at a time. if (offset == 0 && len == FLASH_PAGE_SIZE) { @@ -59,7 +52,7 @@ static void write_page(uint32_t page_addr, uint32_t offset, uint32_t len, uint8_ bool common_hal_nvm_bytearray_set_bytes(nvm_bytearray_obj_t *self, uint32_t start_index, uint8_t* values, uint32_t len) { - uint32_t address = NVM_START_ADDR + start_index; + uint32_t address = self->start_address + start_index; uint32_t offset = address % FLASH_PAGE_SIZE; uint32_t page_addr = address - offset; @@ -76,5 +69,5 @@ bool common_hal_nvm_bytearray_set_bytes(nvm_bytearray_obj_t *self, void common_hal_nvm_bytearray_get_bytes(nvm_bytearray_obj_t *self, uint32_t start_index, uint32_t len, uint8_t* values) { - memcpy(values, (uint8_t *)(NVM_START_ADDR + start_index), len); + memcpy(values, self->start_address + start_index, len); } diff --git a/ports/nrf/common-hal/nvm/ByteArray.h b/ports/nrf/common-hal/nvm/ByteArray.h index a8d09dd43a..c048d55778 100644 --- a/ports/nrf/common-hal/nvm/ByteArray.h +++ b/ports/nrf/common-hal/nvm/ByteArray.h @@ -31,6 +31,8 @@ typedef struct { mp_obj_base_t base; + uint8_t* start_address; + uint32_t len; } nvm_bytearray_obj_t; #endif // MICROPY_INCLUDED_NRF_COMMON_HAL_NVM_BYTEARRAY_H diff --git a/ports/nrf/mpconfigport.h b/ports/nrf/mpconfigport.h index 9c3d02f44d..3cb086f310 100644 --- a/ports/nrf/mpconfigport.h +++ b/ports/nrf/mpconfigport.h @@ -43,6 +43,10 @@ #include "py/circuitpy_mpconfig.h" +#ifndef CIRCUITPY_INTERNAL_NVM_SIZE +#define CIRCUITPY_INTERNAL_NVM_SIZE (4096) +#endif + #ifndef BOARD_HAS_32KHZ_XTAL // Assume crystal is present, which is the most common case. #define BOARD_HAS_32KHZ_XTAL (1) diff --git a/ports/nrf/peripherals/nrf/nvm.h b/ports/nrf/peripherals/nrf/nvm.h index 4eac3d7283..60a663e81f 100644 --- a/ports/nrf/peripherals/nrf/nvm.h +++ b/ports/nrf/peripherals/nrf/nvm.h @@ -27,8 +27,4 @@ #define FLASH_PAGE_SIZE (4096) -#ifndef CIRCUITPY_INTERNAL_NVM_SIZE -#define CIRCUITPY_INTERNAL_NVM_SIZE (0) -#endif - void nrf_nvm_safe_flash_page_write(uint32_t page_addr, uint8_t *data); diff --git a/ports/nrf/supervisor/internal_flash.c b/ports/nrf/supervisor/internal_flash.c index dcacd4d27f..c43454eb39 100644 --- a/ports/nrf/supervisor/internal_flash.c +++ b/ports/nrf/supervisor/internal_flash.c @@ -67,7 +67,7 @@ uint32_t supervisor_flash_get_block_size(void) { } uint32_t supervisor_flash_get_block_count(void) { - return ((uint32_t) __fatfs_flash_length - CIRCUITPY_INTERNAL_NVM_SIZE) / FILESYSTEM_BLOCK_SIZE ; + return ((uint32_t) __fatfs_flash_length) / FILESYSTEM_BLOCK_SIZE ; } void supervisor_flash_flush(void) { @@ -120,4 +120,3 @@ mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t lba, uint32 void supervisor_flash_release_cache(void) { } - diff --git a/ports/nrf/tick.c b/ports/nrf/tick.c index 6d8fd13e0a..1a9e69a8c7 100644 --- a/ports/nrf/tick.c +++ b/ports/nrf/tick.c @@ -43,7 +43,7 @@ void SysTick_Handler(void) { #if CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS > 0 filesystem_tick(); #endif -#ifdef CIRCUITPY_AUTORELOAD_DELAY_MS +#if CIRCUITPY_AUTORELOAD_DELAY_MS > 0 autoreload_tick(); #endif #ifdef CIRCUITPY_GAMEPAD_TICKS diff --git a/ports/stm32f4/boards/feather_f405/mpconfigboard.h b/ports/stm32f4/boards/feather_f405/mpconfigboard.h index 831a17573a..908b35a71e 100644 --- a/ports/stm32f4/boards/feather_f405/mpconfigboard.h +++ b/ports/stm32f4/boards/feather_f405/mpconfigboard.h @@ -33,9 +33,6 @@ #define FLASH_SIZE (0x100000) #define FLASH_PAGE_SIZE (0x4000) -#define AUTORESET_DELAY_MS 500 -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000) - // On-board flash #define SPI_FLASH_MOSI_PIN &pin_PB05 #define SPI_FLASH_MISO_PIN &pin_PB04 diff --git a/ports/stm32f4/boards/pyboard_v11/mpconfigboard.h b/ports/stm32f4/boards/pyboard_v11/mpconfigboard.h index e8441d665c..d793a222f6 100644 --- a/ports/stm32f4/boards/pyboard_v11/mpconfigboard.h +++ b/ports/stm32f4/boards/pyboard_v11/mpconfigboard.h @@ -32,6 +32,3 @@ #define FLASH_SIZE (0x100000) #define FLASH_PAGE_SIZE (0x4000) - -#define AUTORESET_DELAY_MS 500 -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000) \ No newline at end of file diff --git a/ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.h b/ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.h index d5491fe362..5bea089750 100644 --- a/ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.h +++ b/ports/stm32f4/boards/stm32f411ve_discovery/mpconfigboard.h @@ -32,9 +32,3 @@ #define FLASH_SIZE (0x80000) //512K #define FLASH_PAGE_SIZE (0x4000) //16K - -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x2000 - 0xC000) - -#define AUTORESET_DELAY_MS 500 diff --git a/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.h b/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.h index ebee98f89f..9e23f1db54 100644 --- a/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.h +++ b/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.h @@ -32,7 +32,3 @@ #define FLASH_SIZE (0x100000) #define FLASH_PAGE_SIZE (0x4000) - -#define AUTORESET_DELAY_MS 500 -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000) - diff --git a/ports/stm32f4/tick.c b/ports/stm32f4/tick.c index 43521fb516..b417df3059 100644 --- a/ports/stm32f4/tick.c +++ b/ports/stm32f4/tick.c @@ -44,7 +44,7 @@ void SysTick_Handler(void) { #if CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS > 0 filesystem_tick(); #endif -#ifdef CIRCUITPY_AUTORELOAD_DELAY_MS +#if CIRCUITPY_AUTORELOAD_DELAY_MS > 0 autoreload_tick(); #endif #ifdef CIRCUITPY_GAMEPAD_TICKS diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index b72d753904..915310f83a 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -296,7 +296,6 @@ $(filter $(SRC_PATTERNS), \ fontio/Glyph.c \ microcontroller/RunMode.c \ math/__init__.c \ - supervisor/__init__.c \ ) SRC_BINDINGS_ENUMS += \ diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 2cb6178198..91e2e223c2 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -212,7 +212,6 @@ typedef long mp_off_t; #define MP_SSIZE_MAX (0x7fffffff) #endif - // These CIRCUITPY_xxx values should all be defined in the *.mk files as being on or off. // So if any are not defined in *.mk, they'll throw an error here. @@ -661,8 +660,20 @@ void run_background_tasks(void); #define MICROPY_VM_HOOK_LOOP run_background_tasks(); #define MICROPY_VM_HOOK_RETURN run_background_tasks(); +// CIRCUITPY_AUTORELOAD_DELAY_MS = 0 will completely disable autoreload. +#ifndef CIRCUITPY_AUTORELOAD_DELAY_MS #define CIRCUITPY_AUTORELOAD_DELAY_MS 500 +#endif + +#ifndef CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS #define CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS 1000 +#endif + +// Default is no internal flash filesystem. +#ifndef INTERNAL_FLASH_FILESYSTEM_SIZE +#define INTERNAL_FLASH_FILESYSTEM_SIZE (0) +#endif + #define CIRCUITPY_BOOT_OUTPUT_FILE "/boot_out.txt" #endif // __INCLUDED_MPCONFIG_CIRCUITPY_H diff --git a/tools/gen_ld_files.py b/tools/gen_ld_files.py new file mode 100755 index 0000000000..fc80d46c9e --- /dev/null +++ b/tools/gen_ld_files.py @@ -0,0 +1,47 @@ +#! /usr/bin/env python3 +import argparse + +import os +import os.path +import sys +import re +from string import Template + +parser = argparse.ArgumentParser(description='Apply #define values to .template.ld file.') +parser.add_argument('template_files', metavar='TEMPLATE_FILE', type=argparse.FileType('r'), + nargs='+', help="template filename: .template.ld") +parser.add_argument('--defines', type=argparse.FileType('r'), required=True) +parser.add_argument('--out_dir', required=True) + +args = parser.parse_args() + +defines = {} + +# We're looking for lines like this: +# ///DEFINE_VALUE NAME_OF_VALUE +VALUE_LINE_RE = re.compile(r'^([^/].*); ///DEFINE_VALUE (\w+)(.*)$') + +for line in args.defines: + match = VALUE_LINE_RE.match(line.strip()) + if match: + value = match.group(1).strip() + name = match.group(2) + lambda_exp = match.group(3).strip() + # Apply the given lambda to the value if it is present, else just store the value. + defines[match.group(2)] = eval(lambda_exp)(value) if lambda_exp else value + +#print(defines) +fail = False + +for template_file in args.template_files: + ld_template_basename = os.path.basename(template_file.name) + ld_pathname = os.path.join(args.out_dir, ld_template_basename.replace('.template.ld', '.ld')) + with open(ld_pathname, 'w') as output: + try: + output.write(Template(template_file.read()).substitute(defines)) + except KeyError as e: + print("ERROR: {}: No #define for '{}'".format(ld_pathname, e.args[0]), file=sys.stderr) + fail = True + +if fail: + sys.exit(1) From 1505da784f228d43df41a773cfe504e7e4da330a Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 28 Oct 2019 18:15:02 -0400 Subject: [PATCH 03/78] wip --- ports/atmel-samd/boards/common.template.ld | 10 +----- ports/atmel-samd/boards/sam32/mpconfigboard.h | 2 +- ports/atmel-samd/ld_defines.c | 7 ++-- ports/atmel-samd/mpconfigport.h | 36 +++++++++++++++++-- ports/atmel-samd/supervisor/internal_flash.c | 2 +- ports/atmel-samd/supervisor/internal_flash.h | 11 +----- py/circuitpy_mpconfig.h | 6 +--- 7 files changed, 41 insertions(+), 33 deletions(-) diff --git a/ports/atmel-samd/boards/common.template.ld b/ports/atmel-samd/boards/common.template.ld index e02bbfab02..aebda87c20 100644 --- a/ports/atmel-samd/boards/common.template.ld +++ b/ports/atmel-samd/boards/common.template.ld @@ -3,15 +3,7 @@ /* Specify the memory areas */ MEMORY { - /* CIRCUITPY_BOOTLOADER_SIZE is size of bootloader, if any. - * SAMD21 Arduino and UF2 bootloaders are 8KiB. SAMD51 UF2 is 6KiB. - * FLASH_SIZE is defined in ASF4. - * RAM_SIZE is defined in mpconfigport.h, from constants from ASF4. - * CIRCUITPY_INTERNAL_CONFIG_SIZE is size of an optional hidden config area, used currently - * for crystalless USB timing calibration. - * CIRCUITPY_INTERNAL_NVM_SIZE is the size of microntroller.nvm. - */ - FLASH (rx) : ORIGIN = 0x00000000 + ${BOOTLOADER_SIZE}, LENGTH = ${FLASH_SIZE} - ${BOOTLOADER_SIZE} - ${CIRCUITPY_INTERNAL_CONFIG_SIZE} - ${CIRCUITPY_INTERNAL_NVM_SIZE} + FLASH (rx) : ORIGIN = 0x00000000 + ${BOOTLOADER_SIZE}, LENGTH = ${CIRCUITPY_FIRMWARE_SIZE} RAM (xrw) : ORIGIN = 0x20000000, LENGTH = ${RAM_SIZE} } diff --git a/ports/atmel-samd/boards/sam32/mpconfigboard.h b/ports/atmel-samd/boards/sam32/mpconfigboard.h index 3c6f52ebcc..bd9f5e3983 100644 --- a/ports/atmel-samd/boards/sam32/mpconfigboard.h +++ b/ports/atmel-samd/boards/sam32/mpconfigboard.h @@ -9,7 +9,7 @@ #define MICROPY_PORT_A (PORT_PA24 | PORT_PA25) #define MICROPY_PORT_B (0) #define MICROPY_PORT_C (0) -#define MICROPY_PORT_D (0) +#define MICROPY_PORT_D (0) // No microcontroller.nvm #define CIRCUITPY_INTERNAL_NVM_SIZE 0 diff --git a/ports/atmel-samd/ld_defines.c b/ports/atmel-samd/ld_defines.c index 62838ca4b5..d8a7a209bf 100644 --- a/ports/atmel-samd/ld_defines.c +++ b/ports/atmel-samd/ld_defines.c @@ -7,8 +7,7 @@ // This will be post-processed by tools/gen_ld_files.py to extract the name and vlaue. BOOTLOADER_SIZE; ///DEFINE_VALUE BOOTLOADER_SIZE -RAM_SIZE; ///DEFINE_VALUE RAM_SIZE lambda f: f.rstrip("UL") -FLASH_SIZE; ///DEFINE_VALUE FLASH_SIZE lambda f: f.rstrip("UL") -CIRCUITPY_INTERNAL_CONFIG_SIZE; ///DEFINE_VALUE CIRCUITPY_INTERNAL_CONFIG_SIZE -CIRCUITPY_INTERNAL_NVM_SIZE; ///DEFINE_VALUE CIRCUITPY_INTERNAL_NVM_SIZE +RAM_SIZE; ///DEFINE_VALUE RAM_SIZE def noUL(expr): import re; return re.sub( +FLASH_SIZE; ///DEFINE_VALUE FLASH_SIZE lambda expr: expr.rstrip("UL") +CIRCUITPY_FIRMWARE_SIZE; ///DEFINE_VALUE CIRCUITPY_FIRMWARE_SIZE CIRCUITPY_DEFAULT_STACK_SIZE; ///DEFINE_VALUE CIRCUITPY_DEFAULT_STACK_SIZE diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h index 21adb10028..3334ce1532 100644 --- a/ports/atmel-samd/mpconfigport.h +++ b/ports/atmel-samd/mpconfigport.h @@ -32,10 +32,10 @@ #ifdef SAMD21 -// Default is 0, set by py/circuitpy_mpconfig.h #if INTERNAL_FLASH_FILESYSTEM -// 64kB -#define INTERNAL_FLASH_FILESYSTEM_SIZE (64*1024) +#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (64*1024) +#else +#define CIRCUITPYINTERNAL_FLASH_FILESYSTEM_SIZE (0) #endif #ifndef CIRCUITPY_INTERNAL_NVM_SIZE @@ -86,6 +86,15 @@ #define CIRCUITPY_INTERNAL_NVM_SIZE (8192) #endif +// If CIRCUITPY is internal, use half of flash for it. +#ifndef CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE + #if INTERNAL_FLASH_FILESYSTEM + #define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (FLASH_SIZE/2) + #else + #define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (0) + #endif +#endif + // HSRAM_SIZE is defined in the ASF4 include files for each SAMD51 chip. #define RAM_SIZE HSRAM_SIZE #define BOOTLOADER_SIZE (16*1024) @@ -104,6 +113,27 @@ #endif // SAMD51 +// Flash layout, starting at 0x00000000 +// +// bootloader (8 or 16kB) +// firmware +// internal config, used to store crystalless clock calibration info (optional) +// microntroller.nvm (optional) +// internal CIRCUITPY flash filesystem (optional) + +// Bootloader starts at 0x00000000. +#define CIRCUITPY_FIRMWARE_START_ADDR BOOTLOADER_SIZE + +// Total space available for code, after subtracting size of other regions used for non-code. +#define CIRCUITPY_FIRMWARE_SIZE \ + (FLASH_SIZE - BOOTLOADER_SIZE - CIRCUITPY_INTERNAL_CONFIG_SIZE - CIRCUITPY_INTERNAL_NVM_SIZE - \ + CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE) + +#define CIRCUITPY_INTERNAL_CONFIG_START_ADDR (CIRCUITPY_FIRMWARE_START_ADDR + CIRCUITPY_FIRMWARE_SIZE) +#define CIRCUITPY_INTERNAL_NVM_START_ADDR (CIRCUITPY_INTERNAL_CONFIG_START_ADDR + CIRCUITPY_INTERNAL_CONFIG_SIZE) +#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR \ + (CIRCUITPY_INTERNAL_NVM_START_ADDR + CIRCUITPY_INTERNAL_NVM_SIZE) + // Turning off audioio, audiobusio, and touchio as necessary // due to limitations of chips is handled in mpconfigboard.mk diff --git a/ports/atmel-samd/supervisor/internal_flash.c b/ports/atmel-samd/supervisor/internal_flash.c index 6dd5ac0a70..a8ff5adfa9 100644 --- a/ports/atmel-samd/supervisor/internal_flash.c +++ b/ports/atmel-samd/supervisor/internal_flash.c @@ -86,7 +86,7 @@ void flash_flush(void) { static int32_t convert_block_to_flash_addr(uint32_t block) { if (0 <= block && block < INTERNAL_FLASH_PART1_NUM_BLOCKS) { // a block in partition 1 - return INTERNAL_FLASH_MEM_SEG1_START_ADDR + block * FILESYSTEM_BLOCK_SIZE; + return CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR + block * FILESYSTEM_BLOCK_SIZE; } // bad block return -1; diff --git a/ports/atmel-samd/supervisor/internal_flash.h b/ports/atmel-samd/supervisor/internal_flash.h index 0939a34548..df8b495ccb 100644 --- a/ports/atmel-samd/supervisor/internal_flash.h +++ b/ports/atmel-samd/supervisor/internal_flash.h @@ -32,16 +32,7 @@ #include "sam.h" -#ifdef SAMD51 -#define TOTAL_INTERNAL_FLASH_SIZE (FLASH_SIZE / 2) -#endif - -#ifdef SAMD21 -#define TOTAL_INTERNAL_FLASH_SIZE 0x010000 -#endif - -#define INTERNAL_FLASH_MEM_SEG1_START_ADDR (FLASH_SIZE - TOTAL_INTERNAL_FLASH_SIZE - CIRCUITPY_INTERNAL_NVM_SIZE) -#define INTERNAL_FLASH_PART1_NUM_BLOCKS (TOTAL_INTERNAL_FLASH_SIZE / FILESYSTEM_BLOCK_SIZE) +#define INTERNAL_FLASH_PART1_NUM_BLOCKS (CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE / FILESYSTEM_BLOCK_SIZE) #define INTERNAL_FLASH_SYSTICK_MASK (0x1ff) // 512ms #define INTERNAL_FLASH_IDLE_TICK(tick) (((tick) & INTERNAL_FLASH_SYSTICK_MASK) == 2) diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 91e2e223c2..227376ead0 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -167,6 +167,7 @@ typedef long mp_off_t; #define mp_import_stat mp_vfs_import_stat #define mp_builtin_open_obj mp_vfs_open_obj + // extra built in names to add to the global namespace #define MICROPY_PORT_BUILTINS \ { MP_OBJ_NEW_QSTR(MP_QSTR_help), (mp_obj_t)&mp_builtin_help_obj }, \ @@ -669,11 +670,6 @@ void run_background_tasks(void); #define CIRCUITPY_FILESYSTEM_FLUSH_INTERVAL_MS 1000 #endif -// Default is no internal flash filesystem. -#ifndef INTERNAL_FLASH_FILESYSTEM_SIZE -#define INTERNAL_FLASH_FILESYSTEM_SIZE (0) -#endif - #define CIRCUITPY_BOOT_OUTPUT_FILE "/boot_out.txt" #endif // __INCLUDED_MPCONFIG_CIRCUITPY_H From 8ab3ef44dddbb82d623dd557461b2b77cf607283 Mon Sep 17 00:00:00 2001 From: JoeBakalor Date: Tue, 5 Nov 2019 10:52:25 -0500 Subject: [PATCH 04/78] add bluebird template files --- ports/nrf/boards/teknikio_bluebird/board.c | 38 ++++++++++ .../boards/teknikio_bluebird/mpconfigboard.h | 74 +++++++++++++++++++ .../boards/teknikio_bluebird/mpconfigboard.mk | 26 +++++++ ports/nrf/boards/teknikio_bluebird/pins.c | 71 ++++++++++++++++++ 4 files changed, 209 insertions(+) create mode 100644 ports/nrf/boards/teknikio_bluebird/board.c create mode 100644 ports/nrf/boards/teknikio_bluebird/mpconfigboard.h create mode 100644 ports/nrf/boards/teknikio_bluebird/mpconfigboard.mk create mode 100644 ports/nrf/boards/teknikio_bluebird/pins.c diff --git a/ports/nrf/boards/teknikio_bluebird/board.c b/ports/nrf/boards/teknikio_bluebird/board.c new file mode 100644 index 0000000000..4421970eef --- /dev/null +++ b/ports/nrf/boards/teknikio_bluebird/board.c @@ -0,0 +1,38 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" + +void board_init(void) { +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { + +} diff --git a/ports/nrf/boards/teknikio_bluebird/mpconfigboard.h b/ports/nrf/boards/teknikio_bluebird/mpconfigboard.h new file mode 100644 index 0000000000..348028c0f7 --- /dev/null +++ b/ports/nrf/boards/teknikio_bluebird/mpconfigboard.h @@ -0,0 +1,74 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Glenn Ruben Bakke + * Copyright (c) 2018 Dan Halbert for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +//https://github.com/Teknikio/TKInventionBuilderFramework + +#include "nrfx/hal/nrf_gpio.h" + +#define MICROPY_HW_BOARD_NAME "Adafruit Circuit Playground Bluefruit" +#define MICROPY_HW_MCU_NAME "nRF52840" +#define MICROPY_PY_SYS_PLATFORM "CircuitPlaygroundBluefruit" + +#define FLASH_SIZE (0x100000) +#define FLASH_PAGE_SIZE (4096) + +#define MICROPY_HW_LED_STATUS (&pin_P1_14) + +// Unusually, board does not have a 32 kHz xtal. Nearly all boards do. +#define BOARD_HAS_32KHZ_XTAL (0) + +#if QSPI_FLASH_FILESYSTEM +#define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(0, 21) +#define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(0, 23) +#define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(1, 00) +#define MICROPY_QSPI_DATA3 NRF_GPIO_PIN_MAP(0, 22) +#define MICROPY_QSPI_SCK NRF_GPIO_PIN_MAP(0, 19) +#define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(0, 15) +#endif + +#if SPI_FLASH_FILESYSTEM +#define SPI_FLASH_MOSI_PIN &pin_P0_21 +#define SPI_FLASH_MISO_PIN &pin_P0_23 +#define SPI_FLASH_SCK_PIN &pin_P0_19 +#define SPI_FLASH_CS_PIN &pin_P0_15 +#endif + +#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 + +#define CIRCUITPY_INTERNAL_NVM_SIZE (4096) + +#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) + +#define DEFAULT_I2C_BUS_SCL (&pin_P0_04) +#define DEFAULT_I2C_BUS_SDA (&pin_P0_05) + +#define DEFAULT_SPI_BUS_SCK (&pin_P0_05) +#define DEFAULT_SPI_BUS_MOSI (&pin_P1_03) +#define DEFAULT_SPI_BUS_MISO (&pin_P0_29) + +#define DEFAULT_UART_BUS_RX (&pin_P0_30) +#define DEFAULT_UART_BUS_TX (&pin_P0_14) diff --git a/ports/nrf/boards/teknikio_bluebird/mpconfigboard.mk b/ports/nrf/boards/teknikio_bluebird/mpconfigboard.mk new file mode 100644 index 0000000000..dbb32629c6 --- /dev/null +++ b/ports/nrf/boards/teknikio_bluebird/mpconfigboard.mk @@ -0,0 +1,26 @@ +USB_VID = 0x239A +USB_PID = 0x8046 +USB_PRODUCT = "Circuit Playground Bluefruit" +USB_MANUFACTURER = "Adafruit Industries LLC" + +MCU_SERIES = m4 +MCU_VARIANT = nrf52 +MCU_SUB_VARIANT = nrf52840 +MCU_CHIP = nrf52840 +SD ?= s140 +SOFTDEV_VERSION ?= 6.1.0 + +BOOT_SETTING_ADDR = 0xFF000 + +ifeq ($(SD),) + LD_FILE = boards/nrf52840_1M_256k.ld +else + LD_FILE = boards/adafruit_$(MCU_SUB_VARIANT)_$(SD_LOWER)_v$(firstword $(subst ., ,$(SOFTDEV_VERSION))).ld + CIRCUITPY_BLEIO = 1 +endif + +NRF_DEFINES += -DNRF52840_XXAA -DNRF52840 + +QSPI_FLASH_FILESYSTEM = 1 +EXTERNAL_FLASH_DEVICE_COUNT = 1 +EXTERNAL_FLASH_DEVICES = "GD25Q16C" diff --git a/ports/nrf/boards/teknikio_bluebird/pins.c b/ports/nrf/boards/teknikio_bluebird/pins.c new file mode 100644 index 0000000000..e8e5f4110d --- /dev/null +++ b/ports/nrf/boards/teknikio_bluebird/pins.c @@ -0,0 +1,71 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR_AUDIO), MP_ROM_PTR(&pin_P0_26) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_P0_26) }, + { MP_ROM_QSTR(MP_QSTR_SPEAKER), MP_ROM_PTR(&pin_P0_26) }, + + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_P0_02) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_P0_02) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_P0_02) }, + + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_P0_29) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_P0_29) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_P0_29) }, + + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_P0_03) }, + { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_P0_03) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_P0_03) }, + + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_P0_04) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_P0_04) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_04) }, + + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_P0_05) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_P0_05) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_05) }, + + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_P0_30) }, + { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_P0_30) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_P0_30) }, + + // This cannot be A7, as it is on CPX. We don't have enough analog inputs. + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_P0_14) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_P0_14) }, + + { MP_ROM_QSTR(MP_QSTR_LIGHT), MP_ROM_PTR(&pin_P0_28) }, + { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_P0_28) }, + + { MP_ROM_QSTR(MP_QSTR_TEMPERATURE), MP_ROM_PTR(&pin_P0_31) }, + { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_P0_31) }, + + { MP_ROM_QSTR(MP_QSTR_BUTTON_A), MP_ROM_PTR(&pin_P1_02) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_P1_02) }, + + { MP_ROM_QSTR(MP_QSTR_BUTTON_B), MP_ROM_PTR(&pin_P1_15) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_P1_15) }, + + { MP_ROM_QSTR(MP_QSTR_SLIDE_SWITCH), MP_ROM_PTR(&pin_P1_06) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_P1_06) }, + + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_P1_14) }, + { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_P1_14) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_P0_13) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_P0_13) }, + + { MP_ROM_QSTR(MP_QSTR_MICROPHONE_CLOCK), MP_ROM_PTR(&pin_P0_17) }, + { MP_ROM_QSTR(MP_QSTR_MICROPHONE_DATA), MP_ROM_PTR(&pin_P0_16) }, + + { MP_ROM_QSTR(MP_QSTR_ACCELEROMETER_INTERRUPT), MP_ROM_PTR(&pin_P1_13) }, + { MP_ROM_QSTR(MP_QSTR_ACCELEROMETER_SDA), MP_ROM_PTR(&pin_P1_10) }, + { MP_ROM_QSTR(MP_QSTR_ACCELEROMETER_SCL), MP_ROM_PTR(&pin_P1_12) }, + + { MP_ROM_QSTR(MP_QSTR_SPEAKER_ENABLE), MP_ROM_PTR(&pin_P1_04) }, + + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, +}; + +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); From d745c1023ee8b0acb859d12a9fdc2104a5ddbc72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=98=92=20Bjarke=20Gotfredsen?= Date: Tue, 12 Nov 2019 12:48:31 +0200 Subject: [PATCH 05/78] Support for XinaBox CC03 and CS11 CC03 is a ATSAMD21G18 Cortex-M0+ breakout in xChips format. CS11 is the same, but with a SD Card Interface. https://xinabox.cc/products/cc03 https://xinabox.cc/products/cs11 --- ports/atmel-samd/boards/CC03/board.c | 40 +++++++++++++++++++ ports/atmel-samd/boards/CC03/mpconfigboard.h | 24 +++++++++++ ports/atmel-samd/boards/CC03/mpconfigboard.mk | 30 ++++++++++++++ ports/atmel-samd/boards/CC03/pins.c | 35 ++++++++++++++++ ports/atmel-samd/boards/CS11/board.c | 40 +++++++++++++++++++ ports/atmel-samd/boards/CS11/mpconfigboard.h | 24 +++++++++++ ports/atmel-samd/boards/CS11/mpconfigboard.mk | 31 ++++++++++++++ ports/atmel-samd/boards/CS11/pins.c | 35 ++++++++++++++++ 8 files changed, 259 insertions(+) create mode 100644 ports/atmel-samd/boards/CC03/board.c create mode 100644 ports/atmel-samd/boards/CC03/mpconfigboard.h create mode 100644 ports/atmel-samd/boards/CC03/mpconfigboard.mk create mode 100644 ports/atmel-samd/boards/CC03/pins.c create mode 100644 ports/atmel-samd/boards/CS11/board.c create mode 100644 ports/atmel-samd/boards/CS11/mpconfigboard.h create mode 100644 ports/atmel-samd/boards/CS11/mpconfigboard.mk create mode 100644 ports/atmel-samd/boards/CS11/pins.c diff --git a/ports/atmel-samd/boards/CC03/board.c b/ports/atmel-samd/boards/CC03/board.c new file mode 100644 index 0000000000..770bc82593 --- /dev/null +++ b/ports/atmel-samd/boards/CC03/board.c @@ -0,0 +1,40 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" +#include "mpconfigboard.h" +#include "hal/include/hal_gpio.h" + +void board_init(void) +{ +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/atmel-samd/boards/CC03/mpconfigboard.h b/ports/atmel-samd/boards/CC03/mpconfigboard.h new file mode 100644 index 0000000000..4690ed3416 --- /dev/null +++ b/ports/atmel-samd/boards/CC03/mpconfigboard.h @@ -0,0 +1,24 @@ +#define MICROPY_HW_BOARD_NAME "XinaBox CC03" +#define MICROPY_HW_MCU_NAME "samd21g18" + +#define MICROPY_PORT_A (0) +#define MICROPY_PORT_B (0) +#define MICROPY_PORT_C (0) + +#define CIRCUITPY_INTERNAL_NVM_SIZE 256 + +#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) + +#define DEFAULT_I2C_BUS_SCL (&pin_PA23) +#define DEFAULT_I2C_BUS_SDA (&pin_PA22) + +#define DEFAULT_SPI_BUS_SCK (&pin_PB11) +#define DEFAULT_SPI_BUS_MOSI (&pin_PB10) +#define DEFAULT_SPI_BUS_MISO (&pin_PA12) + +#define DEFAULT_UART_BUS_RX (&pin_PA11) +#define DEFAULT_UART_BUS_TX (&pin_PA10) + +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 diff --git a/ports/atmel-samd/boards/CC03/mpconfigboard.mk b/ports/atmel-samd/boards/CC03/mpconfigboard.mk new file mode 100644 index 0000000000..47cd07df21 --- /dev/null +++ b/ports/atmel-samd/boards/CC03/mpconfigboard.mk @@ -0,0 +1,30 @@ +LD_FILE = boards/samd21x18-bootloader.ld +USB_VID = 0x239A +USB_PID = 0x8014 +USB_PRODUCT = "XinaBox CC03" +USB_MANUFACTURER = "XinaBox" + +CHIP_VARIANT = SAMD21G18A +CHIP_FAMILY = samd21 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ +CIRCUITPY_SMALL_BUILD = 1 + +SUPEROPT_GC = 0 + +# Make room for frozen libs. +CIRCUITPY_FREQUENCYIO = 0 +#CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_ANALOGIO=0 +CIRCUITPY_NEOPIXEL_WRITE=0 +CIRCUITPY_PULSEIO=0 +CIRCUITPY_ROTARYIO=0 +CIRCUITPY_TOUCHIO_USE_NATIVE=0 +CIRCUITPY_TOUCHIO=0 +#CIRCUITPY_USB_MIDI=0 +#CIRCUITPY_RTC=0 +#CIRCUITPY_USB_HID=0 + +# Include these Python libraries in firmware. +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice diff --git a/ports/atmel-samd/boards/CC03/pins.c b/ports/atmel-samd/boards/CC03/pins.c new file mode 100644 index 0000000000..2a0a06f218 --- /dev/null +++ b/ports/atmel-samd/boards/CC03/pins.c @@ -0,0 +1,35 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +// { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, +// { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PB08) }, +// { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PB09) }, +// { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA04) }, +// { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA05) }, +// { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PB02) }, +// { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA11) }, +// { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA10) }, +// { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA14) }, +// { MP_ROM_QSTR(MP_QSTR_CS), MP_ROM_PTR(&pin_PA09) }, +// { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA08) }, +// { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA15) }, +// { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) }, +// { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA21) }, +// { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_ALERT), MP_ROM_PTR(&pin_PA19) }, +// { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) }, + { MP_ROM_QSTR(MP_QSTR_RED), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_GREEN), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_BLUE), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA22) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA23) }, +// { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PB11) }, +// { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB10) }, +// { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA12) }, + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/atmel-samd/boards/CS11/board.c b/ports/atmel-samd/boards/CS11/board.c new file mode 100644 index 0000000000..770bc82593 --- /dev/null +++ b/ports/atmel-samd/boards/CS11/board.c @@ -0,0 +1,40 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2017 Scott Shawcroft for Adafruit Industries + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include "boards/board.h" +#include "mpconfigboard.h" +#include "hal/include/hal_gpio.h" + +void board_init(void) +{ +} + +bool board_requests_safe_mode(void) { + return false; +} + +void reset_board(void) { +} diff --git a/ports/atmel-samd/boards/CS11/mpconfigboard.h b/ports/atmel-samd/boards/CS11/mpconfigboard.h new file mode 100644 index 0000000000..9699568dad --- /dev/null +++ b/ports/atmel-samd/boards/CS11/mpconfigboard.h @@ -0,0 +1,24 @@ +#define MICROPY_HW_BOARD_NAME "XinaBox CS11" +#define MICROPY_HW_MCU_NAME "samd21g18" + +#define MICROPY_PORT_A (0) +#define MICROPY_PORT_B (0) +#define MICROPY_PORT_C (0) + +#define CIRCUITPY_INTERNAL_NVM_SIZE 256 + +#define BOARD_FLASH_SIZE (0x00040000 - 0x2000 - 0x010000 - CIRCUITPY_INTERNAL_NVM_SIZE) + +#define DEFAULT_I2C_BUS_SCL (&pin_PA23) +#define DEFAULT_I2C_BUS_SDA (&pin_PA22) + +#define DEFAULT_SPI_BUS_SCK (&pin_PB11) +#define DEFAULT_SPI_BUS_MOSI (&pin_PB10) +#define DEFAULT_SPI_BUS_MISO (&pin_PA12) + +#define DEFAULT_UART_BUS_RX (&pin_PA11) +#define DEFAULT_UART_BUS_TX (&pin_PA10) + +// USB is always used internally so skip the pin objects for it. +#define IGNORE_PIN_PA24 1 +#define IGNORE_PIN_PA25 1 diff --git a/ports/atmel-samd/boards/CS11/mpconfigboard.mk b/ports/atmel-samd/boards/CS11/mpconfigboard.mk new file mode 100644 index 0000000000..f4b7a7bfcb --- /dev/null +++ b/ports/atmel-samd/boards/CS11/mpconfigboard.mk @@ -0,0 +1,31 @@ +LD_FILE = boards/samd21x18-bootloader.ld +USB_VID = 0x239A +USB_PID = 0x8014 +USB_PRODUCT = "XinaBox CS11" +USB_MANUFACTURER = "XinaBox" + +CHIP_VARIANT = SAMD21G18A +CHIP_FAMILY = samd21 + +INTERNAL_FLASH_FILESYSTEM = 1 +LONGINT_IMPL = MPZ +CIRCUITPY_SMALL_BUILD = 1 + +SUPEROPT_GC = 0 + +# Make room for frozen libs. +CIRCUITPY_FREQUENCYIO = 0 +#CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_ANALOGIO=0 +CIRCUITPY_NEOPIXEL_WRITE=0 +CIRCUITPY_PULSEIO=0 +CIRCUITPY_ROTARYIO=0 +CIRCUITPY_TOUCHIO_USE_NATIVE=0 +CIRCUITPY_TOUCHIO=0 +CIRCUITPY_USB_MIDI=0 +#CIRCUITPY_USB_HID=0 +CIRCUITPY_RTC=0 + +# Include these Python libraries in firmware. +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_SD \ No newline at end of file diff --git a/ports/atmel-samd/boards/CS11/pins.c b/ports/atmel-samd/boards/CS11/pins.c new file mode 100644 index 0000000000..d46d1111ff --- /dev/null +++ b/ports/atmel-samd/boards/CS11/pins.c @@ -0,0 +1,35 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { +// { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, +// { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PB08) }, +// { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PB09) }, +// { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA04) }, +// { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA05) }, +// { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PB02) }, +// { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA11) }, +// { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA10) }, +// { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA14) }, + { MP_ROM_QSTR(MP_QSTR_CS), MP_ROM_PTR(&pin_PA09) }, +// { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA08) }, +// { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA15) }, +// { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) }, +// { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA21) }, +// { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_ALERT), MP_ROM_PTR(&pin_PA07) }, +// { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) }, + { MP_ROM_QSTR(MP_QSTR_RED), MP_ROM_PTR(&pin_PA16) }, + { MP_ROM_QSTR(MP_QSTR_GREEN), MP_ROM_PTR(&pin_PA19) }, + { MP_ROM_QSTR(MP_QSTR_BLUE), MP_ROM_PTR(&pin_PA17) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA22) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA23) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PB11) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA12) }, + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); From 91123ab688ffbc13f8757f4acbc939d62b0f890c Mon Sep 17 00:00:00 2001 From: KalbeAbbas Date: Tue, 12 Nov 2019 18:34:29 +0500 Subject: [PATCH 06/78] Update build.yml --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 10c34355d1..850c1ca934 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -159,6 +159,8 @@ jobs: - "uchip" - "ugame10" - "winterbloom_sol" + - "CC03" + - "CS11" steps: - name: Set up Python 3.5 From 3c6c7980185a31fb2d001fb2a6c70c321129503a Mon Sep 17 00:00:00 2001 From: KalbeAbbas Date: Tue, 12 Nov 2019 18:53:13 +0500 Subject: [PATCH 07/78] Update build.yml --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 850c1ca934..b043c3ad2e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -73,6 +73,8 @@ jobs: fail-fast: false matrix: board: + - "CC03" + - "CS11" - "arduino_mkr1300" - "arduino_mkrzero" - "arduino_nano_33_ble" @@ -159,8 +161,6 @@ jobs: - "uchip" - "ugame10" - "winterbloom_sol" - - "CC03" - - "CS11" steps: - name: Set up Python 3.5 From 6161c72270102e228469da7b0efd506a58592c6f Mon Sep 17 00:00:00 2001 From: KalbeAbbas Date: Tue, 12 Nov 2019 20:09:57 +0500 Subject: [PATCH 08/78] SD card folder added --- .gitmodules | 3 +++ frozen/Adafruit_CircuitPython_SD | 1 + 2 files changed, 4 insertions(+) create mode 160000 frozen/Adafruit_CircuitPython_SD diff --git a/.gitmodules b/.gitmodules index bb62a5c39d..010b6c879e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -101,3 +101,6 @@ [submodule "ports/cxd56/spresense-exported-sdk"] path = ports/cxd56/spresense-exported-sdk url = https://github.com/sonydevworld/spresense-exported-sdk.git +[submodule "frozen/Adafruit_CircuitPython_SD"] + path = frozen/Adafruit_CircuitPython_SD + url = ../../adafruit/Adafruit_CircuitPython_SD.git diff --git a/frozen/Adafruit_CircuitPython_SD b/frozen/Adafruit_CircuitPython_SD new file mode 160000 index 0000000000..5ad33e4ca2 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_SD @@ -0,0 +1 @@ +Subproject commit 5ad33e4ca219f0e216beab439cfa259cde32016c From b269fb4bfa42683ffc11d9e67e63f08abc5d9445 Mon Sep 17 00:00:00 2001 From: KalbeAbbas Date: Wed, 13 Nov 2019 14:58:57 +0500 Subject: [PATCH 09/78] deleted SD card folder --- frozen/Adafruit_CircuitPython_SD | 1 - 1 file changed, 1 deletion(-) delete mode 160000 frozen/Adafruit_CircuitPython_SD diff --git a/frozen/Adafruit_CircuitPython_SD b/frozen/Adafruit_CircuitPython_SD deleted file mode 160000 index 5ad33e4ca2..0000000000 --- a/frozen/Adafruit_CircuitPython_SD +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5ad33e4ca219f0e216beab439cfa259cde32016c From 5493dd5dba7e5129700ac34df1c878d0662f821f Mon Sep 17 00:00:00 2001 From: KalbeAbbas Date: Wed, 13 Nov 2019 15:06:53 +0500 Subject: [PATCH 10/78] Added SD card submodule --- frozen/Adafruit_CircuitPython_SD | 1 + 1 file changed, 1 insertion(+) create mode 160000 frozen/Adafruit_CircuitPython_SD diff --git a/frozen/Adafruit_CircuitPython_SD b/frozen/Adafruit_CircuitPython_SD new file mode 160000 index 0000000000..5ad33e4ca2 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_SD @@ -0,0 +1 @@ +Subproject commit 5ad33e4ca219f0e216beab439cfa259cde32016c From f6577fc9f70e6112f7f4393d3f4db1ed76e7fac2 Mon Sep 17 00:00:00 2001 From: KalbeAbbas Date: Wed, 13 Nov 2019 15:11:03 +0500 Subject: [PATCH 11/78] SD card folder removed --- .gitmodules | 3 --- frozen/Adafruit_CircuitPython_SD | 1 - 2 files changed, 4 deletions(-) delete mode 160000 frozen/Adafruit_CircuitPython_SD diff --git a/.gitmodules b/.gitmodules index 010b6c879e..bb62a5c39d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -101,6 +101,3 @@ [submodule "ports/cxd56/spresense-exported-sdk"] path = ports/cxd56/spresense-exported-sdk url = https://github.com/sonydevworld/spresense-exported-sdk.git -[submodule "frozen/Adafruit_CircuitPython_SD"] - path = frozen/Adafruit_CircuitPython_SD - url = ../../adafruit/Adafruit_CircuitPython_SD.git diff --git a/frozen/Adafruit_CircuitPython_SD b/frozen/Adafruit_CircuitPython_SD deleted file mode 160000 index 5ad33e4ca2..0000000000 --- a/frozen/Adafruit_CircuitPython_SD +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5ad33e4ca219f0e216beab439cfa259cde32016c From 040f201fab9554d1404f2b4f9bb331a490bfb988 Mon Sep 17 00:00:00 2001 From: KalbeAbbas Date: Wed, 13 Nov 2019 15:44:59 +0500 Subject: [PATCH 12/78] added SD card module --- .gitmodules | 3 +++ frozen/Adafruit_CircuitPython_SD | 1 + 2 files changed, 4 insertions(+) create mode 160000 frozen/Adafruit_CircuitPython_SD diff --git a/.gitmodules b/.gitmodules index bb62a5c39d..010b6c879e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -101,3 +101,6 @@ [submodule "ports/cxd56/spresense-exported-sdk"] path = ports/cxd56/spresense-exported-sdk url = https://github.com/sonydevworld/spresense-exported-sdk.git +[submodule "frozen/Adafruit_CircuitPython_SD"] + path = frozen/Adafruit_CircuitPython_SD + url = ../../adafruit/Adafruit_CircuitPython_SD.git diff --git a/frozen/Adafruit_CircuitPython_SD b/frozen/Adafruit_CircuitPython_SD new file mode 160000 index 0000000000..5ad33e4ca2 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_SD @@ -0,0 +1 @@ +Subproject commit 5ad33e4ca219f0e216beab439cfa259cde32016c From 99952c0df0f47bec29c7f93a1978fa5ea02a8aa1 Mon Sep 17 00:00:00 2001 From: KalbeAbbas Date: Wed, 13 Nov 2019 16:07:52 +0500 Subject: [PATCH 13/78] Removed SD card folder --- frozen/Adafruit_CircuitPython_SD | 1 - 1 file changed, 1 deletion(-) delete mode 160000 frozen/Adafruit_CircuitPython_SD diff --git a/frozen/Adafruit_CircuitPython_SD b/frozen/Adafruit_CircuitPython_SD deleted file mode 160000 index 5ad33e4ca2..0000000000 --- a/frozen/Adafruit_CircuitPython_SD +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 5ad33e4ca219f0e216beab439cfa259cde32016c From 9ce2087a7577a5c4614c9e9b921bf395d0c852e6 Mon Sep 17 00:00:00 2001 From: KalbeAbbas Date: Wed, 13 Nov 2019 17:18:00 +0500 Subject: [PATCH 14/78] change --- .gitmodules | 2 +- frozen/Adafruit_CircuitPython_SD | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) create mode 160000 frozen/Adafruit_CircuitPython_SD diff --git a/.gitmodules b/.gitmodules index 010b6c879e..da672df8a0 100644 --- a/.gitmodules +++ b/.gitmodules @@ -103,4 +103,4 @@ url = https://github.com/sonydevworld/spresense-exported-sdk.git [submodule "frozen/Adafruit_CircuitPython_SD"] path = frozen/Adafruit_CircuitPython_SD - url = ../../adafruit/Adafruit_CircuitPython_SD.git + url = https://github.com/adafruit/Adafruit_CircuitPython_SD.git diff --git a/frozen/Adafruit_CircuitPython_SD b/frozen/Adafruit_CircuitPython_SD new file mode 160000 index 0000000000..5ad33e4ca2 --- /dev/null +++ b/frozen/Adafruit_CircuitPython_SD @@ -0,0 +1 @@ +Subproject commit 5ad33e4ca219f0e216beab439cfa259cde32016c From 3db7f2798f92fdf7a8a2823c0cfb0cecbfa284c6 Mon Sep 17 00:00:00 2001 From: KalbeAbbas Date: Thu, 14 Nov 2019 16:34:08 +0500 Subject: [PATCH 15/78] updated --- .github/workflows/build.yml | 4 +-- ports/atmel-samd/boards/CC03/pins.c | 35 ------------------- ports/atmel-samd/boards/CS11/pins.c | 35 ------------------- .../boards/{CC03 => xinabox_cc03}/board.c | 0 .../{CC03 => xinabox_cc03}/mpconfigboard.h | 0 .../{CC03 => xinabox_cc03}/mpconfigboard.mk | 0 ports/atmel-samd/boards/xinabox_cc03/pins.c | 15 ++++++++ .../boards/{CS11 => xinabox_cs11}/board.c | 0 .../{CS11 => xinabox_cs11}/mpconfigboard.h | 0 .../{CS11 => xinabox_cs11}/mpconfigboard.mk | 0 ports/atmel-samd/boards/xinabox_cs11/pins.c | 20 +++++++++++ 11 files changed, 37 insertions(+), 72 deletions(-) delete mode 100644 ports/atmel-samd/boards/CC03/pins.c delete mode 100644 ports/atmel-samd/boards/CS11/pins.c rename ports/atmel-samd/boards/{CC03 => xinabox_cc03}/board.c (100%) rename ports/atmel-samd/boards/{CC03 => xinabox_cc03}/mpconfigboard.h (100%) rename ports/atmel-samd/boards/{CC03 => xinabox_cc03}/mpconfigboard.mk (100%) create mode 100644 ports/atmel-samd/boards/xinabox_cc03/pins.c rename ports/atmel-samd/boards/{CS11 => xinabox_cs11}/board.c (100%) rename ports/atmel-samd/boards/{CS11 => xinabox_cs11}/mpconfigboard.h (100%) rename ports/atmel-samd/boards/{CS11 => xinabox_cs11}/mpconfigboard.mk (100%) create mode 100644 ports/atmel-samd/boards/xinabox_cs11/pins.c diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b043c3ad2e..a5d725f28e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -73,8 +73,6 @@ jobs: fail-fast: false matrix: board: - - "CC03" - - "CS11" - "arduino_mkr1300" - "arduino_mkrzero" - "arduino_nano_33_ble" @@ -161,6 +159,8 @@ jobs: - "uchip" - "ugame10" - "winterbloom_sol" + - "xinabox_cc03" + - "xinabox_cs11" steps: - name: Set up Python 3.5 diff --git a/ports/atmel-samd/boards/CC03/pins.c b/ports/atmel-samd/boards/CC03/pins.c deleted file mode 100644 index 2a0a06f218..0000000000 --- a/ports/atmel-samd/boards/CC03/pins.c +++ /dev/null @@ -1,35 +0,0 @@ -#include "shared-bindings/board/__init__.h" - -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { -// { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, -// { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PB08) }, -// { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PB09) }, -// { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA04) }, -// { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA05) }, -// { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PB02) }, -// { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA11) }, - { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA11) }, -// { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA10) }, - { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA10) }, -// { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA14) }, -// { MP_ROM_QSTR(MP_QSTR_CS), MP_ROM_PTR(&pin_PA09) }, -// { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA08) }, -// { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA15) }, -// { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) }, -// { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA21) }, -// { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_ALERT), MP_ROM_PTR(&pin_PA19) }, -// { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) }, - { MP_ROM_QSTR(MP_QSTR_RED), MP_ROM_PTR(&pin_PA05) }, - { MP_ROM_QSTR(MP_QSTR_GREEN), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_BLUE), MP_ROM_PTR(&pin_PA07) }, - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA22) }, - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA23) }, -// { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PB11) }, -// { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB10) }, -// { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA12) }, - { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, - { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, - { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, -}; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/atmel-samd/boards/CS11/pins.c b/ports/atmel-samd/boards/CS11/pins.c deleted file mode 100644 index d46d1111ff..0000000000 --- a/ports/atmel-samd/boards/CS11/pins.c +++ /dev/null @@ -1,35 +0,0 @@ -#include "shared-bindings/board/__init__.h" - -STATIC const mp_rom_map_elem_t board_global_dict_table[] = { -// { MP_ROM_QSTR(MP_QSTR_A0), MP_ROM_PTR(&pin_PA02) }, -// { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_PB08) }, -// { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_PB09) }, -// { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA04) }, -// { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PA05) }, -// { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PB02) }, -// { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_PA11) }, - { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA11) }, -// { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_PA10) }, - { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA10) }, -// { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_PA14) }, - { MP_ROM_QSTR(MP_QSTR_CS), MP_ROM_PTR(&pin_PA09) }, -// { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_PA08) }, -// { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PA15) }, -// { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PA20) }, -// { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_PA21) }, -// { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_PA06) }, - { MP_ROM_QSTR(MP_QSTR_ALERT), MP_ROM_PTR(&pin_PA07) }, -// { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_PA18) }, - { MP_ROM_QSTR(MP_QSTR_RED), MP_ROM_PTR(&pin_PA16) }, - { MP_ROM_QSTR(MP_QSTR_GREEN), MP_ROM_PTR(&pin_PA19) }, - { MP_ROM_QSTR(MP_QSTR_BLUE), MP_ROM_PTR(&pin_PA17) }, - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA22) }, - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA23) }, - { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PB11) }, - { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB10) }, - { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA12) }, - { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, - { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, - { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, -}; -MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/atmel-samd/boards/CC03/board.c b/ports/atmel-samd/boards/xinabox_cc03/board.c similarity index 100% rename from ports/atmel-samd/boards/CC03/board.c rename to ports/atmel-samd/boards/xinabox_cc03/board.c diff --git a/ports/atmel-samd/boards/CC03/mpconfigboard.h b/ports/atmel-samd/boards/xinabox_cc03/mpconfigboard.h similarity index 100% rename from ports/atmel-samd/boards/CC03/mpconfigboard.h rename to ports/atmel-samd/boards/xinabox_cc03/mpconfigboard.h diff --git a/ports/atmel-samd/boards/CC03/mpconfigboard.mk b/ports/atmel-samd/boards/xinabox_cc03/mpconfigboard.mk similarity index 100% rename from ports/atmel-samd/boards/CC03/mpconfigboard.mk rename to ports/atmel-samd/boards/xinabox_cc03/mpconfigboard.mk diff --git a/ports/atmel-samd/boards/xinabox_cc03/pins.c b/ports/atmel-samd/boards/xinabox_cc03/pins.c new file mode 100644 index 0000000000..623b8ed6dc --- /dev/null +++ b/ports/atmel-samd/boards/xinabox_cc03/pins.c @@ -0,0 +1,15 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_RED), MP_ROM_PTR(&pin_PA05) }, + { MP_ROM_QSTR(MP_QSTR_GREEN), MP_ROM_PTR(&pin_PA06) }, + { MP_ROM_QSTR(MP_QSTR_BLUE), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA22) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA23) },, + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); diff --git a/ports/atmel-samd/boards/CS11/board.c b/ports/atmel-samd/boards/xinabox_cs11/board.c similarity index 100% rename from ports/atmel-samd/boards/CS11/board.c rename to ports/atmel-samd/boards/xinabox_cs11/board.c diff --git a/ports/atmel-samd/boards/CS11/mpconfigboard.h b/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.h similarity index 100% rename from ports/atmel-samd/boards/CS11/mpconfigboard.h rename to ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.h diff --git a/ports/atmel-samd/boards/CS11/mpconfigboard.mk b/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk similarity index 100% rename from ports/atmel-samd/boards/CS11/mpconfigboard.mk rename to ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk diff --git a/ports/atmel-samd/boards/xinabox_cs11/pins.c b/ports/atmel-samd/boards/xinabox_cs11/pins.c new file mode 100644 index 0000000000..84928b0dd6 --- /dev/null +++ b/ports/atmel-samd/boards/xinabox_cs11/pins.c @@ -0,0 +1,20 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_global_dict_table[] = { + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_PA11) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_PA10) }, + { MP_ROM_QSTR(MP_QSTR_CS), MP_ROM_PTR(&pin_PA09) }, + { MP_ROM_QSTR(MP_QSTR_ALERT), MP_ROM_PTR(&pin_PA07) }, + { MP_ROM_QSTR(MP_QSTR_RED), MP_ROM_PTR(&pin_PA16) }, + { MP_ROM_QSTR(MP_QSTR_GREEN), MP_ROM_PTR(&pin_PA19) }, + { MP_ROM_QSTR(MP_QSTR_BLUE), MP_ROM_PTR(&pin_PA17) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA22) }, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA23) }, + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_PB11) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_PB10) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA12) }, + { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, + { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, +}; +MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); From 949f87fd2508ccd5c2fef010bf70d1cc3d50d1f0 Mon Sep 17 00:00:00 2001 From: KalbeAbbas Date: Thu, 14 Nov 2019 18:50:26 +0500 Subject: [PATCH 16/78] Update pins.c --- ports/atmel-samd/boards/xinabox_cs11/pins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/xinabox_cs11/pins.c b/ports/atmel-samd/boards/xinabox_cs11/pins.c index 84928b0dd6..f0ef0da674 100644 --- a/ports/atmel-samd/boards/xinabox_cs11/pins.c +++ b/ports/atmel-samd/boards/xinabox_cs11/pins.c @@ -15,6 +15,6 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_PA12) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, - { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) } }; MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); From 799770926ba8c1baa39290791cc2f9e3ff2ba043 Mon Sep 17 00:00:00 2001 From: KalbeAbbas Date: Thu, 14 Nov 2019 18:51:01 +0500 Subject: [PATCH 17/78] Update pins.c --- ports/atmel-samd/boards/xinabox_cc03/pins.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/atmel-samd/boards/xinabox_cc03/pins.c b/ports/atmel-samd/boards/xinabox_cc03/pins.c index 623b8ed6dc..0efc63176b 100644 --- a/ports/atmel-samd/boards/xinabox_cc03/pins.c +++ b/ports/atmel-samd/boards/xinabox_cc03/pins.c @@ -7,9 +7,9 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_GREEN), MP_ROM_PTR(&pin_PA06) }, { MP_ROM_QSTR(MP_QSTR_BLUE), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_PA22) }, - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA23) },, + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_PA23) }, { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, - { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, -}; + { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) } +} MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); From 8134ceec8300d8971400e68f1b8197eec6fb043a Mon Sep 17 00:00:00 2001 From: KalbeAbbas Date: Thu, 14 Nov 2019 23:16:55 +0500 Subject: [PATCH 18/78] Update pins.c --- ports/atmel-samd/boards/xinabox_cc03/pins.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/xinabox_cc03/pins.c b/ports/atmel-samd/boards/xinabox_cc03/pins.c index 0efc63176b..f7c035d0b2 100644 --- a/ports/atmel-samd/boards/xinabox_cc03/pins.c +++ b/ports/atmel-samd/boards/xinabox_cc03/pins.c @@ -11,5 +11,5 @@ STATIC const mp_rom_map_elem_t board_global_dict_table[] = { { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) } -} +}; MP_DEFINE_CONST_DICT(board_module_globals, board_global_dict_table); From d628d2a261bb28b84c6b257a990bd9a30cbe369c Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Fri, 6 Dec 2019 15:18:20 -0500 Subject: [PATCH 19/78] atmel-samd working --- ports/atmel-samd/bindings/samd/Clock.c | 260 ++++++++++++++++++ .../common-hal/frequencyio/FrequencyIn.c | 2 +- ports/atmel-samd/mpconfigport.h | 48 ++-- ports/atmel-samd/peripherals | 2 +- ports/atmel-samd/supervisor/port.c | 54 +++- py/circuitpy_mpconfig.h | 3 +- tools/build_memory_info.py | 3 +- 7 files changed, 349 insertions(+), 23 deletions(-) diff --git a/ports/atmel-samd/bindings/samd/Clock.c b/ports/atmel-samd/bindings/samd/Clock.c index be597c4440..b88bb82e22 100644 --- a/ports/atmel-samd/bindings/samd/Clock.c +++ b/ports/atmel-samd/bindings/samd/Clock.c @@ -163,3 +163,263 @@ const mp_obj_type_t samd_clock_type = { .print = samd_clock_print, .locals_dict = (mp_obj_t)&samd_clock_locals_dict, }; + +#ifdef SAMD21 + +#ifdef SAMD21_EXPOSE_ALL_CLOCKS +CLOCK_SOURCE(XOSC); +CLOCK_SOURCE(GCLKIN); +CLOCK_SOURCE(GCLKGEN1); +CLOCK_SOURCE(OSCULP32K); +#endif +CLOCK_SOURCE(OSC32K); +CLOCK_SOURCE(XOSC32K); +#ifdef SAMD21_EXPOSE_ALL_CLOCKS +CLOCK_SOURCE(OSC8M); +CLOCK_SOURCE(DFLL48M); +CLOCK_SOURCE(DPLL96M); + +CLOCK_GCLK_(SYSCTRL, DFLL48); +CLOCK_GCLK_(SYSCTRL, FDPLL); +CLOCK_GCLK_(SYSCTRL, FDPLL32K); +CLOCK_GCLK(WDT); +#endif +CLOCK_GCLK(RTC); +#ifdef SAMD21_EXPOSE_ALL_CLOCKS +CLOCK_GCLK(EIC); +CLOCK_GCLK(USB); +CLOCK_GCLK_(EVSYS, 0); +CLOCK_GCLK_(EVSYS, 1); +CLOCK_GCLK_(EVSYS, 2); +CLOCK_GCLK_(EVSYS, 3); +CLOCK_GCLK_(EVSYS, 4); +CLOCK_GCLK_(EVSYS, 5); +CLOCK_GCLK_(EVSYS, 6); +CLOCK_GCLK_(EVSYS, 7); +CLOCK_GCLK_(EVSYS, 8); +CLOCK_GCLK_(EVSYS, 9); +CLOCK_GCLK_(EVSYS, 10); +CLOCK_GCLK_(EVSYS, 11); +CLOCK(SERCOMx_SLOW, 1, 19); +CLOCK_GCLK_(SERCOM0, CORE); +CLOCK_GCLK_(SERCOM1, CORE); +CLOCK_GCLK_(SERCOM2, CORE); +CLOCK_GCLK_(SERCOM3, CORE); +CLOCK_GCLK_(SERCOM4, CORE); +CLOCK_GCLK_(SERCOM5, CORE); +CLOCK(TCC0_TCC1, 1, 26); +CLOCK(TCC2_TCC3, 1, 27); +CLOCK(TC4_TC5, 1, 28); +CLOCK(TC6_TC7, 1, 29); +CLOCK_GCLK(ADC); +CLOCK_GCLK_(AC, DIG); +CLOCK_GCLK_(AC, ANA); +CLOCK_GCLK(DAC); +CLOCK_GCLK(PTC); +CLOCK_GCLK_(I2S, 0); +CLOCK_GCLK_(I2S, 1); + +CLOCK(SYSTICK, 2, 0); +#endif + +STATIC const mp_rom_map_elem_t samd_clock_global_dict_table[] = { +#ifdef SAMD21_EXPOSE_ALL_CLOCKS + CLOCK_ENTRY(XOSC), + CLOCK_ENTRY(GCLKIN), + CLOCK_ENTRY(GCLKGEN1), + CLOCK_ENTRY(OSCULP32K), +#endif + CLOCK_ENTRY(OSC32K), + CLOCK_ENTRY(XOSC32K), +#ifdef SAMD21_EXPOSE_ALL_CLOCKS + CLOCK_ENTRY(OSC8M), + CLOCK_ENTRY(DFLL48M), + CLOCK_ENTRY(DPLL96M), + CLOCK_ENTRY_(SYSCTRL, DFLL48), + CLOCK_ENTRY_(SYSCTRL, FDPLL), + CLOCK_ENTRY_(SYSCTRL, FDPLL32K), + CLOCK_ENTRY(WDT), +#endif + CLOCK_ENTRY(RTC), +#ifdef SAMD21_EXPOSE_ALL_CLOCKS + CLOCK_ENTRY(EIC), + CLOCK_ENTRY(USB), + CLOCK_ENTRY_(EVSYS, 0), + CLOCK_ENTRY_(EVSYS, 1), + CLOCK_ENTRY_(EVSYS, 2), + CLOCK_ENTRY_(EVSYS, 3), + CLOCK_ENTRY_(EVSYS, 4), + CLOCK_ENTRY_(EVSYS, 5), + CLOCK_ENTRY_(EVSYS, 6), + CLOCK_ENTRY_(EVSYS, 7), + CLOCK_ENTRY_(EVSYS, 8), + CLOCK_ENTRY_(EVSYS, 9), + CLOCK_ENTRY_(EVSYS, 10), + CLOCK_ENTRY_(EVSYS, 11), + CLOCK_ENTRY(SERCOMx_SLOW), + CLOCK_ENTRY_(SERCOM0, CORE), + CLOCK_ENTRY_(SERCOM1, CORE), + CLOCK_ENTRY_(SERCOM2, CORE), + CLOCK_ENTRY_(SERCOM3, CORE), + CLOCK_ENTRY_(SERCOM4, CORE), + CLOCK_ENTRY_(SERCOM5, CORE), + CLOCK_ENTRY(TCC0_TCC1), + CLOCK_ENTRY(TCC2_TCC3), + CLOCK_ENTRY(TC4_TC5), + CLOCK_ENTRY(TC6_TC7), + CLOCK_ENTRY(ADC), + CLOCK_ENTRY_(AC, DIG), + CLOCK_ENTRY_(AC, ANA), + CLOCK_ENTRY(DAC), + CLOCK_ENTRY(PTC), + CLOCK_ENTRY_(I2S, 0), + CLOCK_ENTRY_(I2S, 1), + + CLOCK_ENTRY(SYSTICK), +#endif +}; +MP_DEFINE_CONST_DICT(samd_clock_globals, samd_clock_global_dict_table); + +#endif // SAMD21 + +#ifdef SAMD51 + + + +#include +#include +#include +#include +#include +#include +#include + +CLOCK_SOURCE(XOSC0); +CLOCK_SOURCE(XOSC1); +CLOCK_SOURCE(GCLKIN); +CLOCK_SOURCE(GCLKGEN1); +CLOCK_SOURCE(OSCULP32K); +CLOCK_SOURCE(XOSC32K); +CLOCK_SOURCE(DFLL); +CLOCK_SOURCE(DPLL0); +CLOCK_SOURCE(DPLL1); + +CLOCK_GCLK_(OSCCTRL, DFLL48); +CLOCK_GCLK_(OSCCTRL, FDPLL0); +CLOCK_GCLK_(OSCCTRL, FDPLL1); +CLOCK_GCLK_(OSCCTRL, FDPLL032K); // GCLK_OSCCTRL_FDPLL1_32K, GCLK_SDHC0_SLOW, GCLK_SDHC1_SLOW, GCLK_SERCOM[0..7]_SLOW +CLOCK_GCLK(EIC); +CLOCK_GCLK_(FREQM, MSR); +// 6: GCLK_FREQM_REF +CLOCK_GCLK_(SERCOM0, CORE); +CLOCK_GCLK_(SERCOM1, CORE); +CLOCK(TC0_TC1, 1, 9); +CLOCK_GCLK(USB); +CLOCK_GCLK_(EVSYS, 0); +CLOCK_GCLK_(EVSYS, 1); +CLOCK_GCLK_(EVSYS, 2); +CLOCK_GCLK_(EVSYS, 3); +CLOCK_GCLK_(EVSYS, 4); +CLOCK_GCLK_(EVSYS, 5); +CLOCK_GCLK_(EVSYS, 6); +CLOCK_GCLK_(EVSYS, 7); +CLOCK_GCLK_(EVSYS, 8); +CLOCK_GCLK_(EVSYS, 9); +CLOCK_GCLK_(EVSYS, 10); +CLOCK_GCLK_(EVSYS, 11); +CLOCK_GCLK_(SERCOM2, CORE); +CLOCK_GCLK_(SERCOM3, CORE); +CLOCK(TCC0_TCC1, 1, 25); +CLOCK(TC2_TC3, 1, 26); +CLOCK_GCLK(CAN0); +CLOCK_GCLK(CAN1); +CLOCK(TCC2_TCC3, 1, 29); +CLOCK(TC4_TC5, 1, 30); +// CLOCK_GCLK(PDEC); +// CLOCK_GCLK(AC); +// CLOCK_GCLK(CCL); +CLOCK_GCLK_(SERCOM4, CORE); +CLOCK_GCLK_(SERCOM5, CORE); +CLOCK_GCLK_(SERCOM6, CORE); +CLOCK_GCLK_(SERCOM7, CORE); +CLOCK_GCLK(TCC4); +CLOCK(TC6_TC7, 1, 39); +CLOCK_GCLK(ADC0); +CLOCK_GCLK(ADC1); +CLOCK_GCLK(DAC); +CLOCK_GCLK_(I2S, 0); +CLOCK_GCLK_(I2S, 1); +// CLOCK_GCLK(SDHC0); +// CLOCK_GCLK(SDHC1); +// 47: GCLK_CM4_TRACE + +CLOCK(SYSTICK, 2, 0); +CLOCK(CPU, 2, 1); +CLOCK(RTC, 2, 2); + + +STATIC const mp_rom_map_elem_t samd_clock_global_dict_table[] = { + CLOCK_ENTRY(XOSC0), + CLOCK_ENTRY(XOSC1), + CLOCK_ENTRY(GCLKIN), + CLOCK_ENTRY(GCLKGEN1), + CLOCK_ENTRY(OSCULP32K), + CLOCK_ENTRY(XOSC32K), + CLOCK_ENTRY(DFLL), + CLOCK_ENTRY(DPLL0), + CLOCK_ENTRY(DPLL1), + + CLOCK_ENTRY_(OSCCTRL, DFLL48), + CLOCK_ENTRY_(OSCCTRL, FDPLL0), + CLOCK_ENTRY_(OSCCTRL, FDPLL1), + CLOCK_ENTRY_(OSCCTRL, FDPLL032K), + CLOCK_ENTRY(EIC), + CLOCK_ENTRY_(FREQM, MSR), + CLOCK_ENTRY_(SERCOM0, CORE), + CLOCK_ENTRY_(SERCOM1, CORE), + CLOCK_ENTRY(TC0_TC1), + CLOCK_ENTRY(USB), + CLOCK_ENTRY_(EVSYS, 0), + CLOCK_ENTRY_(EVSYS, 1), + CLOCK_ENTRY_(EVSYS, 2), + CLOCK_ENTRY_(EVSYS, 3), + CLOCK_ENTRY_(EVSYS, 4), + CLOCK_ENTRY_(EVSYS, 5), + CLOCK_ENTRY_(EVSYS, 6), + CLOCK_ENTRY_(EVSYS, 7), + CLOCK_ENTRY_(EVSYS, 8), + CLOCK_ENTRY_(EVSYS, 9), + CLOCK_ENTRY_(EVSYS, 10), + CLOCK_ENTRY_(EVSYS, 11), + CLOCK_ENTRY_(SERCOM2, CORE), + CLOCK_ENTRY_(SERCOM3, CORE), + CLOCK_ENTRY(TCC0_TCC1), + CLOCK_ENTRY(TC2_TC3), + CLOCK_ENTRY(CAN0), + CLOCK_ENTRY(CAN1), + CLOCK_ENTRY(TCC2_TCC3), + CLOCK_ENTRY(TC4_TC5), + // CLOCK_ENTRY(PDEC), + // CLOCK_ENTRY(AC), + // CLOCK_ENTRY(CCL), + CLOCK_ENTRY_(SERCOM4, CORE), + CLOCK_ENTRY_(SERCOM5, CORE), + CLOCK_ENTRY_(SERCOM6, CORE), + CLOCK_ENTRY_(SERCOM7, CORE), + CLOCK_ENTRY(TCC4), + CLOCK_ENTRY(TC6_TC7), + CLOCK_ENTRY(ADC0), + CLOCK_ENTRY(ADC1), + CLOCK_ENTRY(DAC), + CLOCK_ENTRY_(I2S, 0), + CLOCK_ENTRY_(I2S, 1), + // CLOCK_ENTRY(SDHC0), + // CLOCK_ENTRY(SDHC1), + + CLOCK_ENTRY(SYSTICK), + CLOCK_ENTRY(CPU), + CLOCK_ENTRY(RTC), +}; +MP_DEFINE_CONST_DICT(samd_clock_globals, samd_clock_global_dict_table); + +#endif // SAMD51 diff --git a/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c b/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c index d34049946b..6258818c83 100644 --- a/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +++ b/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c @@ -213,7 +213,7 @@ void frequencyin_samd51_start_dpll() { // Will also enable the Lock Bypass due to low-frequency sources causing DPLL unlocks // as outlined in the Errata (1.12.1) OSCCTRL->Dpll[1].DPLLRATIO.reg = OSCCTRL_DPLLRATIO_LDRFRAC(0) | OSCCTRL_DPLLRATIO_LDR(2999); - if (board_has_crystal()) { // we can use XOSC32K directly as the source + if (BOARD_HAS_CRYSTAL) { // we can use XOSC32K directly as the source OSC32KCTRL->XOSC32K.bit.EN32K = 1; OSCCTRL->Dpll[1].DPLLCTRLB.reg = OSCCTRL_DPLLCTRLB_REFCLK(1) | OSCCTRL_DPLLCTRLB_LBYPASS; diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h index 9733d270ad..ecb9621945 100644 --- a/ports/atmel-samd/mpconfigport.h +++ b/ports/atmel-samd/mpconfigport.h @@ -30,28 +30,16 @@ // Definitions for which SAMD chip we're using. #include "include/sam.h" + +//////////////////////////////////////////////////////////////////////////////////////////////////// +#ifdef SAMD21 + #if INTERNAL_FLASH_FILESYSTEM #define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (64*1024) #else #define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (0) #endif -#ifndef CALIBRATE_CRYSTALLESS -#define CALIBRATE_CRYSTALLESS (0) -#endif - -// if CALIBRATE_CRYSTALLESS is requested, make room for storing -// calibration data generated from external USB. -#ifndef CIRCUITPY_INTERNAL_CONFIG_SIZE - #if CALIBRATE_CRYSTALLESS - #define CIRCUITPY_INTERNAL_CONFIG_SIZE (256) - #else - #define CIRCUITPY_INTERNAL_CONFIG_SIZE (0) - #endif -#endif - -#ifdef SAMD21 - // HMCRAMC0_SIZE is defined in the ASF4 include files for each SAMD21 chip. #define RAM_SIZE HMCRAMC0_SIZE #define BOOTLOADER_SIZE (8*1024) @@ -84,6 +72,8 @@ #endif // SAMD21 +//////////////////////////////////////////////////////////////////////////////////////////////////// + #ifdef SAMD51 #ifndef CIRCUITPY_INTERNAL_NVM_SIZE @@ -110,6 +100,7 @@ #define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (1) #define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1) #define MICROPY_PY_FUNCTION_ATTRS (1) +// MICROPY_PY_UJSON depends on MICROPY_PY_IO #define MICROPY_PY_IO (1) #define MICROPY_PY_UJSON (1) #define MICROPY_PY_REVERSE_SPECIAL_METHODS (1) @@ -117,6 +108,29 @@ #endif // SAMD51 +//////////////////////////////////////////////////////////////////////////////////////////////////// + +// This also includes mpconfigboard.h. +#include "py/circuitpy_mpconfig.h" + +#ifndef CALIBRATE_CRYSTALLESS +#define CALIBRATE_CRYSTALLESS (0) +#endif + +#ifndef BOARD_HAS_CRYSTAL +#define BOARD_HAS_CRYSTAL (0) +#endif + +// if CALIBRATE_CRYSTALLESS is requested, make room for storing +// calibration data generated from external USB. +#ifndef CIRCUITPY_INTERNAL_CONFIG_SIZE + #if CALIBRATE_CRYSTALLESS + #define CIRCUITPY_INTERNAL_CONFIG_SIZE (NVMCTRL_ROW_SIZE) // 256 + #else + #define CIRCUITPY_INTERNAL_CONFIG_SIZE (0) + #endif +#endif + // Flash layout, starting at 0x00000000 // // bootloader (8 or 16kB) @@ -155,8 +169,6 @@ #include "peripherals/samd/dma.h" -#include "py/circuitpy_mpconfig.h" - #define MICROPY_PORT_ROOT_POINTERS \ CIRCUITPY_COMMON_ROOT_POINTERS \ mp_obj_t playing_audio[AUDIO_DMA_CHANNEL_COUNT]; diff --git a/ports/atmel-samd/peripherals b/ports/atmel-samd/peripherals index 2ba5b20ba7..bb26a4145c 160000 --- a/ports/atmel-samd/peripherals +++ b/ports/atmel-samd/peripherals @@ -1 +1 @@ -Subproject commit 2ba5b20ba725e1c91c77875fba3a5e22059cdb92 +Subproject commit bb26a4145c86a51debc6571bb1f791e0d4fd296b diff --git a/ports/atmel-samd/supervisor/port.c b/ports/atmel-samd/supervisor/port.c index e962281c1e..5662b159bc 100644 --- a/ports/atmel-samd/supervisor/port.c +++ b/ports/atmel-samd/supervisor/port.c @@ -24,12 +24,16 @@ * THE SOFTWARE. */ +#include +#include + #include "boards/board.h" #include "supervisor/port.h" // ASF 4 #include "atmel_start_pins.h" #include "hal/include/hal_delay.h" +#include "hal/include/hal_flash.h" #include "hal/include/hal_gpio.h" #include "hal/include/hal_init.h" #include "hpl/gclk/hpl_gclk_base.h" @@ -94,6 +98,40 @@ extern volatile bool mp_msc_enabled; __attribute__((__aligned__(TRACE_BUFFER_SIZE_BYTES))) uint32_t mtb[TRACE_BUFFER_SIZE] = {0}; #endif +#if CALIBRATE_CRYSTALLESS +static void save_usb_clock_calibration(void) { + // If we are on USB lets double check our fine calibration for the clock and + // save the new value if its different enough. + SYSCTRL->DFLLSYNC.bit.READREQ = 1; + uint16_t saved_calibration = 0x1ff; + if (strcmp((char*) CIRCUITPY_INTERNAL_CONFIG_START_ADDR, "CIRCUITPYTHON1") == 0) { + saved_calibration = ((uint16_t *) CIRCUITPY_INTERNAL_CONFIG_START_ADDR)[8]; + } + while (SYSCTRL->PCLKSR.bit.DFLLRDY == 0) { + // TODO(tannewt): Run the mass storage stuff if this takes a while. + } + int16_t current_calibration = SYSCTRL->DFLLVAL.bit.FINE; + if (abs(current_calibration - saved_calibration) > 10) { + // Copy the full internal config page to memory. + uint8_t page_buffer[NVMCTRL_ROW_SIZE]; + memcpy(page_buffer, (uint8_t*) CIRCUITPY_INTERNAL_CONFIG_START_ADDR, NVMCTRL_ROW_SIZE); + + // Modify it. + memcpy(page_buffer, "CIRCUITPYTHON1", 15); + // First 16 bytes (0-15) are ID. Little endian! + page_buffer[16] = current_calibration & 0xff; + page_buffer[17] = current_calibration >> 8; + + // Write it back. + // We don't use features that use any advanced NVMCTRL features so we can fake the descriptor + // whenever we need it instead of storing it long term. + struct flash_descriptor desc; + desc.dev.hw = NVMCTRL; + flash_write(&desc, (uint32_t) CIRCUITPY_INTERNAL_CONFIG_START_ADDR, page_buffer, NVMCTRL_ROW_SIZE); + } +} +#endif + safe_mode_t port_init(void) { #if defined(SAMD21) @@ -168,7 +206,19 @@ safe_mode_t port_init(void) { hri_nvmctrl_set_CTRLB_RWS_bf(NVMCTRL, 2); _pm_init(); #endif - clock_init(); + +#if CALIBRATE_CRYSTALLESS + uint32_t fine = DEFAULT_DFLL48M_FINE_CALIBRATION; + // The fine calibration data is stored in an NVM page after the text and data storage but before + // the optional file system. The first 16 bytes are the identifier for the section. + if (strcmp((char*) CIRCUITPY_INTERNAL_CONFIG_START_ADDR, "CIRCUITPYTHON1") == 0) { + fine = ((uint16_t *) CIRCUITPY_INTERNAL_CONFIG_START_ADDR)[8]; + } + clock_init(BOARD_HAS_CRYSTAL, fine); +#else + // Use a default fine value + clock_init(BOARD_HAS_CRYSTAL, DEFAULT_DFLL48M_FINE_CALIBRATION); +#endif // Configure millisecond timer initialization. tick_init(); @@ -257,9 +307,11 @@ void reset_port(void) { // gpio_set_pin_function(PIN_PB15, GPIO_PIN_FUNCTION_M); // GCLK1, D6 // #endif +#if CALIBRATE_CRYSTALLESS if (tud_cdc_connected()) { save_usb_clock_calibration(); } +#endif } void reset_to_bootloader(void) { diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index cf21d26dd0..c4606074fa 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -174,7 +174,8 @@ typedef long mp_off_t; { MP_OBJ_NEW_QSTR(MP_QSTR_input), (mp_obj_t)&mp_builtin_input_obj }, \ { MP_OBJ_NEW_QSTR(MP_QSTR_open), (mp_obj_t)&mp_builtin_open_obj }, -// board specific definitions +////////////////////////////////////////////////////////////////////////////////////////////////// +// board-specific definitions, which control and may override definitions below. #include "mpconfigboard.h" // CIRCUITPY_FULL_BUILD is defined in a *.mk file. diff --git a/tools/build_memory_info.py b/tools/build_memory_info.py index 0dcd5f6e48..f128561ab2 100644 --- a/tools/build_memory_info.py +++ b/tools/build_memory_info.py @@ -41,6 +41,7 @@ data = 0 bss = 0 # stdin is the linker output. for line in sys.stdin: + print(line) line = line.strip() if not line.startswith("text"): text, data, bss = map(int, line.split()[:3]) @@ -64,7 +65,7 @@ for region in regions: free_flash = regions["FLASH_FIRMWARE"] - text - data free_ram = regions["RAM"] - data - bss print("{} bytes free in flash firmware space out of {} bytes ({}kB).".format(free_flash, regions["FLASH_FIRMWARE"], regions["FLASH_FIRMWARE"] / 1024)) -print("{} bytes free in ram for stack out of {} bytes ({}kB).".format(free_ram, regions["RAM"], regions["RAM"] / 1024)) +print("{} bytes free in ram for heap out of {} bytes ({}kB).".format(free_ram, regions["RAM"], regions["RAM"] / 1024)) print() # Check that we have free flash space. GCC doesn't fail when the text + data From 013c84086288141696e4c09250c61b6f2dbdf4d2 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 10 Dec 2019 17:57:17 -0500 Subject: [PATCH 20/78] working on all ports --- ports/atmel-samd/Makefile | 15 +--- ports/atmel-samd/boards/common.template.ld | 4 +- ports/atmel-samd/mpconfigport.h | 47 +++++++++--- ports/atmel-samd/peripherals | 2 +- ports/cxd56/boards/spresense/mpconfigboard.mk | 2 + ports/nrf/Makefile | 34 +++------ .../mpconfigboard.h | 3 - ports/nrf/boards/common.template.ld | 8 +- .../feather_nrf52840_express/mpconfigboard.h | 3 - .../mpconfigboard.h | 3 - .../metro_nrf52840_express/mpconfigboard.h | 3 - ports/nrf/boards/pca10059/mpconfigboard.mk | 2 +- ports/nrf/ld_defines.c | 39 ++++++++++ ports/nrf/mpconfigport.h | 76 +++++++++++++++---- ports/nrf/mpconfigport.mk | 2 +- ports/nrf/supervisor/internal_flash.c | 8 +- py/circuitpy_defns.mk | 12 +++ supervisor/supervisor.mk | 6 +- tools/build_memory_info.py | 20 +++-- 19 files changed, 189 insertions(+), 100 deletions(-) create mode 100644 ports/nrf/ld_defines.c diff --git a/ports/atmel-samd/Makefile b/ports/atmel-samd/Makefile index 32517c8016..83fd879aad 100644 --- a/ports/atmel-samd/Makefile +++ b/ports/atmel-samd/Makefile @@ -157,7 +157,7 @@ endif -LDFLAGS = $(CFLAGS) -nostartfiles -fshort-enums -Wl,-nostdlib -Wl,-T,$(LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs +LDFLAGS = $(CFLAGS) -nostartfiles -fshort-enums -Wl,-nostdlib -Wl,-T,$(GENERATED_LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs LIBS := -lgcc -lc # Use toolchain libm if we're not using our own. @@ -324,19 +324,10 @@ SRC_QSTR_PREPROCESSOR += peripherals/samd/$(CHIP_FAMILY)/clocks.c all: $(BUILD)/firmware.bin $(BUILD)/firmware.uf2 -LD_FILE = $(BUILD)/$(notdir $(patsubst %.template.ld,%.ld,$(LD_TEMPLATE_FILE))) - -# ld_defines.pp is generated from ld_defines.c. See py/mkrules.mk. -# Run gen_ld_files.py over ALL *.template.ld files, not just LD_TEMPLATE_FILE, -# because it may include other template files. -$(LD_FILE): $(BUILD)/ld_defines.pp boards/*.template.ld - $(STEPECHO) "GEN $@" - $(Q)$(PYTHON3) $(TOP)/tools/gen_ld_files.py --defines $< --out_dir $(BUILD) boards/*.template.ld - -$(BUILD)/firmware.elf: $(OBJ) $(LD_FILE) +$(BUILD)/firmware.elf: $(OBJ) $(GENERATED_LD_FILE) $(STEPECHO) "LINK $@" $(Q)$(CC) -o $@ $(LDFLAGS) $(OBJ) -Wl,--start-group $(LIBS) -Wl,--end-group - $(Q)$(SIZE) $@ | $(PYTHON3) $(TOP)/tools/build_memory_info.py $(LD_FILE) + $(Q)$(SIZE) $@ | $(PYTHON3) $(TOP)/tools/build_memory_info.py $(GENERATED_LD_FILE) $(BUILD)/firmware.bin: $(BUILD)/firmware.elf $(STEPECHO) "Create $@" diff --git a/ports/atmel-samd/boards/common.template.ld b/ports/atmel-samd/boards/common.template.ld index 4c537e0016..1054605c8c 100644 --- a/ports/atmel-samd/boards/common.template.ld +++ b/ports/atmel-samd/boards/common.template.ld @@ -6,9 +6,9 @@ MEMORY FLASH_BOOTLOADER (rx): ORIGIN = ${BOOTLOADER_START_ADDR}, LENGTH = ${BOOTLOADER_SIZE} FLASH_FIRMWARE (rx) : ORIGIN = ${CIRCUITPY_FIRMWARE_START_ADDR}, LENGTH = ${CIRCUITPY_FIRMWARE_SIZE} - FLASH_NVM (r) : ORIGIN = ${CIRCUITPY_INTERNAL_NVM_START_ADDR}, LENGTH = ${CIRCUITPY_INTERNAL_NVM_SIZE} - FLASH_CONFIG (r) : ORIGIN = ${CIRCUITPY_INTERNAL_CONFIG_START_ADDR}, LENGTH = ${CIRCUITPY_INTERNAL_CONFIG_SIZE} FLASH_FILESYSTEM (r) : ORIGIN = ${CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR}, LENGTH = ${CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE} + FLASH_CONFIG (r) : ORIGIN = ${CIRCUITPY_INTERNAL_CONFIG_START_ADDR}, LENGTH = ${CIRCUITPY_INTERNAL_CONFIG_SIZE} + FLASH_NVM (r) : ORIGIN = ${CIRCUITPY_INTERNAL_NVM_START_ADDR}, LENGTH = ${CIRCUITPY_INTERNAL_NVM_SIZE} RAM (xrw) : ORIGIN = 0x20000000, LENGTH = ${RAM_SIZE} } diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h index ecb9621945..6ab95c8a5a 100644 --- a/ports/atmel-samd/mpconfigport.h +++ b/ports/atmel-samd/mpconfigport.h @@ -81,12 +81,12 @@ #endif // If CIRCUITPY is internal, use half of flash for it. -#ifndef CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE - #if INTERNAL_FLASH_FILESYSTEM - #define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (FLASH_SIZE/2) - #else - #define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (0) +#if INTERNAL_FLASH_FILESYSTEM + #ifndef CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE + #define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (FLASH_SIZE/2) #endif +#else + #define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (0) #endif // HSRAM_SIZE is defined in the ASF4 include files for each SAMD51 chip. @@ -135,9 +135,9 @@ // // bootloader (8 or 16kB) // firmware +// internal CIRCUITPY flash filesystem (optional) // internal config, used to store crystalless clock calibration info (optional) // microntroller.nvm (optional) -// internal CIRCUITPY flash filesystem (optional) // Define these regions starting up from the bottom of flash: @@ -147,18 +147,43 @@ // Define these regions start down from the top of flash: -#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR \ - (FLASH_SIZE - CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE) - #define CIRCUITPY_INTERNAL_NVM_START_ADDR \ - (CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR - CIRCUITPY_INTERNAL_NVM_SIZE) + (FLASH_SIZE - CIRCUITPY_INTERNAL_NVM_SIZE) #define CIRCUITPY_INTERNAL_CONFIG_START_ADDR \ (CIRCUITPY_INTERNAL_NVM_START_ADDR - CIRCUITPY_INTERNAL_CONFIG_SIZE) +#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR \ + (CIRCUITPY_INTERNAL_CONFIG_START_ADDR - CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE) + // The firmware space is the space left over between the fixed lower and upper regions. #define CIRCUITPY_FIRMWARE_SIZE \ - (CIRCUITPY_INTERNAL_CONFIG_START_ADDR - CIRCUITPY_FIRMWARE_START_ADDR) + (CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR - CIRCUITPY_FIRMWARE_START_ADDR) + +#if BOOTLOADER_START_ADDR % FLASH_PAGE_SIZE != 0 +#error BOOTLOADER_START_ADDR must be on a flash page boundary. +#endif + +#if CIRCUITPY_INTERNAL_NVM_START_ADDR % FLASH_PAGE_SIZE != 0 +#error CIRCUITPY_INTERNAL_NVM_START_ADDR must be on a flash page boundary. +#endif +#if CIRCUITPY_INTERNAL_NVM_SIZE % FLASH_PAGE_SIZE != 0 +#error CIRCUITPY_INTERNAL_NVM_SIZE must be a multiple of FLASH_PAGE_SIZE. +#endif + +#if CIRCUITPY_INTERNAL_CONFIG_START_ADDR % FLASH_PAGE_SIZE != 0 +#error CIRCUITPY_INTERNAL_CONFIG_SIZE must be on a flash page boundary. +#endif +#if CIRCUITPY_INTERNAL_CONFIG_SIZE % FLASH_PAGE_SIZE != 0 +#error CIRCUITPY_INTERNAL_CONFIG_SIZE must be a multiple of FLASH_PAGE_SIZE. +#endif + +#if CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR % FLASH_PAGE_SIZE != 0 +#error CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE must be on a flash page boundary. +#endif +#if CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE % FLASH_PAGE_SIZE != 0 +#error CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE must be a multiple of FLASH_PAGE_SIZE. +#endif #if CIRCUITPY_FIRMWARE_SIZE < 0 #error No space left in flash for firmware after specifying other regions! diff --git a/ports/atmel-samd/peripherals b/ports/atmel-samd/peripherals index bb26a4145c..4c0deecf88 160000 --- a/ports/atmel-samd/peripherals +++ b/ports/atmel-samd/peripherals @@ -1 +1 @@ -Subproject commit bb26a4145c86a51debc6571bb1f791e0d4fd296b +Subproject commit 4c0deecf889da0074c1dbc9a5e2d24cb7c7a31c6 diff --git a/ports/cxd56/boards/spresense/mpconfigboard.mk b/ports/cxd56/boards/spresense/mpconfigboard.mk index a2d4e5d88c..7b8ac6ff63 100644 --- a/ports/cxd56/boards/spresense/mpconfigboard.mk +++ b/ports/cxd56/boards/spresense/mpconfigboard.mk @@ -2,3 +2,5 @@ USB_VID = 0x054c USB_PID = 0x0bc2 USB_PRODUCT = "Spresense" USB_MANUFACTURER = "Sony" + +INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index b96b8affb3..e7af13a735 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -63,8 +63,6 @@ ifneq ($(SD), ) include bluetooth/bluetooth_common.mk endif -FROZEN_MPY_DIR = freeze - CROSS_COMPILE = arm-none-eabi- FATFS_DIR = lib/oofatfs @@ -92,7 +90,7 @@ INC += -I../../supervisor/shared/usb ifeq ($(DEBUG), 1) CFLAGS += -ggdb3 -Og else - CFLAGS += -Os -DNDEBUG + CFLAGS += -Os -DNDEBUG -ggdb3 CFLAGS += -flto -flto-partition=none endif @@ -118,7 +116,7 @@ CFLAGS += \ # TODO: check this CFLAGS += -D__START=main -LDFLAGS = $(CFLAGS) -nostartfiles -fshort-enums -Wl,-nostdlib -Wl,-T,$(LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs +LDFLAGS = $(CFLAGS) -nostartfiles -fshort-enums -Wl,-nostdlib -Wl,-T,$(GENERATED_LD_FILE) -Wl,-Map=$@.map -Wl,-cref -Wl,-gc-sections -specs=nano.specs LIBS := -lgcc -lc LDFLAGS += -mthumb -mcpu=cortex-m4 @@ -193,15 +191,16 @@ SRC_SHARED_MODULE_EXPANDED = $(addprefix shared-bindings/, $(SRC_SHARED_MODULE)) $(addprefix shared-module/, $(SRC_SHARED_MODULE)) \ $(addprefix shared-module/, $(SRC_SHARED_MODULE_INTERNAL)) -SRC_S = supervisor/cpu.s +# There may be duplicates between SRC_COMMON_HAL_EXPANDED and SRC_SHARED_MODULE_EXPANDED, +# because a few modules have files both in common-hal/ and shared-modules/. +# Doing a $(sort ...) removes duplicates as part of sorting. +SRC_COMMON_HAL_SHARED_MODULE_EXPANDED = $(sort $(SRC_COMMON_HAL_EXPANDED) $(SRC_SHARED_MODULE_EXPANDED)) -FROZEN_MPY_PY_FILES := $(shell find -L $(FROZEN_MPY_DIR) -type f -name '*.py') -FROZEN_MPY_MPY_FILES := $(addprefix $(BUILD)/,$(FROZEN_MPY_PY_FILES:.py=.mpy)) +SRC_S = supervisor/cpu.s OBJ += $(PY_O) $(SUPERVISOR_O) $(addprefix $(BUILD)/, $(SRC_C:.c=.o)) OBJ += $(addprefix $(BUILD)/, $(SRC_NRFX:.c=.o)) -OBJ += $(addprefix $(BUILD)/, $(SRC_COMMON_HAL_EXPANDED:.c=.o)) -OBJ += $(addprefix $(BUILD)/, $(SRC_SHARED_MODULE_EXPANDED:.c=.o)) +OBJ += $(addprefix $(BUILD)/, $(SRC_COMMON_HAL_SHARED_MODULE_EXPANDED:.c=.o)) ifeq ($(INTERNAL_LIBM),1) OBJ += $(addprefix $(BUILD)/, $(SRC_LIBM:.c=.o)) endif @@ -219,19 +218,10 @@ SRC_QSTR_PREPROCESSOR += all: $(BUILD)/firmware.bin $(BUILD)/firmware.uf2 -LD_FILE = $(BUILD)/$(notdir $(patsubst %.template.ld,%.ld,$(LD_TEMPLATE_FILE))) - -# ld_defines.pp is generated from ld_defines.c. See py/mkrules.mk. -# Run gen_ld_files.py over ALL *.template.ld files, not just LD_TEMPLATE_FILE, -# because it may include other template files. -$(LD_FILE): $(BUILD)/ld_defines.pp boards/*.template.ld - $(STEPECHO) "GEN $@" - $(Q)$(PYTHON3) $(TOP)/tools/gen_ld_files.py --defines $< --out_dir $(BUILD) boards/*.template.ld - -$(BUILD)/firmware.elf: $(OBJ) +$(BUILD)/firmware.elf: $(OBJ) $(GENERATED_LD_FILE) $(STEPECHO) "LINK $@" - $(Q)$(CC) -o $@ $(LDFLAGS) $^ -Wl,--start-group $(LIBS) -Wl,--end-group - $(Q)$(SIZE) $@ | $(PYTHON3) $(TOP)/tools/build_memory_info.py $(LD_FILE) + $(Q)$(CC) -o $@ $(LDFLAGS) $(OBJ) -Wl,--start-group $(LIBS) -Wl,--end-group + $(Q)$(SIZE) $@ | $(PYTHON3) $(TOP)/tools/build_memory_info.py $(GENERATED_LD_FILE) $(BUILD)/firmware.bin: $(BUILD)/firmware.elf $(STEPECHO) "Create $@" @@ -273,7 +263,7 @@ else ifeq ($(FLASHER), pyocd) flash: $(BUILD)/firmware.hex pyocd-flashtool -t $(MCU_VARIANT) $< --sector_erase - #pyocd-tool -t $(MCU_VARIANT) erase $(BOOT_SETTING_ADDR) +# pyocd-tool -t $(MCU_VARIANT) erase $(BOOT_SETTING_ADDR) pyocd-tool -t $(MCU_VARIANT) write32 $(BOOT_SETTING_ADDR) 0x00000001 pyocd-tool -t $(MCU_VARIANT) reset diff --git a/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h b/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h index 7ca9b12aee..5abb868204 100644 --- a/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h +++ b/ports/nrf/boards/circuitplayground_bluefruit/mpconfigboard.h @@ -30,9 +30,6 @@ #define MICROPY_HW_BOARD_NAME "Adafruit Circuit Playground Bluefruit" #define MICROPY_HW_MCU_NAME "nRF52840" -#define FLASH_SIZE (0x100000) -#define FLASH_PAGE_SIZE (4096) - #define MICROPY_HW_LED_STATUS (&pin_P1_14) // Unusually, board does not have a 32 kHz xtal. Nearly all boards do. diff --git a/ports/nrf/boards/common.template.ld b/ports/nrf/boards/common.template.ld index 9fd066de10..f267234924 100644 --- a/ports/nrf/boards/common.template.ld +++ b/ports/nrf/boards/common.template.ld @@ -9,11 +9,11 @@ MEMORY /* nRF SoftDevice */ FLASH_MBR (rx) : ORIGIN = ${MBR_START_ADDR}, LENGTH = ${MBR_SIZE} FLASH_SD (rx) : ORIGIN = ${SD_FLASH_START_ADDR}, LENGTH = ${SD_FLASH_SIZE} - FLASH_ISR (rx) : ORIGIN = ${CIRCUITPY_ISR_START_ADDR}, LENGTH = ${CIRCUITPY_ISR_LENGTH} + FLASH_ISR (rx) : ORIGIN = ${ISR_START_ADDR}, LENGTH = ${ISR_SIZE} FLASH_FIRMWARE (rx) : ORIGIN = ${CIRCUITPY_FIRMWARE_START_ADDR}, LENGTH = ${CIRCUITPY_FIRMWARE_SIZE} + FLASH_FATFS (r) : ORIGIN = ${CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR}, LENGTH = ${CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE} FLASH_BLE_CONFIG (r) : ORIGIN = ${CIRCUITPY_BLE_CONFIG_START_ADDR}, LENGTH = ${CIRCUITPY_BLE_CONFIG_SIZE} FLASH_NVM (r) : ORIGIN = ${CIRCUITPY_INTERNAL_NVM_START_ADDR}, LENGTH = ${CIRCUITPY_INTERNAL_NVM_SIZE} - FLASH_FATFS (r) : ORIGIN = ${CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR}, LENGTH = ${CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE} FLASH_BOOTLOADER (rx) : ORIGIN = ${BOOTLOADER_START_ADDR}, LENGTH = ${BOOTLOADER_SIZE} FLASH_BOOTLOADER_SETTINGS (r) : ORIGIN = ${BOOTLOADER_SETTINGS_START_ADDR}, LENGTH = ${BOOTLOADER_SETTINGS_SIZE} RAM (xrw) : ORIGIN = 0x20004000, LENGTH = 0x03C000 /* 240 KiB */ @@ -32,10 +32,6 @@ _estack = ORIGIN(RAM) + LENGTH(RAM); _ram_end = ORIGIN(RAM) + LENGTH(RAM); _heap_end = 0x20020000; /* tunable */ -/* Flash region for File System */ -__fatfs_flash_start_addr = ORIGIN(FLASH_FATFS); -__fatfs_flash_length = LENGTH(FLASH_FATFS); - /* define output sections */ SECTIONS { diff --git a/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h b/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h index b388515e43..64988e1a28 100644 --- a/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h +++ b/ports/nrf/boards/feather_nrf52840_express/mpconfigboard.h @@ -30,9 +30,6 @@ #define MICROPY_HW_BOARD_NAME "Adafruit Feather nRF52840 Express" #define MICROPY_HW_MCU_NAME "nRF52840" -#define FLASH_SIZE (0x100000) -#define FLASH_PAGE_SIZE (4096) - #define MICROPY_HW_NEOPIXEL (&pin_P0_16) #define MICROPY_HW_LED_STATUS (&pin_P1_15) diff --git a/ports/nrf/boards/itsybitsy_nrf52840_express/mpconfigboard.h b/ports/nrf/boards/itsybitsy_nrf52840_express/mpconfigboard.h index 2f17460ae7..629463e4e2 100644 --- a/ports/nrf/boards/itsybitsy_nrf52840_express/mpconfigboard.h +++ b/ports/nrf/boards/itsybitsy_nrf52840_express/mpconfigboard.h @@ -3,9 +3,6 @@ #define MICROPY_HW_BOARD_NAME "Adafruit ItsyBitsy nRF52840 Express" #define MICROPY_HW_MCU_NAME "nRF52840" -#define FLASH_SIZE (0x100000) -#define FLASH_PAGE_SIZE (4096) - #define MICROPY_HW_LED_STATUS (&pin_P0_06) #define MICROPY_HW_APA102_MOSI (&pin_P0_08) diff --git a/ports/nrf/boards/metro_nrf52840_express/mpconfigboard.h b/ports/nrf/boards/metro_nrf52840_express/mpconfigboard.h index 5188a379f6..8373551545 100644 --- a/ports/nrf/boards/metro_nrf52840_express/mpconfigboard.h +++ b/ports/nrf/boards/metro_nrf52840_express/mpconfigboard.h @@ -30,9 +30,6 @@ #define MICROPY_HW_BOARD_NAME "Adafruit Metro nRF52840 Express" #define MICROPY_HW_MCU_NAME "nRF52840" -#define FLASH_SIZE (0x100000) -#define FLASH_PAGE_SIZE (4096) - #define MICROPY_HW_NEOPIXEL (&pin_P0_13) #define MICROPY_HW_LED_STATUS (&pin_P1_13) diff --git a/ports/nrf/boards/pca10059/mpconfigboard.mk b/ports/nrf/boards/pca10059/mpconfigboard.mk index f9ff9c21c5..3f97b08218 100644 --- a/ports/nrf/boards/pca10059/mpconfigboard.mk +++ b/ports/nrf/boards/pca10059/mpconfigboard.mk @@ -5,4 +5,4 @@ USB_MANUFACTURER = "Nordic Semiconductor" MCU_CHIP = nrf52840 -INTERNAL_FLASH_FILEYSTEM = 1 +INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/nrf/ld_defines.c b/ports/nrf/ld_defines.c new file mode 100644 index 0000000000..0ec6dfdb5d --- /dev/null +++ b/ports/nrf/ld_defines.c @@ -0,0 +1,39 @@ +// Fake source file used only to capture #define values for use in ld template files. +#include "mpconfigport.h" + +// For each value needed in the LD file, create a C-like line: +// /*NAME_OF_VALUE=*/ NAME_OF_VALUE; +// The C preprocessor will replace NAME_OF_VALUE with the actual value. +// This will be post-processed by tools/gen_ld_files.py to extract the name and value. + +// The next line is a marker to start looking for definitions. Lines above the next line are ignored. +// START_LD_DEFINES + +/*MBR_START_ADDR=*/ MBR_START_ADDR; +/*MBR_SIZE=*/ MBR_SIZE; + +/*SD_FLASH_START_ADDR=*/ SD_FLASH_START_ADDR; +/*SD_FLASH_SIZE=*/ SD_FLASH_SIZE; + +/*ISR_START_ADDR=*/ ISR_START_ADDR; +/*ISR_SIZE=*/ ISR_SIZE; + +/*CIRCUITPY_DEFAULT_STACK_SIZE=*/ CIRCUITPY_DEFAULT_STACK_SIZE; + +/*CIRCUITPY_FIRMWARE_START_ADDR=*/ CIRCUITPY_FIRMWARE_START_ADDR; +/*CIRCUITPY_FIRMWARE_SIZE=*/ CIRCUITPY_FIRMWARE_SIZE; + +/*CIRCUITPY_BLE_CONFIG_START_ADDR=*/ CIRCUITPY_BLE_CONFIG_START_ADDR; +/*CIRCUITPY_BLE_CONFIG_SIZE=*/ CIRCUITPY_BLE_CONFIG_SIZE; + +/*CIRCUITPY_INTERNAL_NVM_START_ADDR=*/ CIRCUITPY_INTERNAL_NVM_START_ADDR; +/*CIRCUITPY_INTERNAL_NVM_SIZE=*/ CIRCUITPY_INTERNAL_NVM_SIZE; + +/*CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR=*/ CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR; +/*CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE=*/ CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE; + +/*BOOTLOADER_START_ADDR=*/ BOOTLOADER_START_ADDR; +/*BOOTLOADER_SIZE=*/ BOOTLOADER_SIZE; + +/*BOOTLOADER_SETTINGS_START_ADDR=*/ BOOTLOADER_SETTINGS_START_ADDR; +/*BOOTLOADER_SETTINGS_SIZE=*/ BOOTLOADER_SETTINGS_SIZE; diff --git a/ports/nrf/mpconfigport.h b/ports/nrf/mpconfigport.h index 00d4a51ad8..d10f12f6a7 100644 --- a/ports/nrf/mpconfigport.h +++ b/ports/nrf/mpconfigport.h @@ -30,8 +30,13 @@ #include "ble_drv.h" +#include "nrf_mbr.h" // for MBR_SIZE +#include "nrf_sdm.h" // for SD_FLASH_SIZE +#include "peripherals/nrf/nvm.h" // for FLASH_PAGE_SIZE + #ifdef NRF52840 #define MICROPY_PY_SYS_PLATFORM "nRF52840" +#define FLASH_SIZE (0x100000) // 1MiB #endif #define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1) @@ -45,11 +50,12 @@ // 24kiB stack #define CIRCUITPY_DEFAULT_STACK_SIZE 0x6000 -#if INTERNAL_FLASH_FILESYSTEM -#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (64*1024) -#else -#define CIRCUITPYINTERNAL_FLASH_FILESYSTEM_SIZE (0) -#endif +//////////////////////////////////////////////////////////////////////////////////////////////////// + +// This also includes mpconfigboard.h. +#include "py/circuitpy_mpconfig.h" + +// Definitions that might be overriden by mpconfigboard.h #ifndef CIRCUITPY_INTERNAL_NVM_SIZE #define CIRCUITPY_INTERNAL_NVM_SIZE (8192) @@ -60,14 +66,22 @@ #define BOARD_HAS_32KHZ_XTAL (1) #endif +#if INTERNAL_FLASH_FILESYSTEM + #ifndef CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE + #define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (256*1024) + #endif +#else + #define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (0) +#endif + // Flash layout, starting at 0x00000000 // // SoftDevice // ISR // firmware +// internal CIRCUITPY flash filesystem (optional) // BLE config (bonding info, etc.) (optional) // microntroller.nvm (optional) -// internal CIRCUITPY flash filesystem (optional) // bootloader (note the MBR at 0x0 redirects to the bootloader here, in high flash) // bootloader settings @@ -76,14 +90,14 @@ // Define these regions starting up from the bottom of flash: #define MBR_START_ADDR (0x0) -// MBR_SIZE is from nrf_sdm.h +// MBR_SIZE is from nrf_mbr.h #define SD_FLASH_START_ADDR (MBR_START_ADDR + MBR_SIZE) // SD_FLASH_SIZE is from nrf_sdm.h -#define ISR_FLASH_START_ADDR (SD_FLASH_START_ADDR + SD_FLASH_SIZE) -#define ISR_FLASH_SIZE (0x1000) // 4kiB +#define ISR_START_ADDR (SD_FLASH_START_ADDR + SD_FLASH_SIZE) +#define ISR_SIZE (0x1000) // 4kiB -#define CIRCUITPY_FIRMWARE_START_ADDR (ISR_FLASH_START_ADDR + ISR_FLASH_LENGTH) +#define CIRCUITPY_FIRMWARE_START_ADDR (ISR_START_ADDR + ISR_SIZE) // Define these regions starting down from the bootloader: @@ -92,22 +106,52 @@ #define BOOTLOADER_SETTINGS_START_ADDR (0x000FF000) #define BOOTLOADER_SETTINGS_SIZE (0x1000) // 4kiB -#define FLASH_FATFS_SIZE (256*1024) -#define FLASH_FATFS_START_ADDR (BOOTLOADER_START_ADDR - FLASH_FATFS_SIZE) - -#define CIRCUITPY_INTERNAL_NVM_START_ADDR (FLASH_FATFS_START_ADDR - CIRCUITPY_INTERNAL_NVM_SIZE) +#define CIRCUITPY_INTERNAL_NVM_START_ADDR (BOOTLOADER_START_ADDR - CIRCUITPY_INTERNAL_NVM_SIZE) +// 32kiB for bonding, etc. #define CIRCUITPY_BLE_CONFIG_SIZE (32*1024) #define CIRCUITPY_BLE_CONFIG_START_ADDR (CIRCUITPY_INTERNAL_NVM_START_ADDR - CIRCUITPY_BLE_CONFIG_SIZE) +#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR (CIRCUITPY_BLE_CONFIG_START_ADDR - CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE) + // The firmware space is the space left over between the fixed lower and upper regions. -#define CIRCUITPY_FIRMWARE_SIZE (CIRCUITPY_BLE_CONFIG_START_ADDR - CIRCUITPY_FIRMWARE_START_ADDR) +#define CIRCUITPY_FIRMWARE_SIZE (CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR - CIRCUITPY_FIRMWARE_START_ADDR) + +#if BOOTLOADER_START_ADDR % FLASH_PAGE_SIZE != 0 +#error BOOTLOADER_START_ADDR must be on a flash page boundary. +#endif + +#if CIRCUITPY_INTERNAL_NVM_START_ADDR % FLASH_PAGE_SIZE != 0 +#error CIRCUITPY_INTERNAL_NVM_START_ADDR must be on a flash page boundary. +#endif +#if CIRCUITPY_INTERNAL_NVM_SIZE % FLASH_PAGE_SIZE != 0 +#error CIRCUITPY_INTERNAL_NVM_SIZE must be a multiple of FLASH_PAGE_SIZE. +#endif + +#if CIRCUITPY_BLE_CONFIG_START_ADDR % FLASH_PAGE_SIZE != 0 +#error CIRCUITPY_BLE_CONFIG_SIZE must be on a flash page boundary. +#endif +#if CIRCUITPY_BLE_CONFIG_SIZE % FLASH_PAGE_SIZE != 0 +#error CIRCUITPY_BLE_CONFIG_SIZE must be a multiple of FLASH_PAGE_SIZE. +#endif + +#if CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR % FLASH_PAGE_SIZE != 0 +#error CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE must be on a flash page boundary. +#endif +#if CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE % FLASH_PAGE_SIZE != 0 +#error CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE must be a multiple of FLASH_PAGE_SIZE. +#endif #if CIRCUITPY_FIRMWARE_SIZE < 0 #error No space left in flash for firmware after specifying other regions! #endif -#include "py/circuitpy_mpconfig.h" +#if CIRCUITPY_FIRMWARE_SIZE < 0 +#error No space left in flash for firmware after specifying other regions! +#endif + + + #define MICROPY_PORT_ROOT_POINTERS \ CIRCUITPY_COMMON_ROOT_POINTERS \ diff --git a/ports/nrf/mpconfigport.mk b/ports/nrf/mpconfigport.mk index 47cabffb5e..9b738d4b3a 100644 --- a/ports/nrf/mpconfigport.mk +++ b/ports/nrf/mpconfigport.mk @@ -53,7 +53,7 @@ CIRCUITPY_FREQUENCYIO = 0 # nRF52840-specific -ifeq($(MCU_CHIP),nrf52840) +ifeq ($(MCU_CHIP),nrf52840) MCU_SERIES = m4 MCU_VARIANT = nrf52 MCU_SUB_VARIANT = nrf52840 diff --git a/ports/nrf/supervisor/internal_flash.c b/ports/nrf/supervisor/internal_flash.c index c43454eb39..07aa5079f4 100644 --- a/ports/nrf/supervisor/internal_flash.c +++ b/ports/nrf/supervisor/internal_flash.c @@ -42,10 +42,6 @@ #include "nrf_sdm.h" #endif -// defined in linker -extern uint32_t __fatfs_flash_start_addr[]; -extern uint32_t __fatfs_flash_length[]; - #define NO_CACHE 0xffffffff uint8_t _flash_cache[FLASH_PAGE_SIZE] __attribute__((aligned(4))); @@ -56,7 +52,7 @@ uint32_t _flash_page_addr = NO_CACHE; /* Internal Flash API *------------------------------------------------------------------*/ static inline uint32_t lba2addr(uint32_t block) { - return ((uint32_t)__fatfs_flash_start_addr) + block * FILESYSTEM_BLOCK_SIZE; + return CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR + block * FILESYSTEM_BLOCK_SIZE; } void supervisor_flash_init(void) { @@ -67,7 +63,7 @@ uint32_t supervisor_flash_get_block_size(void) { } uint32_t supervisor_flash_get_block_count(void) { - return ((uint32_t) __fatfs_flash_length) / FILESYSTEM_BLOCK_SIZE ; + return CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE / FILESYSTEM_BLOCK_SIZE ; } void supervisor_flash_flush(void) { diff --git a/py/circuitpy_defns.mk b/py/circuitpy_defns.mk index 34c097e36b..265b552bb1 100644 --- a/py/circuitpy_defns.mk +++ b/py/circuitpy_defns.mk @@ -402,6 +402,18 @@ $(addprefix lib/,\ ) endif +ifdef LD_TEMPLATE_FILE +# Generate a linker script (.ld file) from a template, for those builds that use it. +GENERATED_LD_FILE = $(BUILD)/$(notdir $(patsubst %.template.ld,%.ld,$(LD_TEMPLATE_FILE))) +# +# ld_defines.pp is generated from ld_defines.c. See py/mkrules.mk. +# Run gen_ld_files.py over ALL *.template.ld files, not just LD_TEMPLATE_FILE, +# because it may include other template files. +$(GENERATED_LD_FILE): $(BUILD)/ld_defines.pp boards/*.template.ld + $(STEPECHO) "GEN $@" + $(Q)$(PYTHON3) $(TOP)/tools/gen_ld_files.py --defines $< --out_dir $(BUILD) boards/*.template.ld +endif + .PHONY: check-release-needs-clean-build check-release-needs-clean-build: diff --git a/supervisor/supervisor.mk b/supervisor/supervisor.mk index 87d506b3b8..96a14c25b4 100644 --- a/supervisor/supervisor.mk +++ b/supervisor/supervisor.mk @@ -25,14 +25,12 @@ CFLAGS += -DINTERNAL_FLASH_FILESYSTEM=$(INTERNAL_FLASH_FILESYSTEM) ifndef QSPI_FLASH_FILESYSTEM QSPI_FLASH_FILESYSTEM = 0 endif -# EXPRESS_BOARD is obsolete and should be removed when samd-peripherals is updated. -CFLAGS += -DQSPI_FLASH_FILESYSTEM=$(QSPI_FLASH_FILESYSTEM) -DEXPRESS_BOARD +CFLAGS += -DQSPI_FLASH_FILESYSTEM=$(QSPI_FLASH_FILESYSTEM) ifndef SPI_FLASH_FILESYSTEM SPI_FLASH_FILESYSTEM = 0 endif -# EXPRESS_BOARD is obsolete and should be removed when samd-peripherals is updated. -CFLAGS += -DSPI_FLASH_FILESYSTEM=$(SPI_FLASH_FILESYSTEM) -DEXPRESS_BOARD +CFLAGS += -DSPI_FLASH_FILESYSTEM=$(SPI_FLASH_FILESYSTEM) ifeq ($(CIRCUITPY_BLEIO),1) SRC_SUPERVISOR += supervisor/shared/bluetooth.c diff --git a/tools/build_memory_info.py b/tools/build_memory_info.py index f128561ab2..afe49650e2 100644 --- a/tools/build_memory_info.py +++ b/tools/build_memory_info.py @@ -41,7 +41,8 @@ data = 0 bss = 0 # stdin is the linker output. for line in sys.stdin: - print(line) + # Uncomment to see linker output. + # print(line) line = line.strip() if not line.startswith("text"): text, data, bss = map(int, line.split()[:3]) @@ -51,7 +52,7 @@ regions = {} with open(sys.argv[1], "r") as f: for line in f: line = line.strip() - if line.startswith(("FLASH_FIRMWARE", "RAM")): + if line.startswith(("FLASH_FIRMWARE", "FLASH", "RAM")): regions[line.split()[0]] = line.split("=")[-1] for region in regions: @@ -62,10 +63,17 @@ for region in regions: space = M_PATTERN.sub(M_REPLACE, space) regions[region] = eval(space) -free_flash = regions["FLASH_FIRMWARE"] - text - data -free_ram = regions["RAM"] - data - bss -print("{} bytes free in flash firmware space out of {} bytes ({}kB).".format(free_flash, regions["FLASH_FIRMWARE"], regions["FLASH_FIRMWARE"] / 1024)) -print("{} bytes free in ram for heap out of {} bytes ({}kB).".format(free_ram, regions["RAM"], regions["RAM"] / 1024)) +# TODO Remove check for both FLASH_FIRMWARE and FLASH after all ports are converted to use FLASH_FIRMWARE. +try: + firmware_region = regions["FLASH_FIRMWARE"] +except KeyError: + firmware_region = regions["FLASH"] +ram_region = regions["RAM"] + +free_flash = firmware_region - text - data +free_ram = ram_region - data - bss +print("{} bytes free in flash firmware space out of {} bytes ({}kB).".format(free_flash, firmware_region, firmware_region / 1024)) +print("{} bytes free in ram for heap out of {} bytes ({}kB).".format(free_ram, ram_region, ram_region / 1024)) print() # Check that we have free flash space. GCC doesn't fail when the text + data From c6221c5956018941804457274e4fbed03de7e403 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 10 Dec 2019 21:08:51 -0500 Subject: [PATCH 21/78] Remove no-longer-used nrf and atmel-samd .ld files --- .../samd21x18-bootloader-crystalless.ld | 13 -- ...8-bootloader-external-flash-crystalless.ld | 13 -- .../samd21x18-bootloader-external-flash.ld | 13 -- .../atmel-samd/boards/samd21x18-bootloader.ld | 14 --- .../boards/samd21x18-external-flash.ld | 13 -- ports/atmel-samd/boards/samd21x18.ld | 13 -- .../samd51x18-bootloader-external-flash.ld | 13 -- .../samd51x19-bootloader-external-flash.ld | 13 -- .../atmel-samd/boards/samd51x19-bootloader.ld | 13 -- .../samd51x20-bootloader-external-flash.ld | 13 -- .../atmel-samd/boards/samd51x20-bootloader.ld | 12 -- .../boards/samd51x20-external-flash.ld | 12 -- ports/atmel-samd/boards/samd51x20.ld | 13 -- ports/nrf/boards/adafruit_nrf52840_s140_v6.ld | 52 -------- ports/nrf/boards/common.ld | 115 ------------------ ports/nrf/boards/nrf52840_1M_256k.ld | 28 ----- .../nrf/boards/nrf52840_1M_256k_s140_6.0.0.ld | 28 ----- 17 files changed, 391 deletions(-) delete mode 100644 ports/atmel-samd/boards/samd21x18-bootloader-crystalless.ld delete mode 100644 ports/atmel-samd/boards/samd21x18-bootloader-external-flash-crystalless.ld delete mode 100644 ports/atmel-samd/boards/samd21x18-bootloader-external-flash.ld delete mode 100644 ports/atmel-samd/boards/samd21x18-bootloader.ld delete mode 100644 ports/atmel-samd/boards/samd21x18-external-flash.ld delete mode 100644 ports/atmel-samd/boards/samd21x18.ld delete mode 100644 ports/atmel-samd/boards/samd51x18-bootloader-external-flash.ld delete mode 100644 ports/atmel-samd/boards/samd51x19-bootloader-external-flash.ld delete mode 100644 ports/atmel-samd/boards/samd51x19-bootloader.ld delete mode 100644 ports/atmel-samd/boards/samd51x20-bootloader-external-flash.ld delete mode 100644 ports/atmel-samd/boards/samd51x20-bootloader.ld delete mode 100644 ports/atmel-samd/boards/samd51x20-external-flash.ld delete mode 100644 ports/atmel-samd/boards/samd51x20.ld delete mode 100644 ports/nrf/boards/adafruit_nrf52840_s140_v6.ld delete mode 100644 ports/nrf/boards/common.ld delete mode 100644 ports/nrf/boards/nrf52840_1M_256k.ld delete mode 100644 ports/nrf/boards/nrf52840_1M_256k_s140_6.0.0.ld diff --git a/ports/atmel-samd/boards/samd21x18-bootloader-crystalless.ld b/ports/atmel-samd/boards/samd21x18-bootloader-crystalless.ld deleted file mode 100644 index 1ee745eb17..0000000000 --- a/ports/atmel-samd/boards/samd21x18-bootloader-crystalless.ld +++ /dev/null @@ -1,13 +0,0 @@ -/* - GNU linker script for SAMD21x18 (256K flash, 32K RAM) -*/ - -/* Specify the memory areas */ -MEMORY -{ - /* Leave 8KiB for the bootloader, 256b for persistent config (clock), 64k for the flash file system and 256b for the user config. */ - FLASH (rx) : ORIGIN = 0x00000000 + 8K, LENGTH = 256K - 8K - 256 - 64K - 256 - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K -} - -INCLUDE "samd21-common.ld" diff --git a/ports/atmel-samd/boards/samd21x18-bootloader-external-flash-crystalless.ld b/ports/atmel-samd/boards/samd21x18-bootloader-external-flash-crystalless.ld deleted file mode 100644 index d8f4cc2365..0000000000 --- a/ports/atmel-samd/boards/samd21x18-bootloader-external-flash-crystalless.ld +++ /dev/null @@ -1,13 +0,0 @@ -/* - GNU linker script for SAMD21x18 (256K flash, 32K RAM) -*/ - -/* Specify the memory areas */ -MEMORY -{ - /* Leave 8KiB for the bootloader, 256b for internal config and 256b for user config. */ - FLASH (rx) : ORIGIN = 0x00000000 + 8K, LENGTH = 256K - 8K - 256 - 256 - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K -} - -INCLUDE "samd21-common.ld" diff --git a/ports/atmel-samd/boards/samd21x18-bootloader-external-flash.ld b/ports/atmel-samd/boards/samd21x18-bootloader-external-flash.ld deleted file mode 100644 index f663326d69..0000000000 --- a/ports/atmel-samd/boards/samd21x18-bootloader-external-flash.ld +++ /dev/null @@ -1,13 +0,0 @@ -/* - GNU linker script for SAMD21x18 (256K flash, 32K RAM) -*/ - -/* Specify the memory areas */ -MEMORY -{ - /* Leave 8KiB for the bootloader and 256b for user config. */ - FLASH (rx) : ORIGIN = 0x00000000 + 8K, LENGTH = 256K - 8K - 256 - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K /* 32 KiB RAM */ -} - -INCLUDE "samd21-common.ld" diff --git a/ports/atmel-samd/boards/samd21x18-bootloader.ld b/ports/atmel-samd/boards/samd21x18-bootloader.ld deleted file mode 100644 index 666ac79c47..0000000000 --- a/ports/atmel-samd/boards/samd21x18-bootloader.ld +++ /dev/null @@ -1,14 +0,0 @@ -/* - GNU linker script for SAMD21x18 (256K flash, 32K RAM) -*/ - -/* Specify the memory areas */ -MEMORY -{ - /* Leave 8KiB for the bootloader, 64k for the flash file system, and 256b - for user config. */ - FLASH (rx) : ORIGIN = 0x00000000 + 8K, LENGTH = 256K - 8K - 64K - 256 - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K -} - -INCLUDE "samd21-common.ld" diff --git a/ports/atmel-samd/boards/samd21x18-external-flash.ld b/ports/atmel-samd/boards/samd21x18-external-flash.ld deleted file mode 100644 index 6afdab7345..0000000000 --- a/ports/atmel-samd/boards/samd21x18-external-flash.ld +++ /dev/null @@ -1,13 +0,0 @@ -/* - GNU linker script for SAMD21x18 (256K flash, 32K RAM) -*/ - -/* Specify the memory areas */ -MEMORY -{ - /* 256 KiB but leave 256b for internal config and 256b for user config (protected eeprom) */ - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 256K - 256 - 256 - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K -} - -INCLUDE "samd21-common.ld" diff --git a/ports/atmel-samd/boards/samd21x18.ld b/ports/atmel-samd/boards/samd21x18.ld deleted file mode 100644 index c035f5117e..0000000000 --- a/ports/atmel-samd/boards/samd21x18.ld +++ /dev/null @@ -1,13 +0,0 @@ -/* - GNU linker script for SAMD21x18 (256K flash, 32K RAM) -*/ - -/* Specify the memory areas */ -MEMORY -{ - /* Leave 256b for internal config, 64k for the flash file system and 256b for user config. */ - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 256K - 256 - 64K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 32K -} - -INCLUDE "samd21-common.ld" diff --git a/ports/atmel-samd/boards/samd51x18-bootloader-external-flash.ld b/ports/atmel-samd/boards/samd51x18-bootloader-external-flash.ld deleted file mode 100644 index b22bef3f3a..0000000000 --- a/ports/atmel-samd/boards/samd51x18-bootloader-external-flash.ld +++ /dev/null @@ -1,13 +0,0 @@ -/* - GNU linker script for SAMD51x18 (256K flash, 128K RAM) -*/ - -/* Specify the memory areas */ -MEMORY -{ - /* Leave 16KiB for the bootloader. 8K for user data*/ - FLASH (rx) : ORIGIN = 0x00000000 + 16K, LENGTH = 256K - 16K - 8K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K -} - -INCLUDE "samd51-common.ld" diff --git a/ports/atmel-samd/boards/samd51x19-bootloader-external-flash.ld b/ports/atmel-samd/boards/samd51x19-bootloader-external-flash.ld deleted file mode 100644 index f1493f2510..0000000000 --- a/ports/atmel-samd/boards/samd51x19-bootloader-external-flash.ld +++ /dev/null @@ -1,13 +0,0 @@ -/* - GNU linker script for SAMD51x19 (512K flash, 192K RAM) -*/ - -/* Specify the memory areas */ -MEMORY -{ - /* Leave 16KiB for the bootloader. 8K for user data*/ - FLASH (rx) : ORIGIN = 0x00000000 + 16K, LENGTH = 512K - 16K - 8K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 192K -} - -INCLUDE "samd51-common.ld" diff --git a/ports/atmel-samd/boards/samd51x19-bootloader.ld b/ports/atmel-samd/boards/samd51x19-bootloader.ld deleted file mode 100644 index c73db2ece9..0000000000 --- a/ports/atmel-samd/boards/samd51x19-bootloader.ld +++ /dev/null @@ -1,13 +0,0 @@ -/* - GNU linker script for SAMD51x19 (512K flash, 192K RAM) -*/ - -/* Specify the memory areas */ -MEMORY -{ - /* Leave 16KiB for the bootloader, 256KiB for the internal file system, and 8KiB for user binary data. */ - FLASH (rx) : ORIGIN = 0x00000000 + 16K, LENGTH = 512K - 16K - 256K - 8K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 192K -} - -INCLUDE "samd51-common.ld" diff --git a/ports/atmel-samd/boards/samd51x20-bootloader-external-flash.ld b/ports/atmel-samd/boards/samd51x20-bootloader-external-flash.ld deleted file mode 100644 index ee28fdf1cc..0000000000 --- a/ports/atmel-samd/boards/samd51x20-bootloader-external-flash.ld +++ /dev/null @@ -1,13 +0,0 @@ -/* - GNU linker script for SAMD51x20 (1MB flash, 256K RAM) -*/ - -/* Specify the memory areas */ -MEMORY -{ - /* Leave 16KiB for the bootloader. */ - FLASH (rx) : ORIGIN = 0x00000000 + 16K, LENGTH = 1M - 16K - 8K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K -} - -INCLUDE "samd51-common.ld" diff --git a/ports/atmel-samd/boards/samd51x20-bootloader.ld b/ports/atmel-samd/boards/samd51x20-bootloader.ld deleted file mode 100644 index ea0e0569f5..0000000000 --- a/ports/atmel-samd/boards/samd51x20-bootloader.ld +++ /dev/null @@ -1,12 +0,0 @@ -/* - GNU linker script for SAMD51x20 (1MB flash, 256K RAM) -*/ - -/* Specify the memory areas */ -MEMORY -{ - /* Leave 16KiB for the bootloader, 512k for the filesystem and 8k for user config data. */ - FLASH (rx) : ORIGIN = 0x00000000 + 16K, LENGTH = 1M - 16K - 512K - 8K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K -} -INCLUDE "samd51-common.ld" diff --git a/ports/atmel-samd/boards/samd51x20-external-flash.ld b/ports/atmel-samd/boards/samd51x20-external-flash.ld deleted file mode 100644 index 5212363fe1..0000000000 --- a/ports/atmel-samd/boards/samd51x20-external-flash.ld +++ /dev/null @@ -1,12 +0,0 @@ -/* - GNU linker script for SAMD51x20 (1MB flash, 256K RAM) -*/ - -/* Specify the memory areas */ -MEMORY -{ - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 1M - 8K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K -} - -INCLUDE "samd51-common.ld" diff --git a/ports/atmel-samd/boards/samd51x20.ld b/ports/atmel-samd/boards/samd51x20.ld deleted file mode 100644 index 1f0b661720..0000000000 --- a/ports/atmel-samd/boards/samd51x20.ld +++ /dev/null @@ -1,13 +0,0 @@ -/* - GNU linker script for SAMD51x20 (1MB flash, 256K RAM) -*/ - -/* Specify the memory areas */ -MEMORY -{ - /* 1024 KiB minus 512KiB for the internal file system and 8KiB for the user nvm. */ - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 1M - 512K - 8K - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 256K -} - -INCLUDE "samd51-common.ld" diff --git a/ports/nrf/boards/adafruit_nrf52840_s140_v6.ld b/ports/nrf/boards/adafruit_nrf52840_s140_v6.ld deleted file mode 100644 index 2d158c4964..0000000000 --- a/ports/nrf/boards/adafruit_nrf52840_s140_v6.ld +++ /dev/null @@ -1,52 +0,0 @@ -/* - GNU linker script for NRF52840 w/S140 6.x.x SoftDevice - - MEMORY MAP - ------------------------------------------------------------------------ - START ADDR END ADDR SIZE DESCRIPTION - ---------- ---------- ------- ----------------------------------------- - 0x000FF000..0x000FFFFF ( 4KB) Bootloader Settings - 0x000FE000..0x000FEFFF ( 4KB) Master Boot Record Params - 0x000F4000..0x000FDFFF ( 40KB) Bootloader (UF2 + CDC + OTA) - - 0x000ED000..0x000F3FFF (28KB ) Private Config Data (Bonding, Keys, etc.) - 0x000AD000..0x000ECFFF (256KB) User Filesystem - 0x00026000..0x000ACFFF (540KB) Application Code (including ISR vector) - 0x00001000..0x00025FFF (148KB) SoftDevice - 0x00000000..0x00000FFF (4KB) Master Boot Record -*/ - - -/* Specify the memory areas (S140 6.x.x) */ -MEMORY -{ - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 1M - - FLASH_ISR (rx) : ORIGIN = 0x00026000, LENGTH = 0x001000 - FLASH_TEXT (rx) : ORIGIN = 0x00027000, LENGTH = 0x086000 - FLASH_FATFS (r) : ORIGIN = 0x000AD000, LENGTH = 0x040000 - FLASH_NVM (r) : ORIGIN = 0x000EC000, LENGTH = 0x001000 - FLASH_CONFIG (r): ORIGIN = 0x000ED000, LENGTH = 0x007000 - - /* 0x2000000 - RAM:ORIGIN is reserved for Softdevice */ - /* SoftDevice 6.1.0 takes 0x1628 bytes (5.54 kb) minimum. */ - /* To measure the minimum required amount of memory for given configuration, set this number - high enough to work and then check the mutation of the value done by sd_ble_enable. */ - RAM (xrw) : ORIGIN = 0x20000000 + 16K, LENGTH = 256K - 16K -} - -/* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 2K; -_minimum_heap_size = 0; - -/* top end of the stack */ - -/*_stack_end = ORIGIN(RAM) + LENGTH(RAM);*/ -_estack = ORIGIN(RAM) + LENGTH(RAM); - -/* RAM extents for the garbage collector and soft device init */ -_ram_start = ORIGIN(RAM); -_ram_end = ORIGIN(RAM) + LENGTH(RAM); -_heap_end = 0x20020000; /* tunable */ - -INCLUDE "boards/common.ld" diff --git a/ports/nrf/boards/common.ld b/ports/nrf/boards/common.ld deleted file mode 100644 index fade4b9e1b..0000000000 --- a/ports/nrf/boards/common.ld +++ /dev/null @@ -1,115 +0,0 @@ -/* Flash region for File System */ -__fatfs_flash_start_addr = ORIGIN(FLASH_FATFS); -__fatfs_flash_length = LENGTH(FLASH_FATFS); - -/* Flash region for configuration information (bonding info, keys, etc.) */ -__config_flash_start_addr = ORIGIN(FLASH_CONFIG); -__config_flash_length = LENGTH(FLASH_CONFIG); - -/* Flash region for microcontroller.nvm region */ -__nvm_flash_start_addr = ORIGIN(FLASH_NVM); -__nvm_flash_length = LENGTH(FLASH_NVM); - -/* define output sections */ -SECTIONS -{ - /* The startup code goes first into FLASH */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - - . = ALIGN(4); - } >FLASH_ISR - - /* The program code and other data goes into FLASH */ - .text : - { - . = ALIGN(4); - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - /* *(.glue_7) */ /* glue arm to thumb code */ - /* *(.glue_7t) */ /* glue thumb to arm code */ - - . = ALIGN(4); - _etext = .; /* define a global symbol at end of code */ - } >FLASH_TEXT - - /* - .ARM.extab : - { - *(.ARM.extab* .gnu.linkonce.armextab.*) - } >FLASH - - .ARM : - { - __exidx_start = .; - *(.ARM.exidx*) - __exidx_end = .; - } >FLASH - */ - - /* used by the startup to initialize data */ - _sidata = .; - - /* This is the initialized data section - The program executes knowing that the data is in the RAM - but the loader puts the initial values in the FLASH (inidata). - It is one task of the startup to copy the initial values from FLASH to RAM. */ - .data : AT (_sidata) - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start; used by startup code in order to initialise the .data section in RAM */ - _ram_start = .; /* create a global symbol at ram start for garbage collector */ - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end; used by startup code in order to initialise the .data section in RAM */ - } >RAM - - /* Uninitialized data section */ - .bss : - { - . = ALIGN(4); - _sbss = .; /* define a global symbol at bss start; used by startup code */ - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end; used by startup code and GC */ - } >RAM - - /* this is to define the start of the heap, and make sure we have a minimum size */ - .heap : - { - . = ALIGN(4); - PROVIDE ( end = . ); - PROVIDE ( _end = . ); - _heap_start = .; /* define a global symbol at heap start */ - . = . + _minimum_heap_size; - } >RAM - - /* this just checks there is enough RAM for the stack */ - .stack : - { - . = ALIGN(4); - . = . + _minimum_stack_size; - . = ALIGN(4); - } >RAM - - /* Remove information from the standard libraries */ - /* - /DISCARD/ : - { - libc.a ( * ) - libm.a ( * ) - libgcc.a ( * ) - } - */ - - .ARM.attributes 0 : { *(.ARM.attributes) } -} diff --git a/ports/nrf/boards/nrf52840_1M_256k.ld b/ports/nrf/boards/nrf52840_1M_256k.ld deleted file mode 100644 index eb8a18aef6..0000000000 --- a/ports/nrf/boards/nrf52840_1M_256k.ld +++ /dev/null @@ -1,28 +0,0 @@ -/* - GNU linker script for NRF52840 blank w/ no SoftDevice -*/ - -/* Specify the memory areas */ -MEMORY -{ - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x100000 /* entire flash, 1 MiB */ - FLASH_ISR (rx) : ORIGIN = 0x00000000, LENGTH = 0x001000 /* sector 0, 4 KiB */ - FLASH_TEXT (rx) : ORIGIN = 0x00001000, LENGTH = 0x0E6000 /* 920 KiB */ - FLASH_FATFS (r) : ORIGIN = 0x000E7000, LENGTH = 0x019000 /* File system 100 KiB */ - RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 0x040000 /* 256 KiB */ -} - -/* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 40K; -_minimum_heap_size = 0; - -/* top end of the stack */ - -/*_stack_end = ORIGIN(RAM) + LENGTH(RAM);*/ -_estack = ORIGIN(RAM) + LENGTH(RAM); - -/* RAM extents for the garbage collector */ -_ram_end = ORIGIN(RAM) + LENGTH(RAM); -_heap_end = 0x20020000; /* tunable */ - -INCLUDE "boards/common.ld" diff --git a/ports/nrf/boards/nrf52840_1M_256k_s140_6.0.0.ld b/ports/nrf/boards/nrf52840_1M_256k_s140_6.0.0.ld deleted file mode 100644 index 90d6c402d0..0000000000 --- a/ports/nrf/boards/nrf52840_1M_256k_s140_6.0.0.ld +++ /dev/null @@ -1,28 +0,0 @@ -/* - GNU linker script for NRF52840 w/ s140 6.0.0 SoftDevice -*/ - -/* Specify the memory areas */ -MEMORY -{ - FLASH (rx) : ORIGIN = 0x00000000, LENGTH = 0x100000 /* entire flash, 1 MiB */ - FLASH_ISR (rx) : ORIGIN = 0x00026000, LENGTH = 0x001000 /* sector 0, 4 KiB */ - FLASH_TEXT (rx) : ORIGIN = 0x00027000, LENGTH = 0x099000 /* 612 KiB */ - FLASH_FATFS (r) : ORIGIN = 0x000C0000, LENGTH = 0x040000 /* File system 256 KiB */ - RAM (xrw) : ORIGIN = 0x20004000, LENGTH = 0x03C000 /* 240 KiB */ -} - -/* produce a link error if there is not this amount of RAM for these sections */ -_minimum_stack_size = 40K; -_minimum_heap_size = 0; - -/* top end of the stack */ - -/*_stack_end = ORIGIN(RAM) + LENGTH(RAM);*/ -_estack = ORIGIN(RAM) + LENGTH(RAM); - -/* RAM extents for the garbage collector */ -_ram_end = ORIGIN(RAM) + LENGTH(RAM); -_heap_end = 0x20020000; /* tunable */ - -INCLUDE "boards/common.ld" From d9ca4c9a608c08585e37eba88f86a1d89e1335e4 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 10 Dec 2019 22:39:44 -0500 Subject: [PATCH 22/78] fix build failures --- .../boards/kicksat-sprite/mpconfigboard.h | 2 - .../boards/kicksat-sprite/mpconfigboard.mk | 1 - ports/atmel-samd/mpconfigport.h | 64 ++++++++++++------- .../electronut_labs_papyr/mpconfigboard.mk | 2 +- .../mpconfigboard.mk | 2 +- ports/nrf/mpconfigport.h | 4 -- tools/build_memory_info.py | 2 +- 7 files changed, 44 insertions(+), 33 deletions(-) diff --git a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h index 6664524d24..4d911ad64c 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h +++ b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.h @@ -10,8 +10,6 @@ #define MICROPY_PORT_C (0) #define MICROPY_PORT_D (0) -#define CALIBRATE_CRYSTALLESS 1 - #define CIRCUITPY_INTERNAL_NVM_SIZE 0 #define DEFAULT_I2C_BUS_SCL (&pin_PA17) diff --git a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk index b89469776b..df1a2d8eb3 100644 --- a/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk +++ b/ports/atmel-samd/boards/kicksat-sprite/mpconfigboard.mk @@ -6,7 +6,6 @@ USB_MANUFACTURER = "maholli" CHIP_VARIANT = SAMD51G19A CHIP_FAMILY = samd51 -QSPI_FLASH_FILESYSTEM = 0 INTERNAL_FLASH_FILESYSTEM = 1 LONGINT_IMPL = MPZ diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h index 6ab95c8a5a..a319c6199a 100644 --- a/ports/atmel-samd/mpconfigport.h +++ b/ports/atmel-samd/mpconfigport.h @@ -30,15 +30,11 @@ // Definitions for which SAMD chip we're using. #include "include/sam.h" +// Definitions that control circuitpy_mpconfig.h: //////////////////////////////////////////////////////////////////////////////////////////////////// -#ifdef SAMD21 -#if INTERNAL_FLASH_FILESYSTEM -#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (64*1024) -#else -#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (0) -#endif +#ifdef SAMD21 // HMCRAMC0_SIZE is defined in the ASF4 include files for each SAMD21 chip. #define RAM_SIZE HMCRAMC0_SIZE @@ -66,29 +62,12 @@ X(EISDIR) \ X(EINVAL) \ -#ifndef CIRCUITPY_INTERNAL_NVM_SIZE -#define CIRCUITPY_INTERNAL_NVM_SIZE (256) -#endif - #endif // SAMD21 //////////////////////////////////////////////////////////////////////////////////////////////////// #ifdef SAMD51 -#ifndef CIRCUITPY_INTERNAL_NVM_SIZE -#define CIRCUITPY_INTERNAL_NVM_SIZE (8192) -#endif - -// If CIRCUITPY is internal, use half of flash for it. -#if INTERNAL_FLASH_FILESYSTEM - #ifndef CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE - #define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (FLASH_SIZE/2) - #endif -#else - #define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (0) -#endif - // HSRAM_SIZE is defined in the ASF4 include files for each SAMD51 chip. #define RAM_SIZE HSRAM_SIZE #define BOOTLOADER_SIZE (16*1024) @@ -113,6 +92,45 @@ // This also includes mpconfigboard.h. #include "py/circuitpy_mpconfig.h" +// Definitions that can be overridden by mpconfigboard.h: + +//////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifdef SAMD21 + +#if INTERNAL_FLASH_FILESYSTEM +#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (64*1024) +#else +#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (0) +#endif + +#ifndef CIRCUITPY_INTERNAL_NVM_SIZE +#define CIRCUITPY_INTERNAL_NVM_SIZE (256) +#endif + +#endif // SAMD21 + +//////////////////////////////////////////////////////////////////////////////////////////////////// + +#ifdef SAMD51 + +#ifndef CIRCUITPY_INTERNAL_NVM_SIZE +#define CIRCUITPY_INTERNAL_NVM_SIZE (8192) +#endif + +// If CIRCUITPY is internal, use half of flash for it. +#if INTERNAL_FLASH_FILESYSTEM + #ifndef CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE + #define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (FLASH_SIZE/2) + #endif +#else + #define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE (0) +#endif + +#endif // SAMD51 + +//////////////////////////////////////////////////////////////////////////////////////////////////// + #ifndef CALIBRATE_CRYSTALLESS #define CALIBRATE_CRYSTALLESS (0) #endif diff --git a/ports/nrf/boards/electronut_labs_papyr/mpconfigboard.mk b/ports/nrf/boards/electronut_labs_papyr/mpconfigboard.mk index be7175e4ea..569dccc9c4 100644 --- a/ports/nrf/boards/electronut_labs_papyr/mpconfigboard.mk +++ b/ports/nrf/boards/electronut_labs_papyr/mpconfigboard.mk @@ -5,4 +5,4 @@ USB_MANUFACTURER = "Electronut Labs" MCU_CHIP = nrf52840 -INTERNAL_FLASH_FILEYSTEM = 1 +INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.mk b/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.mk index 0a29c54e55..55ca410d9f 100644 --- a/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.mk +++ b/ports/nrf/boards/makerdiary_nrf52840_mdk_usb_dongle/mpconfigboard.mk @@ -5,4 +5,4 @@ USB_MANUFACTURER = "makerdiary" MCU_CHIP = nrf52840 -INTERNAL_FLASH_FILEYSTEM = 1 +INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/nrf/mpconfigport.h b/ports/nrf/mpconfigport.h index d10f12f6a7..c6d148234b 100644 --- a/ports/nrf/mpconfigport.h +++ b/ports/nrf/mpconfigport.h @@ -146,10 +146,6 @@ #error No space left in flash for firmware after specifying other regions! #endif -#if CIRCUITPY_FIRMWARE_SIZE < 0 -#error No space left in flash for firmware after specifying other regions! -#endif - diff --git a/tools/build_memory_info.py b/tools/build_memory_info.py index afe49650e2..f61b843ced 100644 --- a/tools/build_memory_info.py +++ b/tools/build_memory_info.py @@ -61,7 +61,7 @@ for region in regions: space = space.split("/*")[0] space = K_PATTERN.sub(K_REPLACE, space) space = M_PATTERN.sub(M_REPLACE, space) - regions[region] = eval(space) + regions[region] = int(eval(space)) # TODO Remove check for both FLASH_FIRMWARE and FLASH after all ports are converted to use FLASH_FIRMWARE. try: From 1e11f2708b345468ae9b1762339bf3511c8ab7eb Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 11 Dec 2019 09:34:56 -0500 Subject: [PATCH 23/78] remove debugging leftovers --- ports/nrf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index 4bb72324fb..e6070fc329 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -90,7 +90,7 @@ INC += -I../../supervisor/shared/usb ifeq ($(DEBUG), 1) CFLAGS += -ggdb3 -Og else - CFLAGS += -Os -DNDEBUG -ggdb3 + CFLAGS += -Os -DNDEBUG CFLAGS += -flto -flto-partition=none endif From 006d85d5c2c50c694df4b0eda1fab6f93d073b9f Mon Sep 17 00:00:00 2001 From: JoeBakalor Date: Wed, 11 Dec 2019 14:49:59 -0500 Subject: [PATCH 24/78] add make file and board configuration, add accelerometer pin mappings --- .../boards/teknikio_bluebird/mpconfigboard.h | 46 +++---------- .../boards/teknikio_bluebird/mpconfigboard.mk | 34 ++++++++-- ports/nrf/boards/teknikio_bluebird/pins.c | 68 ++----------------- 3 files changed, 44 insertions(+), 104 deletions(-) diff --git a/ports/nrf/boards/teknikio_bluebird/mpconfigboard.h b/ports/nrf/boards/teknikio_bluebird/mpconfigboard.h index 348028c0f7..2b8707ad08 100644 --- a/ports/nrf/boards/teknikio_bluebird/mpconfigboard.h +++ b/ports/nrf/boards/teknikio_bluebird/mpconfigboard.h @@ -27,48 +27,24 @@ //https://github.com/Teknikio/TKInventionBuilderFramework + #include "nrfx/hal/nrf_gpio.h" -#define MICROPY_HW_BOARD_NAME "Adafruit Circuit Playground Bluefruit" +#define MICROPY_HW_BOARD_NAME "Teknikio Bluebird" #define MICROPY_HW_MCU_NAME "nRF52840" -#define MICROPY_PY_SYS_PLATFORM "CircuitPlaygroundBluefruit" - -#define FLASH_SIZE (0x100000) -#define FLASH_PAGE_SIZE (4096) - -#define MICROPY_HW_LED_STATUS (&pin_P1_14) - -// Unusually, board does not have a 32 kHz xtal. Nearly all boards do. -#define BOARD_HAS_32KHZ_XTAL (0) - -#if QSPI_FLASH_FILESYSTEM -#define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(0, 21) -#define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(0, 23) -#define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(1, 00) -#define MICROPY_QSPI_DATA3 NRF_GPIO_PIN_MAP(0, 22) -#define MICROPY_QSPI_SCK NRF_GPIO_PIN_MAP(0, 19) -#define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(0, 15) -#endif - -#if SPI_FLASH_FILESYSTEM -#define SPI_FLASH_MOSI_PIN &pin_P0_21 -#define SPI_FLASH_MISO_PIN &pin_P0_23 -#define SPI_FLASH_SCK_PIN &pin_P0_19 -#define SPI_FLASH_CS_PIN &pin_P0_15 -#endif #define CIRCUITPY_AUTORELOAD_DELAY_MS 500 -#define CIRCUITPY_INTERNAL_NVM_SIZE (4096) +#define MICROPY_HW_NEOPIXEL (&pin_P0_26) -#define BOARD_FLASH_SIZE (FLASH_SIZE - 0x4000 - CIRCUITPY_INTERNAL_NVM_SIZE) +#define DEFAULT_I2C_BUS_SCL (&pin_P0_27) +#define DEFAULT_I2C_BUS_SDA (&pin_P0_26) -#define DEFAULT_I2C_BUS_SCL (&pin_P0_04) -#define DEFAULT_I2C_BUS_SDA (&pin_P0_05) +#define DEFAULT_SPI_BUS_SCK (&pin_P1_15) +#define DEFAULT_SPI_BUS_MOSI (&pin_P1_13) +#define DEFAULT_SPI_BUS_MISO (&pin_P1_14) -#define DEFAULT_SPI_BUS_SCK (&pin_P0_05) -#define DEFAULT_SPI_BUS_MOSI (&pin_P1_03) -#define DEFAULT_SPI_BUS_MISO (&pin_P0_29) +#define DEFAULT_UART_BUS_RX (&pin_P1_07) +#define DEFAULT_UART_BUS_TX (&pin_P1_08) -#define DEFAULT_UART_BUS_RX (&pin_P0_30) -#define DEFAULT_UART_BUS_TX (&pin_P0_14) +#define BOARD_HAS_CRYSTAL 1 // according to the schematic we do \ No newline at end of file diff --git a/ports/nrf/boards/teknikio_bluebird/mpconfigboard.mk b/ports/nrf/boards/teknikio_bluebird/mpconfigboard.mk index dbb32629c6..833a6faa82 100644 --- a/ports/nrf/boards/teknikio_bluebird/mpconfigboard.mk +++ b/ports/nrf/boards/teknikio_bluebird/mpconfigboard.mk @@ -1,7 +1,7 @@ USB_VID = 0x239A USB_PID = 0x8046 -USB_PRODUCT = "Circuit Playground Bluefruit" -USB_MANUFACTURER = "Adafruit Industries LLC" +USB_PRODUCT = "Bluebird" +USB_MANUFACTURER = "Teknikio" MCU_SERIES = m4 MCU_VARIANT = nrf52 @@ -21,6 +21,30 @@ endif NRF_DEFINES += -DNRF52840_XXAA -DNRF52840 -QSPI_FLASH_FILESYSTEM = 1 -EXTERNAL_FLASH_DEVICE_COUNT = 1 -EXTERNAL_FLASH_DEVICES = "GD25Q16C" +INTERNAL_FLASH_FILESYSTEM = 1 + + +USB_VID = 0x239A +USB_PID = 0x802A +USB_PRODUCT = "PCA10059" +USB_MANUFACTURER = "Nordic Semiconductor" + +MCU_SERIES = m4 +MCU_VARIANT = nrf52 +MCU_SUB_VARIANT = nrf52840 +MCU_CHIP = nrf52840 +SD ?= s140 +SOFTDEV_VERSION ?= 6.1.0 + +BOOT_SETTING_ADDR = 0xFF000 +BOOT_FILE = boards/$(BOARD)/bootloader/$(SOFTDEV_VERSION)/$(BOARD)_bootloader_$(SOFTDEV_VERSION)_s140 + +ifeq ($(SD),) + LD_FILE = boards/nrf52840_1M_256k.ld +else + LD_FILE = boards/adafruit_$(MCU_SUB_VARIANT)_$(SD_LOWER)_v$(firstword $(subst ., ,$(SOFTDEV_VERSION))).ld + CIRCUITPY_BLEIO = 1 +endif + +NRF_DEFINES += -DNRF52840_XXAA -DNRF52840 + diff --git a/ports/nrf/boards/teknikio_bluebird/pins.c b/ports/nrf/boards/teknikio_bluebird/pins.c index e8e5f4110d..b41d9c2fce 100644 --- a/ports/nrf/boards/teknikio_bluebird/pins.c +++ b/ports/nrf/boards/teknikio_bluebird/pins.c @@ -1,71 +1,11 @@ #include "shared-bindings/board/__init__.h" STATIC const mp_rom_map_elem_t board_module_globals_table[] = { - { MP_ROM_QSTR(MP_QSTR_AUDIO), MP_ROM_PTR(&pin_P0_26) }, - { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_P0_26) }, - { MP_ROM_QSTR(MP_QSTR_SPEAKER), MP_ROM_PTR(&pin_P0_26) }, - { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_P0_02) }, - { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_P0_02) }, - { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_P0_02) }, - { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_P0_29) }, - { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_P0_29) }, - { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_P0_29) }, - - { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_P0_03) }, - { MP_ROM_QSTR(MP_QSTR_D10), MP_ROM_PTR(&pin_P0_03) }, - { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_P0_03) }, - - { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_P0_04) }, - { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_P0_04) }, - { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_04) }, - - { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_P0_05) }, - { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_P0_05) }, - { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_05) }, - - { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_P0_30) }, - { MP_ROM_QSTR(MP_QSTR_D0), MP_ROM_PTR(&pin_P0_30) }, - { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_P0_30) }, - - // This cannot be A7, as it is on CPX. We don't have enough analog inputs. - { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_P0_14) }, - { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_P0_14) }, - - { MP_ROM_QSTR(MP_QSTR_LIGHT), MP_ROM_PTR(&pin_P0_28) }, - { MP_ROM_QSTR(MP_QSTR_A8), MP_ROM_PTR(&pin_P0_28) }, - - { MP_ROM_QSTR(MP_QSTR_TEMPERATURE), MP_ROM_PTR(&pin_P0_31) }, - { MP_ROM_QSTR(MP_QSTR_A9), MP_ROM_PTR(&pin_P0_31) }, - - { MP_ROM_QSTR(MP_QSTR_BUTTON_A), MP_ROM_PTR(&pin_P1_02) }, - { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_P1_02) }, - - { MP_ROM_QSTR(MP_QSTR_BUTTON_B), MP_ROM_PTR(&pin_P1_15) }, - { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_P1_15) }, - - { MP_ROM_QSTR(MP_QSTR_SLIDE_SWITCH), MP_ROM_PTR(&pin_P1_06) }, - { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_P1_06) }, - - { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_P1_14) }, - { MP_ROM_QSTR(MP_QSTR_L), MP_ROM_PTR(&pin_P1_14) }, - - { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_P0_13) }, - { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_P0_13) }, - - { MP_ROM_QSTR(MP_QSTR_MICROPHONE_CLOCK), MP_ROM_PTR(&pin_P0_17) }, - { MP_ROM_QSTR(MP_QSTR_MICROPHONE_DATA), MP_ROM_PTR(&pin_P0_16) }, - - { MP_ROM_QSTR(MP_QSTR_ACCELEROMETER_INTERRUPT), MP_ROM_PTR(&pin_P1_13) }, - { MP_ROM_QSTR(MP_QSTR_ACCELEROMETER_SDA), MP_ROM_PTR(&pin_P1_10) }, - { MP_ROM_QSTR(MP_QSTR_ACCELEROMETER_SCL), MP_ROM_PTR(&pin_P1_12) }, - - { MP_ROM_QSTR(MP_QSTR_SPEAKER_ENABLE), MP_ROM_PTR(&pin_P1_04) }, - - { MP_ROM_QSTR(MP_QSTR_I2C), MP_ROM_PTR(&board_i2c_obj) }, - { MP_ROM_QSTR(MP_QSTR_SPI), MP_ROM_PTR(&board_spi_obj) }, - { MP_ROM_QSTR(MP_QSTR_UART), MP_ROM_PTR(&board_uart_obj) }, + { MP_ROM_QSTR(MP_QSTR_ACCELEROMETER_INTERRUPT), MP_ROM_PTR(&pin_P1_10) }, + { MP_ROM_QSTR(MP_QSTR_ACCELEROMETER_SDA), MP_ROM_PTR(&pin_P1_12) }, + { MP_ROM_QSTR(MP_QSTR_ACCELEROMETER_SCL), MP_ROM_PTR(&pin_P1_11) }, }; -MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); +MP_DEFINE_CONST_DICT(board_module_globals, board_module_globals_table); \ No newline at end of file From a273a7c55e5396d231ed663497c93694febc5812 Mon Sep 17 00:00:00 2001 From: JoeBakalor Date: Wed, 11 Dec 2019 15:23:16 -0500 Subject: [PATCH 25/78] add remaining peripheral pin maps and digital/analog pin definitions --- ports/nrf/boards/teknikio_bluebird/pins.c | 51 +++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/ports/nrf/boards/teknikio_bluebird/pins.c b/ports/nrf/boards/teknikio_bluebird/pins.c index b41d9c2fce..a90dc7daa2 100644 --- a/ports/nrf/boards/teknikio_bluebird/pins.c +++ b/ports/nrf/boards/teknikio_bluebird/pins.c @@ -2,6 +2,57 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + { MP_ROM_QSTR(MP_QSTR_P0_12), MP_ROM_PTR(&pin_P0_12) }, + { MP_ROM_QSTR(MP_QSTR_D9), MP_ROM_PTR(&pin_P0_12) }, + + { MP_ROM_QSTR(MP_QSTR_P0_11), MP_ROM_PTR(&pin_P0_11) }, + { MP_ROM_QSTR(MP_QSTR_D14), MP_ROM_PTR(&pin_P0_11) }, + + { MP_ROM_QSTR(MP_QSTR_P1_09), MP_ROM_PTR(&pin_P1_09) }, + { MP_ROM_QSTR(MP_QSTR_D8), MP_ROM_PTR(&pin_P1_09) }, + + { MP_ROM_QSTR(MP_QSTR_P1_08), MP_ROM_PTR(&pin_P1_08) }, + { MP_ROM_QSTR(MP_QSTR_D13), MP_ROM_PTR(&pin_P1_08) }, + + { MP_ROM_QSTR(MP_QSTR_P0_08), MP_ROM_PTR(&pin_P0_08) }, + { MP_ROM_QSTR(MP_QSTR_D12), MP_ROM_PTR(&pin_P0_08) }, + + { MP_ROM_QSTR(MP_QSTR_P0_07), MP_ROM_PTR(&pin_P0_07) }, + { MP_ROM_QSTR(MP_QSTR_D11), MP_ROM_PTR(&pin_P0_07) }, + + { MP_ROM_QSTR(MP_QSTR_P0_06), MP_ROM_PTR(&pin_P0_06) }, + { MP_ROM_QSTR(MP_QSTR_D7), MP_ROM_PTR(&pin_P0_06) }, + + { MP_ROM_QSTR(MP_QSTR_P0_05), MP_ROM_PTR(&pin_P0_05) }, + { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_P0_05) }, + { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_P0_05) }, + + { MP_ROM_QSTR(MP_QSTR_P0_04), MP_ROM_PTR(&pin_P0_04) }, + { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_P0_04) }, + { MP_ROM_QSTR(MP_QSTR_A6), MP_ROM_PTR(&pin_P0_04) }, + + { MP_ROM_QSTR(MP_QSTR_P0_29), MP_ROM_PTR(&pin_P0_29) }, + { MP_ROM_QSTR(MP_QSTR_A1), MP_ROM_PTR(&pin_P0_29) }, + { MP_ROM_QSTR(MP_QSTR_D1), MP_ROM_PTR(&pin_P0_29) }, + + { MP_ROM_QSTR(MP_QSTR_P0_31), MP_ROM_PTR(&pin_P0_31) }, + { MP_ROM_QSTR(MP_QSTR_A2), MP_ROM_PTR(&pin_P0_31) }, + { MP_ROM_QSTR(MP_QSTR_D2), MP_ROM_PTR(&pin_P0_31) }, + + { MP_ROM_QSTR(MP_QSTR_P0_02), MP_ROM_PTR(&pin_P0_02) }, + { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_P0_02) }, + { MP_ROM_QSTR(MP_QSTR_D3), MP_ROM_PTR(&pin_P0_02) }, + + { MP_ROM_QSTR(MP_QSTR_P0_03), MP_ROM_PTR(&pin_P0_03) }, + { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_P0_03) }, + { MP_ROM_QSTR(MP_QSTR_D4), MP_ROM_PTR(&pin_P0_03) }, + + { MP_ROM_QSTR(MP_QSTR_NEOPIXEL), MP_ROM_PTR(&pin_P0_26) }, + + { MP_ROM_QSTR(MP_QSTR_LIGHT), MP_ROM_PTR(&pin_P0_28) }, + { MP_ROM_QSTR(MP_QSTR_LIGHT_ENABLE), MP_ROM_PTR(&pin_P0_30) }, + + { MP_ROM_QSTR(MP_QSTR_SPEAKER), MP_ROM_PTR(&pin_P1_15) }, { MP_ROM_QSTR(MP_QSTR_ACCELEROMETER_INTERRUPT), MP_ROM_PTR(&pin_P1_10) }, { MP_ROM_QSTR(MP_QSTR_ACCELEROMETER_SDA), MP_ROM_PTR(&pin_P1_12) }, From 0da5dceccfbbb1b339309ea5bef192b31cb70061 Mon Sep 17 00:00:00 2001 From: JoeBakalor Date: Wed, 11 Dec 2019 15:25:16 -0500 Subject: [PATCH 26/78] update bluebird makefile --- .../boards/teknikio_bluebird/mpconfigboard.mk | 27 +------------------ 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/ports/nrf/boards/teknikio_bluebird/mpconfigboard.mk b/ports/nrf/boards/teknikio_bluebird/mpconfigboard.mk index 833a6faa82..c2b8b7605a 100644 --- a/ports/nrf/boards/teknikio_bluebird/mpconfigboard.mk +++ b/ports/nrf/boards/teknikio_bluebird/mpconfigboard.mk @@ -1,5 +1,5 @@ USB_VID = 0x239A -USB_PID = 0x8046 +USB_PID = 0x802A USB_PRODUCT = "Bluebird" USB_MANUFACTURER = "Teknikio" @@ -23,28 +23,3 @@ NRF_DEFINES += -DNRF52840_XXAA -DNRF52840 INTERNAL_FLASH_FILESYSTEM = 1 - -USB_VID = 0x239A -USB_PID = 0x802A -USB_PRODUCT = "PCA10059" -USB_MANUFACTURER = "Nordic Semiconductor" - -MCU_SERIES = m4 -MCU_VARIANT = nrf52 -MCU_SUB_VARIANT = nrf52840 -MCU_CHIP = nrf52840 -SD ?= s140 -SOFTDEV_VERSION ?= 6.1.0 - -BOOT_SETTING_ADDR = 0xFF000 -BOOT_FILE = boards/$(BOARD)/bootloader/$(SOFTDEV_VERSION)/$(BOARD)_bootloader_$(SOFTDEV_VERSION)_s140 - -ifeq ($(SD),) - LD_FILE = boards/nrf52840_1M_256k.ld -else - LD_FILE = boards/adafruit_$(MCU_SUB_VARIANT)_$(SD_LOWER)_v$(firstword $(subst ., ,$(SOFTDEV_VERSION))).ld - CIRCUITPY_BLEIO = 1 -endif - -NRF_DEFINES += -DNRF52840_XXAA -DNRF52840 - From ae64a669ddd47c5e5ed01b6f94f8c206f1f65cf6 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Wed, 11 Dec 2019 15:43:06 -0500 Subject: [PATCH 27/78] address review comments --- .../common-hal/frequencyio/FrequencyIn.c | 22 +++++++++---------- ports/nrf/README.md | 12 ++-------- ports/nrf/common-hal/_bleio/Adapter.c | 2 +- ports/nrf/mpconfigport.h | 5 ++--- .../stm32f412zg_discovery/mpconfigboard.h | 2 +- 5 files changed, 17 insertions(+), 26 deletions(-) diff --git a/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c b/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c index 6258818c83..cbb0671045 100644 --- a/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c +++ b/ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c @@ -213,17 +213,17 @@ void frequencyin_samd51_start_dpll() { // Will also enable the Lock Bypass due to low-frequency sources causing DPLL unlocks // as outlined in the Errata (1.12.1) OSCCTRL->Dpll[1].DPLLRATIO.reg = OSCCTRL_DPLLRATIO_LDRFRAC(0) | OSCCTRL_DPLLRATIO_LDR(2999); - if (BOARD_HAS_CRYSTAL) { // we can use XOSC32K directly as the source - OSC32KCTRL->XOSC32K.bit.EN32K = 1; - OSCCTRL->Dpll[1].DPLLCTRLB.reg = OSCCTRL_DPLLCTRLB_REFCLK(1) | - OSCCTRL_DPLLCTRLB_LBYPASS; - } else { - // can't use OSCULP32K directly; need to setup a GCLK as a reference, - // which must be done in samd/clocks.c to avoid waiting for sync - return; - //OSC32KCTRL->OSCULP32K.bit.EN32K = 1; - //OSCCTRL->Dpll[1].DPLLCTRLB.reg = OSCCTRL_DPLLCTRLB_REFCLK(0); - } +#if BOARD_HAS_CRYSTAL + // we can use XOSC32K directly as the source + OSC32KCTRL->XOSC32K.bit.EN32K = 1; + OSCCTRL->Dpll[1].DPLLCTRLB.reg = OSCCTRL_DPLLCTRLB_REFCLK(1) | OSCCTRL_DPLLCTRLB_LBYPASS; +#else + // can't use OSCULP32K directly; need to setup a GCLK as a reference, + // which must be done in samd/clocks.c to avoid waiting for sync + return; + //OSC32KCTRL->OSCULP32K.bit.EN32K = 1; + //OSCCTRL->Dpll[1].DPLLCTRLB.reg = OSCCTRL_DPLLCTRLB_REFCLK(0); +#endif OSCCTRL->Dpll[1].DPLLCTRLA.reg = OSCCTRL_DPLLCTRLA_ENABLE; while (!(OSCCTRL->Dpll[1].DPLLSTATUS.bit.LOCK || OSCCTRL->Dpll[1].DPLLSTATUS.bit.CLKRDY)) {} diff --git a/ports/nrf/README.md b/ports/nrf/README.md index 64f5b8aff5..88dd472738 100644 --- a/ports/nrf/README.md +++ b/ports/nrf/README.md @@ -5,21 +5,13 @@ This is a port of CircuitPython to the Nordic Semiconductor nRF52 series of chip > **NOTE**: There are board-specific READMEs that may be more up to date than the generic board-neutral documentation below. -## Compile and Flash - -Prerequisite steps for building the nrf port: - - git clone .git circuitpython - cd circuitpython - git submodule update --init --recursive - make -C mpy-cross +## Flash Some boards have UF2 bootloaders and can simply be flashed in the normal way, by copying firmware.uf2 to the BOOT drive. -To build and flash issue the following command inside the ports/nrf/ folder: +For some boards, you can use the `flash` target: - make BOARD=pca10056 make BOARD=pca10056 flash ## Segger Targets diff --git a/ports/nrf/common-hal/_bleio/Adapter.c b/ports/nrf/common-hal/_bleio/Adapter.c index 1c9f1fcfaf..cee40a5a0c 100644 --- a/ports/nrf/common-hal/_bleio/Adapter.c +++ b/ports/nrf/common-hal/_bleio/Adapter.c @@ -59,8 +59,8 @@ const nvm_bytearray_obj_t common_hal_bleio_nvm_obj = { .base = { .type = &nvm_bytearray_type, }, - .len = CIRCUITPY_BLE_CONFIG_SIZE, .start_address = (uint8_t*) CIRCUITPY_BLE_CONFIG_START_ADDR, + .len = CIRCUITPY_BLE_CONFIG_SIZE, }; STATIC void softdevice_assert_handler(uint32_t id, uint32_t pc, uint32_t info) { diff --git a/ports/nrf/mpconfigport.h b/ports/nrf/mpconfigport.h index c6d148234b..71bf6bc8f0 100644 --- a/ports/nrf/mpconfigport.h +++ b/ports/nrf/mpconfigport.h @@ -81,12 +81,10 @@ // firmware // internal CIRCUITPY flash filesystem (optional) // BLE config (bonding info, etc.) (optional) -// microntroller.nvm (optional) +// microcontroller.nvm (optional) // bootloader (note the MBR at 0x0 redirects to the bootloader here, in high flash) // bootloader settings -// Bootloader values from https://github.com/adafruit/Adafruit_nRF52_Bootloader/blob/master/src/linker/s140_v6.ld - // Define these regions starting up from the bottom of flash: #define MBR_START_ADDR (0x0) @@ -101,6 +99,7 @@ // Define these regions starting down from the bootloader: +// Bootloader values from https://github.com/adafruit/Adafruit_nRF52_Bootloader/blob/master/src/linker/s140_v6.ld #define BOOTLOADER_START_ADDR (0x000F4000) #define BOOTLOADER_SIZE (0xA000) // 40kiB #define BOOTLOADER_SETTINGS_START_ADDR (0x000FF000) diff --git a/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.h b/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.h index 1d47142a83..3ab9a55853 100644 --- a/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.h +++ b/ports/stm32f4/boards/stm32f412zg_discovery/mpconfigboard.h @@ -33,4 +33,4 @@ #define FLASH_PAGE_SIZE (0x4000) #define DEFAULT_I2C_BUS_SCL (&pin_PB10) -#define DEFAULT_I2C_BUS_SDA (&pin_PB09) \ No newline at end of file +#define DEFAULT_I2C_BUS_SDA (&pin_PB09) From 8c841af9461eba6252690c38bc3e726f2fd09e8b Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Wed, 11 Dec 2019 22:04:10 -0600 Subject: [PATCH 28/78] MP3File: Avoid crash in get_buffer when deinitted When a playing mp3 is deinitted, it's possible to reach get_buffer, but all the internal pointers are NULL. This would lead to a hard fault. Avoid it by returning GET_BUFFER_ERROR instead. --- shared-module/audiomp3/MP3File.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/shared-module/audiomp3/MP3File.c b/shared-module/audiomp3/MP3File.c index cabb461056..f0c4adc263 100644 --- a/shared-module/audiomp3/MP3File.c +++ b/shared-module/audiomp3/MP3File.c @@ -227,6 +227,9 @@ audioio_get_buffer_result_t audiomp3_mp3file_get_buffer(audiomp3_mp3file_obj_t* uint8_t channel, uint8_t** bufptr, uint32_t* buffer_length) { + if (!self->inbuf) { + return GET_BUFFER_ERROR; + } if (!single_channel) { channel = 0; } From fd03fd5e4f7d6a7fb5e126a5e56955e73a0d0711 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 12 Dec 2019 00:19:03 -0500 Subject: [PATCH 29/78] sd_flash_operation_status should be volatile --- ports/nrf/bluetooth/ble_drv.c | 2 +- ports/nrf/bluetooth/ble_drv.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/nrf/bluetooth/ble_drv.c b/ports/nrf/bluetooth/ble_drv.c index 63d67a7f4a..7dbb315826 100644 --- a/ports/nrf/bluetooth/ble_drv.c +++ b/ports/nrf/bluetooth/ble_drv.c @@ -43,7 +43,7 @@ nrf_nvic_state_t nrf_nvic_state = { 0 }; // Flag indicating progress of internal flash operation. -sd_flash_operation_status_t sd_flash_operation_status; +volatile sd_flash_operation_status_t sd_flash_operation_status; __attribute__((aligned(4))) static uint8_t m_ble_evt_buf[sizeof(ble_evt_t) + (BLE_GATT_ATT_MTU_DEFAULT)]; diff --git a/ports/nrf/bluetooth/ble_drv.h b/ports/nrf/bluetooth/ble_drv.h index 7716cab8be..91990da6df 100644 --- a/ports/nrf/bluetooth/ble_drv.h +++ b/ports/nrf/bluetooth/ble_drv.h @@ -59,7 +59,7 @@ typedef enum { } sd_flash_operation_status_t; // Flag indicating progress of internal flash operation. -extern sd_flash_operation_status_t sd_flash_operation_status; +extern volatile sd_flash_operation_status_t sd_flash_operation_status; typedef struct ble_drv_evt_handler_entry { struct ble_drv_evt_handler_entry *next; From 1e95466bac139028efbb44e82cacf757d284b905 Mon Sep 17 00:00:00 2001 From: JoeBakalor Date: Thu, 12 Dec 2019 07:48:50 -0500 Subject: [PATCH 30/78] Add teknikio_bluebird to build.yml --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7fd816b30b..b5ee03a02d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -153,6 +153,7 @@ jobs: - "stm32f411ve_discovery" - "stm32f412zg_discovery" - "stringcar_m0_express" + - "teknikio_bluebird" - "trellis_m4_express" - "trinket_m0" - "trinket_m0_haxpress" From 1cdac3f16a9244c992e8494a7246ab643cdb47c0 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 12 Dec 2019 08:44:15 -0600 Subject: [PATCH 31/78] MP3File: Fix stereo playback on samd AudioOut There were several problems with the way this worked -- the read_count approach was too complicated and I made a mistake "simplifying" it from WaveFile. And when the right channel was returned, it was off by 1 byte, making it into static. Instead, directly track which is the "other" channel that has data available, and by using the right data type make the "+ channel" arithmetic give the right result. This requires a double cast (int16_t*)(void*) due to an alignment warning; the alignment is now ensured manually, but the compiler doesn't make the necessary inference that the low address bit must be clear. --- shared-module/audiomp3/MP3File.c | 46 +++++++++++++++++++------------- shared-module/audiomp3/MP3File.h | 6 ++--- 2 files changed, 30 insertions(+), 22 deletions(-) diff --git a/shared-module/audiomp3/MP3File.c b/shared-module/audiomp3/MP3File.c index f0c4adc263..f4861da360 100644 --- a/shared-module/audiomp3/MP3File.c +++ b/shared-module/audiomp3/MP3File.c @@ -151,10 +151,13 @@ void common_hal_audiomp3_mp3file_construct(audiomp3_mp3file_obj_t* self, self->channel_count = fi.nChans; self->frame_buffer_size = fi.outputSamps*sizeof(int16_t); + if ((intptr_t)buffer & 1) { + buffer += 1; buffer_size -= 1; + } if (buffer_size >= 2 * self->frame_buffer_size) { self->len = buffer_size / 2 / self->frame_buffer_size * self->frame_buffer_size; - self->buffers[0] = buffer; - self->buffers[1] = buffer + self->len; + self->buffers[0] = (int16_t*)(void*)buffer; + self->buffers[1] = (int16_t*)(void*)buffer + self->len; } else { self->len = 2 * self->frame_buffer_size; self->buffers[0] = m_malloc(self->len, false); @@ -218,6 +221,7 @@ void audiomp3_mp3file_reset_buffer(audiomp3_mp3file_obj_t* self, f_lseek(&self->file->fp, 0); self->inbuf_offset = self->inbuf_length; self->eof = 0; + self->other_channel = -1; mp3file_update_inbuf(self); mp3file_find_sync_word(self); } @@ -234,26 +238,30 @@ audioio_get_buffer_result_t audiomp3_mp3file_get_buffer(audiomp3_mp3file_obj_t* channel = 0; } - uint16_t channel_read_count = self->channel_read_count[channel]++; - bool need_more_data = self->read_count++ == channel_read_count; - - *bufptr = self->buffers[self->buffer_index] + channel; + *bufptr = (uint8_t*)(self->buffers[self->buffer_index] + channel); *buffer_length = self->frame_buffer_size; - if (need_more_data) { - self->buffer_index = !self->buffer_index; - int16_t *buffer = (int16_t *)(void *)self->buffers[self->buffer_index]; + if (channel == self->other_channel) { + *bufptr = (uint8_t*)(self->buffers[self->other_buffer_index] + channel); + self->other_channel = -1; + return GET_BUFFER_MORE_DATA; + } - if (!mp3file_find_sync_word(self)) { - return self->eof ? GET_BUFFER_DONE : GET_BUFFER_ERROR; - } - int bytes_left = BYTES_LEFT(self); - uint8_t *inbuf = READ_PTR(self); - int err = MP3Decode(self->decoder, &inbuf, &bytes_left, buffer, 0); - CONSUME(self, BYTES_LEFT(self) - bytes_left); - if (err) { - return GET_BUFFER_DONE; - } + self->other_channel = 1-channel; + self->other_buffer_index = self->buffer_index; + + self->buffer_index = !self->buffer_index; + int16_t *buffer = (int16_t *)(void *)self->buffers[self->buffer_index]; + + if (!mp3file_find_sync_word(self)) { + return self->eof ? GET_BUFFER_DONE : GET_BUFFER_ERROR; + } + int bytes_left = BYTES_LEFT(self); + uint8_t *inbuf = READ_PTR(self); + int err = MP3Decode(self->decoder, &inbuf, &bytes_left, buffer, 0); + CONSUME(self, BYTES_LEFT(self) - bytes_left); + if (err) { + return GET_BUFFER_DONE; } return GET_BUFFER_MORE_DATA; diff --git a/shared-module/audiomp3/MP3File.h b/shared-module/audiomp3/MP3File.h index 12649ac1ad..9d99e8d1f0 100644 --- a/shared-module/audiomp3/MP3File.h +++ b/shared-module/audiomp3/MP3File.h @@ -39,7 +39,7 @@ typedef struct { uint8_t* inbuf; uint32_t inbuf_length; uint32_t inbuf_offset; - uint8_t* buffers[2]; + int16_t* buffers[2]; uint32_t len; uint32_t frame_buffer_size; @@ -50,8 +50,8 @@ typedef struct { uint8_t channel_count; bool eof; - uint16_t read_count; - uint16_t channel_read_count[2]; + int8_t other_channel; + int8_t other_buffer_index; } audiomp3_mp3file_obj_t; // These are not available from Python because it may be called in an interrupt. From 63046d800d64081a4f7756476f5249179179ff5e Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 19 Aug 2019 15:50:02 +1000 Subject: [PATCH 32/78] py: Introduce MP_UNREACHABLE macro to annotate unreachable code. And use it to replace the same pattern at the end of nlrthumb.c:nlr_jump. --- py/mpconfig.h | 9 +++++++++ py/nlrthumb.c | 6 +----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/py/mpconfig.h b/py/mpconfig.h index 3ec383817e..a0d211bfaa 100755 --- a/py/mpconfig.h +++ b/py/mpconfig.h @@ -1440,6 +1440,15 @@ typedef double mp_float_t; #define MP_UNLIKELY(x) __builtin_expect((x), 0) #endif +// To annotate that code is unreachable +#ifndef MP_UNREACHABLE +#if defined(__GNUC__) +#define MP_UNREACHABLE __builtin_unreachable(); +#else +#define MP_UNREACHABLE for (;;); +#endif +#endif + #ifndef MP_HTOBE16 #if MP_ENDIANNESS_LITTLE # define MP_HTOBE16(x) ((uint16_t)( (((x) & 0xff) << 8) | (((x) >> 8) & 0xff) )) diff --git a/py/nlrthumb.c b/py/nlrthumb.c index 69d3f868af..eb32e2ce5b 100644 --- a/py/nlrthumb.c +++ b/py/nlrthumb.c @@ -127,11 +127,7 @@ NORETURN void nlr_jump(void *val) { : // clobbered registers ); - #if defined(__GNUC__) - __builtin_unreachable(); - #else - for (;;); // needed to silence compiler warning - #endif + MP_UNREACHABLE } #endif // MICROPY_NLR_THUMB From 1cf0ce094a4a1571b7404643e7a3b992592317a5 Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 19 Aug 2019 15:51:40 +1000 Subject: [PATCH 33/78] py/nlr: Use MP_UNREACHABLE at the end of arch-specific nlr_jump funcs. Recent versions of gcc perform optimisations which can lead to the following code from the MP_NLR_JUMP_HEAD macro being omitted: top->ret_val = val; \ MP_NLR_RESTORE_PYSTACK(top); \ *_top_ptr = top->prev; \ This is noticeable (at least) in the unix coverage on x86-64 built with gcc 9.1.0. This is because the nlr_jump function is marked as no-return, so gcc deduces that the above code has no effect. Adding MP_UNREACHABLE tells the compiler that the asm code may branch elsewhere, and so it cannot optimise away the code. --- py/nlrx64.c | 2 +- py/nlrx86.c | 2 +- py/nlrxtensa.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/py/nlrx64.c b/py/nlrx64.c index 9b2b22c225..569ad84fb0 100644 --- a/py/nlrx64.c +++ b/py/nlrx64.c @@ -108,7 +108,7 @@ NORETURN void nlr_jump(void *val) { : // clobbered registers ); - for (;;); // needed to silence compiler warning + MP_UNREACHABLE } #endif // MICROPY_NLR_X64 diff --git a/py/nlrx86.c b/py/nlrx86.c index 4900a4c0d2..6fbbe44327 100644 --- a/py/nlrx86.c +++ b/py/nlrx86.c @@ -100,7 +100,7 @@ NORETURN void nlr_jump(void *val) { : // clobbered registers ); - for (;;); // needed to silence compiler warning + MP_UNREACHABLE } #endif // MICROPY_NLR_X86 diff --git a/py/nlrxtensa.c b/py/nlrxtensa.c index d66c7a9a7f..5640350043 100644 --- a/py/nlrxtensa.c +++ b/py/nlrxtensa.c @@ -77,7 +77,7 @@ NORETURN void nlr_jump(void *val) { : // clobbered registers ); - for (;;); // needed to silence compiler warning + MP_UNREACHABLE } #endif // MICROPY_NLR_XTENSA From 767d47dd6025e8046b03e6b307fd0ba6a81cf504 Mon Sep 17 00:00:00 2001 From: Damien George Date: Mon, 17 Jun 2019 23:19:34 +1000 Subject: [PATCH 34/78] py/nlrthumb: Save and restore VFP registers s16-s21 when CPU has them. These s16-s21 registers are used by gcc so need to be saved. Future versions of gcc (beyond v9.1.0), or other compilers, may eventually need additional registers saved/restored. See issue #4844. --- py/nlr.h | 9 ++++++++- py/nlrthumb.c | 10 ++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/py/nlr.h b/py/nlr.h index b442aaf8a0..1b95002d3b 100644 --- a/py/nlr.h +++ b/py/nlr.h @@ -54,7 +54,14 @@ #endif #elif defined(__thumb2__) || defined(__thumb__) || defined(__arm__) #define MICROPY_NLR_THUMB (1) - #define MICROPY_NLR_NUM_REGS (10) + #if defined(__SOFTFP__) + #define MICROPY_NLR_NUM_REGS (10) + #else + // With hardware FP registers s16-s31 are callee save so in principle + // should be saved and restored by the NLR code. gcc only uses s16-s21 + // so only save/restore those as an optimisation. + #define MICROPY_NLR_NUM_REGS (10 + 6) + #endif #elif defined(__xtensa__) #define MICROPY_NLR_XTENSA (1) #define MICROPY_NLR_NUM_REGS (10) diff --git a/py/nlrthumb.c b/py/nlrthumb.c index eb32e2ce5b..056aa358e7 100644 --- a/py/nlrthumb.c +++ b/py/nlrthumb.c @@ -63,6 +63,11 @@ __attribute__((naked)) unsigned int nlr_push(nlr_buf_t *nlr) { "str r10, [r0, #36] \n" // store r10 into nlr_buf "str r11, [r0, #40] \n" // store r11 into nlr_buf "str r13, [r0, #44] \n" // store r13=sp into nlr_buf + #if MICROPY_NLR_NUM_REGS == 16 + "vstr d8, [r0, #48] \n" // store s16-s17 into nlr_buf + "vstr d9, [r0, #56] \n" // store s18-s19 into nlr_buf + "vstr d10, [r0, #64] \n" // store s20-s21 into nlr_buf + #endif "str lr, [r0, #8] \n" // store lr into nlr_buf #endif @@ -118,6 +123,11 @@ NORETURN void nlr_jump(void *val) { "ldr r10, [r0, #36] \n" // load r10 from nlr_buf "ldr r11, [r0, #40] \n" // load r11 from nlr_buf "ldr r13, [r0, #44] \n" // load r13=sp from nlr_buf + #if MICROPY_NLR_NUM_REGS == 16 + "vldr d8, [r0, #48] \n" // load s16-s17 from nlr_buf + "vldr d9, [r0, #56] \n" // load s18-s19 from nlr_buf + "vldr d10, [r0, #64] \n" // load s20-s21 from nlr_buf + #endif "ldr lr, [r0, #8] \n" // load lr from nlr_buf #endif "movs r0, #1 \n" // return 1, non-local return From 7889b999ccb32b78ddabc2b2738f0a9d182b9411 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 12 Dec 2019 14:35:24 -0500 Subject: [PATCH 35/78] Fix flash write error handling; clean up safe mode message printing --- main.c | 4 +- ports/nrf/common-hal/nvm/ByteArray.c | 11 +++- ports/nrf/peripherals/nrf/nvm.c | 15 ++--- ports/nrf/peripherals/nrf/nvm.h | 2 +- ports/nrf/supervisor/internal_flash.c | 6 +- supervisor/shared/safe_mode.c | 80 ++++++++++++++++++--------- supervisor/shared/safe_mode.h | 3 +- 7 files changed, 78 insertions(+), 43 deletions(-) diff --git a/main.c b/main.c index a6c7c05816..2bbfd1be0c 100755 --- a/main.c +++ b/main.c @@ -264,9 +264,7 @@ bool run_code_py(safe_mode_t safe_mode) { rgb_status_animation_t animation; prep_rgb_status_animation(&result, found_main, safe_mode, &animation); while (true) { - #ifdef MICROPY_VM_HOOK_LOOP - MICROPY_VM_HOOK_LOOP - #endif + RUN_BACKGROUND_TASKS; if (reload_requested) { reload_requested = false; return true; diff --git a/ports/nrf/common-hal/nvm/ByteArray.c b/ports/nrf/common-hal/nvm/ByteArray.c index ee270f79bb..bace8221c8 100644 --- a/ports/nrf/common-hal/nvm/ByteArray.c +++ b/ports/nrf/common-hal/nvm/ByteArray.c @@ -24,6 +24,7 @@ * THE SOFTWARE. */ +#include "py/runtime.h" #include "common-hal/nvm/ByteArray.h" #include @@ -43,16 +44,20 @@ uint32_t common_hal_nvm_bytearray_get_length(nvm_bytearray_obj_t *self) { } static void write_page(uint32_t page_addr, uint32_t offset, uint32_t len, uint8_t *bytes) { - // Write a whole page to flash, buffering it first and then erasing and rewriting + // Write a whole page to flash, buffering it first and then erasing and rewriting // it since we can only clear a whole page at a time. + bool status; if (offset == 0 && len == FLASH_PAGE_SIZE) { - nrf_nvm_safe_flash_page_write(page_addr, bytes); + status = nrf_nvm_safe_flash_page_write(page_addr, bytes); } else { uint8_t buffer[FLASH_PAGE_SIZE]; memcpy(buffer, (uint8_t *)page_addr, FLASH_PAGE_SIZE); memcpy(buffer + offset, bytes, len); - nrf_nvm_safe_flash_page_write(page_addr, buffer); + status = nrf_nvm_safe_flash_page_write(page_addr, buffer); + } + if (!status) { + mp_raise_OSError_msg(translate("Flash write failed")); } } diff --git a/ports/nrf/peripherals/nrf/nvm.c b/ports/nrf/peripherals/nrf/nvm.c index d8fddc4dcf..7118b9c870 100644 --- a/ports/nrf/peripherals/nrf/nvm.c +++ b/ports/nrf/peripherals/nrf/nvm.c @@ -50,7 +50,7 @@ STATIC sd_flash_operation_status_t sd_flash_operation_wait_until_done(void) { } #endif -void nrf_nvm_safe_flash_page_write(uint32_t page_addr, uint8_t *data) { +bool nrf_nvm_safe_flash_page_write(uint32_t page_addr, uint8_t *data) { #ifdef BLUETOOTH_SD uint8_t sd_en = 0; (void) sd_softdevice_is_enabled(&sd_en); @@ -61,11 +61,11 @@ void nrf_nvm_safe_flash_page_write(uint32_t page_addr, uint8_t *data) { sd_flash_operation_start(); err_code = sd_flash_page_erase(page_addr / FLASH_PAGE_SIZE); if (err_code != NRF_SUCCESS) { - mp_raise_OSError_msg_varg(translate("Flash erase failed to start, err 0x%04x"), err_code); + return false; } status = sd_flash_operation_wait_until_done(); if (status == SD_FLASH_OPERATION_ERROR) { - mp_raise_OSError_msg(translate("Flash erase failed")); + return false; } // Divide a full page into parts, because writing a full page causes an assertion failure. @@ -78,18 +78,19 @@ void nrf_nvm_safe_flash_page_write(uint32_t page_addr, uint8_t *data) { (uint32_t *)data + i * words_to_write, words_to_write); if (err_code != NRF_SUCCESS) { - mp_raise_OSError_msg_varg(translate("Flash write failed to start, err 0x%04x"), err_code); + return false; } status = sd_flash_operation_wait_until_done(); if (status == SD_FLASH_OPERATION_ERROR) { - mp_raise_OSError_msg(translate("Flash write failed")); + return false; } } - return; + return true; } #endif nrf_nvmc_page_erase(page_addr); nrf_nvmc_write_bytes(page_addr, data, FLASH_PAGE_SIZE); -} + return true; +} diff --git a/ports/nrf/peripherals/nrf/nvm.h b/ports/nrf/peripherals/nrf/nvm.h index 4eac3d7283..c1a2a76dad 100644 --- a/ports/nrf/peripherals/nrf/nvm.h +++ b/ports/nrf/peripherals/nrf/nvm.h @@ -31,4 +31,4 @@ #define CIRCUITPY_INTERNAL_NVM_SIZE (0) #endif -void nrf_nvm_safe_flash_page_write(uint32_t page_addr, uint8_t *data); +bool nrf_nvm_safe_flash_page_write(uint32_t page_addr, uint8_t *data); diff --git a/ports/nrf/supervisor/internal_flash.c b/ports/nrf/supervisor/internal_flash.c index dcacd4d27f..4688e0ceeb 100644 --- a/ports/nrf/supervisor/internal_flash.c +++ b/ports/nrf/supervisor/internal_flash.c @@ -34,6 +34,7 @@ #include "py/obj.h" #include "py/runtime.h" #include "lib/oofatfs/ff.h" +#include "supervisor/shared/safe_mode.h" #include "peripherals/nrf/nvm.h" @@ -75,7 +76,9 @@ void supervisor_flash_flush(void) { // Skip if data is the same if (memcmp(_flash_cache, (void *)_flash_page_addr, FLASH_PAGE_SIZE) != 0) { - nrf_nvm_safe_flash_page_write(_flash_page_addr, _flash_cache); + if (!nrf_nvm_safe_flash_page_write(_flash_page_addr, _flash_cache)) { + reset_into_safe_mode(FLASH_WRITE_FAIL); + } } } @@ -120,4 +123,3 @@ mp_uint_t supervisor_flash_write_blocks(const uint8_t *src, uint32_t lba, uint32 void supervisor_flash_release_cache(void) { } - diff --git a/supervisor/shared/safe_mode.c b/supervisor/shared/safe_mode.c index 363181da06..9e3b864028 100644 --- a/supervisor/shared/safe_mode.c +++ b/supervisor/shared/safe_mode.c @@ -94,44 +94,72 @@ void __attribute__((noinline,)) reset_into_safe_mode(safe_mode_t reason) { reset_cpu(); } + + +#define FILE_AN_ISSUE translate("\r\nPlease file an issue with the contents of your CIRCUITPY drive at \nhttps://github.com/adafruit/circuitpython/issues\r\n") + void print_safe_mode_message(safe_mode_t reason) { if (reason == NO_SAFE_MODE) { return; } serial_write("\r\n"); - // Output a user safe mode string if its set. + // Output a user safe mode string if it's set. #ifdef BOARD_USER_SAFE_MODE if (reason == USER_SAFE_MODE) { serial_write_compressed(translate("You requested starting safe mode by ")); serial_write(BOARD_USER_SAFE_MODE_ACTION); - serial_write("\r\n"); - serial_write_compressed(translate("To exit, please reset the board without ")); + serial_write_compressed(translate("\r\nTo exit, please reset the board without ")); serial_write(BOARD_USER_SAFE_MODE_ACTION); serial_write("\r\n"); } else #endif - if (reason == MANUAL_SAFE_MODE) { - serial_write_compressed(translate("The reset button was pressed while booting CircuitPython. Press again to exit safe mode.\n")); - } else if (reason == PROGRAMMATIC_SAFE_MODE) { - serial_write_compressed(translate("The `microcontroller` module was used to boot into safe mode. Press reset to exit safe mode.\n")); - } else { - serial_write_compressed(translate("You are running in safe mode which means something unanticipated happened.\n")); - if (reason == HARD_CRASH || reason == MICROPY_NLR_JUMP_FAIL || reason == MICROPY_FATAL_ERROR || reason == GC_ALLOC_OUTSIDE_VM) { - serial_write_compressed(translate("Looks like our core CircuitPython code crashed hard. Whoops!\nPlease file an issue at https://github.com/adafruit/circuitpython/issues\n with the contents of your CIRCUITPY drive and this message:\n")); - if (reason == HARD_CRASH) { - serial_write_compressed(translate("Crash into the HardFault_Handler.\n")); - } else if (reason == MICROPY_NLR_JUMP_FAIL) { - serial_write_compressed(translate("MicroPython NLR jump failed. Likely memory corruption.\n")); - } else if (reason == MICROPY_FATAL_ERROR) { - serial_write_compressed(translate("MicroPython fatal error.\n")); - } else if (reason == GC_ALLOC_OUTSIDE_VM) { - serial_write_compressed(translate("Attempted heap allocation when MicroPython VM not running.\n")); - } - } else if (reason == BROWNOUT) { - serial_write_compressed(translate("The microcontroller's power dipped. Please make sure your power supply provides\nenough power for the whole circuit and press reset (after ejecting CIRCUITPY).\n")); - } else if (reason == HEAP_OVERWRITTEN) { - serial_write_compressed(translate("The CircuitPython heap was corrupted because the stack was too small.\nPlease increase stack size limits and press reset (after ejecting CIRCUITPY).\nIf you didn't change the stack, then file an issue here with the contents of your CIRCUITPY drive:\n")); - serial_write("https://github.com/adafruit/circuitpython/issues\r\n"); + switch (reason) { + case MANUAL_SAFE_MODE: + serial_write_compressed(translate("CircuitPython is in safe mode because you pressed the reset button during boot. Press again to exit safe mode.\r\n")); + return; + case PROGRAMMATIC_SAFE_MODE: + serial_write_compressed(translate("The `microcontroller` module was used to boot into safe mode. Press reset to exit safe mode.\r\n")); + return; + default: + break; } - } + + serial_write_compressed(translate("You are in safe mode: something unanticipated happened.\r\n")); + switch (reason) { + case BROWNOUT: + serial_write_compressed(translate("The microcontroller's power dipped. Make sure your power supply provides\r\nenough power for the whole circuit and press reset (after ejecting CIRCUITPY).\r\n")); + return; + case HEAP_OVERWRITTEN: + serial_write_compressed(translate("The CircuitPython heap was corrupted because the stack was too small.\r\nPlease increase the stack size if you know how, or if not:")); + serial_write_compressed(FILE_AN_ISSUE); + return; + default: + break; + } + + serial_write_compressed(translate("CircuitPython core code crashed hard. Whoops!\r\n")); + switch (reason) { + case HARD_CRASH: + serial_write_compressed(translate("Crash into the HardFault_Handler.")); + return; + case MICROPY_NLR_JUMP_FAIL: + serial_write_compressed(translate("MicroPython NLR jump failed. Likely memory corruption.")); + return; + case MICROPY_FATAL_ERROR: + serial_write_compressed(translate("MicroPython fatal error.")); + break; + case GC_ALLOC_OUTSIDE_VM: + serial_write_compressed(translate("Attempted heap allocation when MicroPython VM not running.")); + break; + case NORDIC_SOFT_DEVICE_ASSERT: + serial_write_compressed(translate("Nordic Soft Device failure assertion.")); + break; + case FLASH_WRITE_FAIL: + serial_write_compressed(translate("Failed to write internal flash.")); + break; + default: + serial_write_compressed(translate("Unknown reason.")); + break; + } + serial_write_compressed(FILE_AN_ISSUE); } diff --git a/supervisor/shared/safe_mode.h b/supervisor/shared/safe_mode.h index 8c5dcd9c5d..e05fca0e46 100644 --- a/supervisor/shared/safe_mode.h +++ b/supervisor/shared/safe_mode.h @@ -38,7 +38,8 @@ typedef enum { MICROPY_FATAL_ERROR, GC_ALLOC_OUTSIDE_VM, PROGRAMMATIC_SAFE_MODE, - NORDIC_SOFT_DEVICE_ASSERT + NORDIC_SOFT_DEVICE_ASSERT, + FLASH_WRITE_FAIL, } safe_mode_t; safe_mode_t wait_for_safe_mode_reset(void); From 1b3028bed139149247ff5e692f24ec5356450f83 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 12 Dec 2019 14:51:50 -0500 Subject: [PATCH 36/78] make translate and remove backslash-r's --- locale/ID.po | 116 ++++++++++++--------- locale/circuitpython.pot | 89 ++++++++-------- locale/de_DE.po | 176 +++++++++++++++++++------------ locale/en_US.po | 89 ++++++++-------- locale/en_x_pirate.po | 89 ++++++++-------- locale/es.po | 191 ++++++++++++++++++++++------------ locale/fil.po | 168 +++++++++++++++++++----------- locale/fr.po | 190 +++++++++++++++++++++------------ locale/it_IT.po | 130 ++++++++++++++--------- locale/ko.po | 89 ++++++++-------- locale/pl.po | 182 ++++++++++++++++++++------------ locale/pt_BR.po | 92 ++++++++-------- locale/zh_Latn_pinyin.po | 185 ++++++++++++++++++++------------ supervisor/shared/safe_mode.c | 20 ++-- 14 files changed, 1073 insertions(+), 733 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index 4be18ec0de..c147a5f5f9 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-10 13:55-0600\n" +"POT-Creation-Date: 2019-12-12 14:51-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -23,6 +23,19 @@ msgid "" "Code done running. Waiting for reload.\n" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"Please file an issue with the contents of your CIRCUITPY drive at \n" +"https://github.com/adafruit/circuitpython/issues\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"To exit, please reset the board without " +msgstr "" + #: py/obj.c msgid " File \"%q\"" msgstr "" @@ -294,7 +307,7 @@ msgid "Array values should be single bytes." msgstr "" #: supervisor/shared/safe_mode.c -msgid "Attempted heap allocation when MicroPython VM not running.\n" +msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" #: main.c @@ -454,6 +467,16 @@ msgstr "" msgid "CharacteristicBuffer writing not provided" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "CircuitPython core code crashed hard. Whoops!\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"CircuitPython is in safe mode because you pressed the reset button during " +"boot. Press again to exit safe mode.\n" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "" @@ -515,7 +538,7 @@ msgid "Couldn't allocate second buffer" msgstr "" #: supervisor/shared/safe_mode.c -msgid "Crash into the HardFault_Handler.\n" +msgid "Crash into the HardFault_Handler." msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -632,28 +655,18 @@ msgstr "" msgid "Failed to release mutex, err 0x%04x" msgstr "Gagal untuk melepaskan mutex, status: 0x%08lX" +#: supervisor/shared/safe_mode.c +msgid "Failed to write internal flash." +msgstr "" + #: py/moduerrno.c msgid "File exists" msgstr "" -#: ports/nrf/peripherals/nrf/nvm.c -msgid "Flash erase failed" -msgstr "" - -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash erase failed to start, err 0x%04x" -msgstr "" - -#: ports/nrf/peripherals/nrf/nvm.c +#: ports/nrf/common-hal/nvm/ByteArray.c msgid "Flash write failed" msgstr "" -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash write failed to start, err 0x%04x" -msgstr "" - #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "" @@ -826,13 +839,6 @@ msgstr "" msgid "Length must be non-negative" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "" -"Looks like our core CircuitPython code crashed hard. Whoops!\n" -"Please file an issue at https://github.com/adafruit/circuitpython/issues\n" -" with the contents of your CIRCUITPY drive and this message:\n" -msgstr "" - #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." msgstr "" @@ -847,11 +853,11 @@ msgid "Maximum x value when mirrored is %d" msgstr "" #: supervisor/shared/safe_mode.c -msgid "MicroPython NLR jump failed. Likely memory corruption.\n" +msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "" #: supervisor/shared/safe_mode.c -msgid "MicroPython fatal error.\n" +msgid "MicroPython fatal error." msgstr "" #: shared-bindings/audiobusio/PDMIn.c @@ -920,6 +926,10 @@ msgstr "" msgid "No such file/directory" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "Nordic Soft Device failure assertion." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c #, fuzzy @@ -1103,10 +1113,7 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" -"Please increase stack size limits and press reset (after ejecting " -"CIRCUITPY).\n" -"If you didn't change the stack, then file an issue here with the contents of " -"your CIRCUITPY drive:\n" +"Please increase the stack size if you know how, or if not:" msgstr "" #: supervisor/shared/safe_mode.c @@ -1116,21 +1123,11 @@ msgid "" msgstr "" #: supervisor/shared/safe_mode.c -#, fuzzy msgid "" -"The microcontroller's power dipped. Please make sure your power supply " -"provides\n" +"The microcontroller's power dipped. Make sure your power supply provides\n" "enough power for the whole circuit and press reset (after ejecting " "CIRCUITPY).\n" msgstr "" -"Tegangan dari mikrokontroler turun atau mati. Pastikan sumber tegangan " -"memberikan daya\n" - -#: supervisor/shared/safe_mode.c -msgid "" -"The reset button was pressed while booting CircuitPython. Press again to " -"exit safe mode.\n" -msgstr "" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" @@ -1164,10 +1161,6 @@ msgstr "" msgid "Tile width must exactly divide bitmap width" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " -msgstr "Untuk keluar, silahkan reset board tanpa " - #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Terlalu banyak channel dalam sampel" @@ -1246,6 +1239,10 @@ msgstr "" msgid "Unknown gatt error: 0x%04x" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "Unknown reason." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown security error: 0x%04x" @@ -1323,12 +1320,8 @@ msgstr "" "Untuk menampilkan modul built-in silahkan ketik `help(\"modules\")`.\n" #: supervisor/shared/safe_mode.c -#, fuzzy -msgid "" -"You are running in safe mode which means something unanticipated happened.\n" +msgid "You are in safe mode: something unanticipated happened.\n" msgstr "" -"Anda sedang menjalankan mode aman (safe mode) yang berarti sesuatu yang " -"sangat buruk telah terjadi.\n" #: supervisor/shared/safe_mode.c msgid "You requested starting safe mode by " @@ -2853,6 +2846,19 @@ msgstr "" #~ msgid "Soft device assert, id: 0x%08lX, pc: 0x%08lX" #~ msgstr "Dukungan soft device, id: 0x%08lX, pc: 0x%08l" +#, fuzzy +#~ msgid "" +#~ "The microcontroller's power dipped. Please make sure your power supply " +#~ "provides\n" +#~ "enough power for the whole circuit and press reset (after ejecting " +#~ "CIRCUITPY).\n" +#~ msgstr "" +#~ "Tegangan dari mikrokontroler turun atau mati. Pastikan sumber tegangan " +#~ "memberikan daya\n" + +#~ msgid "To exit, please reset the board without " +#~ msgstr "Untuk keluar, silahkan reset board tanpa " + #~ msgid "UART(%d) does not exist" #~ msgstr "UART(%d) tidak ada" @@ -2870,6 +2876,14 @@ msgstr "" #~ "Gunakan esptool untuk menghapus flash dan upload ulang Python sebagai " #~ "gantinya" +#, fuzzy +#~ msgid "" +#~ "You are running in safe mode which means something unanticipated " +#~ "happened.\n" +#~ msgstr "" +#~ "Anda sedang menjalankan mode aman (safe mode) yang berarti sesuatu yang " +#~ "sangat buruk telah terjadi.\n" + #~ msgid "[addrinfo error %d]" #~ msgstr "[addrinfo error %d]" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index f007202071..3b605d99fd 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-10 13:55-0600\n" +"POT-Creation-Date: 2019-12-12 14:51-0500\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -23,6 +23,19 @@ msgid "" "Code done running. Waiting for reload.\n" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"Please file an issue with the contents of your CIRCUITPY drive at \n" +"https://github.com/adafruit/circuitpython/issues\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"To exit, please reset the board without " +msgstr "" + #: py/obj.c msgid " File \"%q\"" msgstr "" @@ -292,7 +305,7 @@ msgid "Array values should be single bytes." msgstr "" #: supervisor/shared/safe_mode.c -msgid "Attempted heap allocation when MicroPython VM not running.\n" +msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" #: main.c @@ -444,6 +457,16 @@ msgstr "" msgid "CharacteristicBuffer writing not provided" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "CircuitPython core code crashed hard. Whoops!\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"CircuitPython is in safe mode because you pressed the reset button during " +"boot. Press again to exit safe mode.\n" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "" @@ -505,7 +528,7 @@ msgid "Couldn't allocate second buffer" msgstr "" #: supervisor/shared/safe_mode.c -msgid "Crash into the HardFault_Handler.\n" +msgid "Crash into the HardFault_Handler." msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -621,28 +644,18 @@ msgstr "" msgid "Failed to release mutex, err 0x%04x" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "Failed to write internal flash." +msgstr "" + #: py/moduerrno.c msgid "File exists" msgstr "" -#: ports/nrf/peripherals/nrf/nvm.c -msgid "Flash erase failed" -msgstr "" - -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash erase failed to start, err 0x%04x" -msgstr "" - -#: ports/nrf/peripherals/nrf/nvm.c +#: ports/nrf/common-hal/nvm/ByteArray.c msgid "Flash write failed" msgstr "" -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash write failed to start, err 0x%04x" -msgstr "" - #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "" @@ -815,13 +828,6 @@ msgstr "" msgid "Length must be non-negative" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "" -"Looks like our core CircuitPython code crashed hard. Whoops!\n" -"Please file an issue at https://github.com/adafruit/circuitpython/issues\n" -" with the contents of your CIRCUITPY drive and this message:\n" -msgstr "" - #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." msgstr "" @@ -836,11 +842,11 @@ msgid "Maximum x value when mirrored is %d" msgstr "" #: supervisor/shared/safe_mode.c -msgid "MicroPython NLR jump failed. Likely memory corruption.\n" +msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "" #: supervisor/shared/safe_mode.c -msgid "MicroPython fatal error.\n" +msgid "MicroPython fatal error." msgstr "" #: shared-bindings/audiobusio/PDMIn.c @@ -909,6 +915,10 @@ msgstr "" msgid "No such file/directory" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "Nordic Soft Device failure assertion." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "Not connected" @@ -1087,10 +1097,7 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" -"Please increase stack size limits and press reset (after ejecting " -"CIRCUITPY).\n" -"If you didn't change the stack, then file an issue here with the contents of " -"your CIRCUITPY drive:\n" +"Please increase the stack size if you know how, or if not:" msgstr "" #: supervisor/shared/safe_mode.c @@ -1101,18 +1108,11 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "" -"The microcontroller's power dipped. Please make sure your power supply " -"provides\n" +"The microcontroller's power dipped. Make sure your power supply provides\n" "enough power for the whole circuit and press reset (after ejecting " "CIRCUITPY).\n" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "" -"The reset button was pressed while booting CircuitPython. Press again to " -"exit safe mode.\n" -msgstr "" - #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" msgstr "" @@ -1145,10 +1145,6 @@ msgstr "" msgid "Tile width must exactly divide bitmap width" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " -msgstr "" - #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -1227,6 +1223,10 @@ msgstr "" msgid "Unknown gatt error: 0x%04x" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "Unknown reason." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown security error: 0x%04x" @@ -1297,8 +1297,7 @@ msgid "" msgstr "" #: supervisor/shared/safe_mode.c -msgid "" -"You are running in safe mode which means something unanticipated happened.\n" +msgid "You are in safe mode: something unanticipated happened.\n" msgstr "" #: supervisor/shared/safe_mode.c diff --git a/locale/de_DE.po b/locale/de_DE.po index 1756a7717e..f1158b1b3a 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-10 13:55-0600\n" +"POT-Creation-Date: 2019-12-12 14:51-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" @@ -25,6 +25,19 @@ msgstr "" "\n" "Der Code wurde ausgeführt. Warte auf reload.\n" +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"Please file an issue with the contents of your CIRCUITPY drive at \n" +"https://github.com/adafruit/circuitpython/issues\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"To exit, please reset the board without " +msgstr "" + #: py/obj.c msgid " File \"%q\"" msgstr " Datei \"%q\"" @@ -294,7 +307,7 @@ msgid "Array values should be single bytes." msgstr "Array-Werte sollten aus Einzelbytes bestehen." #: supervisor/shared/safe_mode.c -msgid "Attempted heap allocation when MicroPython VM not running.\n" +msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" #: main.c @@ -448,6 +461,16 @@ msgstr "Kann nicht ohne MOSI-Pin schreiben." msgid "CharacteristicBuffer writing not provided" msgstr "Schreiben von CharacteristicBuffer ist nicht vorgesehen" +#: supervisor/shared/safe_mode.c +msgid "CircuitPython core code crashed hard. Whoops!\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"CircuitPython is in safe mode because you pressed the reset button during " +"boot. Press again to exit safe mode.\n" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "Clock pin init fehlgeschlagen." @@ -509,8 +532,8 @@ msgid "Couldn't allocate second buffer" msgstr "Konnte second buffer nicht zuteilen" #: supervisor/shared/safe_mode.c -msgid "Crash into the HardFault_Handler.\n" -msgstr "Absturz in HardFault_Handler.\n" +msgid "Crash into the HardFault_Handler." +msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" @@ -625,28 +648,18 @@ msgstr "" msgid "Failed to release mutex, err 0x%04x" msgstr "Mutex konnte nicht freigegeben werden. Status: 0x%04x" +#: supervisor/shared/safe_mode.c +msgid "Failed to write internal flash." +msgstr "" + #: py/moduerrno.c msgid "File exists" msgstr "Datei existiert" -#: ports/nrf/peripherals/nrf/nvm.c -msgid "Flash erase failed" -msgstr "" - -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash erase failed to start, err 0x%04x" -msgstr "" - -#: ports/nrf/peripherals/nrf/nvm.c +#: ports/nrf/common-hal/nvm/ByteArray.c msgid "Flash write failed" msgstr "" -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash write failed to start, err 0x%04x" -msgstr "" - #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "" @@ -823,17 +836,6 @@ msgstr "Länge muss ein int sein" msgid "Length must be non-negative" msgstr "Länge darf nicht negativ sein" -#: supervisor/shared/safe_mode.c -msgid "" -"Looks like our core CircuitPython code crashed hard. Whoops!\n" -"Please file an issue at https://github.com/adafruit/circuitpython/issues\n" -" with the contents of your CIRCUITPY drive and this message:\n" -msgstr "" -"Sieht aus, als wäre der CircuitPython-Kernel-Code abgestürzt. Uups!\n" -"Bitte melde das Problem unter https://github.com/adafruit/circuitpython/" -"issues\n" -"mit dem Inhalt deines CIRCUITPY-Laufwerks und dieser Nachricht:\n" - #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." msgstr "MISO pin Initialisierung fehlgeschlagen" @@ -848,14 +850,12 @@ msgid "Maximum x value when mirrored is %d" msgstr "Maximaler x-Wert beim Spiegeln ist %d" #: supervisor/shared/safe_mode.c -msgid "MicroPython NLR jump failed. Likely memory corruption.\n" +msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "" -"MicroPython-NLR-Sprung ist fehlgeschlagen. Wahrscheinlich " -"Speicherbeschädigung.\n" #: supervisor/shared/safe_mode.c -msgid "MicroPython fatal error.\n" -msgstr "Schwerwiegender MicroPython-Fehler\n" +msgid "MicroPython fatal error." +msgstr "" #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" @@ -924,6 +924,10 @@ msgstr "Kein Speicherplatz mehr verfügbar auf dem Gerät" msgid "No such file/directory" msgstr "Keine solche Datei/Verzeichnis" +#: supervisor/shared/safe_mode.c +msgid "Nordic Soft Device failure assertion." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "Not connected" @@ -1110,17 +1114,8 @@ msgstr "Stream fehlt readinto() oder write() Methode." #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" -"Please increase stack size limits and press reset (after ejecting " -"CIRCUITPY).\n" -"If you didn't change the stack, then file an issue here with the contents of " -"your CIRCUITPY drive:\n" +"Please increase the stack size if you know how, or if not:" msgstr "" -"Der CircuitPython-Heap war beschädigt, weil der Stack zu klein war.\n" -"Bitte erhöhe die stack size limits und drücke die Reset-Taste (nach Auswurf " -"des CIRCUITPY-Laufwerks)\n" -"Wenn du den Stack nicht geändert hast, melde bitte das Problem unter https://" -"github.com/adafruit/circuitpython/issues\n" -"mit dem Inhalt deines CIRCUITPY-Laufwerks.\n" #: supervisor/shared/safe_mode.c msgid "" @@ -1132,23 +1127,10 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "" -"The microcontroller's power dipped. Please make sure your power supply " -"provides\n" +"The microcontroller's power dipped. Make sure your power supply provides\n" "enough power for the whole circuit and press reset (after ejecting " "CIRCUITPY).\n" msgstr "" -"Die Stromversorgung des Mikrocontrollers ist eingebrochen. Stelle sicher, " -"dass deine Stromversorgung genug Leistung für die gesamte Schaltung zur " -"Verfügung stellt und drücke die Reset-Taste (nach Auswurf des CIRCUITPY-" -"Laufwerks)\n" - -#: supervisor/shared/safe_mode.c -msgid "" -"The reset button was pressed while booting CircuitPython. Press again to " -"exit safe mode.\n" -msgstr "" -"Die Reset-Taste wurde beim Booten von CircuitPython gedrückt. Drücke sie " -"erneut um den abgesicherten Modus zu verlassen. \n" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" @@ -1182,10 +1164,6 @@ msgstr "" msgid "Tile width must exactly divide bitmap width" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " -msgstr "Zum beenden, resette bitte das board ohne " - #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Zu viele Kanäle im sample" @@ -1264,6 +1242,10 @@ msgstr "Unerwarteter nrfx uuid-Typ" msgid "Unknown gatt error: 0x%04x" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "Unknown reason." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown security error: 0x%04x" @@ -1343,11 +1325,8 @@ msgstr "" "aus.\n" #: supervisor/shared/safe_mode.c -msgid "" -"You are running in safe mode which means something unanticipated happened.\n" +msgid "You are in safe mode: something unanticipated happened.\n" msgstr "" -"Sie laufen im abgesicherten Modus, was bedeutet, dass etwas Unerwartetes " -"passiert ist.\n" #: supervisor/shared/safe_mode.c msgid "You requested starting safe mode by " @@ -2737,6 +2716,9 @@ msgstr "" #~ msgid "Could not decode ble_uuid, err 0x%04x" #~ msgstr "Konnte ble_uuid nicht decodieren. Status: 0x%04x" +#~ msgid "Crash into the HardFault_Handler.\n" +#~ msgstr "Absturz in HardFault_Handler.\n" + #~ msgid "Data too large for the advertisement packet" #~ msgstr "Daten sind zu groß für das advertisement packet" @@ -2871,9 +2853,27 @@ msgstr "" #~ msgid "Invalid data pin" #~ msgstr "Ungültiger data pin" +#~ msgid "" +#~ "Looks like our core CircuitPython code crashed hard. Whoops!\n" +#~ "Please file an issue at https://github.com/adafruit/circuitpython/issues\n" +#~ " with the contents of your CIRCUITPY drive and this message:\n" +#~ msgstr "" +#~ "Sieht aus, als wäre der CircuitPython-Kernel-Code abgestürzt. Uups!\n" +#~ "Bitte melde das Problem unter https://github.com/adafruit/circuitpython/" +#~ "issues\n" +#~ "mit dem Inhalt deines CIRCUITPY-Laufwerks und dieser Nachricht:\n" + #~ msgid "Maximum PWM frequency is %dhz." #~ msgstr "Maximale PWM Frequenz ist %dHz" +#~ msgid "MicroPython NLR jump failed. Likely memory corruption.\n" +#~ msgstr "" +#~ "MicroPython-NLR-Sprung ist fehlgeschlagen. Wahrscheinlich " +#~ "Speicherbeschädigung.\n" + +#~ msgid "MicroPython fatal error.\n" +#~ msgstr "Schwerwiegender MicroPython-Fehler\n" + #~ msgid "Minimum PWM frequency is 1hz." #~ msgstr "Minimale PWM Frequenz ist %dHz" @@ -2920,6 +2920,41 @@ msgstr "" #~ msgid "STA required" #~ msgstr "STA erforderlich" +#~ msgid "" +#~ "The CircuitPython heap was corrupted because the stack was too small.\n" +#~ "Please increase stack size limits and press reset (after ejecting " +#~ "CIRCUITPY).\n" +#~ "If you didn't change the stack, then file an issue here with the contents " +#~ "of your CIRCUITPY drive:\n" +#~ msgstr "" +#~ "Der CircuitPython-Heap war beschädigt, weil der Stack zu klein war.\n" +#~ "Bitte erhöhe die stack size limits und drücke die Reset-Taste (nach " +#~ "Auswurf des CIRCUITPY-Laufwerks)\n" +#~ "Wenn du den Stack nicht geändert hast, melde bitte das Problem unter " +#~ "https://github.com/adafruit/circuitpython/issues\n" +#~ "mit dem Inhalt deines CIRCUITPY-Laufwerks.\n" + +#~ msgid "" +#~ "The microcontroller's power dipped. Please make sure your power supply " +#~ "provides\n" +#~ "enough power for the whole circuit and press reset (after ejecting " +#~ "CIRCUITPY).\n" +#~ msgstr "" +#~ "Die Stromversorgung des Mikrocontrollers ist eingebrochen. Stelle sicher, " +#~ "dass deine Stromversorgung genug Leistung für die gesamte Schaltung zur " +#~ "Verfügung stellt und drücke die Reset-Taste (nach Auswurf des CIRCUITPY-" +#~ "Laufwerks)\n" + +#~ msgid "" +#~ "The reset button was pressed while booting CircuitPython. Press again to " +#~ "exit safe mode.\n" +#~ msgstr "" +#~ "Die Reset-Taste wurde beim Booten von CircuitPython gedrückt. Drücke sie " +#~ "erneut um den abgesicherten Modus zu verlassen. \n" + +#~ msgid "To exit, please reset the board without " +#~ msgstr "Zum beenden, resette bitte das board ohne " + #~ msgid "UART(%d) does not exist" #~ msgstr "UART(%d) existiert nicht" @@ -2942,6 +2977,13 @@ msgstr "" #~ msgid "Voice index too high" #~ msgstr "Voice index zu hoch" +#~ msgid "" +#~ "You are running in safe mode which means something unanticipated " +#~ "happened.\n" +#~ msgstr "" +#~ "Sie laufen im abgesicherten Modus, was bedeutet, dass etwas Unerwartetes " +#~ "passiert ist.\n" + #~ msgid "buffer too long" #~ msgstr "Buffer zu lang" diff --git a/locale/en_US.po b/locale/en_US.po index 79940e95ed..c6f342186f 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-10 13:55-0600\n" +"POT-Creation-Date: 2019-12-12 14:51-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -23,6 +23,19 @@ msgid "" "Code done running. Waiting for reload.\n" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"Please file an issue with the contents of your CIRCUITPY drive at \n" +"https://github.com/adafruit/circuitpython/issues\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"To exit, please reset the board without " +msgstr "" + #: py/obj.c msgid " File \"%q\"" msgstr "" @@ -292,7 +305,7 @@ msgid "Array values should be single bytes." msgstr "" #: supervisor/shared/safe_mode.c -msgid "Attempted heap allocation when MicroPython VM not running.\n" +msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" #: main.c @@ -444,6 +457,16 @@ msgstr "" msgid "CharacteristicBuffer writing not provided" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "CircuitPython core code crashed hard. Whoops!\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"CircuitPython is in safe mode because you pressed the reset button during " +"boot. Press again to exit safe mode.\n" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "" @@ -505,7 +528,7 @@ msgid "Couldn't allocate second buffer" msgstr "" #: supervisor/shared/safe_mode.c -msgid "Crash into the HardFault_Handler.\n" +msgid "Crash into the HardFault_Handler." msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -621,28 +644,18 @@ msgstr "" msgid "Failed to release mutex, err 0x%04x" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "Failed to write internal flash." +msgstr "" + #: py/moduerrno.c msgid "File exists" msgstr "" -#: ports/nrf/peripherals/nrf/nvm.c -msgid "Flash erase failed" -msgstr "" - -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash erase failed to start, err 0x%04x" -msgstr "" - -#: ports/nrf/peripherals/nrf/nvm.c +#: ports/nrf/common-hal/nvm/ByteArray.c msgid "Flash write failed" msgstr "" -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash write failed to start, err 0x%04x" -msgstr "" - #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "" @@ -815,13 +828,6 @@ msgstr "" msgid "Length must be non-negative" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "" -"Looks like our core CircuitPython code crashed hard. Whoops!\n" -"Please file an issue at https://github.com/adafruit/circuitpython/issues\n" -" with the contents of your CIRCUITPY drive and this message:\n" -msgstr "" - #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." msgstr "" @@ -836,11 +842,11 @@ msgid "Maximum x value when mirrored is %d" msgstr "" #: supervisor/shared/safe_mode.c -msgid "MicroPython NLR jump failed. Likely memory corruption.\n" +msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "" #: supervisor/shared/safe_mode.c -msgid "MicroPython fatal error.\n" +msgid "MicroPython fatal error." msgstr "" #: shared-bindings/audiobusio/PDMIn.c @@ -909,6 +915,10 @@ msgstr "" msgid "No such file/directory" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "Nordic Soft Device failure assertion." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "Not connected" @@ -1087,10 +1097,7 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" -"Please increase stack size limits and press reset (after ejecting " -"CIRCUITPY).\n" -"If you didn't change the stack, then file an issue here with the contents of " -"your CIRCUITPY drive:\n" +"Please increase the stack size if you know how, or if not:" msgstr "" #: supervisor/shared/safe_mode.c @@ -1101,18 +1108,11 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "" -"The microcontroller's power dipped. Please make sure your power supply " -"provides\n" +"The microcontroller's power dipped. Make sure your power supply provides\n" "enough power for the whole circuit and press reset (after ejecting " "CIRCUITPY).\n" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "" -"The reset button was pressed while booting CircuitPython. Press again to " -"exit safe mode.\n" -msgstr "" - #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" msgstr "" @@ -1145,10 +1145,6 @@ msgstr "" msgid "Tile width must exactly divide bitmap width" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " -msgstr "" - #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -1227,6 +1223,10 @@ msgstr "" msgid "Unknown gatt error: 0x%04x" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "Unknown reason." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown security error: 0x%04x" @@ -1297,8 +1297,7 @@ msgid "" msgstr "" #: supervisor/shared/safe_mode.c -msgid "" -"You are running in safe mode which means something unanticipated happened.\n" +msgid "You are in safe mode: something unanticipated happened.\n" msgstr "" #: supervisor/shared/safe_mode.c diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index 9fe49ec9f1..54d246e2de 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-10 13:55-0600\n" +"POT-Creation-Date: 2019-12-12 14:51-0500\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: @sommersoft, @MrCertainly\n" @@ -25,6 +25,19 @@ msgstr "" "\n" "Captin's orders are complete. Holdin' fast fer reload.\n" +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"Please file an issue with the contents of your CIRCUITPY drive at \n" +"https://github.com/adafruit/circuitpython/issues\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"To exit, please reset the board without " +msgstr "" + #: py/obj.c msgid " File \"%q\"" msgstr "" @@ -294,7 +307,7 @@ msgid "Array values should be single bytes." msgstr "" #: supervisor/shared/safe_mode.c -msgid "Attempted heap allocation when MicroPython VM not running.\n" +msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" #: main.c @@ -448,6 +461,16 @@ msgstr "" msgid "CharacteristicBuffer writing not provided" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "CircuitPython core code crashed hard. Whoops!\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"CircuitPython is in safe mode because you pressed the reset button during " +"boot. Press again to exit safe mode.\n" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "" @@ -509,7 +532,7 @@ msgid "Couldn't allocate second buffer" msgstr "" #: supervisor/shared/safe_mode.c -msgid "Crash into the HardFault_Handler.\n" +msgid "Crash into the HardFault_Handler." msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -625,28 +648,18 @@ msgstr "" msgid "Failed to release mutex, err 0x%04x" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "Failed to write internal flash." +msgstr "" + #: py/moduerrno.c msgid "File exists" msgstr "" -#: ports/nrf/peripherals/nrf/nvm.c -msgid "Flash erase failed" -msgstr "" - -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash erase failed to start, err 0x%04x" -msgstr "" - -#: ports/nrf/peripherals/nrf/nvm.c +#: ports/nrf/common-hal/nvm/ByteArray.c msgid "Flash write failed" msgstr "" -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash write failed to start, err 0x%04x" -msgstr "" - #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "" @@ -819,13 +832,6 @@ msgstr "" msgid "Length must be non-negative" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "" -"Looks like our core CircuitPython code crashed hard. Whoops!\n" -"Please file an issue at https://github.com/adafruit/circuitpython/issues\n" -" with the contents of your CIRCUITPY drive and this message:\n" -msgstr "" - #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." msgstr "" @@ -840,11 +846,11 @@ msgid "Maximum x value when mirrored is %d" msgstr "" #: supervisor/shared/safe_mode.c -msgid "MicroPython NLR jump failed. Likely memory corruption.\n" +msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "" #: supervisor/shared/safe_mode.c -msgid "MicroPython fatal error.\n" +msgid "MicroPython fatal error." msgstr "" #: shared-bindings/audiobusio/PDMIn.c @@ -913,6 +919,10 @@ msgstr "" msgid "No such file/directory" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "Nordic Soft Device failure assertion." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "Not connected" @@ -1091,10 +1101,7 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" -"Please increase stack size limits and press reset (after ejecting " -"CIRCUITPY).\n" -"If you didn't change the stack, then file an issue here with the contents of " -"your CIRCUITPY drive:\n" +"Please increase the stack size if you know how, or if not:" msgstr "" #: supervisor/shared/safe_mode.c @@ -1105,18 +1112,11 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "" -"The microcontroller's power dipped. Please make sure your power supply " -"provides\n" +"The microcontroller's power dipped. Make sure your power supply provides\n" "enough power for the whole circuit and press reset (after ejecting " "CIRCUITPY).\n" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "" -"The reset button was pressed while booting CircuitPython. Press again to " -"exit safe mode.\n" -msgstr "" - #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" msgstr "" @@ -1149,10 +1149,6 @@ msgstr "" msgid "Tile width must exactly divide bitmap width" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " -msgstr "" - #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -1231,6 +1227,10 @@ msgstr "" msgid "Unknown gatt error: 0x%04x" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "Unknown reason." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown security error: 0x%04x" @@ -1301,8 +1301,7 @@ msgid "" msgstr "" #: supervisor/shared/safe_mode.c -msgid "" -"You are running in safe mode which means something unanticipated happened.\n" +msgid "You are in safe mode: something unanticipated happened.\n" msgstr "" #: supervisor/shared/safe_mode.c diff --git a/locale/es.po b/locale/es.po index b5c375481c..7ced099be5 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-10 13:55-0600\n" +"POT-Creation-Date: 2019-12-12 14:51-0500\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -25,6 +25,19 @@ msgstr "" "\n" "El código terminó su ejecución. Esperando para recargar.\n" +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"Please file an issue with the contents of your CIRCUITPY drive at \n" +"https://github.com/adafruit/circuitpython/issues\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"To exit, please reset the board without " +msgstr "" + #: py/obj.c msgid " File \"%q\"" msgstr " Archivo \"%q\"" @@ -296,10 +309,8 @@ msgid "Array values should be single bytes." msgstr "Valores del array deben ser bytes individuales." #: supervisor/shared/safe_mode.c -msgid "Attempted heap allocation when MicroPython VM not running.\n" +msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" -"Intento de allocation de heap cuando la VM de MicroPython no estaba " -"corriendo.\n" #: main.c msgid "Auto-reload is off.\n" @@ -452,6 +463,16 @@ msgstr "No se puede escribir sin pin MOSI." msgid "CharacteristicBuffer writing not provided" msgstr "CharateristicBuffer escritura no proporcionada" +#: supervisor/shared/safe_mode.c +msgid "CircuitPython core code crashed hard. Whoops!\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"CircuitPython is in safe mode because you pressed the reset button during " +"boot. Press again to exit safe mode.\n" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "Clock pin init fallido" @@ -513,8 +534,8 @@ msgid "Couldn't allocate second buffer" msgstr "No se pudo asignar el segundo buffer" #: supervisor/shared/safe_mode.c -msgid "Crash into the HardFault_Handler.\n" -msgstr "Choque en el HardFault_Handler.\n" +msgid "Crash into the HardFault_Handler." +msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" @@ -629,28 +650,18 @@ msgstr "" msgid "Failed to release mutex, err 0x%04x" msgstr "No se puede liberar el mutex, err 0x%04x" +#: supervisor/shared/safe_mode.c +msgid "Failed to write internal flash." +msgstr "" + #: py/moduerrno.c msgid "File exists" msgstr "El archivo ya existe" -#: ports/nrf/peripherals/nrf/nvm.c -msgid "Flash erase failed" -msgstr "Falló borrado de flash" - -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash erase failed to start, err 0x%04x" -msgstr "Falló el iniciar borrado de flash, err 0x%04x" - -#: ports/nrf/peripherals/nrf/nvm.c +#: ports/nrf/common-hal/nvm/ByteArray.c msgid "Flash write failed" msgstr "Falló la escritura" -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash write failed to start, err 0x%04x" -msgstr "Falló el iniciar la escritura de flash, err 0x%04x" - #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "Frecuencia capturada por encima de la capacidad. Captura en pausa." @@ -825,17 +836,6 @@ msgstr "Length debe ser un int" msgid "Length must be non-negative" msgstr "Longitud no deberia ser negativa" -#: supervisor/shared/safe_mode.c -msgid "" -"Looks like our core CircuitPython code crashed hard. Whoops!\n" -"Please file an issue at https://github.com/adafruit/circuitpython/issues\n" -" with the contents of your CIRCUITPY drive and this message:\n" -msgstr "" -"Parece que nuestro código de CircuitPython ha fallado con fuerza. Whoops!\n" -"Por favor, crea un issue en https://github.com/adafruit/circuitpython/" -"issues\n" -" con el contenido de su unidad CIRCUITPY y este mensaje:\n" - #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." msgstr "MISO pin init fallido." @@ -850,12 +850,12 @@ msgid "Maximum x value when mirrored is %d" msgstr "Valor máximo de x cuando se refleja es %d" #: supervisor/shared/safe_mode.c -msgid "MicroPython NLR jump failed. Likely memory corruption.\n" -msgstr "MicroPython NLR salto fallido. Probable corrupción de memoria.\n" +msgid "MicroPython NLR jump failed. Likely memory corruption." +msgstr "" #: supervisor/shared/safe_mode.c -msgid "MicroPython fatal error.\n" -msgstr "Error fatal de MicroPython.\n" +msgid "MicroPython fatal error." +msgstr "" #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" @@ -923,6 +923,10 @@ msgstr "No queda espacio en el dispositivo" msgid "No such file/directory" msgstr "No existe el archivo/directorio" +#: supervisor/shared/safe_mode.c +msgid "Nordic Soft Device failure assertion." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "Not connected" @@ -1112,17 +1116,8 @@ msgstr "A Stream le falta el método readinto() o write()." #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" -"Please increase stack size limits and press reset (after ejecting " -"CIRCUITPY).\n" -"If you didn't change the stack, then file an issue here with the contents of " -"your CIRCUITPY drive:\n" +"Please increase the stack size if you know how, or if not:" msgstr "" -"El heap de CircuitPython estaba corrupto porque el stack era demasiado " -"pequeño.\n" -"Aumente los límites del tamaño del stacj y presione reset (después de " -"expulsarCIRCUITPY).\n" -"Si no cambió el stack, entonces reporte un issue aquí con el contenido desu " -"unidad CIRCUITPY:\n" #: supervisor/shared/safe_mode.c msgid "" @@ -1132,23 +1127,10 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "" -"The microcontroller's power dipped. Please make sure your power supply " -"provides\n" +"The microcontroller's power dipped. Make sure your power supply provides\n" "enough power for the whole circuit and press reset (after ejecting " "CIRCUITPY).\n" msgstr "" -"La alimentación del microcontrolador cayó. Por favor asegurate de que tu " -"fuente de alimentación provee\n" -"suficiente energia para todo el circuito y presiona el botón de reset " -"(despuesde expulsar CIRCUITPY).\n" - -#: supervisor/shared/safe_mode.c -msgid "" -"The reset button was pressed while booting CircuitPython. Press again to " -"exit safe mode.\n" -msgstr "" -"El botón reset fue presionado mientras arrancaba CircuitPython. Presiona " -"otra vez para salir del modo seguro.\n" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" @@ -1182,10 +1164,6 @@ msgstr "" msgid "Tile width must exactly divide bitmap width" msgstr "Ancho del Tile debe dividir exactamente el ancho de mapa de bits" -#: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " -msgstr "Para salir, por favor reinicia la tarjeta sin " - #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Demasiados canales en sample." @@ -1264,6 +1242,10 @@ msgstr "Tipo de uuid nrfx inesperado" msgid "Unknown gatt error: 0x%04x" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "Unknown reason." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown security error: 0x%04x" @@ -1341,11 +1323,8 @@ msgstr "" "Para listar los módulos incorporados por favor haga `help(\"modules\")`.\n" #: supervisor/shared/safe_mode.c -msgid "" -"You are running in safe mode which means something unanticipated happened.\n" +msgid "You are in safe mode: something unanticipated happened.\n" msgstr "" -"Estás ejecutando en modo seguro, lo cual significa que algo realmente malo " -"ha sucedido.\n" #: supervisor/shared/safe_mode.c msgid "You requested starting safe mode by " @@ -2702,6 +2681,11 @@ msgstr "paso cero" #~ msgid "Address is not %d bytes long or is in wrong format" #~ msgstr "Direción no es %d bytes largo o esta en el formato incorrecto" +#~ msgid "Attempted heap allocation when MicroPython VM not running.\n" +#~ msgstr "" +#~ "Intento de allocation de heap cuando la VM de MicroPython no estaba " +#~ "corriendo.\n" + #~ msgid "Can't add services in Central mode" #~ msgstr "No se pueden agregar servicio en modo Central" @@ -2735,6 +2719,9 @@ msgstr "paso cero" #~ msgid "Could not decode ble_uuid, err 0x%04x" #~ msgstr "No se puede descodificar ble_uuid, err 0x%04x" +#~ msgid "Crash into the HardFault_Handler.\n" +#~ msgstr "Choque en el HardFault_Handler.\n" + #, fuzzy #~ msgid "Data too large for the advertisement packet" #~ msgstr "Los datos no caben en el paquete de anuncio." @@ -2849,6 +2836,15 @@ msgstr "paso cero" #~ msgid "Failed to write gatts value, err 0x%04x" #~ msgstr "No se puede escribir el valor del atributo. err: 0x%04x" +#~ msgid "Flash erase failed" +#~ msgstr "Falló borrado de flash" + +#~ msgid "Flash erase failed to start, err 0x%04x" +#~ msgstr "Falló el iniciar borrado de flash, err 0x%04x" + +#~ msgid "Flash write failed to start, err 0x%04x" +#~ msgstr "Falló el iniciar la escritura de flash, err 0x%04x" + #~ msgid "Function requires lock." #~ msgstr "La función requiere lock" @@ -2864,9 +2860,26 @@ msgstr "paso cero" #~ msgid "Invalid data pin" #~ msgstr "Pin de datos inválido" +#~ msgid "" +#~ "Looks like our core CircuitPython code crashed hard. Whoops!\n" +#~ "Please file an issue at https://github.com/adafruit/circuitpython/issues\n" +#~ " with the contents of your CIRCUITPY drive and this message:\n" +#~ msgstr "" +#~ "Parece que nuestro código de CircuitPython ha fallado con fuerza. " +#~ "Whoops!\n" +#~ "Por favor, crea un issue en https://github.com/adafruit/circuitpython/" +#~ "issues\n" +#~ " con el contenido de su unidad CIRCUITPY y este mensaje:\n" + #~ msgid "Maximum PWM frequency is %dhz." #~ msgstr "La frecuencia máxima del PWM es %dhz." +#~ msgid "MicroPython NLR jump failed. Likely memory corruption.\n" +#~ msgstr "MicroPython NLR salto fallido. Probable corrupción de memoria.\n" + +#~ msgid "MicroPython fatal error.\n" +#~ msgstr "Error fatal de MicroPython.\n" + #~ msgid "Minimum PWM frequency is 1hz." #~ msgstr "La frecuencia mínima del PWM es 1hz" @@ -2926,9 +2939,44 @@ msgstr "paso cero" #~ msgid "Soft device assert, id: 0x%08lX, pc: 0x%08lX" #~ msgstr "Soft device assert, id: 0x%08lX, pc: 0x%08lX" +#~ msgid "" +#~ "The CircuitPython heap was corrupted because the stack was too small.\n" +#~ "Please increase stack size limits and press reset (after ejecting " +#~ "CIRCUITPY).\n" +#~ "If you didn't change the stack, then file an issue here with the contents " +#~ "of your CIRCUITPY drive:\n" +#~ msgstr "" +#~ "El heap de CircuitPython estaba corrupto porque el stack era demasiado " +#~ "pequeño.\n" +#~ "Aumente los límites del tamaño del stacj y presione reset (después de " +#~ "expulsarCIRCUITPY).\n" +#~ "Si no cambió el stack, entonces reporte un issue aquí con el contenido " +#~ "desu unidad CIRCUITPY:\n" + +#~ msgid "" +#~ "The microcontroller's power dipped. Please make sure your power supply " +#~ "provides\n" +#~ "enough power for the whole circuit and press reset (after ejecting " +#~ "CIRCUITPY).\n" +#~ msgstr "" +#~ "La alimentación del microcontrolador cayó. Por favor asegurate de que tu " +#~ "fuente de alimentación provee\n" +#~ "suficiente energia para todo el circuito y presiona el botón de reset " +#~ "(despuesde expulsar CIRCUITPY).\n" + +#~ msgid "" +#~ "The reset button was pressed while booting CircuitPython. Press again to " +#~ "exit safe mode.\n" +#~ msgstr "" +#~ "El botón reset fue presionado mientras arrancaba CircuitPython. Presiona " +#~ "otra vez para salir del modo seguro.\n" + #~ msgid "Tile indices must be 0 - 255" #~ msgstr "Los índices de Tile deben ser 0 - 255" +#~ msgid "To exit, please reset the board without " +#~ msgstr "Para salir, por favor reinicia la tarjeta sin " + #~ msgid "UART(%d) does not exist" #~ msgstr "UART(%d) no existe" @@ -2951,6 +2999,13 @@ msgstr "paso cero" #~ msgid "Voice index too high" #~ msgstr "Index de voz demasiado alto" +#~ msgid "" +#~ "You are running in safe mode which means something unanticipated " +#~ "happened.\n" +#~ msgstr "" +#~ "Estás ejecutando en modo seguro, lo cual significa que algo realmente " +#~ "malo ha sucedido.\n" + #~ msgid "bad GATT role" #~ msgstr "mal GATT role" diff --git a/locale/fil.po b/locale/fil.po index ba20e69b81..16fac72244 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-10 13:55-0600\n" +"POT-Creation-Date: 2019-12-12 14:51-0500\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -23,6 +23,19 @@ msgid "" "Code done running. Waiting for reload.\n" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"Please file an issue with the contents of your CIRCUITPY drive at \n" +"https://github.com/adafruit/circuitpython/issues\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"To exit, please reset the board without " +msgstr "" + #: py/obj.c msgid " File \"%q\"" msgstr " File \"%q\"" @@ -296,7 +309,7 @@ msgid "Array values should be single bytes." msgstr "Array values ay dapat single bytes." #: supervisor/shared/safe_mode.c -msgid "Attempted heap allocation when MicroPython VM not running.\n" +msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" #: main.c @@ -452,6 +465,16 @@ msgstr "Hindi maaring isulat kapag walang MOSI pin." msgid "CharacteristicBuffer writing not provided" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "CircuitPython core code crashed hard. Whoops!\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"CircuitPython is in safe mode because you pressed the reset button during " +"boot. Press again to exit safe mode.\n" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "Nabigo sa pag init ng Clock pin." @@ -514,8 +537,8 @@ msgid "Couldn't allocate second buffer" msgstr "Hindi ma-iallocate ang second buffer" #: supervisor/shared/safe_mode.c -msgid "Crash into the HardFault_Handler.\n" -msgstr "Nagcrash sa HardFault_Handler.\n" +msgid "Crash into the HardFault_Handler." +msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" @@ -635,28 +658,18 @@ msgstr "" msgid "Failed to release mutex, err 0x%04x" msgstr "Nabigo sa pagrelease ng mutex, status: 0x%08lX" +#: supervisor/shared/safe_mode.c +msgid "Failed to write internal flash." +msgstr "" + #: py/moduerrno.c msgid "File exists" msgstr "Mayroong file" -#: ports/nrf/peripherals/nrf/nvm.c -msgid "Flash erase failed" -msgstr "" - -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash erase failed to start, err 0x%04x" -msgstr "" - -#: ports/nrf/peripherals/nrf/nvm.c +#: ports/nrf/common-hal/nvm/ByteArray.c msgid "Flash write failed" msgstr "" -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash write failed to start, err 0x%04x" -msgstr "" - #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "" @@ -831,17 +844,6 @@ msgstr "Haba ay dapat int" msgid "Length must be non-negative" msgstr "Haba ay dapat hindi negatibo" -#: supervisor/shared/safe_mode.c -msgid "" -"Looks like our core CircuitPython code crashed hard. Whoops!\n" -"Please file an issue at https://github.com/adafruit/circuitpython/issues\n" -" with the contents of your CIRCUITPY drive and this message:\n" -msgstr "" -"Mukhang ang core CircuitPython code nag crash. Ay!\n" -"Maaring mag file ng issue sa https://github.com/adafruit/circuitpython/" -"issues\n" -"kasama ng laman ng iyong CIRCUITPY drive at ang message na ito:\n" - #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." msgstr "Hindi ma-initialize ang MISO pin." @@ -856,12 +858,12 @@ msgid "Maximum x value when mirrored is %d" msgstr "" #: supervisor/shared/safe_mode.c -msgid "MicroPython NLR jump failed. Likely memory corruption.\n" -msgstr "CircuitPython NLR jump nabigo. Maaring memory corruption.\n" +msgid "MicroPython NLR jump failed. Likely memory corruption." +msgstr "" #: supervisor/shared/safe_mode.c -msgid "MicroPython fatal error.\n" -msgstr "CircuitPython fatal na pagkakamali.\n" +msgid "MicroPython fatal error." +msgstr "" #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" @@ -929,6 +931,10 @@ msgstr "" msgid "No such file/directory" msgstr "Walang file/directory" +#: supervisor/shared/safe_mode.c +msgid "Nordic Soft Device failure assertion." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c #, fuzzy @@ -1116,16 +1122,8 @@ msgstr "Stream kulang ng readinto() o write() method." #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" -"Please increase stack size limits and press reset (after ejecting " -"CIRCUITPY).\n" -"If you didn't change the stack, then file an issue here with the contents of " -"your CIRCUITPY drive:\n" +"Please increase the stack size if you know how, or if not:" msgstr "" -"Ang CircuitPython heap ay na corrupt dahil ang stack ay maliit.\n" -"Maaring i-increase ang stack size limit at i-press ang reset (pagkatapos i-" -"eject ang CIRCUITPY.\n" -"Kung hindi mo pinalitan ang stack, mag file ng issue dito kasama ng laman ng " -"CIRCUITPY drive:\n" #: supervisor/shared/safe_mode.c msgid "" @@ -1135,22 +1133,10 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "" -"The microcontroller's power dipped. Please make sure your power supply " -"provides\n" +"The microcontroller's power dipped. Make sure your power supply provides\n" "enough power for the whole circuit and press reset (after ejecting " "CIRCUITPY).\n" msgstr "" -"Ang kapangyarihan ng mikrokontroller ay bumaba. Mangyaring suriin ang power " -"supply \n" -"pindutin ang reset (pagkatapos i-eject ang CIRCUITPY).\n" - -#: supervisor/shared/safe_mode.c -msgid "" -"The reset button was pressed while booting CircuitPython. Press again to " -"exit safe mode.\n" -msgstr "" -"Ang reset button ay pinindot habang nag boot ang CircuitPython. Pindutin " -"ulit para lumabas sa safe mode.\n" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" @@ -1184,10 +1170,6 @@ msgstr "" msgid "Tile width must exactly divide bitmap width" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " -msgstr "Para lumabas, paki-reset ang board na wala ang " - #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Sobra ang channels sa sample." @@ -1267,6 +1249,10 @@ msgstr "hindi inaasahang indent" msgid "Unknown gatt error: 0x%04x" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "Unknown reason." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown security error: 0x%04x" @@ -1346,9 +1332,8 @@ msgstr "" "Para makita ang listahan ng modules, `help(“modules”)`.\n" #: supervisor/shared/safe_mode.c -msgid "" -"You are running in safe mode which means something unanticipated happened.\n" -msgstr "Ikaw ay tumatakbo sa safe mode dahil may masamang nangyari.\n" +msgid "You are in safe mode: something unanticipated happened.\n" +msgstr "" #: supervisor/shared/safe_mode.c msgid "You requested starting safe mode by " @@ -2735,6 +2720,9 @@ msgstr "zero step" #~ msgid "Cannot update i/f status" #~ msgstr "Hindi ma-update i/f status" +#~ msgid "Crash into the HardFault_Handler.\n" +#~ msgstr "Nagcrash sa HardFault_Handler.\n" + #, fuzzy #~ msgid "Data too large for the advertisement packet" #~ msgstr "Hindi makasya ang data sa loob ng advertisement packet" @@ -2871,9 +2859,25 @@ msgstr "zero step" #~ msgid "Invalid data pin" #~ msgstr "Mali ang data pin" +#~ msgid "" +#~ "Looks like our core CircuitPython code crashed hard. Whoops!\n" +#~ "Please file an issue at https://github.com/adafruit/circuitpython/issues\n" +#~ " with the contents of your CIRCUITPY drive and this message:\n" +#~ msgstr "" +#~ "Mukhang ang core CircuitPython code nag crash. Ay!\n" +#~ "Maaring mag file ng issue sa https://github.com/adafruit/circuitpython/" +#~ "issues\n" +#~ "kasama ng laman ng iyong CIRCUITPY drive at ang message na ito:\n" + #~ msgid "Maximum PWM frequency is %dhz." #~ msgstr "Pinakamataas na PWM frequency ay %dhz." +#~ msgid "MicroPython NLR jump failed. Likely memory corruption.\n" +#~ msgstr "CircuitPython NLR jump nabigo. Maaring memory corruption.\n" + +#~ msgid "MicroPython fatal error.\n" +#~ msgstr "CircuitPython fatal na pagkakamali.\n" + #~ msgid "Minimum PWM frequency is 1hz." #~ msgstr "Pinakamababang PWM frequency ay 1hz." @@ -2918,6 +2922,39 @@ msgstr "zero step" #~ msgid "STA required" #~ msgstr "STA kailangan" +#~ msgid "" +#~ "The CircuitPython heap was corrupted because the stack was too small.\n" +#~ "Please increase stack size limits and press reset (after ejecting " +#~ "CIRCUITPY).\n" +#~ "If you didn't change the stack, then file an issue here with the contents " +#~ "of your CIRCUITPY drive:\n" +#~ msgstr "" +#~ "Ang CircuitPython heap ay na corrupt dahil ang stack ay maliit.\n" +#~ "Maaring i-increase ang stack size limit at i-press ang reset (pagkatapos " +#~ "i-eject ang CIRCUITPY.\n" +#~ "Kung hindi mo pinalitan ang stack, mag file ng issue dito kasama ng laman " +#~ "ng CIRCUITPY drive:\n" + +#~ msgid "" +#~ "The microcontroller's power dipped. Please make sure your power supply " +#~ "provides\n" +#~ "enough power for the whole circuit and press reset (after ejecting " +#~ "CIRCUITPY).\n" +#~ msgstr "" +#~ "Ang kapangyarihan ng mikrokontroller ay bumaba. Mangyaring suriin ang " +#~ "power supply \n" +#~ "pindutin ang reset (pagkatapos i-eject ang CIRCUITPY).\n" + +#~ msgid "" +#~ "The reset button was pressed while booting CircuitPython. Press again to " +#~ "exit safe mode.\n" +#~ msgstr "" +#~ "Ang reset button ay pinindot habang nag boot ang CircuitPython. Pindutin " +#~ "ulit para lumabas sa safe mode.\n" + +#~ msgid "To exit, please reset the board without " +#~ msgstr "Para lumabas, paki-reset ang board na wala ang " + #~ msgid "UART(%d) does not exist" #~ msgstr "Walang UART(%d)" @@ -2937,6 +2974,11 @@ msgstr "zero step" #~ msgid "Voice index too high" #~ msgstr "Index ng Voice ay masyadong mataas" +#~ msgid "" +#~ "You are running in safe mode which means something unanticipated " +#~ "happened.\n" +#~ msgstr "Ikaw ay tumatakbo sa safe mode dahil may masamang nangyari.\n" + #~ msgid "[addrinfo error %d]" #~ msgstr "[addrinfo error %d]" diff --git a/locale/fr.po b/locale/fr.po index e103cd06d2..9762b5e7da 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-10 13:55-0600\n" +"POT-Creation-Date: 2019-12-12 14:51-0500\n" "PO-Revision-Date: 2019-04-14 20:05+0100\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -25,6 +25,19 @@ msgstr "" "\n" "Fin d'éxecution du code. En attente de recharge.\n" +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"Please file an issue with the contents of your CIRCUITPY drive at \n" +"https://github.com/adafruit/circuitpython/issues\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"To exit, please reset the board without " +msgstr "" + #: py/obj.c msgid " File \"%q\"" msgstr " Fichier \"%q\"" @@ -300,9 +313,8 @@ msgid "Array values should be single bytes." msgstr "Les valeurs du tableau doivent être des octets simples 'bytes'." #: supervisor/shared/safe_mode.c -msgid "Attempted heap allocation when MicroPython VM not running.\n" +msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" -"Tentative d'allocation de tas alors que la VM MicroPython ne tourne pas.\n" #: main.c msgid "Auto-reload is off.\n" @@ -458,6 +470,16 @@ msgstr "Impossible d'écrire sans broche MOSI." msgid "CharacteristicBuffer writing not provided" msgstr "Ecriture sur 'CharacteristicBuffer' non fournie" +#: supervisor/shared/safe_mode.c +msgid "CircuitPython core code crashed hard. Whoops!\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"CircuitPython is in safe mode because you pressed the reset button during " +"boot. Press again to exit safe mode.\n" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "Echec de l'init. de la broche d'horloge" @@ -520,8 +542,8 @@ msgid "Couldn't allocate second buffer" msgstr "Impossible d'allouer le 2e tampon" #: supervisor/shared/safe_mode.c -msgid "Crash into the HardFault_Handler.\n" -msgstr "Plantage vers le 'HardFault_Handler'.\n" +msgid "Crash into the HardFault_Handler." +msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" @@ -639,28 +661,18 @@ msgstr "" msgid "Failed to release mutex, err 0x%04x" msgstr "Impossible de libérer mutex, err 0x%04x" +#: supervisor/shared/safe_mode.c +msgid "Failed to write internal flash." +msgstr "" + #: py/moduerrno.c msgid "File exists" msgstr "Le fichier existe" -#: ports/nrf/peripherals/nrf/nvm.c -msgid "Flash erase failed" -msgstr "L'effacement de la flash a échoué" - -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash erase failed to start, err 0x%04x" -msgstr "Echec du démarrage de l'effacement de la flash, err 0x%04x" - -#: ports/nrf/peripherals/nrf/nvm.c +#: ports/nrf/common-hal/nvm/ByteArray.c msgid "Flash write failed" msgstr "L'écriture de la flash échoué" -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash write failed to start, err 0x%04x" -msgstr "Echec du démarrage de l'écriture de la flash, err 0x%04x" - #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "La fréquence capturée est au delà des capacités. Capture en pause." @@ -839,17 +851,6 @@ msgstr "La longueur doit être un nombre entier" msgid "Length must be non-negative" msgstr "La longueur ne doit pas être négative" -#: supervisor/shared/safe_mode.c -msgid "" -"Looks like our core CircuitPython code crashed hard. Whoops!\n" -"Please file an issue at https://github.com/adafruit/circuitpython/issues\n" -" with the contents of your CIRCUITPY drive and this message:\n" -msgstr "" -"On dirait que notre code CircuitPython a durement planté. Oups !\n" -"Merci de remplir un ticket sur https://github.com/adafruit/circuitpython/" -"issues\n" -"avec le contenu de votre lecteur CIRCUITPY et ce message:\n" - #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." msgstr "Echec de l'init. de la broche MISO" @@ -864,12 +865,12 @@ msgid "Maximum x value when mirrored is %d" msgstr "La valeur max. de x est %d lors d'une opération miroir" #: supervisor/shared/safe_mode.c -msgid "MicroPython NLR jump failed. Likely memory corruption.\n" -msgstr "Saut MicroPython NLR a échoué. Corruption de mémoire possible.\n" +msgid "MicroPython NLR jump failed. Likely memory corruption." +msgstr "" #: supervisor/shared/safe_mode.c -msgid "MicroPython fatal error.\n" -msgstr "Erreur fatale de MicroPython.\n" +msgid "MicroPython fatal error." +msgstr "" #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" @@ -937,6 +938,10 @@ msgstr "Il n'y a plus d'espace libre sur le périphérique" msgid "No such file/directory" msgstr "Fichier/dossier introuvable" +#: supervisor/shared/safe_mode.c +msgid "Nordic Soft Device failure assertion." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c #, fuzzy @@ -1131,17 +1136,8 @@ msgstr "Il manque une méthode readinto() ou write() au flux." #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" -"Please increase stack size limits and press reset (after ejecting " -"CIRCUITPY).\n" -"If you didn't change the stack, then file an issue here with the contents of " -"your CIRCUITPY drive:\n" +"Please increase the stack size if you know how, or if not:" msgstr "" -"Le tas (heap) de CircuitPython a été corrompu parce que la pile était trop " -"petite.\n" -"Augmentez la limite de taille de la pile et appuyez sur 'reset' (après avoir " -"éjecté CIRCUITPY).\n" -"Si vous n'avez pas modifié la pile, merci de remplir un ticket avec le " -"contenu de votre lecteur CIRCUITPY :\n" #: supervisor/shared/safe_mode.c msgid "" @@ -1150,25 +1146,11 @@ msgid "" msgstr "" #: supervisor/shared/safe_mode.c -#, fuzzy msgid "" -"The microcontroller's power dipped. Please make sure your power supply " -"provides\n" +"The microcontroller's power dipped. Make sure your power supply provides\n" "enough power for the whole circuit and press reset (after ejecting " "CIRCUITPY).\n" msgstr "" -"L'alimentation du microcontroleur a chuté. Merci de vérifier que votre " -"alimentation fournit\n" -"suffisamment de puissance pour l'ensemble du circuit et appuyez sur " -"'reset' (après avoir éjecté CIRCUITPY).\n" - -#: supervisor/shared/safe_mode.c -msgid "" -"The reset button was pressed while booting CircuitPython. Press again to " -"exit safe mode.\n" -msgstr "" -"Le bouton 'reset' a été appuyé pendant le démarrage de CircuitPython. " -"Appuyer de nouveau pour quitter de le mode sans-échec.\n" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" @@ -1203,10 +1185,6 @@ msgstr "" msgid "Tile width must exactly divide bitmap width" msgstr "La largeur de la tuile doit diviser exactement la largeur de l'image" -#: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " -msgstr "Pour quitter, redémarrez la carte SVP sans " - #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Trop de canaux dans l'échantillon." @@ -1289,6 +1267,10 @@ msgstr "Type inattendu pour l'uuid nrfx" msgid "Unknown gatt error: 0x%04x" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "Unknown reason." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown security error: 0x%04x" @@ -1367,11 +1349,8 @@ msgstr "" "Pour lister les modules inclus, tapez `help(\"modules\")`.\n" #: supervisor/shared/safe_mode.c -#, fuzzy -msgid "" -"You are running in safe mode which means something unanticipated happened.\n" +msgid "You are in safe mode: something unanticipated happened.\n" msgstr "" -"Vous êtes en mode sans-échec ce qui signifie qu'un imprévu est survenu.\n" #: supervisor/shared/safe_mode.c msgid "You requested starting safe mode by " @@ -2753,6 +2732,10 @@ msgstr "'step' nul" #~ msgid "Address is not %d bytes long or is in wrong format" #~ msgstr "L'adresse n'est pas longue de %d octets ou est d'un format erroné" +#~ msgid "Attempted heap allocation when MicroPython VM not running.\n" +#~ msgstr "" +#~ "Tentative d'allocation de tas alors que la VM MicroPython ne tourne pas.\n" + #~ msgid "Can't add services in Central mode" #~ msgstr "Impossible d'ajouter des services en mode Central" @@ -2786,6 +2769,9 @@ msgstr "'step' nul" #~ msgid "Could not decode ble_uuid, err 0x%04x" #~ msgstr "Impossible de décoder le 'ble_uuid', err 0x%04x" +#~ msgid "Crash into the HardFault_Handler.\n" +#~ msgstr "Plantage vers le 'HardFault_Handler'.\n" + #~ msgid "Data too large for the advertisement packet" #~ msgstr "Données trop volumineuses pour le paquet de diffusion" @@ -2912,6 +2898,15 @@ msgstr "'step' nul" #~ msgid "Failed to write gatts value, err 0x%04x" #~ msgstr "Impossible d'écrire la valeur de 'gatts', err 0x%04x" +#~ msgid "Flash erase failed" +#~ msgstr "L'effacement de la flash a échoué" + +#~ msgid "Flash erase failed to start, err 0x%04x" +#~ msgstr "Echec du démarrage de l'effacement de la flash, err 0x%04x" + +#~ msgid "Flash write failed to start, err 0x%04x" +#~ msgstr "Echec du démarrage de l'écriture de la flash, err 0x%04x" + #~ msgid "Function requires lock." #~ msgstr "La fonction nécessite un verrou." @@ -2927,9 +2922,25 @@ msgstr "'step' nul" #~ msgid "Invalid data pin" #~ msgstr "Broche de données invalide" +#~ msgid "" +#~ "Looks like our core CircuitPython code crashed hard. Whoops!\n" +#~ "Please file an issue at https://github.com/adafruit/circuitpython/issues\n" +#~ " with the contents of your CIRCUITPY drive and this message:\n" +#~ msgstr "" +#~ "On dirait que notre code CircuitPython a durement planté. Oups !\n" +#~ "Merci de remplir un ticket sur https://github.com/adafruit/circuitpython/" +#~ "issues\n" +#~ "avec le contenu de votre lecteur CIRCUITPY et ce message:\n" + #~ msgid "Maximum PWM frequency is %dhz." #~ msgstr "La fréquence de PWM maximale est %dHz" +#~ msgid "MicroPython NLR jump failed. Likely memory corruption.\n" +#~ msgstr "Saut MicroPython NLR a échoué. Corruption de mémoire possible.\n" + +#~ msgid "MicroPython fatal error.\n" +#~ msgstr "Erreur fatale de MicroPython.\n" + #~ msgid "Minimum PWM frequency is 1hz." #~ msgstr "La fréquence de PWM minimale est 1Hz" @@ -2986,9 +2997,45 @@ msgstr "'step' nul" #~ msgid "Soft device assert, id: 0x%08lX, pc: 0x%08lX" #~ msgstr "Assertion en mode 'soft-device', id: 0x%08lX, pc: 0x%08lX" +#~ msgid "" +#~ "The CircuitPython heap was corrupted because the stack was too small.\n" +#~ "Please increase stack size limits and press reset (after ejecting " +#~ "CIRCUITPY).\n" +#~ "If you didn't change the stack, then file an issue here with the contents " +#~ "of your CIRCUITPY drive:\n" +#~ msgstr "" +#~ "Le tas (heap) de CircuitPython a été corrompu parce que la pile était " +#~ "trop petite.\n" +#~ "Augmentez la limite de taille de la pile et appuyez sur 'reset' (après " +#~ "avoir éjecté CIRCUITPY).\n" +#~ "Si vous n'avez pas modifié la pile, merci de remplir un ticket avec le " +#~ "contenu de votre lecteur CIRCUITPY :\n" + +#, fuzzy +#~ msgid "" +#~ "The microcontroller's power dipped. Please make sure your power supply " +#~ "provides\n" +#~ "enough power for the whole circuit and press reset (after ejecting " +#~ "CIRCUITPY).\n" +#~ msgstr "" +#~ "L'alimentation du microcontroleur a chuté. Merci de vérifier que votre " +#~ "alimentation fournit\n" +#~ "suffisamment de puissance pour l'ensemble du circuit et appuyez sur " +#~ "'reset' (après avoir éjecté CIRCUITPY).\n" + +#~ msgid "" +#~ "The reset button was pressed while booting CircuitPython. Press again to " +#~ "exit safe mode.\n" +#~ msgstr "" +#~ "Le bouton 'reset' a été appuyé pendant le démarrage de CircuitPython. " +#~ "Appuyer de nouveau pour quitter de le mode sans-échec.\n" + #~ msgid "Tile indices must be 0 - 255" #~ msgstr "Les indices des tuiles doivent être compris entre 0 et 255 " +#~ msgid "To exit, please reset the board without " +#~ msgstr "Pour quitter, redémarrez la carte SVP sans " + #~ msgid "UART(%d) does not exist" #~ msgstr "UART(%d) n'existe pas" @@ -3011,6 +3058,13 @@ msgstr "'step' nul" #~ msgid "Voice index too high" #~ msgstr "Index de la voix trop grand" +#, fuzzy +#~ msgid "" +#~ "You are running in safe mode which means something unanticipated " +#~ "happened.\n" +#~ msgstr "" +#~ "Vous êtes en mode sans-échec ce qui signifie qu'un imprévu est survenu.\n" + #~ msgid "bad GATT role" #~ msgstr "mauvais rôle GATT" diff --git a/locale/it_IT.po b/locale/it_IT.po index c1a445fa24..0a3c30d2bd 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-10 13:55-0600\n" +"POT-Creation-Date: 2019-12-12 14:51-0500\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -23,6 +23,19 @@ msgid "" "Code done running. Waiting for reload.\n" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"Please file an issue with the contents of your CIRCUITPY drive at \n" +"https://github.com/adafruit/circuitpython/issues\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"To exit, please reset the board without " +msgstr "" + #: py/obj.c msgid " File \"%q\"" msgstr " File \"%q\"" @@ -295,7 +308,7 @@ msgid "Array values should be single bytes." msgstr "Valori di Array dovrebbero essere bytes singulari" #: supervisor/shared/safe_mode.c -msgid "Attempted heap allocation when MicroPython VM not running.\n" +msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" #: main.c @@ -453,6 +466,16 @@ msgstr "Impossibile scrivere senza pin MOSI." msgid "CharacteristicBuffer writing not provided" msgstr "CharacteristicBuffer scritura non dato" +#: supervisor/shared/safe_mode.c +msgid "CircuitPython core code crashed hard. Whoops!\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"CircuitPython is in safe mode because you pressed the reset button during " +"boot. Press again to exit safe mode.\n" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "Inizializzazione del pin di clock fallita." @@ -515,7 +538,7 @@ msgid "Couldn't allocate second buffer" msgstr "Impossibile allocare il secondo buffer" #: supervisor/shared/safe_mode.c -msgid "Crash into the HardFault_Handler.\n" +msgid "Crash into the HardFault_Handler." msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -635,28 +658,18 @@ msgstr "" msgid "Failed to release mutex, err 0x%04x" msgstr "Impossibile leggere valore dell'attributo. status: 0x%02x" +#: supervisor/shared/safe_mode.c +msgid "Failed to write internal flash." +msgstr "" + #: py/moduerrno.c msgid "File exists" msgstr "File esistente" -#: ports/nrf/peripherals/nrf/nvm.c -msgid "Flash erase failed" -msgstr "Cancellamento di Flash fallito" - -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash erase failed to start, err 0x%04x" -msgstr "Iniziamento di Cancellamento di Flash fallito, err 0x%04x" - -#: ports/nrf/peripherals/nrf/nvm.c +#: ports/nrf/common-hal/nvm/ByteArray.c msgid "Flash write failed" msgstr "Impostazione di Flash fallito" -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash write failed to start, err 0x%04x" -msgstr "Iniziamento di Impostazione di Flash dallito, err 0x%04x" - #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "" @@ -834,13 +847,6 @@ msgstr "Length deve essere un intero" msgid "Length must be non-negative" msgstr "Length deve essere non negativo" -#: supervisor/shared/safe_mode.c -msgid "" -"Looks like our core CircuitPython code crashed hard. Whoops!\n" -"Please file an issue at https://github.com/adafruit/circuitpython/issues\n" -" with the contents of your CIRCUITPY drive and this message:\n" -msgstr "" - #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." msgstr "inizializzazione del pin MISO fallita." @@ -855,12 +861,12 @@ msgid "Maximum x value when mirrored is %d" msgstr "Valore massimo di x quando rispachiato è %d" #: supervisor/shared/safe_mode.c -msgid "MicroPython NLR jump failed. Likely memory corruption.\n" +msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "" #: supervisor/shared/safe_mode.c -msgid "MicroPython fatal error.\n" -msgstr "Errore fatale in MicroPython.\n" +msgid "MicroPython fatal error." +msgstr "" #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" @@ -929,6 +935,10 @@ msgstr "Non che spazio sul dispositivo" msgid "No such file/directory" msgstr "Nessun file/directory esistente" +#: supervisor/shared/safe_mode.c +msgid "Nordic Soft Device failure assertion." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c #, fuzzy @@ -1123,10 +1133,7 @@ msgstr "Metodi mancanti readinto() o write() allo stream." #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" -"Please increase stack size limits and press reset (after ejecting " -"CIRCUITPY).\n" -"If you didn't change the stack, then file an issue here with the contents of " -"your CIRCUITPY drive:\n" +"Please increase the stack size if you know how, or if not:" msgstr "" #: supervisor/shared/safe_mode.c @@ -1136,21 +1143,11 @@ msgid "" msgstr "" #: supervisor/shared/safe_mode.c -#, fuzzy msgid "" -"The microcontroller's power dipped. Please make sure your power supply " -"provides\n" +"The microcontroller's power dipped. Make sure your power supply provides\n" "enough power for the whole circuit and press reset (after ejecting " "CIRCUITPY).\n" msgstr "" -"La potenza del microcontrollore è calata. Assicurati che l'alimentazione sia " -"attaccata correttamente\n" - -#: supervisor/shared/safe_mode.c -msgid "" -"The reset button was pressed while booting CircuitPython. Press again to " -"exit safe mode.\n" -msgstr "" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" @@ -1184,10 +1181,6 @@ msgstr "" msgid "Tile width must exactly divide bitmap width" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " -msgstr "Per uscire resettare la scheda senza " - #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -1267,6 +1260,10 @@ msgstr "indentazione inaspettata" msgid "Unknown gatt error: 0x%04x" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "Unknown reason." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown security error: 0x%04x" @@ -1338,12 +1335,8 @@ msgid "" msgstr "" #: supervisor/shared/safe_mode.c -#, fuzzy -msgid "" -"You are running in safe mode which means something unanticipated happened.\n" +msgid "You are in safe mode: something unanticipated happened.\n" msgstr "" -"Sei nella modalità sicura che significa che qualcosa di molto brutto è " -"successo.\n" #: supervisor/shared/safe_mode.c msgid "You requested starting safe mode by " @@ -2862,6 +2855,15 @@ msgstr "zero step" #~ msgid "Failed to write gatts value, err 0x%04x" #~ msgstr "Impossibile scrivere valore dell'attributo. status: 0x%02x" +#~ msgid "Flash erase failed" +#~ msgstr "Cancellamento di Flash fallito" + +#~ msgid "Flash erase failed to start, err 0x%04x" +#~ msgstr "Iniziamento di Cancellamento di Flash fallito, err 0x%04x" + +#~ msgid "Flash write failed to start, err 0x%04x" +#~ msgstr "Iniziamento di Impostazione di Flash dallito, err 0x%04x" + #~ msgid "GPIO16 does not support pull up." #~ msgstr "GPIO16 non supporta pull-up" @@ -2877,6 +2879,9 @@ msgstr "zero step" #~ msgid "Maximum PWM frequency is %dhz." #~ msgstr "Frequenza massima su PWM è %dhz" +#~ msgid "MicroPython fatal error.\n" +#~ msgstr "Errore fatale in MicroPython.\n" + #~ msgid "Minimum PWM frequency is 1hz." #~ msgstr "Frequenza minima su PWM è 1hz" @@ -2922,6 +2927,19 @@ msgstr "zero step" #~ msgid "STA required" #~ msgstr "STA richiesta" +#, fuzzy +#~ msgid "" +#~ "The microcontroller's power dipped. Please make sure your power supply " +#~ "provides\n" +#~ "enough power for the whole circuit and press reset (after ejecting " +#~ "CIRCUITPY).\n" +#~ msgstr "" +#~ "La potenza del microcontrollore è calata. Assicurati che l'alimentazione " +#~ "sia attaccata correttamente\n" + +#~ msgid "To exit, please reset the board without " +#~ msgstr "Per uscire resettare la scheda senza " + #~ msgid "UART(%d) does not exist" #~ msgstr "UART(%d) non esistente" @@ -2937,6 +2955,14 @@ msgstr "zero step" #~ msgid "Use esptool to erase flash and re-upload Python instead" #~ msgstr "Usa esptool per cancellare la flash e ricaricare Python invece" +#, fuzzy +#~ msgid "" +#~ "You are running in safe mode which means something unanticipated " +#~ "happened.\n" +#~ msgstr "" +#~ "Sei nella modalità sicura che significa che qualcosa di molto brutto è " +#~ "successo.\n" + #~ msgid "[addrinfo error %d]" #~ msgstr "[errore addrinfo %d]" diff --git a/locale/ko.po b/locale/ko.po index 93a476b876..78f0c756b1 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-10 13:55-0600\n" +"POT-Creation-Date: 2019-12-12 14:51-0500\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -25,6 +25,19 @@ msgstr "" "\n" "실행 완료 코드. 재장전 을 기다리는 중입니다\n" +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"Please file an issue with the contents of your CIRCUITPY drive at \n" +"https://github.com/adafruit/circuitpython/issues\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"To exit, please reset the board without " +msgstr "" + #: py/obj.c msgid " File \"%q\"" msgstr " 파일 \"%q\"" @@ -294,7 +307,7 @@ msgid "Array values should be single bytes." msgstr "" #: supervisor/shared/safe_mode.c -msgid "Attempted heap allocation when MicroPython VM not running.\n" +msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" #: main.c @@ -448,6 +461,16 @@ msgstr "" msgid "CharacteristicBuffer writing not provided" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "CircuitPython core code crashed hard. Whoops!\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"CircuitPython is in safe mode because you pressed the reset button during " +"boot. Press again to exit safe mode.\n" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "" @@ -509,7 +532,7 @@ msgid "Couldn't allocate second buffer" msgstr "" #: supervisor/shared/safe_mode.c -msgid "Crash into the HardFault_Handler.\n" +msgid "Crash into the HardFault_Handler." msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -625,28 +648,18 @@ msgstr "" msgid "Failed to release mutex, err 0x%04x" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "Failed to write internal flash." +msgstr "" + #: py/moduerrno.c msgid "File exists" msgstr "" -#: ports/nrf/peripherals/nrf/nvm.c -msgid "Flash erase failed" -msgstr "" - -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash erase failed to start, err 0x%04x" -msgstr "" - -#: ports/nrf/peripherals/nrf/nvm.c +#: ports/nrf/common-hal/nvm/ByteArray.c msgid "Flash write failed" msgstr "" -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash write failed to start, err 0x%04x" -msgstr "" - #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "" @@ -819,13 +832,6 @@ msgstr "길이는 정수(int) 여야합니다" msgid "Length must be non-negative" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "" -"Looks like our core CircuitPython code crashed hard. Whoops!\n" -"Please file an issue at https://github.com/adafruit/circuitpython/issues\n" -" with the contents of your CIRCUITPY drive and this message:\n" -msgstr "" - #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." msgstr "" @@ -840,11 +846,11 @@ msgid "Maximum x value when mirrored is %d" msgstr "" #: supervisor/shared/safe_mode.c -msgid "MicroPython NLR jump failed. Likely memory corruption.\n" +msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "" #: supervisor/shared/safe_mode.c -msgid "MicroPython fatal error.\n" +msgid "MicroPython fatal error." msgstr "" #: shared-bindings/audiobusio/PDMIn.c @@ -913,6 +919,10 @@ msgstr "" msgid "No such file/directory" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "Nordic Soft Device failure assertion." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "Not connected" @@ -1091,10 +1101,7 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" -"Please increase stack size limits and press reset (after ejecting " -"CIRCUITPY).\n" -"If you didn't change the stack, then file an issue here with the contents of " -"your CIRCUITPY drive:\n" +"Please increase the stack size if you know how, or if not:" msgstr "" #: supervisor/shared/safe_mode.c @@ -1105,18 +1112,11 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "" -"The microcontroller's power dipped. Please make sure your power supply " -"provides\n" +"The microcontroller's power dipped. Make sure your power supply provides\n" "enough power for the whole circuit and press reset (after ejecting " "CIRCUITPY).\n" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "" -"The reset button was pressed while booting CircuitPython. Press again to " -"exit safe mode.\n" -msgstr "" - #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" msgstr "" @@ -1149,10 +1149,6 @@ msgstr "" msgid "Tile width must exactly divide bitmap width" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " -msgstr "" - #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "" @@ -1232,6 +1228,10 @@ msgstr "" msgid "Unknown gatt error: 0x%04x" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "Unknown reason." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown security error: 0x%04x" @@ -1302,8 +1302,7 @@ msgid "" msgstr "" #: supervisor/shared/safe_mode.c -msgid "" -"You are running in safe mode which means something unanticipated happened.\n" +msgid "You are in safe mode: something unanticipated happened.\n" msgstr "" #: supervisor/shared/safe_mode.c diff --git a/locale/pl.po b/locale/pl.po index 8efab18675..60aac45a3f 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-10 13:55-0600\n" +"POT-Creation-Date: 2019-12-12 14:51-0500\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -24,6 +24,19 @@ msgstr "" "\n" "Kod wykonany. Czekam na przeładowanie.\n" +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"Please file an issue with the contents of your CIRCUITPY drive at \n" +"https://github.com/adafruit/circuitpython/issues\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"To exit, please reset the board without " +msgstr "" + #: py/obj.c msgid " File \"%q\"" msgstr " Plik \"%q\"" @@ -293,8 +306,8 @@ msgid "Array values should be single bytes." msgstr "Wartości powinny być bajtami." #: supervisor/shared/safe_mode.c -msgid "Attempted heap allocation when MicroPython VM not running.\n" -msgstr "Próba alokacji pamięci na stercie gdy VM nie działa.\n" +msgid "Attempted heap allocation when MicroPython VM not running." +msgstr "" #: main.c msgid "Auto-reload is off.\n" @@ -447,6 +460,16 @@ msgstr "Nie można pisać bez nóżki MOSI." msgid "CharacteristicBuffer writing not provided" msgstr "Pisanie do CharacteristicBuffer niewspierane" +#: supervisor/shared/safe_mode.c +msgid "CircuitPython core code crashed hard. Whoops!\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"CircuitPython is in safe mode because you pressed the reset button during " +"boot. Press again to exit safe mode.\n" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "Nie powiodło się ustawienie nóżki zegara" @@ -508,8 +531,8 @@ msgid "Couldn't allocate second buffer" msgstr "Nie udała się alokacja drugiego bufora" #: supervisor/shared/safe_mode.c -msgid "Crash into the HardFault_Handler.\n" -msgstr "Katastrofa w HardFault_Handler.\n" +msgid "Crash into the HardFault_Handler." +msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" @@ -624,28 +647,18 @@ msgstr "" msgid "Failed to release mutex, err 0x%04x" msgstr "Nie udało się zwolnić blokady, błąd 0x%04x" +#: supervisor/shared/safe_mode.c +msgid "Failed to write internal flash." +msgstr "" + #: py/moduerrno.c msgid "File exists" msgstr "Plik istnieje" -#: ports/nrf/peripherals/nrf/nvm.c -msgid "Flash erase failed" -msgstr "Nie udało się skasować flash" - -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash erase failed to start, err 0x%04x" -msgstr "Nie udało się rozpocząć kasowania flash, błąd 0x%04x" - -#: ports/nrf/peripherals/nrf/nvm.c +#: ports/nrf/common-hal/nvm/ByteArray.c msgid "Flash write failed" msgstr "Zapis do flash nie powiódł się" -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash write failed to start, err 0x%04x" -msgstr "Nie udało się rozpocząć zapisu do flash, błąd 0x%04x" - #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "Uzyskana częstotliwość jest niemożliwa. Spauzowano." @@ -820,17 +833,6 @@ msgstr "Długość musi być całkowita" msgid "Length must be non-negative" msgstr "Długość musi być nieujemna" -#: supervisor/shared/safe_mode.c -msgid "" -"Looks like our core CircuitPython code crashed hard. Whoops!\n" -"Please file an issue at https://github.com/adafruit/circuitpython/issues\n" -" with the contents of your CIRCUITPY drive and this message:\n" -msgstr "" -"Ojej, wygląda na to, że CircuitPython natrafił na poważny problem!\n" -"Prosimy o zgłoszenie błędu pod adresem https://github.com/adafruit/" -"circuitpython/issues\n" -" z zawartością dysku CIRCUITPY oraz tym komunikatem:\n" - #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." msgstr "Nie powiodło się ustawienie nóżki MISO." @@ -845,13 +847,12 @@ msgid "Maximum x value when mirrored is %d" msgstr "Największa wartość x przy odwróceniu to %d" #: supervisor/shared/safe_mode.c -msgid "MicroPython NLR jump failed. Likely memory corruption.\n" +msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "" -"Skok NLR MicroPythona nie powiódł się. Prawdopodobne skażenie pamięci.\n" #: supervisor/shared/safe_mode.c -msgid "MicroPython fatal error.\n" -msgstr "Krytyczny błąd MicroPythona.\n" +msgid "MicroPython fatal error." +msgstr "" #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" @@ -919,6 +920,10 @@ msgstr "Brak miejsca" msgid "No such file/directory" msgstr "Brak pliku/katalogu" +#: supervisor/shared/safe_mode.c +msgid "Nordic Soft Device failure assertion." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "Not connected" @@ -1097,16 +1102,8 @@ msgstr "Strumień nie ma metod readinto() lub write()." #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" -"Please increase stack size limits and press reset (after ejecting " -"CIRCUITPY).\n" -"If you didn't change the stack, then file an issue here with the contents of " -"your CIRCUITPY drive:\n" +"Please increase the stack size if you know how, or if not:" msgstr "" -"Sterta CircuitPythona jest skażona z powodu zbyt małego stosu.\n" -"Proszę zwiększyć limity wielkości stosu i nazisnąć reset (po odmontowaniu " -"CIRCUITPY).\n" -"Jeśli wielkość stosu nie była zmieniana, proszę zgłosić błąd zawierający " -"zawartość CIRCUITPY tutaj:\n" #: supervisor/shared/safe_mode.c msgid "" @@ -1116,22 +1113,10 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "" -"The microcontroller's power dipped. Please make sure your power supply " -"provides\n" +"The microcontroller's power dipped. Make sure your power supply provides\n" "enough power for the whole circuit and press reset (after ejecting " "CIRCUITPY).\n" msgstr "" -"Zasilanie mikrokontrolera gwałtownie spadło. Proszę upewnić się,\n" -"że zasilanie jest wystarczające dla całego obwodu in nacisnąć reset (po " -"odmontowaniu CIRCUITPY).\n" - -#: supervisor/shared/safe_mode.c -msgid "" -"The reset button was pressed while booting CircuitPython. Press again to " -"exit safe mode.\n" -msgstr "" -"Przycisk reset został wciśnięty podczas startu CircuitPythona. Wciśnij go " -"ponownie aby wyjść z trybu bezpieczeństwa.\n" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" @@ -1165,10 +1150,6 @@ msgstr "" msgid "Tile width must exactly divide bitmap width" msgstr "Szerokość bitmapy musi być wielokrotnością szerokości kafelka" -#: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " -msgstr "By wyjść, proszę zresetować płytkę bez " - #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Zbyt wiele kanałów." @@ -1247,6 +1228,10 @@ msgstr "Nieoczekiwany typ nrfx uuid." msgid "Unknown gatt error: 0x%04x" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "Unknown reason." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown security error: 0x%04x" @@ -1320,10 +1305,8 @@ msgstr "" "Aby zobaczyć wbudowane moduły, wpisz `help(\"modules\")`.\n" #: supervisor/shared/safe_mode.c -msgid "" -"You are running in safe mode which means something unanticipated happened.\n" +msgid "You are in safe mode: something unanticipated happened.\n" msgstr "" -"Uruchomiono w trybie bezpieczeństwa, gdyż nastąpiło coś nieoczekiwanego.\n" #: supervisor/shared/safe_mode.c msgid "You requested starting safe mode by " @@ -2660,6 +2643,9 @@ msgstr "zerowy krok" #~ msgid "Address is not %d bytes long or is in wrong format" #~ msgstr "Adres nie ma długości %d bajtów lub zły format" +#~ msgid "Attempted heap allocation when MicroPython VM not running.\n" +#~ msgstr "Próba alokacji pamięci na stercie gdy VM nie działa.\n" + #~ msgid "Can't add services in Central mode" #~ msgstr "Nie można dodać serwisów w trybie Central" @@ -2681,6 +2667,9 @@ msgstr "zerowy krok" #~ msgid "Could not decode ble_uuid, err 0x%04x" #~ msgstr "Nie można zdekodować ble_uuid, błąd 0x%04x" +#~ msgid "Crash into the HardFault_Handler.\n" +#~ msgstr "Katastrofa w HardFault_Handler.\n" + #~ msgid "Data too large for the advertisement packet" #~ msgstr "Zbyt dużo danych pakietu rozgłoszeniowego" @@ -2763,6 +2752,15 @@ msgstr "zerowy krok" #~ msgid "Failed to write gatts value, err 0x%04x" #~ msgstr "Nie udało się zapisać gatts, błąd 0x%04x" +#~ msgid "Flash erase failed" +#~ msgstr "Nie udało się skasować flash" + +#~ msgid "Flash erase failed to start, err 0x%04x" +#~ msgstr "Nie udało się rozpocząć kasowania flash, błąd 0x%04x" + +#~ msgid "Flash write failed to start, err 0x%04x" +#~ msgstr "Nie udało się rozpocząć zapisu do flash, błąd 0x%04x" + #~ msgid "Invalid bit clock pin" #~ msgstr "Zła nóżka zegara" @@ -2772,6 +2770,23 @@ msgstr "zerowy krok" #~ msgid "Invalid data pin" #~ msgstr "Zła nóżka danych" +#~ msgid "" +#~ "Looks like our core CircuitPython code crashed hard. Whoops!\n" +#~ "Please file an issue at https://github.com/adafruit/circuitpython/issues\n" +#~ " with the contents of your CIRCUITPY drive and this message:\n" +#~ msgstr "" +#~ "Ojej, wygląda na to, że CircuitPython natrafił na poważny problem!\n" +#~ "Prosimy o zgłoszenie błędu pod adresem https://github.com/adafruit/" +#~ "circuitpython/issues\n" +#~ " z zawartością dysku CIRCUITPY oraz tym komunikatem:\n" + +#~ msgid "MicroPython NLR jump failed. Likely memory corruption.\n" +#~ msgstr "" +#~ "Skok NLR MicroPythona nie powiódł się. Prawdopodobne skażenie pamięci.\n" + +#~ msgid "MicroPython fatal error.\n" +#~ msgstr "Krytyczny błąd MicroPythona.\n" + #~ msgid "Must be a Group subclass." #~ msgstr "Musi dziedziczyć z Group." @@ -2783,15 +2798,54 @@ msgstr "zerowy krok" #~ msgid "Soft device assert, id: 0x%08lX, pc: 0x%08lX" #~ msgstr "Soft device assert, id: 0x%08lX, pc: 0x%08lX" +#~ msgid "" +#~ "The CircuitPython heap was corrupted because the stack was too small.\n" +#~ "Please increase stack size limits and press reset (after ejecting " +#~ "CIRCUITPY).\n" +#~ "If you didn't change the stack, then file an issue here with the contents " +#~ "of your CIRCUITPY drive:\n" +#~ msgstr "" +#~ "Sterta CircuitPythona jest skażona z powodu zbyt małego stosu.\n" +#~ "Proszę zwiększyć limity wielkości stosu i nazisnąć reset (po odmontowaniu " +#~ "CIRCUITPY).\n" +#~ "Jeśli wielkość stosu nie była zmieniana, proszę zgłosić błąd zawierający " +#~ "zawartość CIRCUITPY tutaj:\n" + +#~ msgid "" +#~ "The microcontroller's power dipped. Please make sure your power supply " +#~ "provides\n" +#~ "enough power for the whole circuit and press reset (after ejecting " +#~ "CIRCUITPY).\n" +#~ msgstr "" +#~ "Zasilanie mikrokontrolera gwałtownie spadło. Proszę upewnić się,\n" +#~ "że zasilanie jest wystarczające dla całego obwodu in nacisnąć reset (po " +#~ "odmontowaniu CIRCUITPY).\n" + +#~ msgid "" +#~ "The reset button was pressed while booting CircuitPython. Press again to " +#~ "exit safe mode.\n" +#~ msgstr "" +#~ "Przycisk reset został wciśnięty podczas startu CircuitPythona. Wciśnij go " +#~ "ponownie aby wyjść z trybu bezpieczeństwa.\n" + #~ msgid "Tile indices must be 0 - 255" #~ msgstr "Indeks kafelka musi być pomiędzy 0 a 255 włącznie" +#~ msgid "To exit, please reset the board without " +#~ msgstr "By wyjść, proszę zresetować płytkę bez " + #~ msgid "UUID integer value not in range 0 to 0xffff" #~ msgstr "Wartość UUID poza zakresem 0 do 0xffff" #~ msgid "Voice index too high" #~ msgstr "Zbyt wysoki indeks głosu" +#~ msgid "" +#~ "You are running in safe mode which means something unanticipated " +#~ "happened.\n" +#~ msgstr "" +#~ "Uruchomiono w trybie bezpieczeństwa, gdyż nastąpiło coś nieoczekiwanego.\n" + #~ msgid "bad GATT role" #~ msgstr "zła rola GATT" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 1ca6b7d9a5..0aa2ac6308 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-10 13:55-0600\n" +"POT-Creation-Date: 2019-12-12 14:51-0500\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -23,6 +23,19 @@ msgid "" "Code done running. Waiting for reload.\n" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"Please file an issue with the contents of your CIRCUITPY drive at \n" +"https://github.com/adafruit/circuitpython/issues\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"To exit, please reset the board without " +msgstr "" + #: py/obj.c msgid " File \"%q\"" msgstr " Arquivo \"%q\"" @@ -295,7 +308,7 @@ msgid "Array values should be single bytes." msgstr "" #: supervisor/shared/safe_mode.c -msgid "Attempted heap allocation when MicroPython VM not running.\n" +msgid "Attempted heap allocation when MicroPython VM not running." msgstr "" #: main.c @@ -449,6 +462,16 @@ msgstr "Não é possível ler sem um pino MOSI" msgid "CharacteristicBuffer writing not provided" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "CircuitPython core code crashed hard. Whoops!\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"CircuitPython is in safe mode because you pressed the reset button during " +"boot. Press again to exit safe mode.\n" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "Inicialização do pino de Clock falhou." @@ -511,7 +534,7 @@ msgid "Couldn't allocate second buffer" msgstr "Não pôde alocar segundo buffer" #: supervisor/shared/safe_mode.c -msgid "Crash into the HardFault_Handler.\n" +msgid "Crash into the HardFault_Handler." msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c @@ -630,28 +653,18 @@ msgstr "" msgid "Failed to release mutex, err 0x%04x" msgstr "Não é possível ler o valor do atributo. status: 0x%02x" +#: supervisor/shared/safe_mode.c +msgid "Failed to write internal flash." +msgstr "" + #: py/moduerrno.c msgid "File exists" msgstr "Arquivo já existe" -#: ports/nrf/peripherals/nrf/nvm.c -msgid "Flash erase failed" -msgstr "" - -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash erase failed to start, err 0x%04x" -msgstr "" - -#: ports/nrf/peripherals/nrf/nvm.c +#: ports/nrf/common-hal/nvm/ByteArray.c msgid "Flash write failed" msgstr "" -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash write failed to start, err 0x%04x" -msgstr "" - #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "" @@ -827,13 +840,6 @@ msgstr "Tamanho deve ser um int" msgid "Length must be non-negative" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "" -"Looks like our core CircuitPython code crashed hard. Whoops!\n" -"Please file an issue at https://github.com/adafruit/circuitpython/issues\n" -" with the contents of your CIRCUITPY drive and this message:\n" -msgstr "" - #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." msgstr "Inicialização do pino MISO falhou" @@ -848,11 +854,11 @@ msgid "Maximum x value when mirrored is %d" msgstr "" #: supervisor/shared/safe_mode.c -msgid "MicroPython NLR jump failed. Likely memory corruption.\n" +msgid "MicroPython NLR jump failed. Likely memory corruption." msgstr "" #: supervisor/shared/safe_mode.c -msgid "MicroPython fatal error.\n" +msgid "MicroPython fatal error." msgstr "" #: shared-bindings/audiobusio/PDMIn.c @@ -921,6 +927,10 @@ msgstr "" msgid "No such file/directory" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "Nordic Soft Device failure assertion." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c #, fuzzy @@ -1104,10 +1114,7 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" -"Please increase stack size limits and press reset (after ejecting " -"CIRCUITPY).\n" -"If you didn't change the stack, then file an issue here with the contents of " -"your CIRCUITPY drive:\n" +"Please increase the stack size if you know how, or if not:" msgstr "" #: supervisor/shared/safe_mode.c @@ -1118,18 +1125,11 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "" -"The microcontroller's power dipped. Please make sure your power supply " -"provides\n" +"The microcontroller's power dipped. Make sure your power supply provides\n" "enough power for the whole circuit and press reset (after ejecting " "CIRCUITPY).\n" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "" -"The reset button was pressed while booting CircuitPython. Press again to " -"exit safe mode.\n" -msgstr "" - #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" msgstr "" @@ -1162,10 +1162,6 @@ msgstr "" msgid "Tile width must exactly divide bitmap width" msgstr "" -#: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " -msgstr "Para sair, por favor, reinicie a placa sem " - #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Muitos canais na amostra." @@ -1244,6 +1240,10 @@ msgstr "" msgid "Unknown gatt error: 0x%04x" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "Unknown reason." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown security error: 0x%04x" @@ -1315,8 +1315,7 @@ msgid "" msgstr "" #: supervisor/shared/safe_mode.c -msgid "" -"You are running in safe mode which means something unanticipated happened.\n" +msgid "You are in safe mode: something unanticipated happened.\n" msgstr "" #: supervisor/shared/safe_mode.c @@ -2837,6 +2836,9 @@ msgstr "passo zero" #~ msgid "STA required" #~ msgstr "STA requerido" +#~ msgid "To exit, please reset the board without " +#~ msgstr "Para sair, por favor, reinicie a placa sem " + #~ msgid "UART(%d) does not exist" #~ msgstr "UART(%d) não existe" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index 40966090d4..bd5b80a724 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-10 13:55-0600\n" +"POT-Creation-Date: 2019-12-12 14:51-0500\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -25,6 +25,19 @@ msgstr "" "\n" "Dàimǎ yǐ wánchéng yùnxíng. Zhèngzài děngdài chóngxīn jiāzài.\n" +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"Please file an issue with the contents of your CIRCUITPY drive at \n" +"https://github.com/adafruit/circuitpython/issues\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"\n" +"To exit, please reset the board without " +msgstr "" + #: py/obj.c msgid " File \"%q\"" msgstr " Wénjiàn \"%q\"" @@ -294,8 +307,8 @@ msgid "Array values should be single bytes." msgstr "Shùzǔ zhí yīnggāi shì dāngè zì jié." #: supervisor/shared/safe_mode.c -msgid "Attempted heap allocation when MicroPython VM not running.\n" -msgstr "MicroPython VM wèi yùnxíng shí chángshì duī fēnpèi.\n" +msgid "Attempted heap allocation when MicroPython VM not running." +msgstr "" #: main.c msgid "Auto-reload is off.\n" @@ -448,6 +461,16 @@ msgstr "Wúfǎ xiě rù MOSI de yǐn jiǎo." msgid "CharacteristicBuffer writing not provided" msgstr "Wèi tígōng zìfú huǎncún xiě rù" +#: supervisor/shared/safe_mode.c +msgid "CircuitPython core code crashed hard. Whoops!\n" +msgstr "" + +#: supervisor/shared/safe_mode.c +msgid "" +"CircuitPython is in safe mode because you pressed the reset button during " +"boot. Press again to exit safe mode.\n" +msgstr "" + #: shared-module/bitbangio/SPI.c msgid "Clock pin init failed." msgstr "Shízhōng de yǐn jiǎo chūshǐhuà shībài." @@ -509,8 +532,8 @@ msgid "Couldn't allocate second buffer" msgstr "Wúfǎ fēnpèi dì èr gè huǎnchōng qū" #: supervisor/shared/safe_mode.c -msgid "Crash into the HardFault_Handler.\n" -msgstr "Bēngkuì dào HardFault_Handler.\n" +msgid "Crash into the HardFault_Handler." +msgstr "" #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "DAC already in use" @@ -625,28 +648,18 @@ msgstr "" msgid "Failed to release mutex, err 0x%04x" msgstr "Wúfǎ shìfàng mutex, err 0x%04x" +#: supervisor/shared/safe_mode.c +msgid "Failed to write internal flash." +msgstr "" + #: py/moduerrno.c msgid "File exists" msgstr "Wénjiàn cúnzài" -#: ports/nrf/peripherals/nrf/nvm.c -msgid "Flash erase failed" -msgstr "Flash cā chú shībài" - -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash erase failed to start, err 0x%04x" -msgstr "Flash cā chú shībài, err 0x%04x" - -#: ports/nrf/peripherals/nrf/nvm.c +#: ports/nrf/common-hal/nvm/ByteArray.c msgid "Flash write failed" msgstr "Flash xiě rù shībài" -#: ports/nrf/peripherals/nrf/nvm.c -#, c-format -msgid "Flash write failed to start, err 0x%04x" -msgstr "Flash xiě rù shībài, err 0x%04x" - #: ports/atmel-samd/common-hal/frequencyio/FrequencyIn.c msgid "Frequency captured is above capability. Capture Paused." msgstr "Pínlǜ bǔhuò gāo yú nénglì. Bǔhuò zàntíng." @@ -821,17 +834,6 @@ msgstr "Chángdù bìxū shì yīgè zhěngshù" msgid "Length must be non-negative" msgstr "Chángdù bìxū shìfēi fùshù" -#: supervisor/shared/safe_mode.c -msgid "" -"Looks like our core CircuitPython code crashed hard. Whoops!\n" -"Please file an issue at https://github.com/adafruit/circuitpython/issues\n" -" with the contents of your CIRCUITPY drive and this message:\n" -msgstr "" -"Kàn lái wǒmen de héxīn CircuitPython dàimǎ bēngkuì dé hěn lìhài. Āi yōu!\n" -"Qǐng zài https://Github.Com/adafruit/circuitpython/issues\n" -"shàng tíjiāo yīgè wèntí, qízhōng bāohán nín de CIRCUITPY qūdòngqì de nèiróng " -"hé cǐ xiāoxī:\n" - #: shared-module/bitbangio/SPI.c msgid "MISO pin init failed." msgstr "MISO yǐn jiǎo chūshǐhuà shībài." @@ -846,12 +848,12 @@ msgid "Maximum x value when mirrored is %d" msgstr "Jìngxiàng shí de zuìdà X zhí wèi%d" #: supervisor/shared/safe_mode.c -msgid "MicroPython NLR jump failed. Likely memory corruption.\n" -msgstr "MicroPython NLR tiàoyuè shībài. Kěnéng nèicún fǔbài.\n" +msgid "MicroPython NLR jump failed. Likely memory corruption." +msgstr "" #: supervisor/shared/safe_mode.c -msgid "MicroPython fatal error.\n" -msgstr "MicroPython zhìmìng cuòwù.\n" +msgid "MicroPython fatal error." +msgstr "" #: shared-bindings/audiobusio/PDMIn.c msgid "Microphone startup delay must be in range 0.0 to 1.0" @@ -919,6 +921,10 @@ msgstr "Shèbèi shàng méiyǒu kònggé" msgid "No such file/directory" msgstr "Méiyǒu cǐ lèi wénjiàn/mùlù" +#: supervisor/shared/safe_mode.c +msgid "Nordic Soft Device failure assertion." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #: shared-bindings/_bleio/CharacteristicBuffer.c msgid "Not connected" @@ -1101,16 +1107,8 @@ msgstr "Liú quēshǎo readinto() huò write() fāngfǎ." #: supervisor/shared/safe_mode.c msgid "" "The CircuitPython heap was corrupted because the stack was too small.\n" -"Please increase stack size limits and press reset (after ejecting " -"CIRCUITPY).\n" -"If you didn't change the stack, then file an issue here with the contents of " -"your CIRCUITPY drive:\n" +"Please increase the stack size if you know how, or if not:" msgstr "" -"Yóuyú duīzhàn tài xiǎo, huánliú Python rè sǔnhuài.\n" -"Qǐng zēngjiā duīzhàn chǐcùn xiànzhì, ránhòu chóngxīn shèzhì (zài dànchū " -"CIRCUITPY).\n" -"Rúguǒ nín méiyǒu gǎibiàn duīzhàn, qǐng zài cǐ chù tíchū yīgè wèntí, bìng zài " -"rù nín de CIRCUITPY qūdòngqì:\n" #: supervisor/shared/safe_mode.c msgid "" @@ -1122,22 +1120,10 @@ msgstr "" #: supervisor/shared/safe_mode.c msgid "" -"The microcontroller's power dipped. Please make sure your power supply " -"provides\n" +"The microcontroller's power dipped. Make sure your power supply provides\n" "enough power for the whole circuit and press reset (after ejecting " "CIRCUITPY).\n" msgstr "" -"Wēi kòngzhì qì de diànliàng bèi chōng chū. Qǐng quèbǎo nín de diànyuán wèi\n" -"zhěnggè diànlù tígōng zúgòu de diànyuán bìng àn xià fùwèi (zài dànchū " -"CIRCUITPY hòu).\n" - -#: supervisor/shared/safe_mode.c -msgid "" -"The reset button was pressed while booting CircuitPython. Press again to " -"exit safe mode.\n" -msgstr "" -"Qǐdòng CircuitPython shí, chóng zhì ànniǔ bèi àn xià. Zàicì àn xià yǐ tuìchū " -"ānquán móshì\n" #: shared-module/audiomixer/MixerVoice.c msgid "The sample's bits_per_sample does not match the mixer's" @@ -1171,10 +1157,6 @@ msgstr "Píng pū zhí chāochū fànwéi" msgid "Tile width must exactly divide bitmap width" msgstr "Píng pū kuāndù bìxū huàfēn wèi tú kuāndù" -#: supervisor/shared/safe_mode.c -msgid "To exit, please reset the board without " -msgstr "Yào tuìchū, qǐng chóng zhì bǎnkuài ér bùyòng " - #: ports/atmel-samd/common-hal/audiobusio/I2SOut.c msgid "Too many channels in sample." msgstr "Chōuyàng zhōng de píndào tài duō." @@ -1253,6 +1235,10 @@ msgstr "Yìwài de nrfx uuid lèixíng" msgid "Unknown gatt error: 0x%04x" msgstr "" +#: supervisor/shared/safe_mode.c +msgid "Unknown reason." +msgstr "" + #: ports/nrf/common-hal/_bleio/__init__.c #, c-format msgid "Unknown security error: 0x%04x" @@ -1328,11 +1314,8 @@ msgstr "" "Ruò yào liè chū nèizài de mókuài, qǐng qǐng zuò yǐxià `help(\"modules\")`.\n" #: supervisor/shared/safe_mode.c -msgid "" -"You are running in safe mode which means something unanticipated happened.\n" +msgid "You are in safe mode: something unanticipated happened.\n" msgstr "" -"Nǐ zhèngzài ānquán móshì xià yùnxíng, zhè yì wèi zhuó yìwài fāshēng de " -"shìqíng.\n" #: supervisor/shared/safe_mode.c msgid "You requested starting safe mode by " @@ -2673,6 +2656,9 @@ msgstr "líng bù" #~ msgid "Address is not %d bytes long or is in wrong format" #~ msgstr "Dìzhǐ bùshì %d zì jié zhǎng, huòzhě géshì cuòwù" +#~ msgid "Attempted heap allocation when MicroPython VM not running.\n" +#~ msgstr "MicroPython VM wèi yùnxíng shí chángshì duī fēnpèi.\n" + #~ msgid "Can't add services in Central mode" #~ msgstr "Wúfǎ zài zhōngyāng móshì xià tiānjiā fúwù" @@ -2697,6 +2683,9 @@ msgstr "líng bù" #~ msgid "Could not decode ble_uuid, err 0x%04x" #~ msgstr "Wúfǎ jiěmǎ kě dú_uuid, err 0x%04x" +#~ msgid "Crash into the HardFault_Handler.\n" +#~ msgstr "Bēngkuì dào HardFault_Handler.\n" + #~ msgid "Data too large for the advertisement packet" #~ msgstr "Guǎnggào bāo de shùjù tài dà" @@ -2802,6 +2791,15 @@ msgstr "líng bù" #~ msgid "Failed to write gatts value, err 0x%04x" #~ msgstr "Xiě rù gatts zhí,err 0x%04x shībài" +#~ msgid "Flash erase failed" +#~ msgstr "Flash cā chú shībài" + +#~ msgid "Flash erase failed to start, err 0x%04x" +#~ msgstr "Flash cā chú shībài, err 0x%04x" + +#~ msgid "Flash write failed to start, err 0x%04x" +#~ msgstr "Flash xiě rù shībài, err 0x%04x" + #~ msgid "Invalid bit clock pin" #~ msgstr "Wúxiào de wèi shízhōng yǐn jiǎo" @@ -2811,6 +2809,22 @@ msgstr "líng bù" #~ msgid "Invalid data pin" #~ msgstr "Wúxiào de shùjù yǐn jiǎo" +#~ msgid "" +#~ "Looks like our core CircuitPython code crashed hard. Whoops!\n" +#~ "Please file an issue at https://github.com/adafruit/circuitpython/issues\n" +#~ " with the contents of your CIRCUITPY drive and this message:\n" +#~ msgstr "" +#~ "Kàn lái wǒmen de héxīn CircuitPython dàimǎ bēngkuì dé hěn lìhài. Āi yōu!\n" +#~ "Qǐng zài https://Github.Com/adafruit/circuitpython/issues\n" +#~ "shàng tíjiāo yīgè wèntí, qízhōng bāohán nín de CIRCUITPY qūdòngqì de " +#~ "nèiróng hé cǐ xiāoxī:\n" + +#~ msgid "MicroPython NLR jump failed. Likely memory corruption.\n" +#~ msgstr "MicroPython NLR tiàoyuè shībài. Kěnéng nèicún fǔbài.\n" + +#~ msgid "MicroPython fatal error.\n" +#~ msgstr "MicroPython zhìmìng cuòwù.\n" + #~ msgid "Must be a Group subclass." #~ msgstr "Bìxū shì fēnzǔ zi lèi." @@ -2835,15 +2849,56 @@ msgstr "líng bù" #~ msgid "Soft device assert, id: 0x%08lX, pc: 0x%08lX" #~ msgstr "Ruǎn shèbèi wéihù, id: 0X%08lX, pc: 0X%08lX" +#~ msgid "" +#~ "The CircuitPython heap was corrupted because the stack was too small.\n" +#~ "Please increase stack size limits and press reset (after ejecting " +#~ "CIRCUITPY).\n" +#~ "If you didn't change the stack, then file an issue here with the contents " +#~ "of your CIRCUITPY drive:\n" +#~ msgstr "" +#~ "Yóuyú duīzhàn tài xiǎo, huánliú Python rè sǔnhuài.\n" +#~ "Qǐng zēngjiā duīzhàn chǐcùn xiànzhì, ránhòu chóngxīn shèzhì (zài dànchū " +#~ "CIRCUITPY).\n" +#~ "Rúguǒ nín méiyǒu gǎibiàn duīzhàn, qǐng zài cǐ chù tíchū yīgè wèntí, bìng " +#~ "zài rù nín de CIRCUITPY qūdòngqì:\n" + +#~ msgid "" +#~ "The microcontroller's power dipped. Please make sure your power supply " +#~ "provides\n" +#~ "enough power for the whole circuit and press reset (after ejecting " +#~ "CIRCUITPY).\n" +#~ msgstr "" +#~ "Wēi kòngzhì qì de diànliàng bèi chōng chū. Qǐng quèbǎo nín de diànyuán " +#~ "wèi\n" +#~ "zhěnggè diànlù tígōng zúgòu de diànyuán bìng àn xià fùwèi (zài dànchū " +#~ "CIRCUITPY hòu).\n" + +#~ msgid "" +#~ "The reset button was pressed while booting CircuitPython. Press again to " +#~ "exit safe mode.\n" +#~ msgstr "" +#~ "Qǐdòng CircuitPython shí, chóng zhì ànniǔ bèi àn xià. Zàicì àn xià yǐ " +#~ "tuìchū ānquán móshì\n" + #~ msgid "Tile indices must be 0 - 255" #~ msgstr "Píng pū zhǐshù bìxū wèi 0 - 255" +#~ msgid "To exit, please reset the board without " +#~ msgstr "Yào tuìchū, qǐng chóng zhì bǎnkuài ér bùyòng " + #~ msgid "UUID integer value not in range 0 to 0xffff" #~ msgstr "UUID zhěngshù zhí bùzài fànwéi 0 zhì 0xffff" #~ msgid "Voice index too high" #~ msgstr "Yǔyīn suǒyǐn tài gāo" +#~ msgid "" +#~ "You are running in safe mode which means something unanticipated " +#~ "happened.\n" +#~ msgstr "" +#~ "Nǐ zhèngzài ānquán móshì xià yùnxíng, zhè yì wèi zhuó yìwài fāshēng de " +#~ "shìqíng.\n" + #~ msgid "bad GATT role" #~ msgstr "zǒng xiédìng de bùliáng juésè" diff --git a/supervisor/shared/safe_mode.c b/supervisor/shared/safe_mode.c index 9e3b864028..aba31e9c9e 100644 --- a/supervisor/shared/safe_mode.c +++ b/supervisor/shared/safe_mode.c @@ -96,48 +96,48 @@ void __attribute__((noinline,)) reset_into_safe_mode(safe_mode_t reason) { -#define FILE_AN_ISSUE translate("\r\nPlease file an issue with the contents of your CIRCUITPY drive at \nhttps://github.com/adafruit/circuitpython/issues\r\n") +#define FILE_AN_ISSUE translate("\nPlease file an issue with the contents of your CIRCUITPY drive at \nhttps://github.com/adafruit/circuitpython/issues\n") void print_safe_mode_message(safe_mode_t reason) { if (reason == NO_SAFE_MODE) { return; } - serial_write("\r\n"); + serial_write("\n"); // Output a user safe mode string if it's set. #ifdef BOARD_USER_SAFE_MODE if (reason == USER_SAFE_MODE) { serial_write_compressed(translate("You requested starting safe mode by ")); serial_write(BOARD_USER_SAFE_MODE_ACTION); - serial_write_compressed(translate("\r\nTo exit, please reset the board without ")); + serial_write_compressed(translate("\nTo exit, please reset the board without ")); serial_write(BOARD_USER_SAFE_MODE_ACTION); - serial_write("\r\n"); + serial_write("\n"); } else #endif switch (reason) { case MANUAL_SAFE_MODE: - serial_write_compressed(translate("CircuitPython is in safe mode because you pressed the reset button during boot. Press again to exit safe mode.\r\n")); + serial_write_compressed(translate("CircuitPython is in safe mode because you pressed the reset button during boot. Press again to exit safe mode.\n")); return; case PROGRAMMATIC_SAFE_MODE: - serial_write_compressed(translate("The `microcontroller` module was used to boot into safe mode. Press reset to exit safe mode.\r\n")); + serial_write_compressed(translate("The `microcontroller` module was used to boot into safe mode. Press reset to exit safe mode.\n")); return; default: break; } - serial_write_compressed(translate("You are in safe mode: something unanticipated happened.\r\n")); + serial_write_compressed(translate("You are in safe mode: something unanticipated happened.\n")); switch (reason) { case BROWNOUT: - serial_write_compressed(translate("The microcontroller's power dipped. Make sure your power supply provides\r\nenough power for the whole circuit and press reset (after ejecting CIRCUITPY).\r\n")); + serial_write_compressed(translate("The microcontroller's power dipped. Make sure your power supply provides\nenough power for the whole circuit and press reset (after ejecting CIRCUITPY).\n")); return; case HEAP_OVERWRITTEN: - serial_write_compressed(translate("The CircuitPython heap was corrupted because the stack was too small.\r\nPlease increase the stack size if you know how, or if not:")); + serial_write_compressed(translate("The CircuitPython heap was corrupted because the stack was too small.\nPlease increase the stack size if you know how, or if not:")); serial_write_compressed(FILE_AN_ISSUE); return; default: break; } - serial_write_compressed(translate("CircuitPython core code crashed hard. Whoops!\r\n")); + serial_write_compressed(translate("CircuitPython core code crashed hard. Whoops!\n")); switch (reason) { case HARD_CRASH: serial_write_compressed(translate("Crash into the HardFault_Handler.")); From e11fabd5e0979fa257a81d6025a0df0b6652b600 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Thu, 12 Dec 2019 14:57:23 -0500 Subject: [PATCH 37/78] moved nrf internal filesystem to just below bootloader --- ports/atmel-samd/mpconfigport.h | 10 +++++----- ports/nrf/boards/common.template.ld | 2 +- ports/nrf/mpconfigport.h | 28 +++++++++++++++++----------- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h index a319c6199a..846e8db707 100644 --- a/ports/atmel-samd/mpconfigport.h +++ b/ports/atmel-samd/mpconfigport.h @@ -151,11 +151,11 @@ // Flash layout, starting at 0x00000000 // -// bootloader (8 or 16kB) -// firmware -// internal CIRCUITPY flash filesystem (optional) -// internal config, used to store crystalless clock calibration info (optional) -// microntroller.nvm (optional) +// - bootloader (8 or 16kB) +// - firmware +// - internal CIRCUITPY flash filesystem (optional) +// - internal config, used to store crystalless clock calibration info (optional) +// - microntroller.nvm (optional) // Define these regions starting up from the bottom of flash: diff --git a/ports/nrf/boards/common.template.ld b/ports/nrf/boards/common.template.ld index f267234924..931f95ee9e 100644 --- a/ports/nrf/boards/common.template.ld +++ b/ports/nrf/boards/common.template.ld @@ -11,9 +11,9 @@ MEMORY FLASH_SD (rx) : ORIGIN = ${SD_FLASH_START_ADDR}, LENGTH = ${SD_FLASH_SIZE} FLASH_ISR (rx) : ORIGIN = ${ISR_START_ADDR}, LENGTH = ${ISR_SIZE} FLASH_FIRMWARE (rx) : ORIGIN = ${CIRCUITPY_FIRMWARE_START_ADDR}, LENGTH = ${CIRCUITPY_FIRMWARE_SIZE} - FLASH_FATFS (r) : ORIGIN = ${CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR}, LENGTH = ${CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE} FLASH_BLE_CONFIG (r) : ORIGIN = ${CIRCUITPY_BLE_CONFIG_START_ADDR}, LENGTH = ${CIRCUITPY_BLE_CONFIG_SIZE} FLASH_NVM (r) : ORIGIN = ${CIRCUITPY_INTERNAL_NVM_START_ADDR}, LENGTH = ${CIRCUITPY_INTERNAL_NVM_SIZE} + FLASH_FATFS (r) : ORIGIN = ${CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR}, LENGTH = ${CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE} FLASH_BOOTLOADER (rx) : ORIGIN = ${BOOTLOADER_START_ADDR}, LENGTH = ${BOOTLOADER_SIZE} FLASH_BOOTLOADER_SETTINGS (r) : ORIGIN = ${BOOTLOADER_SETTINGS_START_ADDR}, LENGTH = ${BOOTLOADER_SETTINGS_SIZE} RAM (xrw) : ORIGIN = 0x20004000, LENGTH = 0x03C000 /* 240 KiB */ diff --git a/ports/nrf/mpconfigport.h b/ports/nrf/mpconfigport.h index 71bf6bc8f0..cb25870dc0 100644 --- a/ports/nrf/mpconfigport.h +++ b/ports/nrf/mpconfigport.h @@ -76,14 +76,16 @@ // Flash layout, starting at 0x00000000 // -// SoftDevice -// ISR -// firmware -// internal CIRCUITPY flash filesystem (optional) -// BLE config (bonding info, etc.) (optional) -// microcontroller.nvm (optional) -// bootloader (note the MBR at 0x0 redirects to the bootloader here, in high flash) -// bootloader settings +// - SoftDevice +// - ISR +// - firmware +// - BLE config (bonding info, etc.) (optional) +// - microcontroller.nvm (optional) +// - internal CIRCUITPY flash filesystem (optional) +// The flash filesystem is adjacent to the bootloader, so that its location will not change even if +// other regions change in size. +// - bootloader (note the MBR at 0x0 redirects to the bootloader here, in high flash) +// - bootloader settings // Define these regions starting up from the bottom of flash: @@ -105,14 +107,18 @@ #define BOOTLOADER_SETTINGS_START_ADDR (0x000FF000) #define BOOTLOADER_SETTINGS_SIZE (0x1000) // 4kiB -#define CIRCUITPY_INTERNAL_NVM_START_ADDR (BOOTLOADER_START_ADDR - CIRCUITPY_INTERNAL_NVM_SIZE) +#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR (BOOTLOADER_START_ADDR - CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE) + +#if CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE > 0 && CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR != (BOOTLOADER_START_ADDR - 256*1024) +#warning Internal flash filesystem location has moved! +#endif + +#define CIRCUITPY_INTERNAL_NVM_START_ADDR (CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR - CIRCUITPY_INTERNAL_NVM_SIZE) // 32kiB for bonding, etc. #define CIRCUITPY_BLE_CONFIG_SIZE (32*1024) #define CIRCUITPY_BLE_CONFIG_START_ADDR (CIRCUITPY_INTERNAL_NVM_START_ADDR - CIRCUITPY_BLE_CONFIG_SIZE) -#define CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR (CIRCUITPY_BLE_CONFIG_START_ADDR - CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE) - // The firmware space is the space left over between the fixed lower and upper regions. #define CIRCUITPY_FIRMWARE_SIZE (CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_START_ADDR - CIRCUITPY_FIRMWARE_START_ADDR) From 9a3d45e7d0fd942201f4bb2102d9d5489bd7cb86 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 12 Dec 2019 13:46:51 -0800 Subject: [PATCH 38/78] Add extended, connectable and scannable error. Related to https://github.com/adafruit/Adafruit_CircuitPython_BLE/issues/44 --- shared-bindings/_bleio/Adapter.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/shared-bindings/_bleio/Adapter.c b/shared-bindings/_bleio/Adapter.c index 9772fa830d..5d3211b0c4 100644 --- a/shared-bindings/_bleio/Adapter.c +++ b/shared-bindings/_bleio/Adapter.c @@ -29,6 +29,7 @@ #include "py/objproperty.h" #include "py/runtime.h" +#include "shared-bindings/_bleio/__init__.h" #include "shared-bindings/_bleio/Address.h" #include "shared-bindings/_bleio/Adapter.h" @@ -185,7 +186,12 @@ STATIC mp_obj_t bleio_adapter_start_advertising(mp_uint_t n_args, const mp_obj_t ADV_INTERVAL_MIN_STRING, ADV_INTERVAL_MAX_STRING); } - common_hal_bleio_adapter_start_advertising(self, args[ARG_connectable].u_bool, interval, + bool connectable = args[ARG_connectable].u_bool; + if (data_bufinfo.len > 31 && connectable && scan_response_bufinfo.len > 0) { + mp_raise_bleio_BluetoothError(translate("Cannot have scan responses for extended, connectable advertisements.")); + } + + common_hal_bleio_adapter_start_advertising(self, connectable, interval, &data_bufinfo, &scan_response_bufinfo); return mp_const_none; From 51ba0ed2501ba2467e2b8da708bcc8ba6ab09a7c Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Thu, 12 Dec 2019 15:33:46 -0800 Subject: [PATCH 39/78] Update translations --- locale/ID.po | 6 +++++- locale/circuitpython.pot | 6 +++++- locale/de_DE.po | 6 +++++- locale/en_US.po | 6 +++++- locale/en_x_pirate.po | 6 +++++- locale/es.po | 6 +++++- locale/fil.po | 6 +++++- locale/fr.po | 6 +++++- locale/it_IT.po | 6 +++++- locale/ko.po | 6 +++++- locale/pl.po | 6 +++++- locale/pt_BR.po | 6 +++++- locale/zh_Latn_pinyin.po | 6 +++++- 13 files changed, 65 insertions(+), 13 deletions(-) diff --git a/locale/ID.po b/locale/ID.po index c147a5f5f9..18773a2027 100644 --- a/locale/ID.po +++ b/locale/ID.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-12 14:51-0500\n" +"POT-Creation-Date: 2019-12-12 15:33-0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -419,6 +419,10 @@ msgstr "Tidak bisa mendapatkan pull pada saat mode output" msgid "Cannot get temperature" msgstr "Tidak bisa mendapatkan temperatur. status: 0x%02x" +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot have scan responses for extended, connectable advertisements." +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Cannot output both channels on the same pin" msgstr "" diff --git a/locale/circuitpython.pot b/locale/circuitpython.pot index e21541d7e2..f4b67521ce 100644 --- a/locale/circuitpython.pot +++ b/locale/circuitpython.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-12 15:51-0500\n" +"POT-Creation-Date: 2019-12-12 15:33-0800\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -413,6 +413,10 @@ msgstr "" msgid "Cannot get temperature" msgstr "" +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot have scan responses for extended, connectable advertisements." +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Cannot output both channels on the same pin" msgstr "" diff --git a/locale/de_DE.po b/locale/de_DE.po index f1158b1b3a..36d2f266d7 100644 --- a/locale/de_DE.po +++ b/locale/de_DE.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-12 14:51-0500\n" +"POT-Creation-Date: 2019-12-12 15:33-0800\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: Pascal Deneaux\n" "Language-Team: Sebastian Plamauer, Pascal Deneaux\n" @@ -417,6 +417,10 @@ msgstr "Pull up im Ausgabemodus nicht möglich" msgid "Cannot get temperature" msgstr "Kann Temperatur nicht holen" +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot have scan responses for extended, connectable advertisements." +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Cannot output both channels on the same pin" msgstr "Kann nicht beite Kanäle auf dem gleichen Pin ausgeben" diff --git a/locale/en_US.po b/locale/en_US.po index c6f342186f..7da32614f4 100644 --- a/locale/en_US.po +++ b/locale/en_US.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-12 14:51-0500\n" +"POT-Creation-Date: 2019-12-12 15:33-0800\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: \n" @@ -413,6 +413,10 @@ msgstr "" msgid "Cannot get temperature" msgstr "" +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot have scan responses for extended, connectable advertisements." +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Cannot output both channels on the same pin" msgstr "" diff --git a/locale/en_x_pirate.po b/locale/en_x_pirate.po index 54d246e2de..867618bd98 100644 --- a/locale/en_x_pirate.po +++ b/locale/en_x_pirate.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-12 14:51-0500\n" +"POT-Creation-Date: 2019-12-12 15:33-0800\n" "PO-Revision-Date: 2018-07-27 11:55-0700\n" "Last-Translator: \n" "Language-Team: @sommersoft, @MrCertainly\n" @@ -417,6 +417,10 @@ msgstr "" msgid "Cannot get temperature" msgstr "" +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot have scan responses for extended, connectable advertisements." +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Cannot output both channels on the same pin" msgstr "" diff --git a/locale/es.po b/locale/es.po index 7ced099be5..285d1d8515 100644 --- a/locale/es.po +++ b/locale/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-12 14:51-0500\n" +"POT-Creation-Date: 2019-12-12 15:33-0800\n" "PO-Revision-Date: 2018-08-24 22:56-0500\n" "Last-Translator: \n" "Language-Team: \n" @@ -419,6 +419,10 @@ msgstr "No puede ser pull mientras este en modo de salida" msgid "Cannot get temperature" msgstr "No se puede obtener la temperatura." +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot have scan responses for extended, connectable advertisements." +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Cannot output both channels on the same pin" msgstr "No se puede tener ambos canales en el mismo pin" diff --git a/locale/fil.po b/locale/fil.po index 16fac72244..6600ffb9a6 100644 --- a/locale/fil.po +++ b/locale/fil.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-12 14:51-0500\n" +"POT-Creation-Date: 2019-12-12 15:33-0800\n" "PO-Revision-Date: 2018-12-20 22:15-0800\n" "Last-Translator: Timothy \n" "Language-Team: fil\n" @@ -421,6 +421,10 @@ msgstr "Hindi makakakuha ng pull habang nasa output mode" msgid "Cannot get temperature" msgstr "Hindi makuha ang temperatura. status 0x%02x" +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot have scan responses for extended, connectable advertisements." +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Cannot output both channels on the same pin" msgstr "Hindi maaaring output ang mga parehong channel sa parehong pin" diff --git a/locale/fr.po b/locale/fr.po index 9762b5e7da..6437b8ba86 100644 --- a/locale/fr.po +++ b/locale/fr.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: 0.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-12 14:51-0500\n" +"POT-Creation-Date: 2019-12-12 15:33-0800\n" "PO-Revision-Date: 2019-04-14 20:05+0100\n" "Last-Translator: Pierrick Couturier \n" "Language-Team: fr\n" @@ -425,6 +425,10 @@ msgstr "Ne peut être tiré ('pull') en mode 'output'" msgid "Cannot get temperature" msgstr "Impossible de lire la température" +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot have scan responses for extended, connectable advertisements." +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Cannot output both channels on the same pin" msgstr "Les 2 canaux de sortie ne peuvent être sur la même broche" diff --git a/locale/it_IT.po b/locale/it_IT.po index 0a3c30d2bd..a659664a00 100644 --- a/locale/it_IT.po +++ b/locale/it_IT.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-12 14:51-0500\n" +"POT-Creation-Date: 2019-12-12 15:33-0800\n" "PO-Revision-Date: 2018-10-02 16:27+0200\n" "Last-Translator: Enrico Paganin \n" "Language-Team: \n" @@ -421,6 +421,10 @@ msgstr "non si può tirare quando nella modalita output" msgid "Cannot get temperature" msgstr "Impossibile leggere la temperatura. status: 0x%02x" +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot have scan responses for extended, connectable advertisements." +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Cannot output both channels on the same pin" msgstr "Impossibile dare in output entrambi i canal sullo stesso pin" diff --git a/locale/ko.po b/locale/ko.po index 78f0c756b1..c47c10a94d 100644 --- a/locale/ko.po +++ b/locale/ko.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-12 14:51-0500\n" +"POT-Creation-Date: 2019-12-12 15:33-0800\n" "PO-Revision-Date: 2019-05-06 14:22-0700\n" "Last-Translator: \n" "Language-Team: LANGUAGE \n" @@ -417,6 +417,10 @@ msgstr "" msgid "Cannot get temperature" msgstr "온도 데이터를 수신 할 수 없습니다" +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot have scan responses for extended, connectable advertisements." +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Cannot output both channels on the same pin" msgstr "" diff --git a/locale/pl.po b/locale/pl.po index 60aac45a3f..8d564c2431 100644 --- a/locale/pl.po +++ b/locale/pl.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-12 14:51-0500\n" +"POT-Creation-Date: 2019-12-12 15:33-0800\n" "PO-Revision-Date: 2019-03-19 18:37-0700\n" "Last-Translator: Radomir Dopieralski \n" "Language-Team: pl\n" @@ -416,6 +416,10 @@ msgstr "Nie ma podciągnięcia w trybie wyjścia" msgid "Cannot get temperature" msgstr "Nie można odczytać temperatury" +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot have scan responses for extended, connectable advertisements." +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Cannot output both channels on the same pin" msgstr "Nie można mieć obu kanałów na tej samej nóżce" diff --git a/locale/pt_BR.po b/locale/pt_BR.po index 0aa2ac6308..48cf9e77ef 100644 --- a/locale/pt_BR.po +++ b/locale/pt_BR.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-12 14:51-0500\n" +"POT-Creation-Date: 2019-12-12 15:33-0800\n" "PO-Revision-Date: 2018-10-02 21:14-0000\n" "Last-Translator: \n" "Language-Team: \n" @@ -418,6 +418,10 @@ msgstr "" msgid "Cannot get temperature" msgstr "Não pode obter a temperatura. status: 0x%02x" +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot have scan responses for extended, connectable advertisements." +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Cannot output both channels on the same pin" msgstr "" diff --git a/locale/zh_Latn_pinyin.po b/locale/zh_Latn_pinyin.po index bd5b80a724..63889a52d6 100644 --- a/locale/zh_Latn_pinyin.po +++ b/locale/zh_Latn_pinyin.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: circuitpython-cn\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2019-12-12 14:51-0500\n" +"POT-Creation-Date: 2019-12-12 15:33-0800\n" "PO-Revision-Date: 2019-04-13 10:10-0700\n" "Last-Translator: hexthat\n" "Language-Team: Chinese Hanyu Pinyin\n" @@ -417,6 +417,10 @@ msgstr "Zài shūchū móshì xià wúfǎ huòqǔ lādòng" msgid "Cannot get temperature" msgstr "Wúfǎ huòqǔ wēndù" +#: shared-bindings/_bleio/Adapter.c +msgid "Cannot have scan responses for extended, connectable advertisements." +msgstr "" + #: ports/atmel-samd/common-hal/audioio/AudioOut.c msgid "Cannot output both channels on the same pin" msgstr "Wúfǎ shūchū tóng yīgè yǐn jiǎo shàng de liǎng gè píndào" From 4bee6536c9db82d8ba51c4e1391b99e017d9a7e4 Mon Sep 17 00:00:00 2001 From: JoeBakalor Date: Fri, 13 Dec 2019 08:52:03 -0500 Subject: [PATCH 40/78] updates to bluebird --- ports/nrf/boards/pca10056/mpconfigboard.h | 62 +++++++++---------- ports/nrf/boards/pca10056/mpconfigboard.mk | 16 ----- ports/nrf/boards/pca10059/mpconfigboard.h | 2 - ports/nrf/boards/pca10059/mpconfigboard.mk | 17 +---- .../boards/teknikio_bluebird/mpconfigboard.h | 4 +- .../boards/teknikio_bluebird/mpconfigboard.mk | 3 - 6 files changed, 32 insertions(+), 72 deletions(-) diff --git a/ports/nrf/boards/pca10056/mpconfigboard.h b/ports/nrf/boards/pca10056/mpconfigboard.h index 5b30c7fe83..b34bc83260 100644 --- a/ports/nrf/boards/pca10056/mpconfigboard.h +++ b/ports/nrf/boards/pca10056/mpconfigboard.h @@ -24,42 +24,40 @@ * THE SOFTWARE. */ -#include "nrfx/hal/nrf_gpio.h" + #include "nrfx/hal/nrf_gpio.h" -#define MICROPY_HW_BOARD_NAME "PCA10056 nRF52840-DK" -#define MICROPY_HW_MCU_NAME "nRF52840" + #define MICROPY_HW_BOARD_NAME "PCA10056 nRF52840-DK" + #define MICROPY_HW_MCU_NAME "nRF52840" -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 + #define MICROPY_HW_LED_STATUS (&pin_P0_13) -#define MICROPY_HW_LED_STATUS (&pin_P0_13) + #define DEFAULT_I2C_BUS_SCL (&pin_P0_27) + #define DEFAULT_I2C_BUS_SDA (&pin_P0_26) -#define DEFAULT_I2C_BUS_SCL (&pin_P0_27) -#define DEFAULT_I2C_BUS_SDA (&pin_P0_26) + #define DEFAULT_SPI_BUS_SCK (&pin_P1_15) + #define DEFAULT_SPI_BUS_MOSI (&pin_P1_13) + #define DEFAULT_SPI_BUS_MISO (&pin_P1_14) -#define DEFAULT_SPI_BUS_SCK (&pin_P1_15) -#define DEFAULT_SPI_BUS_MOSI (&pin_P1_13) -#define DEFAULT_SPI_BUS_MISO (&pin_P1_14) + #define DEFAULT_UART_BUS_RX (&pin_P1_01) + #define DEFAULT_UART_BUS_TX (&pin_P1_02) -#define DEFAULT_UART_BUS_RX (&pin_P1_01) -#define DEFAULT_UART_BUS_TX (&pin_P1_02) + // Flash operation mode is determined by MICROPY_QSPI_DATAn pin configuration. + // A pin config is valid if it is defined and its value is not 0xFF. + // Quad mode: If all DATA0 --> DATA3 are valid + // Dual mode: If DATA0 and DATA1 are valid while either DATA2 and/or DATA3 are invalid + // Single mode: If only DATA0 is valid + #if QSPI_FLASH_FILESYSTEM + #define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(0, 20) + #define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(0, 21) + #define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(0, 22) + #define MICROPY_QSPI_DATA3 NRF_GPIO_PIN_MAP(0, 23) + #define MICROPY_QSPI_SCK NRF_GPIO_PIN_MAP(0, 19) + #define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(0, 17) + #endif -// Flash operation mode is determined by MICROPY_QSPI_DATAn pin configuration. -// A pin config is valid if it is defined and its value is not 0xFF. -// Quad mode: If all DATA0 --> DATA3 are valid -// Dual mode: If DATA0 and DATA1 are valid while either DATA2 and/or DATA3 are invalid -// Single mode: If only DATA0 is valid -#if QSPI_FLASH_FILESYSTEM -#define MICROPY_QSPI_DATA0 NRF_GPIO_PIN_MAP(0, 20) -#define MICROPY_QSPI_DATA1 NRF_GPIO_PIN_MAP(0, 21) -#define MICROPY_QSPI_DATA2 NRF_GPIO_PIN_MAP(0, 22) -#define MICROPY_QSPI_DATA3 NRF_GPIO_PIN_MAP(0, 23) -#define MICROPY_QSPI_SCK NRF_GPIO_PIN_MAP(0, 19) -#define MICROPY_QSPI_CS NRF_GPIO_PIN_MAP(0, 17) -#endif - -#if SPI_FLASH_FILESYSTEM -#define SPI_FLASH_MOSI_PIN &pin_P0_20 -#define SPI_FLASH_MISO_PIN &pin_P0_21 -#define SPI_FLASH_SCK_PIN &pin_P0_19 -#define SPI_FLASH_CS_PIN &pin_P0_17 -#endif + #if SPI_FLASH_FILESYSTEM + #define SPI_FLASH_MOSI_PIN &pin_P0_20 + #define SPI_FLASH_MISO_PIN &pin_P0_21 + #define SPI_FLASH_SCK_PIN &pin_P0_19 + #define SPI_FLASH_CS_PIN &pin_P0_17 + #endif diff --git a/ports/nrf/boards/pca10056/mpconfigboard.mk b/ports/nrf/boards/pca10056/mpconfigboard.mk index 723e7976e1..8fd1ef08d0 100644 --- a/ports/nrf/boards/pca10056/mpconfigboard.mk +++ b/ports/nrf/boards/pca10056/mpconfigboard.mk @@ -3,23 +3,7 @@ USB_PID = 0x802A USB_PRODUCT = "PCA10056" USB_MANUFACTURER = "Nordic Semiconductor" -MCU_SERIES = m4 -MCU_VARIANT = nrf52 -MCU_SUB_VARIANT = nrf52840 MCU_CHIP = nrf52840 -SD ?= s140 -SOFTDEV_VERSION ?= 6.1.0 - -BOOT_SETTING_ADDR = 0xFF000 - -ifeq ($(SD),) - LD_FILE = boards/nrf52840_1M_256k.ld -else - LD_FILE = boards/adafruit_$(MCU_SUB_VARIANT)_$(SD_LOWER)_v$(firstword $(subst ., ,$(SOFTDEV_VERSION))).ld - CIRCUITPY_BLEIO = 1 -endif - -NRF_DEFINES += -DNRF52840_XXAA -DNRF52840 QSPI_FLASH_FILESYSTEM = 1 EXTERNAL_FLASH_DEVICE_COUNT = 1 diff --git a/ports/nrf/boards/pca10059/mpconfigboard.h b/ports/nrf/boards/pca10059/mpconfigboard.h index b79d3c88f2..18aa66f16b 100644 --- a/ports/nrf/boards/pca10059/mpconfigboard.h +++ b/ports/nrf/boards/pca10059/mpconfigboard.h @@ -28,5 +28,3 @@ #define MICROPY_HW_MCU_NAME "nRF52840" #define MICROPY_HW_LED_STATUS (&pin_P0_06) - -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 diff --git a/ports/nrf/boards/pca10059/mpconfigboard.mk b/ports/nrf/boards/pca10059/mpconfigboard.mk index db9d806685..3f97b08218 100644 --- a/ports/nrf/boards/pca10059/mpconfigboard.mk +++ b/ports/nrf/boards/pca10059/mpconfigboard.mk @@ -3,21 +3,6 @@ USB_PID = 0x802A USB_PRODUCT = "PCA10059" USB_MANUFACTURER = "Nordic Semiconductor" -MCU_SERIES = m4 -MCU_VARIANT = nrf52 -MCU_SUB_VARIANT = nrf52840 MCU_CHIP = nrf52840 -SD ?= s140 -SOFTDEV_VERSION ?= 6.1.0 -BOOT_SETTING_ADDR = 0xFF000 -BOOT_FILE = boards/$(BOARD)/bootloader/$(SOFTDEV_VERSION)/$(BOARD)_bootloader_$(SOFTDEV_VERSION)_s140 - -ifeq ($(SD),) - LD_FILE = boards/nrf52840_1M_256k.ld -else - LD_FILE = boards/adafruit_$(MCU_SUB_VARIANT)_$(SD_LOWER)_v$(firstword $(subst ., ,$(SOFTDEV_VERSION))).ld - CIRCUITPY_BLEIO = 1 -endif - -NRF_DEFINES += -DNRF52840_XXAA -DNRF52840 +INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/nrf/boards/teknikio_bluebird/mpconfigboard.h b/ports/nrf/boards/teknikio_bluebird/mpconfigboard.h index 2b8707ad08..76e772ca9b 100644 --- a/ports/nrf/boards/teknikio_bluebird/mpconfigboard.h +++ b/ports/nrf/boards/teknikio_bluebird/mpconfigboard.h @@ -33,8 +33,6 @@ #define MICROPY_HW_BOARD_NAME "Teknikio Bluebird" #define MICROPY_HW_MCU_NAME "nRF52840" -#define CIRCUITPY_AUTORELOAD_DELAY_MS 500 - #define MICROPY_HW_NEOPIXEL (&pin_P0_26) #define DEFAULT_I2C_BUS_SCL (&pin_P0_27) @@ -47,4 +45,4 @@ #define DEFAULT_UART_BUS_RX (&pin_P1_07) #define DEFAULT_UART_BUS_TX (&pin_P1_08) -#define BOARD_HAS_CRYSTAL 1 // according to the schematic we do \ No newline at end of file +#define BOARD_HAS_CRYSTAL 1 // according to the schematic we do diff --git a/ports/nrf/boards/teknikio_bluebird/mpconfigboard.mk b/ports/nrf/boards/teknikio_bluebird/mpconfigboard.mk index c2b8b7605a..c99b33f3d6 100644 --- a/ports/nrf/boards/teknikio_bluebird/mpconfigboard.mk +++ b/ports/nrf/boards/teknikio_bluebird/mpconfigboard.mk @@ -20,6 +20,3 @@ else endif NRF_DEFINES += -DNRF52840_XXAA -DNRF52840 - -INTERNAL_FLASH_FILESYSTEM = 1 - From 32744a04e1334bfa9cbee0e487a19f52eee44d6f Mon Sep 17 00:00:00 2001 From: JoeBakalor Date: Fri, 13 Dec 2019 09:08:21 -0500 Subject: [PATCH 41/78] update bluebird make file --- ports/atmel-samd/peripherals | 2 +- .../boards/teknikio_bluebird/mpconfigboard.mk | 20 +++---------------- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/ports/atmel-samd/peripherals b/ports/atmel-samd/peripherals index 4c0deecf88..2ba5b20ba7 160000 --- a/ports/atmel-samd/peripherals +++ b/ports/atmel-samd/peripherals @@ -1 +1 @@ -Subproject commit 4c0deecf889da0074c1dbc9a5e2d24cb7c7a31c6 +Subproject commit 2ba5b20ba725e1c91c77875fba3a5e22059cdb92 diff --git a/ports/nrf/boards/teknikio_bluebird/mpconfigboard.mk b/ports/nrf/boards/teknikio_bluebird/mpconfigboard.mk index c99b33f3d6..3f97b08218 100644 --- a/ports/nrf/boards/teknikio_bluebird/mpconfigboard.mk +++ b/ports/nrf/boards/teknikio_bluebird/mpconfigboard.mk @@ -1,22 +1,8 @@ USB_VID = 0x239A USB_PID = 0x802A -USB_PRODUCT = "Bluebird" -USB_MANUFACTURER = "Teknikio" +USB_PRODUCT = "PCA10059" +USB_MANUFACTURER = "Nordic Semiconductor" -MCU_SERIES = m4 -MCU_VARIANT = nrf52 -MCU_SUB_VARIANT = nrf52840 MCU_CHIP = nrf52840 -SD ?= s140 -SOFTDEV_VERSION ?= 6.1.0 -BOOT_SETTING_ADDR = 0xFF000 - -ifeq ($(SD),) - LD_FILE = boards/nrf52840_1M_256k.ld -else - LD_FILE = boards/adafruit_$(MCU_SUB_VARIANT)_$(SD_LOWER)_v$(firstword $(subst ., ,$(SOFTDEV_VERSION))).ld - CIRCUITPY_BLEIO = 1 -endif - -NRF_DEFINES += -DNRF52840_XXAA -DNRF52840 +INTERNAL_FLASH_FILESYSTEM = 1 From a854a76819e4b871f9d0c4e059ca5c03f05dca76 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 13 Dec 2019 14:05:56 -0600 Subject: [PATCH 42/78] audiocore: The arguments to reset_buffer went missing In conversion I missed these arguments were being passed, but noticed it when an implausible value for audio_channel was sent to mp3's reset_buffer method. It's not clear whether there was any negative impact to this, but it should be fixed! --- shared-module/audiocore/__init__.c | 2 +- shared-module/audiocore/__init__.h | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/shared-module/audiocore/__init__.c b/shared-module/audiocore/__init__.c index 1553dbe961..ac9d41b60a 100644 --- a/shared-module/audiocore/__init__.c +++ b/shared-module/audiocore/__init__.c @@ -52,7 +52,7 @@ uint8_t audiosample_channel_count(mp_obj_t sample_obj) { void audiosample_reset_buffer(mp_obj_t sample_obj, bool single_channel, uint8_t audio_channel) { const audiosample_p_t *proto = mp_proto_get_or_throw(MP_QSTR_protocol_audiosample, sample_obj); - proto->reset_buffer(MP_OBJ_TO_PTR(sample_obj)); + proto->reset_buffer(MP_OBJ_TO_PTR(sample_obj), single_channel, audio_channel); } audioio_get_buffer_result_t audiosample_get_buffer(mp_obj_t sample_obj, diff --git a/shared-module/audiocore/__init__.h b/shared-module/audiocore/__init__.h index 38c1f5aeb1..7a56454b8a 100644 --- a/shared-module/audiocore/__init__.h +++ b/shared-module/audiocore/__init__.h @@ -42,7 +42,8 @@ typedef enum { typedef uint32_t (*audiosample_sample_rate_fun)(mp_obj_t); typedef uint8_t (*audiosample_bits_per_sample_fun)(mp_obj_t); typedef uint8_t (*audiosample_channel_count_fun)(mp_obj_t); -typedef void (*audiosample_reset_buffer_fun)(mp_obj_t); +typedef void (*audiosample_reset_buffer_fun)(mp_obj_t, + bool single_channel, uint8_t audio_channel); typedef audioio_get_buffer_result_t (*audiosample_get_buffer_fun)(mp_obj_t, bool single_channel, uint8_t channel, uint8_t** buffer, uint32_t* buffer_length); From bf9b7e7ece6186b2fb7716323fba8ef24315cb47 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 13 Dec 2019 14:07:00 -0600 Subject: [PATCH 43/78] MP3: skip ID3V2 metadata This was one reason that the "bartlebeats" mp3s would not play. --- shared-module/audiomp3/MP3File.c | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/shared-module/audiomp3/MP3File.c b/shared-module/audiomp3/MP3File.c index f4861da360..789d75e0f7 100644 --- a/shared-module/audiomp3/MP3File.c +++ b/shared-module/audiomp3/MP3File.c @@ -88,6 +88,39 @@ STATIC bool mp3file_update_inbuf(audiomp3_mp3file_obj_t* self) { #define BYTES_LEFT(self) (self->inbuf_length - self->inbuf_offset) #define CONSUME(self, n) (self->inbuf_offset += n) +// http://id3.org/d3v2.3.0 +// http://id3.org/id3v2.3.0 +STATIC void mp3file_skip_id3v2(audiomp3_mp3file_obj_t* self) { + mp3file_update_inbuf(self); + if (BYTES_LEFT(self) < 10) { + return; + } + uint8_t *data = READ_PTR(self); + if (!( + data[0] == 'I' && + data[1] == 'D' && + data[2] == '3' && + data[3] != 0xff && + data[4] != 0xff && + (data[5] & 0x1f) == 0 && + (data[6] & 0x80) == 0 && + (data[7] & 0x80) == 0 && + (data[8] & 0x80) == 0 && + (data[9] & 0x80) == 0)) { + return; + } + uint32_t size = (data[6] << 21) | (data[7] << 14) | (data[8] << 7) | (data[9]); + size += 10; // size excludes the "header" (but not the "extended header") + // First, deduct from size whatever is left in buffer + uint32_t to_consume = MIN(size, BYTES_LEFT(self)); + CONSUME(self, to_consume); + size -= to_consume; + + // Next, seek in the file after the header + f_lseek(&self->file->fp, f_tell(&self->file->fp) + size); + return; +} + /* If a sync word can be found, advance to it and return true. Otherwise, * return false. */ @@ -223,6 +256,7 @@ void audiomp3_mp3file_reset_buffer(audiomp3_mp3file_obj_t* self, self->eof = 0; self->other_channel = -1; mp3file_update_inbuf(self); + mp3file_skip_id3v2(self); mp3file_find_sync_word(self); } @@ -253,6 +287,7 @@ audioio_get_buffer_result_t audiomp3_mp3file_get_buffer(audiomp3_mp3file_obj_t* self->buffer_index = !self->buffer_index; int16_t *buffer = (int16_t *)(void *)self->buffers[self->buffer_index]; + mp3file_skip_id3v2(self); if (!mp3file_find_sync_word(self)) { return self->eof ? GET_BUFFER_DONE : GET_BUFFER_ERROR; } From 91a1706160aa653cb00c7910b0930df679bcdd21 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Fri, 13 Dec 2019 15:20:48 -0600 Subject: [PATCH 44/78] MP3: look harder for frame info Apparently sometimes, a proper "frame info" block is not found after a "sync word". Keep looking for one as needed, instead of giving up after one try. This was one reason that the "bartlebeats" mp3s would not play. --- shared-module/audiomp3/MP3File.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/shared-module/audiomp3/MP3File.c b/shared-module/audiomp3/MP3File.c index 789d75e0f7..0aa4f24a66 100644 --- a/shared-module/audiomp3/MP3File.c +++ b/shared-module/audiomp3/MP3File.c @@ -139,7 +139,15 @@ STATIC bool mp3file_find_sync_word(audiomp3_mp3file_obj_t* self) { } STATIC bool mp3file_get_next_frame_info(audiomp3_mp3file_obj_t* self, MP3FrameInfo* fi) { - int err = MP3GetNextFrameInfo(self->decoder, fi, READ_PTR(self)); + int err; + do { + err = MP3GetNextFrameInfo(self->decoder, fi, READ_PTR(self)); + if (err == ERR_MP3_NONE) { + break; + } + CONSUME(self, 1); + mp3file_find_sync_word(self); + } while (!self->eof); return err == ERR_MP3_NONE; } From b26f8a781583c41b5f0452b8e22b4d093bf0c9e3 Mon Sep 17 00:00:00 2001 From: Roy Hooper Date: Sat, 14 Dec 2019 14:34:26 -0500 Subject: [PATCH 45/78] Add a BUILDING.md - #2370 --- BUILDING.md | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 BUILDING.md diff --git a/BUILDING.md b/BUILDING.md new file mode 100644 index 0000000000..6594ce4d08 --- /dev/null +++ b/BUILDING.md @@ -0,0 +1,83 @@ + +# Building CircuitPython + +Welcome to CircuitPython! + +This document is a quick-start guide only. + +Detailed guides on how to build CircuitPython can be found in the Adafruit Learn system at +https://learn.adafruit.com/building-circuitpython/. + +## Setup + +Please ensure you setup your build environment appropriately, as per the guide. You will need: + +* Linux: https://learn.adafruit.com/building-circuitpython/linux +* MacOS: https://learn.adafruit.com/building-circuitpython/macos +* Windows Subsystem for Linux (WSL): https://learn.adafruit.com/building-circuitpython/windows-subsystem-for-linux + +### Submodules + +This project has a bunch of git submodules. You will need to update them regularly. + + git submodule sync + git submodule update --init --recursive + +### mpy-cross + +As part of the build process, mpy-cross is needed to compile .py files into .mpy files. +To compile (or recompile) mpy-cross: + + make -C mpy-cross + +# Building + +There a number of ports of CircuitPython! To build for your board, change to the appropriate ports directory and build. + +Examples: + + cd ports/atmel-samd + make BOARD=circuitplayground_express + + cd ports/nrf + make BOARD=circuitplayground_bluefruit + +If you aren't sure what boards exist, have a peek in the boards subdirectory of your port. + +Useful make arguments or targets: + + make BOARD=circuitplayground_express clean + +# Testing + +If you are working on changes to the core language, you might find it useful to run the test suite. +The test suite in the top level `tests` directory. It needs the unix port to run. + + cd ports/unix + make axtls + make micropython + +Then you can run the test suite: + + cd ../../tests + ./run-tests + +A successful run will say something like + + 676 tests performed (19129 individual testcases) + 676 tests passed + 30 tests skipped: buffered_writer builtin_help builtin_range_binop class_delattr_setattr cmd_parsetree extra_coverage framebuf1 framebuf16 framebuf2 framebuf4 framebuf8 framebuf_subclass mpy_invalid namedtuple_asdict non_compliant resource_stream schedule sys_getsizeof urandom_extra ure_groups ure_span ure_sub ure_sub_unmatched vfs_basic vfs_fat_fileio1 vfs_fat_fileio2 vfs_fat_more vfs_fat_oldproto vfs_fat_ramdisk vfs_userfs + +# Debugging + +The easiest way to debug CircuitPython on hardware is with a JLink device, JLinkGDBServer, and `gcc-arm-embedded`. +Instructions can be found at https://learn.adafruit.com/debugging-the-samd21-with-gdb + +If using JLink, you'll need both the `JLinkGDBServer` and `arm-non-eabi-gdb-py` running. + +Example: + + JLinkGDBServer -if SWD -device ATSAMD51J19 + arm-none-eabi-gdb-py build-metro_m4_express/firmware.elf -iex "target extended-remote :2331" + + \ No newline at end of file From cca42e94d719c9005d09df543596324fca2af2ae Mon Sep 17 00:00:00 2001 From: Roy Hooper Date: Sat, 14 Dec 2019 15:00:42 -0500 Subject: [PATCH 46/78] Add to BUILDING to table of contents. --- docs/index.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/index.rst b/docs/index.rst index a85772fdc9..6dadddfc1a 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -43,6 +43,7 @@ Full Table of Contents ../README ../CONTRIBUTING + ../BUILDING ../CODE_OF_CONDUCT ../license.rst From 6f6d6c01abb790d3f6b279f935405835ca8aa95c Mon Sep 17 00:00:00 2001 From: KalbeAbbas Date: Mon, 16 Dec 2019 12:18:16 +0500 Subject: [PATCH 47/78] Update mpconfigboard.mk --- ports/atmel-samd/boards/xinabox_cc03/mpconfigboard.mk | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/ports/atmel-samd/boards/xinabox_cc03/mpconfigboard.mk b/ports/atmel-samd/boards/xinabox_cc03/mpconfigboard.mk index 47cd07df21..941d88b459 100644 --- a/ports/atmel-samd/boards/xinabox_cc03/mpconfigboard.mk +++ b/ports/atmel-samd/boards/xinabox_cc03/mpconfigboard.mk @@ -1,6 +1,6 @@ LD_FILE = boards/samd21x18-bootloader.ld -USB_VID = 0x239A -USB_PID = 0x8014 +USB_VID = 0x04D8 +USB_PID = 0xEC72 USB_PRODUCT = "XinaBox CC03" USB_MANUFACTURER = "XinaBox" @@ -15,16 +15,12 @@ SUPEROPT_GC = 0 # Make room for frozen libs. CIRCUITPY_FREQUENCYIO = 0 -#CIRCUITPY_I2CSLAVE = 0 CIRCUITPY_ANALOGIO=0 CIRCUITPY_NEOPIXEL_WRITE=0 CIRCUITPY_PULSEIO=0 CIRCUITPY_ROTARYIO=0 CIRCUITPY_TOUCHIO_USE_NATIVE=0 CIRCUITPY_TOUCHIO=0 -#CIRCUITPY_USB_MIDI=0 -#CIRCUITPY_RTC=0 -#CIRCUITPY_USB_HID=0 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice From 87dc9bee8b33c40aa2e342ee42ced71ed757b142 Mon Sep 17 00:00:00 2001 From: KalbeAbbas Date: Mon, 16 Dec 2019 12:25:51 +0500 Subject: [PATCH 48/78] Update mpconfigboard.mk --- ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk b/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk index f4b7a7bfcb..5c418d312c 100644 --- a/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk +++ b/ports/atmel-samd/boards/xinabox_cs11/mpconfigboard.mk @@ -1,6 +1,6 @@ LD_FILE = boards/samd21x18-bootloader.ld -USB_VID = 0x239A -USB_PID = 0x8014 +USB_VID = 0x04D8 +USB_PID = 0xEC75 USB_PRODUCT = "XinaBox CS11" USB_MANUFACTURER = "XinaBox" @@ -15,7 +15,6 @@ SUPEROPT_GC = 0 # Make room for frozen libs. CIRCUITPY_FREQUENCYIO = 0 -#CIRCUITPY_I2CSLAVE = 0 CIRCUITPY_ANALOGIO=0 CIRCUITPY_NEOPIXEL_WRITE=0 CIRCUITPY_PULSEIO=0 @@ -23,9 +22,8 @@ CIRCUITPY_ROTARYIO=0 CIRCUITPY_TOUCHIO_USE_NATIVE=0 CIRCUITPY_TOUCHIO=0 CIRCUITPY_USB_MIDI=0 -#CIRCUITPY_USB_HID=0 CIRCUITPY_RTC=0 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice -FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_SD \ No newline at end of file +FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_SD From 2abccc1745862bf3a5dc13f33a5030e1a877e3a6 Mon Sep 17 00:00:00 2001 From: JoeBakalor Date: Mon, 16 Dec 2019 08:58:56 -0500 Subject: [PATCH 49/78] update vid and pid for teknikio_bluebird --- .gitignore | 2 ++ ports/nrf/boards/teknikio_bluebird/mpconfigboard.mk | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 3e5bd28300..435ed73a78 100644 --- a/.gitignore +++ b/.gitignore @@ -65,6 +65,8 @@ TAGS *~ *.DS_Store +**/*.DS_Store +*.icloud # POEdit mo files #################### diff --git a/ports/nrf/boards/teknikio_bluebird/mpconfigboard.mk b/ports/nrf/boards/teknikio_bluebird/mpconfigboard.mk index 3f97b08218..e178a82051 100644 --- a/ports/nrf/boards/teknikio_bluebird/mpconfigboard.mk +++ b/ports/nrf/boards/teknikio_bluebird/mpconfigboard.mk @@ -1,7 +1,7 @@ USB_VID = 0x239A -USB_PID = 0x802A -USB_PRODUCT = "PCA10059" -USB_MANUFACTURER = "Nordic Semiconductor" +USB_PID = 0x8070 +USB_PRODUCT = "Bluebird" +USB_MANUFACTURER = "Teknikio" MCU_CHIP = nrf52840 From a63da7a6c0e0537cbefaafb724d722f9587b82a2 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 16 Dec 2019 15:23:41 -0600 Subject: [PATCH 50/78] displayio: make 'rotation' property settable --- shared-bindings/displayio/Display.c | 9 ++++++++- shared-bindings/displayio/Display.h | 1 + shared-module/displayio/Display.c | 17 +++++++++++++++++ shared-module/displayio/display_core.c | 9 +++++++++ shared-module/displayio/display_core.h | 2 ++ supervisor/shared/display.c | 1 + 6 files changed, 38 insertions(+), 1 deletion(-) diff --git a/shared-bindings/displayio/Display.c b/shared-bindings/displayio/Display.c index 5ce7b3581b..5759e8ad22 100644 --- a/shared-bindings/displayio/Display.c +++ b/shared-bindings/displayio/Display.c @@ -394,11 +394,18 @@ STATIC mp_obj_t displayio_display_obj_get_rotation(mp_obj_t self_in) { return MP_OBJ_NEW_SMALL_INT(common_hal_displayio_display_get_rotation(self)); } MP_DEFINE_CONST_FUN_OBJ_1(displayio_display_get_rotation_obj, displayio_display_obj_get_rotation); +STATIC mp_obj_t displayio_display_obj_set_rotation(mp_obj_t self_in, mp_obj_t value) { + displayio_display_obj_t *self = native_display(self_in); + common_hal_displayio_display_set_rotation(self, mp_obj_get_int(value)); + return mp_const_none; +} +MP_DEFINE_CONST_FUN_OBJ_2(displayio_display_set_rotation_obj, displayio_display_obj_set_rotation); + const mp_obj_property_t displayio_display_rotation_obj = { .base.type = &mp_type_property, .proxy = {(mp_obj_t)&displayio_display_get_rotation_obj, - (mp_obj_t)&mp_const_none_obj, + (mp_obj_t)&displayio_display_set_rotation_obj, (mp_obj_t)&mp_const_none_obj}, }; diff --git a/shared-bindings/displayio/Display.h b/shared-bindings/displayio/Display.h index ca2b2d4765..b82a68ebe9 100644 --- a/shared-bindings/displayio/Display.h +++ b/shared-bindings/displayio/Display.h @@ -58,6 +58,7 @@ void common_hal_displayio_display_set_auto_refresh(displayio_display_obj_t* self uint16_t common_hal_displayio_display_get_width(displayio_display_obj_t* self); uint16_t common_hal_displayio_display_get_height(displayio_display_obj_t* self); uint16_t common_hal_displayio_display_get_rotation(displayio_display_obj_t* self); +void common_hal_displayio_display_set_rotation(displayio_display_obj_t* self, int rotation); bool common_hal_displayio_display_get_auto_brightness(displayio_display_obj_t* self); void common_hal_displayio_display_set_auto_brightness(displayio_display_obj_t* self, bool auto_brightness); diff --git a/shared-module/displayio/Display.c b/shared-module/displayio/Display.c index 11db0f8ff2..299c8ad359 100644 --- a/shared-module/displayio/Display.c +++ b/shared-module/displayio/Display.c @@ -308,10 +308,27 @@ STATIC void _refresh_display(displayio_display_obj_t* self) { displayio_display_core_finish_refresh(&self->core); } +void common_hal_displayio_display_set_rotation(displayio_display_obj_t* self, int rotation){ + bool transposed = (self->core.rotation == 90 || self->core.rotation == 270); + bool will_transposed = (rotation == 90 || rotation == 270); + if(transposed != will_transposed) { + int tmp = self->core.width; + self->core.width = self->core.height; + self->core.height = tmp; + } + displayio_display_core_set_rotation(&self->core, rotation); + supervisor_stop_terminal(); + supervisor_start_terminal(self->core.width, self->core.height); + if (self->core.current_group != NULL) { + displayio_group_update_transform(self->core.current_group, &self->core.transform); + } +} + uint16_t common_hal_displayio_display_get_rotation(displayio_display_obj_t* self){ return self->core.rotation; } + bool common_hal_displayio_display_refresh(displayio_display_obj_t* self, uint32_t target_ms_per_frame, uint32_t maximum_ms_per_real_frame) { if (!self->auto_refresh && !self->first_manual_refresh) { uint64_t current_time = supervisor_ticks_ms64(); diff --git a/shared-module/displayio/display_core.c b/shared-module/displayio/display_core.c index 658daa8d69..120b70f76a 100644 --- a/shared-module/displayio/display_core.c +++ b/shared-module/displayio/display_core.c @@ -86,6 +86,15 @@ void displayio_display_core_construct(displayio_display_core_t* self, self->height = height; self->ram_width = ram_width; self->ram_height = ram_height; + + displayio_display_core_set_rotation(self, rotation); +} + +void displayio_display_core_set_rotation( displayio_display_core_t* self, + int rotation) { + int height = self->height; + int width = self->width; + rotation = rotation % 360; self->rotation = rotation; self->transform.x = 0; diff --git a/shared-module/displayio/display_core.h b/shared-module/displayio/display_core.h index 3a69cd40a2..1c3d0f09c6 100644 --- a/shared-module/displayio/display_core.h +++ b/shared-module/displayio/display_core.h @@ -68,6 +68,8 @@ uint16_t displayio_display_core_get_height(displayio_display_core_t* self); void displayio_display_core_set_dither(displayio_display_core_t* self, bool dither); bool displayio_display_core_get_dither(displayio_display_core_t* self); +void displayio_display_core_set_rotation(displayio_display_core_t* self, int rotation); + bool displayio_display_core_bus_free(displayio_display_core_t *self); bool displayio_display_core_begin_transaction(displayio_display_core_t* self); void displayio_display_core_end_transaction(displayio_display_core_t* self); diff --git a/supervisor/shared/display.c b/supervisor/shared/display.c index c6fda0f168..855432d645 100644 --- a/supervisor/shared/display.c +++ b/supervisor/shared/display.c @@ -81,6 +81,7 @@ void supervisor_start_terminal(uint16_t width_px, uint16_t height_px) { grid->pixel_width = width_in_tiles * grid->tile_width; grid->pixel_height = height_in_tiles * grid->tile_height; grid->tiles = tiles; + grid->full_change = true; common_hal_terminalio_terminal_construct(&supervisor_terminal, grid, &supervisor_terminal_font); } From 03ea9ff66ee513714c3ba95320d414a9e6c1f088 Mon Sep 17 00:00:00 2001 From: JoeBakalor Date: Mon, 16 Dec 2019 16:31:44 -0500 Subject: [PATCH 51/78] reset atmel-samd submodule to correct commit --- ports/atmel-samd/peripherals | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/peripherals b/ports/atmel-samd/peripherals index 2ba5b20ba7..4c0deecf88 160000 --- a/ports/atmel-samd/peripherals +++ b/ports/atmel-samd/peripherals @@ -1 +1 @@ -Subproject commit 2ba5b20ba725e1c91c77875fba3a5e22059cdb92 +Subproject commit 4c0deecf889da0074c1dbc9a5e2d24cb7c7a31c6 From 201f4648c40c13bdbf91f8cc078c1fbecc09256d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Mon, 16 Dec 2019 15:33:55 -0600 Subject: [PATCH 52/78] py.mk: Fix race condition building .mo files By having an order-only dependency on the directory itself, the directory is sure to be created before the rule to create a .mo file is. This fixes a low-freqency error on github actions such as > msgfmt: error while opening "build/genhdr/en_US.mo" for writing: No such file or directory --- py/py.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/py/py.mk b/py/py.mk index 0c68e9af1b..9031c009f6 100644 --- a/py/py.mk +++ b/py/py.mk @@ -317,7 +317,7 @@ SRC_QSTR += $(HEADER_BUILD)/moduledefs.h # overall config, so they need to be caught MPCONFIGPORT_MK = $(wildcard mpconfigport.mk) -$(HEADER_BUILD)/$(TRANSLATION).mo: $(TOP)/locale/$(TRANSLATION).po +$(HEADER_BUILD)/$(TRANSLATION).mo: $(TOP)/locale/$(TRANSLATION).po | $(HEADER_BUILD) $(Q)msgfmt -o $@ $^ $(HEADER_BUILD)/qstrdefs.preprocessed.h: $(PY_QSTR_DEFS) $(QSTR_DEFS) $(QSTR_DEFS_COLLECTED) mpconfigport.h $(MPCONFIGPORT_MK) $(PY_SRC)/mpconfig.h | $(HEADER_BUILD) From 81581b345c4cb4dbf33af3c3bbd48c6baf522283 Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Mon, 16 Dec 2019 17:17:13 -0500 Subject: [PATCH 53/78] Increase CPX stack size slightly --- .../boards/circuitplayground_express/mpconfigboard.h | 3 +++ .../circuitplayground_express_crickit/mpconfigboard.h | 3 +++ .../mpconfigboard.h | 3 +++ ports/atmel-samd/mpconfigport.h | 11 ++++++++--- tools/build_memory_info.py | 2 +- 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h index 0ed5262ab5..6eb49b02c5 100644 --- a/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitplayground_express/mpconfigboard.h @@ -27,6 +27,9 @@ // Explanation of how a user got into safe mode. #define BOARD_USER_SAFE_MODE_ACTION "pressing both buttons at start up" +// Increase stack size slightly due to CPX library import nesting +#define CIRCUITPY_DEFAULT_STACK_SIZE (4504) + #define DEFAULT_I2C_BUS_SCL (&pin_PB03) #define DEFAULT_I2C_BUS_SDA (&pin_PB02) diff --git a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h index 2db5129291..e64997c0e4 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.h @@ -27,6 +27,9 @@ // Explanation of how a user got into safe mode. #define BOARD_USER_SAFE_MODE_ACTION "pressing both buttons at start up" +// Increase stack size slightly due to CPX library import nesting +#define CIRCUITPY_DEFAULT_STACK_SIZE (4504) + #define DEFAULT_I2C_BUS_SCL (&pin_PB03) #define DEFAULT_I2C_BUS_SDA (&pin_PB02) diff --git a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h index a1d5b0a671..4486e8a6d3 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h @@ -27,6 +27,9 @@ // Explanation of how a user got into safe mode. #define BOARD_USER_SAFE_MODE_ACTION "pressing both buttons at start up" +// Increase stack size slightly due to CPX library import nesting. +#define CIRCUITPY_DEFAULT_STACK_SIZE (4504) // divisible by 8 + #define DEFAULT_I2C_BUS_SCL (&pin_PB03) #define DEFAULT_I2C_BUS_SDA (&pin_PB02) diff --git a/ports/atmel-samd/mpconfigport.h b/ports/atmel-samd/mpconfigport.h index 846e8db707..28a844ffc0 100644 --- a/ports/atmel-samd/mpconfigport.h +++ b/ports/atmel-samd/mpconfigport.h @@ -42,7 +42,6 @@ #define CIRCUITPY_MCU_FAMILY samd21 #define MICROPY_PY_SYS_PLATFORM "Atmel SAMD21" #define SPI_FLASH_MAX_BAUDRATE 8000000 -#define CIRCUITPY_DEFAULT_STACK_SIZE 4096 #define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (0) #define MICROPY_PY_COLLECTIONS_ORDEREDDICT (0) #define MICROPY_PY_FUNCTION_ATTRS (0) @@ -74,8 +73,6 @@ #define CIRCUITPY_MCU_FAMILY samd51 #define MICROPY_PY_SYS_PLATFORM "MicroChip SAMD51" #define SPI_FLASH_MAX_BAUDRATE 24000000 -// 24kiB stack -#define CIRCUITPY_DEFAULT_STACK_SIZE 0x6000 #define MICROPY_PY_BUILTINS_NOTIMPLEMENTED (1) #define MICROPY_PY_COLLECTIONS_ORDEREDDICT (1) #define MICROPY_PY_FUNCTION_ATTRS (1) @@ -108,6 +105,10 @@ #define CIRCUITPY_INTERNAL_NVM_SIZE (256) #endif +#ifndef CIRCUITPY_DEFAULT_STACK_SIZE +#define CIRCUITPY_DEFAULT_STACK_SIZE 4096 +#endif + #endif // SAMD21 //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -118,6 +119,10 @@ #define CIRCUITPY_INTERNAL_NVM_SIZE (8192) #endif +#ifndef CIRCUITPY_DEFAULT_STACK_SIZE +#define CIRCUITPY_DEFAULT_STACK_SIZE (24*1024) +#endif + // If CIRCUITPY is internal, use half of flash for it. #if INTERNAL_FLASH_FILESYSTEM #ifndef CIRCUITPY_INTERNAL_FLASH_FILESYSTEM_SIZE diff --git a/tools/build_memory_info.py b/tools/build_memory_info.py index f61b843ced..93b4c1e82f 100644 --- a/tools/build_memory_info.py +++ b/tools/build_memory_info.py @@ -73,7 +73,7 @@ ram_region = regions["RAM"] free_flash = firmware_region - text - data free_ram = ram_region - data - bss print("{} bytes free in flash firmware space out of {} bytes ({}kB).".format(free_flash, firmware_region, firmware_region / 1024)) -print("{} bytes free in ram for heap out of {} bytes ({}kB).".format(free_ram, ram_region, ram_region / 1024)) +print("{} bytes free in ram for stack and heap out of {} bytes ({}kB).".format(free_ram, ram_region, ram_region / 1024)) print() # Check that we have free flash space. GCC doesn't fail when the text + data From a46adb6175d479870960a38b47f9bf27e0e5ccc3 Mon Sep 17 00:00:00 2001 From: Roy Hooper Date: Mon, 16 Dec 2019 20:15:53 -0500 Subject: [PATCH 54/78] remove . from end of url --- BUILDING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILDING.md b/BUILDING.md index 6594ce4d08..794d5409aa 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -6,7 +6,7 @@ Welcome to CircuitPython! This document is a quick-start guide only. Detailed guides on how to build CircuitPython can be found in the Adafruit Learn system at -https://learn.adafruit.com/building-circuitpython/. +https://learn.adafruit.com/building-circuitpython/ ## Setup From 894cad2e177cf1af5258ce07a78acb386c34ef68 Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 17 Dec 2019 21:39:52 +0700 Subject: [PATCH 55/78] upgrade nrfx API to v2 --- ports/nrf/Makefile | 2 +- ports/nrf/common-hal/analogio/AnalogIn.c | 51 +++++++++---------- ports/nrf/common-hal/busio/I2C.c | 12 +++-- ports/nrf/common-hal/busio/SPI.c | 3 +- ports/nrf/common-hal/busio/UART.c | 8 +-- .../common-hal/microcontroller/Processor.c | 39 +++++++------- ports/nrf/common-hal/os/__init__.c | 12 ++--- ports/nrf/common-hal/pulseio/PulseIn.c | 2 +- ports/nrf/common-hal/rtc/RTC.c | 4 +- ports/nrf/nrfx | 2 +- ports/nrf/nrfx_config.h | 5 +- ports/nrf/peripherals/nrf/nrf52840/power.c | 4 +- ports/nrf/peripherals/nrf/nvm.c | 6 +-- 13 files changed, 78 insertions(+), 72 deletions(-) diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index e6070fc329..f38b9f6846 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -138,6 +138,7 @@ SRC_NRFX = $(addprefix nrfx/,\ drivers/src/nrfx_uarte.c \ drivers/src/nrfx_gpiote.c \ drivers/src/nrfx_rtc.c \ + drivers/src/nrfx_nvmc.c \ ) ifdef EXTERNAL_FLASH_DEVICES @@ -167,7 +168,6 @@ SRC_C += \ lib/utils/pyexec.c \ lib/utils/stdout_helpers.c \ lib/utils/sys_stdio_mphal.c \ - nrfx/hal/nrf_nvmc.c \ nrfx/mdk/system_$(MCU_SUB_VARIANT).c \ peripherals/nrf/cache.c \ peripherals/nrf/clocks.c \ diff --git a/ports/nrf/common-hal/analogio/AnalogIn.c b/ports/nrf/common-hal/analogio/AnalogIn.c index 44ebe9b4df..3bc097019e 100644 --- a/ports/nrf/common-hal/analogio/AnalogIn.c +++ b/ports/nrf/common-hal/analogio/AnalogIn.c @@ -36,12 +36,12 @@ void analogin_init(void) { // Calibrate the ADC once, on startup. - nrf_saadc_enable(); - nrf_saadc_event_clear(NRF_SAADC_EVENT_CALIBRATEDONE); - nrf_saadc_task_trigger(NRF_SAADC_TASK_CALIBRATEOFFSET); - while (nrf_saadc_event_check(NRF_SAADC_EVENT_CALIBRATEDONE) == 0) { } - nrf_saadc_event_clear(NRF_SAADC_EVENT_CALIBRATEDONE); - nrf_saadc_disable(); + nrf_saadc_enable(NRF_SAADC); + nrf_saadc_event_clear(NRF_SAADC, NRF_SAADC_EVENT_CALIBRATEDONE); + nrf_saadc_task_trigger(NRF_SAADC, NRF_SAADC_TASK_CALIBRATEOFFSET); + while (nrf_saadc_event_check(NRF_SAADC, NRF_SAADC_EVENT_CALIBRATEDONE) == 0) { } + nrf_saadc_event_clear(NRF_SAADC, NRF_SAADC_EVENT_CALIBRATEDONE); + nrf_saadc_disable(NRF_SAADC); } void common_hal_analogio_analogin_construct(analogio_analogin_obj_t *self, const mcu_pin_obj_t *pin) { @@ -81,34 +81,33 @@ uint16_t common_hal_analogio_analogin_get_value(analogio_analogin_obj_t *self) { .reference = NRF_SAADC_REFERENCE_VDD4, .acq_time = NRF_SAADC_ACQTIME_3US, .mode = NRF_SAADC_MODE_SINGLE_ENDED, - .burst = NRF_SAADC_BURST_DISABLED, - .pin_p = self->pin->adc_channel, - .pin_n = self->pin->adc_channel, + .burst = NRF_SAADC_BURST_DISABLED }; - nrf_saadc_resolution_set(NRF_SAADC_RESOLUTION_14BIT); - nrf_saadc_oversample_set(NRF_SAADC_OVERSAMPLE_DISABLED); - nrf_saadc_enable(); + nrf_saadc_resolution_set(NRF_SAADC, NRF_SAADC_RESOLUTION_14BIT); + nrf_saadc_oversample_set(NRF_SAADC, NRF_SAADC_OVERSAMPLE_DISABLED); + nrf_saadc_enable(NRF_SAADC); - for (uint32_t i = 0; i < NRF_SAADC_CHANNEL_COUNT; i++) - nrf_saadc_channel_input_set(i, NRF_SAADC_INPUT_DISABLED, NRF_SAADC_INPUT_DISABLED); + for (uint32_t i = 0; i < SAADC_CH_NUM; i++) + nrf_saadc_channel_input_set(NRF_SAADC, i, NRF_SAADC_INPUT_DISABLED, NRF_SAADC_INPUT_DISABLED); - nrf_saadc_channel_init(CHANNEL_NO, &config); - nrf_saadc_buffer_init(&value, 1); + nrf_saadc_channel_init(NRF_SAADC, CHANNEL_NO, &config); + nrf_saadc_channel_input_set(NRF_SAADC, CHANNEL_NO, self->pin->adc_channel, self->pin->adc_channel); + nrf_saadc_buffer_init(NRF_SAADC, &value, 1); - nrf_saadc_task_trigger(NRF_SAADC_TASK_START); - while (nrf_saadc_event_check(NRF_SAADC_EVENT_STARTED) == 0); - nrf_saadc_event_clear(NRF_SAADC_EVENT_STARTED); + nrf_saadc_task_trigger(NRF_SAADC, NRF_SAADC_TASK_START); + while (nrf_saadc_event_check(NRF_SAADC, NRF_SAADC_EVENT_STARTED) == 0); + nrf_saadc_event_clear(NRF_SAADC, NRF_SAADC_EVENT_STARTED); - nrf_saadc_task_trigger(NRF_SAADC_TASK_SAMPLE); - while (nrf_saadc_event_check(NRF_SAADC_EVENT_END) == 0); - nrf_saadc_event_clear(NRF_SAADC_EVENT_END); + nrf_saadc_task_trigger(NRF_SAADC, NRF_SAADC_TASK_SAMPLE); + while (nrf_saadc_event_check(NRF_SAADC, NRF_SAADC_EVENT_END) == 0); + nrf_saadc_event_clear(NRF_SAADC, NRF_SAADC_EVENT_END); - nrf_saadc_task_trigger(NRF_SAADC_TASK_STOP); - while (nrf_saadc_event_check(NRF_SAADC_EVENT_STOPPED) == 0); - nrf_saadc_event_clear(NRF_SAADC_EVENT_STOPPED); + nrf_saadc_task_trigger(NRF_SAADC, NRF_SAADC_TASK_STOP); + while (nrf_saadc_event_check(NRF_SAADC, NRF_SAADC_EVENT_STOPPED) == 0); + nrf_saadc_event_clear(NRF_SAADC, NRF_SAADC_EVENT_STOPPED); - nrf_saadc_disable(); + nrf_saadc_disable(NRF_SAADC); if (value < 0) value = 0; diff --git a/ports/nrf/common-hal/busio/I2C.c b/ports/nrf/common-hal/busio/I2C.c index 8a2ebde3bd..7a079ff7f4 100644 --- a/ports/nrf/common-hal/busio/I2C.c +++ b/ports/nrf/common-hal/busio/I2C.c @@ -133,9 +133,8 @@ void common_hal_busio_i2c_construct(busio_i2c_obj_t *self, const mcu_pin_obj_t * mp_raise_RuntimeError(translate("SDA or SCL needs a pull up")); } - nrfx_twim_config_t config = NRFX_TWIM_DEFAULT_CONFIG; - config.scl = scl->number; - config.sda = sda->number; + nrfx_twim_config_t config = NRFX_TWIM_DEFAULT_CONFIG(scl->number, sda->number); + // change freq. only if it's less than the default 400K if (frequency < 100000) { config.frequency = NRF_TWIM_FREQ_100K; @@ -248,8 +247,10 @@ uint8_t common_hal_busio_i2c_write(busio_i2c_obj_t *self, uint16_t addr, const u // break into MAX_XFER_LEN transaction while ( len ) { const size_t xact_len = MIN(len, I2C_MAX_XFER_LEN); + nrfx_twim_xfer_desc_t xfer_desc = NRFX_TWIM_XFER_DESC_TX(addr, (uint8_t*) data, xact_len); + uint32_t const flags = (stopBit ? 0 : NRFX_TWIM_FLAG_TX_NO_STOP); - if ( NRFX_SUCCESS != (err = nrfx_twim_tx(&self->twim_peripheral->twim, addr, data, xact_len, !stopBit)) ) { + if ( NRFX_SUCCESS != (err = nrfx_twim_xfer(&self->twim_peripheral->twim, &xfer_desc, flags)) ) { break; } @@ -274,8 +275,9 @@ uint8_t common_hal_busio_i2c_read(busio_i2c_obj_t *self, uint16_t addr, uint8_t // break into MAX_XFER_LEN transaction while ( len ) { const size_t xact_len = MIN(len, I2C_MAX_XFER_LEN); + nrfx_twim_xfer_desc_t xfer_desc = NRFX_TWIM_XFER_DESC_RX(addr, data, xact_len); - if ( NRFX_SUCCESS != (err = nrfx_twim_rx(&self->twim_peripheral->twim, addr, data, xact_len)) ) { + if ( NRFX_SUCCESS != (err = nrfx_twim_xfer(&self->twim_peripheral->twim, &xfer_desc, 0)) ) { break; } diff --git a/ports/nrf/common-hal/busio/SPI.c b/ports/nrf/common-hal/busio/SPI.c index 5f1aac1934..d2977909e1 100644 --- a/ports/nrf/common-hal/busio/SPI.c +++ b/ports/nrf/common-hal/busio/SPI.c @@ -135,7 +135,8 @@ void common_hal_busio_spi_construct(busio_spi_obj_t *self, const mcu_pin_obj_t * mp_raise_ValueError(translate("All SPI peripherals are in use")); } - nrfx_spim_config_t config = NRFX_SPIM_DEFAULT_CONFIG; + nrfx_spim_config_t config = NRFX_SPIM_DEFAULT_CONFIG(NRFX_SPIM_PIN_NOT_USED, NRFX_SPIM_PIN_NOT_USED, + NRFX_SPIM_PIN_NOT_USED, NRFX_SPIM_PIN_NOT_USED); config.frequency = NRF_SPIM_FREQ_8M; config.sck_pin = clock->number; diff --git a/ports/nrf/common-hal/busio/UART.c b/ports/nrf/common-hal/busio/UART.c index 9cdc197e7c..0579db4142 100644 --- a/ports/nrf/common-hal/busio/UART.c +++ b/ports/nrf/common-hal/busio/UART.c @@ -163,10 +163,12 @@ void common_hal_busio_uart_construct (busio_uart_obj_t *self, .pselcts = NRF_UARTE_PSEL_DISCONNECTED, .pselrts = NRF_UARTE_PSEL_DISCONNECTED, .p_context = self, - .hwfc = NRF_UARTE_HWFC_DISABLED, - .parity = (parity == PARITY_NONE) ? NRF_UARTE_PARITY_EXCLUDED : NRF_UARTE_PARITY_INCLUDED, .baudrate = get_nrf_baud(baudrate), - .interrupt_priority = 7 + .interrupt_priority = 7, + .hal_cfg = { + .hwfc = NRF_UARTE_HWFC_DISABLED, + .parity = (parity == PARITY_NONE) ? NRF_UARTE_PARITY_EXCLUDED : NRF_UARTE_PARITY_INCLUDED + } }; nrfx_uarte_uninit(self->uarte); diff --git a/ports/nrf/common-hal/microcontroller/Processor.c b/ports/nrf/common-hal/microcontroller/Processor.c index abfd5b8656..03d9c4d3f0 100644 --- a/ports/nrf/common-hal/microcontroller/Processor.c +++ b/ports/nrf/common-hal/microcontroller/Processor.c @@ -75,35 +75,34 @@ float common_hal_mcu_processor_get_voltage(void) { .reference = NRF_SAADC_REFERENCE_INTERNAL, .acq_time = NRF_SAADC_ACQTIME_10US, .mode = NRF_SAADC_MODE_SINGLE_ENDED, - .burst = NRF_SAADC_BURST_DISABLED, - .pin_p = NRF_SAADC_INPUT_VDD, - .pin_n = NRF_SAADC_INPUT_VDD, + .burst = NRF_SAADC_BURST_DISABLED }; - nrf_saadc_resolution_set(NRF_SAADC_RESOLUTION_14BIT); - nrf_saadc_oversample_set(NRF_SAADC_OVERSAMPLE_DISABLED); - nrf_saadc_enable(); + nrf_saadc_resolution_set(NRF_SAADC, NRF_SAADC_RESOLUTION_14BIT); + nrf_saadc_oversample_set(NRF_SAADC, NRF_SAADC_OVERSAMPLE_DISABLED); + nrf_saadc_enable(NRF_SAADC); - for (uint32_t i = 0; i < NRF_SAADC_CHANNEL_COUNT; i++) { - nrf_saadc_channel_input_set(i, NRF_SAADC_INPUT_DISABLED, NRF_SAADC_INPUT_DISABLED); + for (uint32_t i = 0; i < SAADC_CH_NUM; i++) { + nrf_saadc_channel_input_set(NRF_SAADC, i, NRF_SAADC_INPUT_DISABLED, NRF_SAADC_INPUT_DISABLED); } - nrf_saadc_channel_init(0, &config); - nrf_saadc_buffer_init(&value, 1); + nrf_saadc_channel_init(NRF_SAADC, 0, &config); + nrf_saadc_channel_input_set(NRF_SAADC, 0, NRF_SAADC_INPUT_VDD, NRF_SAADC_INPUT_VDD); + nrf_saadc_buffer_init(NRF_SAADC, &value, 1); - nrf_saadc_task_trigger(NRF_SAADC_TASK_START); - while (nrf_saadc_event_check(NRF_SAADC_EVENT_STARTED) == 0) { } - nrf_saadc_event_clear(NRF_SAADC_EVENT_STARTED); + nrf_saadc_task_trigger(NRF_SAADC, NRF_SAADC_TASK_START); + while (nrf_saadc_event_check(NRF_SAADC, NRF_SAADC_EVENT_STARTED) == 0) { } + nrf_saadc_event_clear(NRF_SAADC, NRF_SAADC_EVENT_STARTED); - nrf_saadc_task_trigger(NRF_SAADC_TASK_SAMPLE); - while (nrf_saadc_event_check(NRF_SAADC_EVENT_END) == 0) { } - nrf_saadc_event_clear(NRF_SAADC_EVENT_END); + nrf_saadc_task_trigger(NRF_SAADC, NRF_SAADC_TASK_SAMPLE); + while (nrf_saadc_event_check(NRF_SAADC, NRF_SAADC_EVENT_END) == 0) { } + nrf_saadc_event_clear(NRF_SAADC, NRF_SAADC_EVENT_END); - nrf_saadc_task_trigger(NRF_SAADC_TASK_STOP); - while (nrf_saadc_event_check(NRF_SAADC_EVENT_STOPPED) == 0) { } - nrf_saadc_event_clear(NRF_SAADC_EVENT_STOPPED); + nrf_saadc_task_trigger(NRF_SAADC, NRF_SAADC_TASK_STOP); + while (nrf_saadc_event_check(NRF_SAADC, NRF_SAADC_EVENT_STOPPED) == 0) { } + nrf_saadc_event_clear(NRF_SAADC, NRF_SAADC_EVENT_STOPPED); - nrf_saadc_disable(); + nrf_saadc_disable(NRF_SAADC); if (value < 0) { value = 0; diff --git a/ports/nrf/common-hal/os/__init__.c b/ports/nrf/common-hal/os/__init__.c index 7671cc2a51..e38226f94e 100644 --- a/ports/nrf/common-hal/os/__init__.c +++ b/ports/nrf/common-hal/os/__init__.c @@ -70,17 +70,17 @@ bool common_hal_os_urandom(uint8_t *buffer, uint32_t length) { return NRF_SUCCESS == sd_rand_application_vector_get(buffer, length); #endif - nrf_rng_event_clear(NRF_RNG_EVENT_VALRDY); - nrf_rng_task_trigger(NRF_RNG_TASK_START); + nrf_rng_event_clear(NRF_RNG, NRF_RNG_EVENT_VALRDY); + nrf_rng_task_trigger(NRF_RNG, NRF_RNG_TASK_START); for (uint32_t i = 0; i < length; i++) { - while (nrf_rng_event_get(NRF_RNG_EVENT_VALRDY) == 0); - nrf_rng_event_clear(NRF_RNG_EVENT_VALRDY); + while (nrf_rng_event_check(NRF_RNG, NRF_RNG_EVENT_VALRDY) == 0); + nrf_rng_event_clear(NRF_RNG, NRF_RNG_EVENT_VALRDY); - buffer[i] = nrf_rng_random_value_get(); + buffer[i] = nrf_rng_random_value_get(NRF_RNG); } - nrf_rng_task_trigger(NRF_RNG_TASK_STOP); + nrf_rng_task_trigger(NRF_RNG, NRF_RNG_TASK_STOP); return true; } diff --git a/ports/nrf/common-hal/pulseio/PulseIn.c b/ports/nrf/common-hal/pulseio/PulseIn.c index 3839668314..b47cc6273b 100644 --- a/ports/nrf/common-hal/pulseio/PulseIn.c +++ b/ports/nrf/common-hal/pulseio/PulseIn.c @@ -112,7 +112,7 @@ void pulsein_reset(void) { if ( nrfx_gpiote_is_init() ) { nrfx_gpiote_uninit(); } - nrfx_gpiote_init(); + nrfx_gpiote_init(NRFX_GPIOTE_CONFIG_IRQ_PRIORITY); memset(_objs, 0, sizeof(_objs)); } diff --git a/ports/nrf/common-hal/rtc/RTC.c b/ports/nrf/common-hal/rtc/RTC.c index 57138350c9..a8ea366887 100644 --- a/ports/nrf/common-hal/rtc/RTC.c +++ b/ports/nrf/common-hal/rtc/RTC.c @@ -59,8 +59,8 @@ void rtc_handler(nrfx_rtc_int_type_t int_type) { } void rtc_init(void) { - if (!nrf_clock_lf_is_running()) { - nrf_clock_task_trigger(NRF_CLOCK_TASK_LFCLKSTART); + if (!nrf_clock_lf_is_running(NRF_CLOCK)) { + nrf_clock_task_trigger(NRF_CLOCK, NRF_CLOCK_TASK_LFCLKSTART); } nrfx_rtc_counter_clear(&rtc_instance); nrfx_rtc_init(&rtc_instance, &rtc_config, rtc_handler); diff --git a/ports/nrf/nrfx b/ports/nrf/nrfx index 3d268263be..8efb27e97a 160000 --- a/ports/nrf/nrfx +++ b/ports/nrf/nrfx @@ -1 +1 @@ -Subproject commit 3d268263be2390ab760f75a3da72689ef13031a4 +Subproject commit 8efb27e97abe8e2a1d2b63908f510c8dca304a5d diff --git a/ports/nrf/nrfx_config.h b/ports/nrf/nrfx_config.h index cafec6aa1d..82f6514dfa 100644 --- a/ports/nrf/nrfx_config.h +++ b/ports/nrf/nrfx_config.h @@ -3,7 +3,7 @@ // Power #define NRFX_POWER_ENABLED 1 -#define NRFX_POWER_CONFIG_IRQ_PRIORITY 7 +#define NRFX_POWER_DEFAULT_CONFIG_IRQ_PRIORITY 7 // NOTE: THIS WORKAROUND CAUSES BLE CODE TO CRASH. // It doesn't work with the SoftDevice. @@ -116,4 +116,7 @@ #define NRFX_GPIOTE_CONFIG_NUM_OF_LOW_POWER_EVENTS 1 #define NRFX_GPIOTE_CONFIG_IRQ_PRIORITY 7 +// NVM controller +#define NRFX_NVMC_ENABLED 1 + #endif // NRFX_CONFIG_H__ diff --git a/ports/nrf/peripherals/nrf/nrf52840/power.c b/ports/nrf/peripherals/nrf/nrf52840/power.c index 9f7a9fa17a..794872c5d9 100644 --- a/ports/nrf/peripherals/nrf/nrf52840/power.c +++ b/ports/nrf/peripherals/nrf/nrf52840/power.c @@ -25,7 +25,7 @@ */ #include "nrfx.h" -#include "nrf_nvmc.h" +#include "nrfx_nvmc.h" void nrf_peripherals_power_init(void) { // Set GPIO reference voltage to 3.3V if it isn't already. REGOUT0 will get reset to 0xfffffff @@ -33,7 +33,7 @@ void nrf_peripherals_power_init(void) { // This matters only when "high voltage mode" is enabled, which is true on the PCA10059, // and might be true on other boards. if (NRF_UICR->REGOUT0 == 0xffffffff) { - nrf_nvmc_write_word((uint32_t) &NRF_UICR->REGOUT0, UICR_REGOUT0_VOUT_3V3 << UICR_REGOUT0_VOUT_Pos); + nrfx_nvmc_word_write((uint32_t) &NRF_UICR->REGOUT0, UICR_REGOUT0_VOUT_3V3 << UICR_REGOUT0_VOUT_Pos); // Must reset to make enable change. NVIC_SystemReset(); } diff --git a/ports/nrf/peripherals/nrf/nvm.c b/ports/nrf/peripherals/nrf/nvm.c index 7118b9c870..1501ccfc98 100644 --- a/ports/nrf/peripherals/nrf/nvm.c +++ b/ports/nrf/peripherals/nrf/nvm.c @@ -30,7 +30,7 @@ #include #include -#include "nrf_nvmc.h" +#include "nrfx_nvmc.h" #define FLASH_PAGE_SIZE (4096) @@ -90,7 +90,7 @@ bool nrf_nvm_safe_flash_page_write(uint32_t page_addr, uint8_t *data) { } #endif - nrf_nvmc_page_erase(page_addr); - nrf_nvmc_write_bytes(page_addr, data, FLASH_PAGE_SIZE); + nrfx_nvmc_page_erase(page_addr); + nrfx_nvmc_bytes_write(page_addr, data, FLASH_PAGE_SIZE); return true; } From a7f8a0afd7239a51062ebff12d239b80de358cec Mon Sep 17 00:00:00 2001 From: Roy Hooper Date: Tue, 17 Dec 2019 09:48:55 -0500 Subject: [PATCH 56/78] Address code review feedback. --- BUILDING.md | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index 794d5409aa..9513f71455 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -44,10 +44,6 @@ Examples: If you aren't sure what boards exist, have a peek in the boards subdirectory of your port. -Useful make arguments or targets: - - make BOARD=circuitplayground_express clean - # Testing If you are working on changes to the core language, you might find it useful to run the test suite. @@ -70,14 +66,14 @@ A successful run will say something like # Debugging -The easiest way to debug CircuitPython on hardware is with a JLink device, JLinkGDBServer, and `gcc-arm-embedded`. +The easiest way to debug CircuitPython on hardware is with a JLink device, JLinkGDBServer, and an appropriate GDB. Instructions can be found at https://learn.adafruit.com/debugging-the-samd21-with-gdb -If using JLink, you'll need both the `JLinkGDBServer` and `arm-non-eabi-gdb-py` running. +If using JLink, you'll need both the `JLinkGDBServer` and `arm-none-eabi-gdb` running. Example: JLinkGDBServer -if SWD -device ATSAMD51J19 - arm-none-eabi-gdb-py build-metro_m4_express/firmware.elf -iex "target extended-remote :2331" + arm-none-eabi-gdb build-metro_m4_express/firmware.elf -iex "target extended-remote :2331" \ No newline at end of file From 8137ac4c49257396e6ba513f68418cd72c8b0d8b Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 17 Dec 2019 08:59:08 -0600 Subject: [PATCH 57/78] nRF: PWMAudioOut: handle non-looping rawsamples --- ports/nrf/common-hal/audiopwmio/PWMAudioOut.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c b/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c index b4c626355f..d9226628fa 100644 --- a/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +++ b/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c @@ -255,16 +255,18 @@ void common_hal_audiopwmio_pwmaudioout_play(audiopwmio_pwmaudioout_obj_t* self, self->pwm->LOOP = 1; audiosample_reset_buffer(self->sample, false, 0); activate_audiopwmout_obj(self); + self->stopping = false; + self->pwm->SHORTS = NRF_PWM_SHORT_LOOPSDONE_SEQSTART0_MASK; fill_buffers(self, 0); self->pwm->SEQ[1].PTR = self->pwm->SEQ[0].PTR; self->pwm->SEQ[1].CNT = self->pwm->SEQ[0].CNT; self->pwm->EVENTS_SEQSTARTED[0] = 0; self->pwm->EVENTS_SEQSTARTED[1] = 0; + self->pwm->EVENTS_SEQEND[0] = 0; + self->pwm->EVENTS_SEQEND[1] = 0; self->pwm->EVENTS_STOPPED = 0; - self->pwm->SHORTS = NRF_PWM_SHORT_LOOPSDONE_SEQSTART0_MASK; self->pwm->TASKS_SEQSTART[0] = 1; self->playing = true; - self->stopping = false; self->paused = false; } From 554373fdd92b1df198b8329be5663c23d4f73f99 Mon Sep 17 00:00:00 2001 From: hathach Date: Tue, 17 Dec 2019 22:26:08 +0700 Subject: [PATCH 58/78] bump tinyusb lib submodule --- lib/tinyusb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tinyusb b/lib/tinyusb index e413c9efa3..7a05b177a4 160000 --- a/lib/tinyusb +++ b/lib/tinyusb @@ -1 +1 @@ -Subproject commit e413c9efa303d70de019a91aa415384fe80ca78f +Subproject commit 7a05b177a43b368fea1d60ca344fe4ae9902a432 From 6a8efa6ef1b4264daa6e8f1a0623ee6d88a56b9d Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Tue, 17 Dec 2019 10:01:33 -0600 Subject: [PATCH 59/78] preprocess_frozen_modules: exclude subdirs of examples, docs, tests .. this reclaims several kB on CPX, where we really need it. --- tools/preprocess_frozen_modules.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/preprocess_frozen_modules.py b/tools/preprocess_frozen_modules.py index 2199e9d395..7ae20c4d61 100755 --- a/tools/preprocess_frozen_modules.py +++ b/tools/preprocess_frozen_modules.py @@ -35,6 +35,7 @@ def copy_and_process(in_dir, out_dir): # Skip library examples directory and subfolders. relative_path_parts = Path(root).relative_to(in_dir).parts if relative_path_parts and relative_path_parts[0] in ['examples', 'docs', 'tests']: + del subdirs[:] continue for file in files: From c7a2228b1baac4d35efa465a0ea815b0f5d51012 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 17 Dec 2019 14:30:44 -0800 Subject: [PATCH 60/78] Switch to fetching GCC from AWS Fixes #2388 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 01335ccfc4..e87190c727 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -174,7 +174,7 @@ jobs: run: | sudo apt-get install -y gettext pip install requests sh click setuptools awscli - wget https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2019q4/RC2.1/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 + wget https://adafruit-circuit-python.s3.amazonaws.com/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 sudo tar -C /usr --strip-components=1 -xaf gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2 - name: Versions run: | From d267dac4ac14d1fa7dcf3fe80b67886cd33a75d3 Mon Sep 17 00:00:00 2001 From: Roy Hooper Date: Tue, 17 Dec 2019 18:59:54 -0500 Subject: [PATCH 61/78] Address review feedback. --- BUILDING.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index 9513f71455..2e9fb4f30e 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -43,6 +43,8 @@ Examples: make BOARD=circuitplayground_bluefruit If you aren't sure what boards exist, have a peek in the boards subdirectory of your port. +If you have a fast computer with many cores, consider adding `-j` to your build flags, such as `-j17` on +a 6-core 12-thread machine. # Testing @@ -75,5 +77,6 @@ Example: JLinkGDBServer -if SWD -device ATSAMD51J19 arm-none-eabi-gdb build-metro_m4_express/firmware.elf -iex "target extended-remote :2331" - - \ No newline at end of file + +If your port/build includes `arm-none-eabi-gdb-py`, consider using it instead, as it can be used for better register +debugging with https://github.com/bnahill/PyCortexMDebug From 7571f9790b233d508b426c8e2faa69514bea89d5 Mon Sep 17 00:00:00 2001 From: Roy Hooper Date: Tue, 17 Dec 2019 19:17:46 -0500 Subject: [PATCH 62/78] remove --recursive --- BUILDING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILDING.md b/BUILDING.md index 2e9fb4f30e..73499d65d5 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -21,7 +21,7 @@ Please ensure you setup your build environment appropriately, as per the guide. This project has a bunch of git submodules. You will need to update them regularly. git submodule sync - git submodule update --init --recursive + git submodule update --init ### mpy-cross From 561fdfb279c45f7a9ff69a2b2e71ac272cb6aaef Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 17 Dec 2019 19:01:03 -0800 Subject: [PATCH 63/78] Improve USB eject by resetting on replug --- supervisor/shared/usb/usb.c | 2 ++ supervisor/shared/usb/usb_msc_flash.c | 41 ++++++++++++++++++++++----- supervisor/usb.h | 4 +++ 3 files changed, 40 insertions(+), 7 deletions(-) diff --git a/supervisor/shared/usb/usb.c b/supervisor/shared/usb/usb.c index c1d70c5b0f..a0178528d8 100644 --- a/supervisor/shared/usb/usb.c +++ b/supervisor/shared/usb/usb.c @@ -87,10 +87,12 @@ void usb_background(void) { // Invoked when device is mounted void tud_mount_cb(void) { + usb_msc_mount(); } // Invoked when device is unmounted void tud_umount_cb(void) { + usb_msc_umount(); } // Invoked when usb bus is suspended diff --git a/supervisor/shared/usb/usb_msc_flash.c b/supervisor/shared/usb/usb_msc_flash.c index 205cb7b500..0376cfc1df 100644 --- a/supervisor/shared/usb/usb_msc_flash.c +++ b/supervisor/shared/usb/usb_msc_flash.c @@ -41,6 +41,18 @@ static bool ejected[1]; +void usb_msc_mount(void) { + // Reset the ejection tracking every time we're plugged into USB. This allows for us to battery + // power the device, eject, unplug and plug it back in to get the drive. + for (uint8_t i = 0; i < sizeof(ejected); i++) { + ejected[i] = false; + } +} + +void usb_msc_umount(void) { + +} + // The root FS is always at the end of the list. static fs_user_mount_t* get_vfs(int lun) { // TODO(tannewt): Return the mount which matches the lun where 0 is the end @@ -198,19 +210,34 @@ bool tud_msc_test_unit_ready_cb(uint8_t lun) { // - Start = 0 : stopped power mode, if load_eject = 1 : unload disk storage // - Start = 1 : active mode, if load_eject = 1 : load disk storage bool tud_msc_start_stop_cb(uint8_t lun, uint8_t power_condition, bool start, bool load_eject) { + if (lun > 1) { + return false; + } + fs_user_mount_t* current_mount = get_vfs(lun); + if (current_mount == NULL) { + return false; + } if (load_eject) { - if (lun > 1) { - return false; - } else { - fs_user_mount_t* current_mount = get_vfs(lun); - if (current_mount == NULL) { - return false; - } + if (!start) { + // Eject but first flush. if (disk_ioctl(current_mount, CTRL_SYNC, NULL) != RES_OK) { return false; } else { ejected[lun] = true; } + } else { + // We can only load if it hasn't been ejected. + return !ejected[lun]; + } + } else { + if (!start) { + // Stop the unit but don't eject. + if (disk_ioctl(current_mount, CTRL_SYNC, NULL) != RES_OK) { + return false; + } + } else { + // Start the unit, but only if not ejected. + return !ejected[lun]; } } diff --git a/supervisor/usb.h b/supervisor/usb.h index c87540d408..0cc361619d 100644 --- a/supervisor/usb.h +++ b/supervisor/usb.h @@ -41,4 +41,8 @@ void init_usb_hardware(void); bool usb_enabled(void); void usb_init(void); +// Propagate plug/unplug events to the MSC logic. +void usb_msc_mount(void); +void usb_msc_umount(void); + #endif // MICROPY_INCLUDED_SUPERVISOR_USB_H From dad2663337e3473a8405d2e70164c3bfc0380ca6 Mon Sep 17 00:00:00 2001 From: hathach Date: Wed, 18 Dec 2019 15:39:11 +0700 Subject: [PATCH 64/78] update nrfx submodule to v2 --- ports/nrf/nrfx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/nrf/nrfx b/ports/nrf/nrfx index 8efb27e97a..3f55e49eb1 160000 --- a/ports/nrf/nrfx +++ b/ports/nrf/nrfx @@ -1 +1 @@ -Subproject commit 8efb27e97abe8e2a1d2b63908f510c8dca304a5d +Subproject commit 3f55e49eb11e6db0da1da09e189bb094222702c9 From 5c42ae1e13a786052155e0c4746fb97af4dd019b Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 19 Dec 2019 08:13:00 -0600 Subject: [PATCH 65/78] mp3: update to upstream release 1.1.1 --- lib/mp3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mp3 b/lib/mp3 index 2a3cc7873b..c3c664bf4d 160000 --- a/lib/mp3 +++ b/lib/mp3 @@ -1 +1 @@ -Subproject commit 2a3cc7873b5c642d4bb60043dc14d2555e3377a5 +Subproject commit c3c664bf4db6a36d11808dfcbb5dbf7cff1715b8 From 51af8aadb7d9b1a22fbff9bbb978878fc959b5a8 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 19 Dec 2019 10:27:56 -0600 Subject: [PATCH 66/78] nrf: PWMAudioOut: 62500Hz limitation is not needed .. and it gets in the way of some example programs, due to the way circuitplayground library generates different frequency sine waves --- ports/nrf/common-hal/audiopwmio/PWMAudioOut.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c b/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c index d9226628fa..cdb57bbe1d 100644 --- a/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c +++ b/ports/nrf/common-hal/audiopwmio/PWMAudioOut.c @@ -225,10 +225,6 @@ void common_hal_audiopwmio_pwmaudioout_play(audiopwmio_pwmaudioout_obj_t* self, self->loop = loop; uint32_t sample_rate = audiosample_sample_rate(sample); - uint32_t max_sample_rate = 62500; - if (sample_rate > max_sample_rate) { - mp_raise_ValueError_varg(translate("Sample rate too high. It must be less than %d"), max_sample_rate); - } self->bytes_per_sample = audiosample_bits_per_sample(sample) / 8; uint32_t max_buffer_length; From 4700f7cf23954cd21212fd5a4f7760826237e194 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 19 Dec 2019 10:35:57 -0600 Subject: [PATCH 67/78] frozen: Update Adafruit_CircuitPython_CircuitPlayground submodule --- frozen/Adafruit_CircuitPython_CircuitPlayground | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frozen/Adafruit_CircuitPython_CircuitPlayground b/frozen/Adafruit_CircuitPython_CircuitPlayground index d87ea261c4..82ba9e40df 160000 --- a/frozen/Adafruit_CircuitPython_CircuitPlayground +++ b/frozen/Adafruit_CircuitPython_CircuitPlayground @@ -1 +1 @@ -Subproject commit d87ea261c40ecbc6d893d72d337beefbea1cf932 +Subproject commit 82ba9e40dfff41fdc0541636afde4936c930d86c From 516d930e6c0aaf718fea258c2b6850fe8f43eaf8 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 19 Dec 2019 16:06:17 -0600 Subject: [PATCH 68/78] frozen: Update all submodules to latest tagged release --- frozen/Adafruit_CircuitPython_BusDevice | 2 +- frozen/Adafruit_CircuitPython_CircuitPlayground | 2 +- frozen/Adafruit_CircuitPython_Crickit | 2 +- frozen/Adafruit_CircuitPython_DotStar | 2 +- frozen/Adafruit_CircuitPython_HID | 2 +- frozen/Adafruit_CircuitPython_Motor | 2 +- frozen/Adafruit_CircuitPython_NeoPixel | 2 +- frozen/Adafruit_CircuitPython_SD | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/frozen/Adafruit_CircuitPython_BusDevice b/frozen/Adafruit_CircuitPython_BusDevice index 52d87bd7e5..2000ae3a7c 160000 --- a/frozen/Adafruit_CircuitPython_BusDevice +++ b/frozen/Adafruit_CircuitPython_BusDevice @@ -1 +1 @@ -Subproject commit 52d87bd7e571af66ecb57ee32b5af92531134150 +Subproject commit 2000ae3a7c5d60b850c9546a16425aee279e2a36 diff --git a/frozen/Adafruit_CircuitPython_CircuitPlayground b/frozen/Adafruit_CircuitPython_CircuitPlayground index d87ea261c4..82ba9e40df 160000 --- a/frozen/Adafruit_CircuitPython_CircuitPlayground +++ b/frozen/Adafruit_CircuitPython_CircuitPlayground @@ -1 +1 @@ -Subproject commit d87ea261c40ecbc6d893d72d337beefbea1cf932 +Subproject commit 82ba9e40dfff41fdc0541636afde4936c930d86c diff --git a/frozen/Adafruit_CircuitPython_Crickit b/frozen/Adafruit_CircuitPython_Crickit index a6100fb5d8..5534662902 160000 --- a/frozen/Adafruit_CircuitPython_Crickit +++ b/frozen/Adafruit_CircuitPython_Crickit @@ -1 +1 @@ -Subproject commit a6100fb5d867c7f4980f071119bfa7e0a76e1d47 +Subproject commit 5534662902a223ac8562e6f999d6359e4c17dab1 diff --git a/frozen/Adafruit_CircuitPython_DotStar b/frozen/Adafruit_CircuitPython_DotStar index 409e90902a..01e89a8437 160000 --- a/frozen/Adafruit_CircuitPython_DotStar +++ b/frozen/Adafruit_CircuitPython_DotStar @@ -1 +1 @@ -Subproject commit 409e90902ac49720c4add985e8e1a1660bbe63a0 +Subproject commit 01e89a8437c78b62d4d655c745ded57e26dc747a diff --git a/frozen/Adafruit_CircuitPython_HID b/frozen/Adafruit_CircuitPython_HID index 89faee0eb0..a23b80569f 160000 --- a/frozen/Adafruit_CircuitPython_HID +++ b/frozen/Adafruit_CircuitPython_HID @@ -1 +1 @@ -Subproject commit 89faee0eb08a6855e14f117c514fecf2dd90769d +Subproject commit a23b80569f23ef109667dd8c595d319e8a30d620 diff --git a/frozen/Adafruit_CircuitPython_Motor b/frozen/Adafruit_CircuitPython_Motor index ddc7484498..f69fc9b47f 160000 --- a/frozen/Adafruit_CircuitPython_Motor +++ b/frozen/Adafruit_CircuitPython_Motor @@ -1 +1 @@ -Subproject commit ddc74844983b35b027bd45091c7b8bb3c8d7a2d1 +Subproject commit f69fc9b47fa25ba1414eb3d5c82f05013280c0d2 diff --git a/frozen/Adafruit_CircuitPython_NeoPixel b/frozen/Adafruit_CircuitPython_NeoPixel index c0bdd8b103..ff99d55115 160000 --- a/frozen/Adafruit_CircuitPython_NeoPixel +++ b/frozen/Adafruit_CircuitPython_NeoPixel @@ -1 +1 @@ -Subproject commit c0bdd8b10383725ee9293f5d88fb8d47eb1272bd +Subproject commit ff99d55115f81899902c2c4a84fdfbea9ae83823 diff --git a/frozen/Adafruit_CircuitPython_SD b/frozen/Adafruit_CircuitPython_SD index 5ad33e4ca2..dd0fe8530a 160000 --- a/frozen/Adafruit_CircuitPython_SD +++ b/frozen/Adafruit_CircuitPython_SD @@ -1 +1 @@ -Subproject commit 5ad33e4ca219f0e216beab439cfa259cde32016c +Subproject commit dd0fe8530a2dcc64ac95bb3e116af2158dcd7cd2 From d31a387ace9488d161534a61f20a31d12cb01a4e Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 19 Dec 2019 16:11:29 -0600 Subject: [PATCH 69/78] circuitplayground_express_displayio: reduce inlining to make .ko translation fit --- .../boards/circuitplayground_express_displayio/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk index b5a7c2424d..cf3d11d124 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk @@ -20,7 +20,7 @@ CIRCUITPY_GAMEPAD = 0 CIRCUITPY_RTC = 0 SUPEROPT_GC = 0 -CFLAGS_INLINE_LIMIT = 55 +CFLAGS_INLINE_LIMIT = 35 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice From 5f0af7788026bdae10224dc6570ff79aba394fb7 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 19 Dec 2019 08:13:00 -0600 Subject: [PATCH 70/78] mp3: update to upstream release 1.1.1 --- lib/mp3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mp3 b/lib/mp3 index 2a3cc7873b..c3c664bf4d 160000 --- a/lib/mp3 +++ b/lib/mp3 @@ -1 +1 @@ -Subproject commit 2a3cc7873b5c642d4bb60043dc14d2555e3377a5 +Subproject commit c3c664bf4db6a36d11808dfcbb5dbf7cff1715b8 From cc3ef2d5e647c9814a3a25c4df23e3764ec5fdb8 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 19 Dec 2019 16:06:17 -0600 Subject: [PATCH 71/78] frozen: Update all submodules to latest tagged release --- frozen/Adafruit_CircuitPython_BusDevice | 2 +- frozen/Adafruit_CircuitPython_Crickit | 2 +- frozen/Adafruit_CircuitPython_DotStar | 2 +- frozen/Adafruit_CircuitPython_HID | 2 +- frozen/Adafruit_CircuitPython_Motor | 2 +- frozen/Adafruit_CircuitPython_NeoPixel | 2 +- frozen/Adafruit_CircuitPython_SD | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/frozen/Adafruit_CircuitPython_BusDevice b/frozen/Adafruit_CircuitPython_BusDevice index 52d87bd7e5..2000ae3a7c 160000 --- a/frozen/Adafruit_CircuitPython_BusDevice +++ b/frozen/Adafruit_CircuitPython_BusDevice @@ -1 +1 @@ -Subproject commit 52d87bd7e571af66ecb57ee32b5af92531134150 +Subproject commit 2000ae3a7c5d60b850c9546a16425aee279e2a36 diff --git a/frozen/Adafruit_CircuitPython_Crickit b/frozen/Adafruit_CircuitPython_Crickit index a6100fb5d8..5534662902 160000 --- a/frozen/Adafruit_CircuitPython_Crickit +++ b/frozen/Adafruit_CircuitPython_Crickit @@ -1 +1 @@ -Subproject commit a6100fb5d867c7f4980f071119bfa7e0a76e1d47 +Subproject commit 5534662902a223ac8562e6f999d6359e4c17dab1 diff --git a/frozen/Adafruit_CircuitPython_DotStar b/frozen/Adafruit_CircuitPython_DotStar index 409e90902a..01e89a8437 160000 --- a/frozen/Adafruit_CircuitPython_DotStar +++ b/frozen/Adafruit_CircuitPython_DotStar @@ -1 +1 @@ -Subproject commit 409e90902ac49720c4add985e8e1a1660bbe63a0 +Subproject commit 01e89a8437c78b62d4d655c745ded57e26dc747a diff --git a/frozen/Adafruit_CircuitPython_HID b/frozen/Adafruit_CircuitPython_HID index 89faee0eb0..a23b80569f 160000 --- a/frozen/Adafruit_CircuitPython_HID +++ b/frozen/Adafruit_CircuitPython_HID @@ -1 +1 @@ -Subproject commit 89faee0eb08a6855e14f117c514fecf2dd90769d +Subproject commit a23b80569f23ef109667dd8c595d319e8a30d620 diff --git a/frozen/Adafruit_CircuitPython_Motor b/frozen/Adafruit_CircuitPython_Motor index ddc7484498..f69fc9b47f 160000 --- a/frozen/Adafruit_CircuitPython_Motor +++ b/frozen/Adafruit_CircuitPython_Motor @@ -1 +1 @@ -Subproject commit ddc74844983b35b027bd45091c7b8bb3c8d7a2d1 +Subproject commit f69fc9b47fa25ba1414eb3d5c82f05013280c0d2 diff --git a/frozen/Adafruit_CircuitPython_NeoPixel b/frozen/Adafruit_CircuitPython_NeoPixel index c0bdd8b103..ff99d55115 160000 --- a/frozen/Adafruit_CircuitPython_NeoPixel +++ b/frozen/Adafruit_CircuitPython_NeoPixel @@ -1 +1 @@ -Subproject commit c0bdd8b10383725ee9293f5d88fb8d47eb1272bd +Subproject commit ff99d55115f81899902c2c4a84fdfbea9ae83823 diff --git a/frozen/Adafruit_CircuitPython_SD b/frozen/Adafruit_CircuitPython_SD index 5ad33e4ca2..dd0fe8530a 160000 --- a/frozen/Adafruit_CircuitPython_SD +++ b/frozen/Adafruit_CircuitPython_SD @@ -1 +1 @@ -Subproject commit 5ad33e4ca219f0e216beab439cfa259cde32016c +Subproject commit dd0fe8530a2dcc64ac95bb3e116af2158dcd7cd2 From 8d2a3e94d72298a111dfae7f616d9abbab87cb1b Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 19 Dec 2019 16:11:29 -0600 Subject: [PATCH 72/78] circuitplayground_express_displayio: reduce inlining to make .ko translation fit --- .../boards/circuitplayground_express_displayio/mpconfigboard.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk index b5a7c2424d..cf3d11d124 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk @@ -20,7 +20,7 @@ CIRCUITPY_GAMEPAD = 0 CIRCUITPY_RTC = 0 SUPEROPT_GC = 0 -CFLAGS_INLINE_LIMIT = 55 +CFLAGS_INLINE_LIMIT = 35 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice From 00c226738d404a0664a73d0ca2dabfcad75798ac Mon Sep 17 00:00:00 2001 From: albang Date: Thu, 19 Dec 2019 23:16:51 +0100 Subject: [PATCH 73/78] Typo in doc --- shared-bindings/random/__init__.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shared-bindings/random/__init__.c b/shared-bindings/random/__init__.c index 83698eac57..de4c90910d 100644 --- a/shared-bindings/random/__init__.c +++ b/shared-bindings/random/__init__.c @@ -33,11 +33,11 @@ #include "shared-bindings/random/__init__.h" #include "supervisor/shared/translate.h" -//| :mod:`random` --- psuedo-random numbers and choices +//| :mod:`random` --- pseudo-random numbers and choices //| ======================================================== //| //| .. module:: random -//| :synopsis: psuedo-random numbers and choices +//| :synopsis: pseudo-random numbers and choices //| :platform: SAMD21, ESP8266 //| //| The `random` module is a strict subset of the CPython `cpython:random` From a93475707e18c110afdff23ac965e2e0c393fa40 Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Thu, 19 Dec 2019 16:26:01 -0600 Subject: [PATCH 74/78] gen_display_resources: speed it up It was intended that the `f.load_glyphs` line was fast and did most of the work. However, it actually didn't, because it's necessary to pass in a code point by number, not by string. Additionally, a little light layer violation is needed to make the check for missing characters fast. This used to be less important, as no fonts had missing characters. However, it would take an appreciable length of time on the Korean translation when failing to find hundreds of different code points. Testing performed: built build-circuitplayground_express_displayio/autogen_display_resources.c with ko translation before and after change. verified the file content was identical. Time went from about 7s on my machine to way under 1 second. --- tools/gen_display_resources.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tools/gen_display_resources.py b/tools/gen_display_resources.py index 781b5e69b2..c08daf4776 100644 --- a/tools/gen_display_resources.py +++ b/tools/gen_display_resources.py @@ -48,18 +48,19 @@ for c in sample_characters: all_characters += c if args.extra_characters: all_characters.extend(args.extra_characters) +all_characters = "".join(sorted(set(all_characters))) filtered_characters = all_characters # Try to pre-load all of the glyphs. Misses will still be slow later. -f.load_glyphs(set(all_characters)) +f.load_glyphs(set(ord(c) for c in all_characters)) # Get each glyph. -for c in all_characters: - g = f.get_glyph(ord(c)) - if not g: +for c in set(all_characters): + if ord(c) not in f._glyphs: print("Font missing character:", c, ord(c)) filtered_characters = filtered_characters.replace(c, "") continue + g = f.get_glyph(ord(c)) if g["shift"][1] != 0: raise RuntimeError("y shift") From b859e2b71013f603bb91539a62ada4e0eee15d48 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 20 Dec 2019 11:42:32 -0800 Subject: [PATCH 75/78] Remove `re` from CPX Displayio build to make space. --- .../boards/circuitplayground_express_displayio/mpconfigboard.h | 2 ++ .../boards/circuitplayground_express_displayio/mpconfigboard.mk | 2 +- py/circuitpy_mpconfig.h | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h index 4486e8a6d3..c9a7ce0405 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h +++ b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.h @@ -43,3 +43,5 @@ // USB is always used internally so skip the pin objects for it. #define IGNORE_PIN_PA24 1 #define IGNORE_PIN_PA25 1 + +#define MICROPY_PY_URE 0 diff --git a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk index cf3d11d124..b5a7c2424d 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_displayio/mpconfigboard.mk @@ -20,7 +20,7 @@ CIRCUITPY_GAMEPAD = 0 CIRCUITPY_RTC = 0 SUPEROPT_GC = 0 -CFLAGS_INLINE_LIMIT = 35 +CFLAGS_INLINE_LIMIT = 55 # Include these Python libraries in firmware. FROZEN_MPY_DIRS += $(TOP)/frozen/Adafruit_CircuitPython_BusDevice diff --git a/py/circuitpy_mpconfig.h b/py/circuitpy_mpconfig.h index 3161938c48..932d4f855f 100644 --- a/py/circuitpy_mpconfig.h +++ b/py/circuitpy_mpconfig.h @@ -193,7 +193,9 @@ typedef long mp_off_t; #define MICROPY_PY_UERRNO (CIRCUITPY_FULL_BUILD) // Opposite setting is deliberate. #define MICROPY_PY_UERRNO_ERRORCODE (!CIRCUITPY_FULL_BUILD) +#ifndef MICROPY_PY_URE #define MICROPY_PY_URE (CIRCUITPY_FULL_BUILD) +#endif #define MICROPY_PY_URE_MATCH_GROUPS (CIRCUITPY_FULL_BUILD) #define MICROPY_PY_URE_MATCH_SPAN_START_END (CIRCUITPY_FULL_BUILD) #define MICROPY_PY_URE_SUB (CIRCUITPY_FULL_BUILD) From f60b6481e090b2748dc84100502deda660466805 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Fri, 20 Dec 2019 12:14:27 -0800 Subject: [PATCH 76/78] Turn off `gamepad` on cpx crickit --- .../boards/circuitplayground_express_crickit/mpconfigboard.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk index a6ed28aa71..04b4b7792e 100644 --- a/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk +++ b/ports/atmel-samd/boards/circuitplayground_express_crickit/mpconfigboard.mk @@ -13,9 +13,10 @@ EXTERNAL_FLASH_DEVICES = "S25FL216K, GD25Q16C" # Turn off features and optimizations for Crickit build to make room for additional frozen libs. LONGINT_IMPL = NONE CIRCUITPY_DISPLAYIO = 0 -CIRCUITPY_PIXELBUF = 0 CIRCUITPY_FREQUENCYIO = 0 +CIRCUITPY_GAMEPAD = 0 CIRCUITPY_I2CSLAVE = 0 +CIRCUITPY_PIXELBUF = 0 SUPEROPT_GC = 0 CFLAGS_INLINE_LIMIT = 55 From b49ecc52b9e41cbcc6943649217d8abea29b30a6 Mon Sep 17 00:00:00 2001 From: Hierophect Date: Mon, 23 Dec 2019 14:55:26 -0500 Subject: [PATCH 77/78] text fixes --- ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h | 2 +- ports/stm32f4/supervisor/usb.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h b/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h index b8e374f05b..05e2a384a1 100644 --- a/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h +++ b/ports/stm32f4/boards/stm32f411ce_blackpill/mpconfigboard.h @@ -33,7 +33,7 @@ #define FLASH_PAGE_SIZE (0x4000) #define BOARD_OSC_DIV 25 -#define BOARD_NO_VBUS +#define BOARD_NO_VBUS_SENSE // On-board flash // #define SPI_FLASH_MOSI_PIN (&pin_PA07) diff --git a/ports/stm32f4/supervisor/usb.c b/ports/stm32f4/supervisor/usb.c index 23fff1a36b..0d2d5cce9d 100644 --- a/ports/stm32f4/supervisor/usb.c +++ b/ports/stm32f4/supervisor/usb.c @@ -38,7 +38,7 @@ STATIC void init_usb_vbus_sense(void) { -#ifdef BOARD_NO_VBUS +#ifdef BOARD_NO_VBUS_SENSE // Disable VBUS sensing #ifdef USB_OTG_GCCFG_VBDEN USB_OTG_FS->GCCFG &= ~USB_OTG_GCCFG_VBDEN; From d38a0007f199b3e497a18f4aa52f9d5927f790e1 Mon Sep 17 00:00:00 2001 From: Jerry Needell Date: Thu, 26 Dec 2019 08:46:27 -0500 Subject: [PATCH 78/78] define board.VOLTAGE_MONITOR for feather_stm32f405_express --- ports/stm32f4/boards/feather_stm32f405_express/pins.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/stm32f4/boards/feather_stm32f405_express/pins.c b/ports/stm32f4/boards/feather_stm32f405_express/pins.c index 180fdd0937..ebc8fa337e 100644 --- a/ports/stm32f4/boards/feather_stm32f405_express/pins.c +++ b/ports/stm32f4/boards/feather_stm32f405_express/pins.c @@ -7,6 +7,7 @@ STATIC const mp_rom_map_elem_t board_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_A3), MP_ROM_PTR(&pin_PA07) }, { MP_ROM_QSTR(MP_QSTR_A4), MP_ROM_PTR(&pin_PC04) }, { MP_ROM_QSTR(MP_QSTR_A5), MP_ROM_PTR(&pin_PC05) }, + { MP_ROM_QSTR(MP_QSTR_VOLTAGE_MONITOR), MP_ROM_PTR(&pin_PA03) }, { MP_ROM_QSTR(MP_QSTR_D5), MP_ROM_PTR(&pin_PC07) }, { MP_ROM_QSTR(MP_QSTR_D6), MP_ROM_PTR(&pin_PC06) },