From b24a551485c1a26da0a12e73ae85a1ad3e1476a0 Mon Sep 17 00:00:00 2001 From: Pascal Bakhuis Date: Thu, 12 Oct 2023 21:26:30 +0100 Subject: [PATCH 1/4] Added support for SuperMini NRF52840 --- ports/nrf/boards/supermini_nrf52840/board.c | 29 +++++++++ .../boards/supermini_nrf52840/mpconfigboard.h | 45 ++++++++++++++ .../supermini_nrf52840/mpconfigboard.mk | 8 +++ ports/nrf/boards/supermini_nrf52840/pins.c | 62 +++++++++++++++++++ 4 files changed, 144 insertions(+) create mode 100644 ports/nrf/boards/supermini_nrf52840/board.c create mode 100644 ports/nrf/boards/supermini_nrf52840/mpconfigboard.h create mode 100644 ports/nrf/boards/supermini_nrf52840/mpconfigboard.mk create mode 100644 ports/nrf/boards/supermini_nrf52840/pins.c diff --git a/ports/nrf/boards/supermini_nrf52840/board.c b/ports/nrf/boards/supermini_nrf52840/board.c new file mode 100644 index 0000000000..fb1ce4fb83 --- /dev/null +++ b/ports/nrf/boards/supermini_nrf52840/board.c @@ -0,0 +1,29 @@ +/* + * 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 "supervisor/board.h" + +// Use the MP_WEAK supervisor/shared/board.c versions of routines not defined here. diff --git a/ports/nrf/boards/supermini_nrf52840/mpconfigboard.h b/ports/nrf/boards/supermini_nrf52840/mpconfigboard.h new file mode 100644 index 0000000000..abeb5e2e13 --- /dev/null +++ b/ports/nrf/boards/supermini_nrf52840/mpconfigboard.h @@ -0,0 +1,45 @@ +/* + * 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. + */ + +#include "nrfx/hal/nrf_gpio.h" + +#define MICROPY_HW_BOARD_NAME "SuperMini NRF52840" +#define MICROPY_HW_MCU_NAME "nRF52840" + +#define MICROPY_HW_LED_STATUS (&pin_P0_15) + +#define BOARD_HAS_CRYSTAL 1 + +#define DEFAULT_I2C_BUS_SCL (&pin_P0_20) +#define DEFAULT_I2C_BUS_SDA (&pin_P0_17) + +#define DEFAULT_SPI_BUS_SCK (&pin_P1_13) +#define DEFAULT_SPI_BUS_MOSI (&pin_P0_10) +#define DEFAULT_SPI_BUS_MISO (&pin_P1_11) + +#define DEFAULT_UART_BUS_RX (&pin_P0_08) +#define DEFAULT_UART_BUS_TX (&pin_P0_06) diff --git a/ports/nrf/boards/supermini_nrf52840/mpconfigboard.mk b/ports/nrf/boards/supermini_nrf52840/mpconfigboard.mk new file mode 100644 index 0000000000..b2eb705537 --- /dev/null +++ b/ports/nrf/boards/supermini_nrf52840/mpconfigboard.mk @@ -0,0 +1,8 @@ +USB_VID = 0x239A +USB_PID = 0x8029 +USB_PRODUCT = "SuperMini NRF52840" +USB_MANUFACTURER = "ICBbuy" + +MCU_CHIP = nrf52840 + +INTERNAL_FLASH_FILESYSTEM = 1 diff --git a/ports/nrf/boards/supermini_nrf52840/pins.c b/ports/nrf/boards/supermini_nrf52840/pins.c new file mode 100644 index 0000000000..1a8dcc101f --- /dev/null +++ b/ports/nrf/boards/supermini_nrf52840/pins.c @@ -0,0 +1,62 @@ +#include "shared-bindings/board/__init__.h" + +STATIC const mp_rom_map_elem_t board_module_globals_table[] = { + CIRCUITPYTHON_BOARD_DICT_STANDARD_ITEMS + + { MP_ROM_QSTR(MP_QSTR_P0_02), MP_ROM_PTR(&pin_P0_02) }, + { MP_ROM_QSTR(MP_QSTR_P0_04), MP_ROM_PTR(&pin_P0_04) }, + { MP_ROM_QSTR(MP_QSTR_P0_06), MP_ROM_PTR(&pin_P0_06) }, + { MP_ROM_QSTR(MP_QSTR_P0_08), MP_ROM_PTR(&pin_P0_08) }, + { MP_ROM_QSTR(MP_QSTR_P0_09), MP_ROM_PTR(&pin_P0_09) }, + { MP_ROM_QSTR(MP_QSTR_P0_10), MP_ROM_PTR(&pin_P0_10) }, + { MP_ROM_QSTR(MP_QSTR_P0_11), MP_ROM_PTR(&pin_P0_11) }, + { MP_ROM_QSTR(MP_QSTR_P0_12), MP_ROM_PTR(&pin_P0_12) }, + { MP_ROM_QSTR(MP_QSTR_P0_13), MP_ROM_PTR(&pin_P0_13) }, + { MP_ROM_QSTR(MP_QSTR_P0_15), MP_ROM_PTR(&pin_P0_15) }, + { MP_ROM_QSTR(MP_QSTR_P0_17), MP_ROM_PTR(&pin_P0_17) }, + { MP_ROM_QSTR(MP_QSTR_P0_20), MP_ROM_PTR(&pin_P0_20) }, + { MP_ROM_QSTR(MP_QSTR_P0_22), MP_ROM_PTR(&pin_P0_22) }, + { MP_ROM_QSTR(MP_QSTR_P0_24), MP_ROM_PTR(&pin_P0_24) }, + { MP_ROM_QSTR(MP_QSTR_P0_26), MP_ROM_PTR(&pin_P0_26) }, + { MP_ROM_QSTR(MP_QSTR_P0_29), MP_ROM_PTR(&pin_P0_29) }, + { MP_ROM_QSTR(MP_QSTR_P0_31), MP_ROM_PTR(&pin_P0_31) }, + { MP_ROM_QSTR(MP_QSTR_P1_00), MP_ROM_PTR(&pin_P1_00) }, + { MP_ROM_QSTR(MP_QSTR_P1_01), MP_ROM_PTR(&pin_P1_01) }, + { MP_ROM_QSTR(MP_QSTR_P1_02), MP_ROM_PTR(&pin_P1_02) }, + { MP_ROM_QSTR(MP_QSTR_P1_04), MP_ROM_PTR(&pin_P1_04) }, + { MP_ROM_QSTR(MP_QSTR_P1_06), MP_ROM_PTR(&pin_P1_06) }, + { MP_ROM_QSTR(MP_QSTR_P1_07), MP_ROM_PTR(&pin_P1_07) }, + { MP_ROM_QSTR(MP_QSTR_P1_11), MP_ROM_PTR(&pin_P1_11) }, + { MP_ROM_QSTR(MP_QSTR_P1_13), MP_ROM_PTR(&pin_P1_13) }, + { MP_ROM_QSTR(MP_QSTR_P1_15), MP_ROM_PTR(&pin_P1_15) }, + + { MP_ROM_QSTR(MP_QSTR_AIN0), MP_ROM_PTR(&pin_P0_02) }, + { MP_ROM_QSTR(MP_QSTR_AIN2), MP_ROM_PTR(&pin_P0_04) }, + { MP_ROM_QSTR(MP_QSTR_AIN5), MP_ROM_PTR(&pin_P0_29) }, + { MP_ROM_QSTR(MP_QSTR_AIN7), MP_ROM_PTR(&pin_P0_31) }, + + { MP_ROM_QSTR(MP_QSTR_NFC1), MP_ROM_PTR(&pin_P0_09) }, + { MP_ROM_QSTR(MP_QSTR_NFC2), MP_ROM_PTR(&pin_P0_10) }, + + { MP_ROM_QSTR(MP_QSTR_BAT_VOLT), MP_ROM_PTR(&pin_P0_04) }, // Read battery voltage + + { MP_ROM_QSTR(MP_QSTR_VCC_OFF), MP_ROM_PTR(&pin_P0_13) }, // Turn off external VCC by MOSFET + + { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&pin_P0_15) }, // Controls blue LED, high is on + + { MP_ROM_QSTR(MP_QSTR_RX), MP_ROM_PTR(&pin_P0_08) }, + { MP_ROM_QSTR(MP_QSTR_TX), MP_ROM_PTR(&pin_P0_06) }, + + { MP_ROM_QSTR(MP_QSTR_SCL), MP_ROM_PTR(&pin_P0_20) }, + { MP_ROM_QSTR(MP_QSTR_SDA), MP_ROM_PTR(&pin_P0_17) }, + + { MP_ROM_QSTR(MP_QSTR_SCK), MP_ROM_PTR(&pin_P1_13) }, + { MP_ROM_QSTR(MP_QSTR_MOSI), MP_ROM_PTR(&pin_P0_10) }, + { MP_ROM_QSTR(MP_QSTR_MISO), MP_ROM_PTR(&pin_P1_11) }, + + { 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 792def24f369d1dce64e0d63b7ee52e140c0b777 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 17 Oct 2023 11:10:03 -0700 Subject: [PATCH 2/4] A few silabs improvements * Fix watchdog code crash. * Define status LEDs for all boards. * Add flash target to Makefile. * Reduce build verbosity. --- ports/silabs/Makefile | 45 +++++-------------- ports/silabs/README.md | 9 ++++ .../devkit_xg24_brd2601b/mpconfigboard.h | 4 ++ .../explorerkit_xg24_brd2703a/mpconfigboard.h | 2 + .../mpconfigboard.h | 2 + .../common-hal/watchdog/WatchDogTimer.c | 7 +++ 6 files changed, 35 insertions(+), 34 deletions(-) diff --git a/ports/silabs/Makefile b/ports/silabs/Makefile index 71092afcbf..6a2165333d 100644 --- a/ports/silabs/Makefile +++ b/ports/silabs/Makefile @@ -24,7 +24,7 @@ # .SUFFIXES: # ignore builtin rules -.PHONY: all clean slc-clean slc-generate dependents +.PHONY: all clean slc-clean slc-generate dependents flash # Values set by the initial generation PROJECTNAME = circuitpython_efr32 # If the build directory is not given, make it reflect the board name. @@ -142,10 +142,13 @@ $(SILABS_BUILD)/$(PROJECTNAME).Makefile: | $(HEADER_BUILD)/mpversion.h +@$(MAKE) --no-print-directory slc-generate $(OUTPUT_DIR)/firmware.out: $(SILABS_BUILD)/pin_functions.h $(SILABS_BUILD)/pins.c $(OBJ) $(OBJS) $(LIB_FILES) - @echo 'Linking $(OUTPUT_DIR)/firmware.out' - @echo "$(OBJS) $(OBJ)" > $(OUTPUT_DIR)/linker_objs - $(CC) $(LD_FLAGS) @$(OUTPUT_DIR)/linker_objs $(LIBS) -o $(OUTPUT_DIR)/firmware.out - $(OBJCOPY) $(OUTPUT_DIR)/firmware.out -O binary $(OUTPUT_DIR)/firmware.bin + $(STEPECHO) 'Linking $(OUTPUT_DIR)/firmware.out' + $(Q)echo "$(OBJS) $(OBJ)" > $(OUTPUT_DIR)/linker_objs + $(Q)$(CC) $(LD_FLAGS) @$(OUTPUT_DIR)/linker_objs $(LIBS) -o $(OUTPUT_DIR)/firmware.out + $(Q)$(OBJCOPY) $(OUTPUT_DIR)/firmware.out -O binary $(OUTPUT_DIR)/firmware.bin + +flash: $(OUTPUT_DIR)/firmware.bin + $(Q)commander flash -d EFR32MG24 --address 08000000 $(OUTPUT_DIR)/firmware.bin $(OUTPUT_DIR)/firmware.hex: @@ -174,37 +177,11 @@ endif @sed -i 's/ autogen\// $(SILABS_BUILD)\/autogen\//g' $(SILABS_BUILD)/circuitpython_efr32.project.mak @sed -i 's/-T"autogen\//-T"$(SILABS_BUILD)\/autogen\//g' $(SILABS_BUILD)/circuitpython_efr32.project.mak -# tools/slc_cli_linux/bin/slc-cli/developer/exporter_templates/arm_gcc/arm_gcc.Makefile defines -# ECHO = @ -# which is not compatible with py/mkenv.mk: +# tools/slc_cli_linux/bin/slc-cli/developer/exporter_templates/arm_gcc/arm_gcc.Makefile includes +# build rules and defines ECHO = @ when VERBOSE = 1 which is not compatible with py/mkenv.mk: # ECHO = @echo # so override ECHO -$(OBJS): ECHO = +$(OBJS): ECHO = $(Q) #$(OBJS): -$(OUTPUT_DIR)/%.o: %.c - #@echo 'Building $<' - @$(MKDIR_P) $(@D) - @$(CC) $(CFLAGS) -c -o $@ $< - -$(OUTPUT_DIR)/%.o: %.cpp - #@echo 'Building $<' - @$(MKDIR_P) $(@D) - @$(CXX) $(CXXFLAGS) -c -o $@ $< - -$(OUTPUT_DIR)/%.o: %.cc - #@echo 'Building $<' - @$(MKDIR_P) $(@D) - @$(CXX) $(CXXFLAGS) -c -o $@ $< - -$(OUTPUT_DIR)/%.o: %.s - #@echo 'Building $<' - @$(MKDIR_P) $(@D) - @$(CC) $(ASMFLAGS) -c -o $@ $< - -$(OUTPUT_DIR)/%.o: %.S - #@echo 'Building $<' - @$(MKDIR_P) $(@D) - @$(CC) $(ASMFLAGS) -c -o $@ $< - include $(TOP)/py/mkrules.mk diff --git a/ports/silabs/README.md b/ports/silabs/README.md index 17423f57a3..3813104727 100644 --- a/ports/silabs/README.md +++ b/ports/silabs/README.md @@ -34,6 +34,8 @@ Install necessary packages sudo apt install default-jre gcc-arm-none-eabi wget python3 python3-pip git git-lfs gettext uncrustify sudo python -m pip install --upgrade pip +**Note** that this uses git lfs and will not link without it. The error is something like "Unknown file format" because git lfs has a text placeholder file. + ## Supported boards ## | Board | Code | Build CMD | @@ -71,6 +73,13 @@ Clean the project by using: make BOARD=explorerkit_xg24_brd2703a clean +## Flashing CircuitPython + +Flash the project by using [Simplicity Commander](https://community.silabs.com/s/article/simplicity-commander?language=en_US): + + make BOARD=explorerkit_xg24_brd2703a flash + + ## Running CircuitPython ## ### Connecting to the Serial Console ### diff --git a/ports/silabs/boards/devkit_xg24_brd2601b/mpconfigboard.h b/ports/silabs/boards/devkit_xg24_brd2601b/mpconfigboard.h index 5456e1ecd5..2504c12c63 100644 --- a/ports/silabs/boards/devkit_xg24_brd2601b/mpconfigboard.h +++ b/ports/silabs/boards/devkit_xg24_brd2601b/mpconfigboard.h @@ -34,6 +34,10 @@ #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) #define BOARD_HAS_LOW_SPEED_CRYSTAL (0) +#define CIRCUITPY_RGB_STATUS_R (&pin_PD2) +#define CIRCUITPY_RGB_STATUS_G (&pin_PA4) +#define CIRCUITPY_RGB_STATUS_B (&pin_PB0) + // On-board flash #define SPI_FLASH_MOSI_PIN (&pin_PC3) #define SPI_FLASH_MISO_PIN (&pin_PC2) diff --git a/ports/silabs/boards/explorerkit_xg24_brd2703a/mpconfigboard.h b/ports/silabs/boards/explorerkit_xg24_brd2703a/mpconfigboard.h index eb1efca12d..db3257e689 100644 --- a/ports/silabs/boards/explorerkit_xg24_brd2703a/mpconfigboard.h +++ b/ports/silabs/boards/explorerkit_xg24_brd2703a/mpconfigboard.h @@ -37,6 +37,8 @@ #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) #define BOARD_HAS_LOW_SPEED_CRYSTAL (0) +#define MICROPY_HW_LED_STATUS (&pin_PA4) + #define DEFAULT_I2C_BUS_SDA (&pin_PC5) #define DEFAULT_I2C_BUS_SCL (&pin_PC4) #define DEFAULT_I2C_PERIPHERAL I2C0 diff --git a/ports/silabs/boards/sparkfun_thingplus_matter_mgm240p_brd2704a/mpconfigboard.h b/ports/silabs/boards/sparkfun_thingplus_matter_mgm240p_brd2704a/mpconfigboard.h index ea43ef27cd..463a2e5b1f 100644 --- a/ports/silabs/boards/sparkfun_thingplus_matter_mgm240p_brd2704a/mpconfigboard.h +++ b/ports/silabs/boards/sparkfun_thingplus_matter_mgm240p_brd2704a/mpconfigboard.h @@ -34,6 +34,8 @@ #define BOARD_HSE_SOURCE (RCC_HSE_BYPASS) #define BOARD_HAS_LOW_SPEED_CRYSTAL (0) +#define MICROPY_HW_LED_STATUS (&pin_PA8) + #define DEFAULT_I2C_BUS_SDA (&pin_PB4) #define DEFAULT_I2C_BUS_SCL (&pin_PB3) #define DEFAULT_I2C_PERIPHERAL I2C0 diff --git a/ports/silabs/common-hal/watchdog/WatchDogTimer.c b/ports/silabs/common-hal/watchdog/WatchDogTimer.c index d65c794833..21b6cc6126 100644 --- a/ports/silabs/common-hal/watchdog/WatchDogTimer.c +++ b/ports/silabs/common-hal/watchdog/WatchDogTimer.c @@ -33,11 +33,16 @@ #include "em_wdog.h" #include "em_cmu.h" +static bool _wdt_init = false; + void common_hal_watchdog_feed(watchdog_watchdogtimer_obj_t *self) { WDOGn_Feed(DEFAULT_WDOG); } void common_hal_watchdog_deinit(watchdog_watchdogtimer_obj_t *self) { + if (!_wdt_init) { + return; + } WDOG_Enable(false); } @@ -105,6 +110,8 @@ void common_hal_watchdog_set_timeout(watchdog_watchdogtimer_obj_t *self, // Initializing watchdog with chosen settings WDOGn_Init(DEFAULT_WDOG, &wdogInit); + + _wdt_init = true; } } From 48f4b0f7cb559ff94c505cc9e88987f2df4ab8d4 Mon Sep 17 00:00:00 2001 From: Scott Shawcroft Date: Tue, 28 Feb 2023 15:16:36 -0800 Subject: [PATCH 3/4] Switch to gcc 12.3 for arm32 Fixes #7432 --- .github/actions/deps/external/action.yml | 2 +- ports/atmel-samd/boards/common.template.ld | 6 +++--- ports/broadcom/Makefile | 2 +- ports/espressif/Makefile | 2 +- ports/litex/Makefile | 2 +- ports/nrf/Makefile | 2 +- ports/silabs/Makefile | 2 +- ports/stm/Makefile | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/actions/deps/external/action.yml b/.github/actions/deps/external/action.yml index 2d6f65eeff..faeb9100a8 100644 --- a/.github/actions/deps/external/action.yml +++ b/.github/actions/deps/external/action.yml @@ -25,7 +25,7 @@ runs: inputs.port != 'espressif' uses: carlosperate/arm-none-eabi-gcc-action@v1 with: - release: '10-2020-q4' + release: '12.3.Rel1' # espressif - name: Get espressif toolchain diff --git a/ports/atmel-samd/boards/common.template.ld b/ports/atmel-samd/boards/common.template.ld index 97504d44e5..cda6fe115f 100644 --- a/ports/atmel-samd/boards/common.template.ld +++ b/ports/atmel-samd/boards/common.template.ld @@ -67,7 +67,7 @@ SECTIONS The program executes knowing that the data is in the RAM but the loader puts the initial values in the FLASH_FIRMWARE (inidata). It is one task of the startup to copy the initial values from FLASH_FIRMWARE to RAM. */ - .data : AT ( _sidata ) + .data : { . = ALIGN(4); _srelocate = .; /* create a global symbol at data start; used by startup code in order to initialize the .data section in RAM */ @@ -78,7 +78,7 @@ 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 + } >RAM AT> FLASH_FIRMWARE /* Uninitialized data section */ .bss (NOLOAD) : @@ -96,7 +96,7 @@ SECTIONS } >RAM /* this just checks there is enough RAM for the requested stack. */ - .stack : + .stack (NOLOAD) : { . = ALIGN(4); . = . + ${CIRCUITPY_DEFAULT_STACK_SIZE}; diff --git a/ports/broadcom/Makefile b/ports/broadcom/Makefile index be2dd788f8..31dc835ea6 100644 --- a/ports/broadcom/Makefile +++ b/ports/broadcom/Makefile @@ -148,7 +148,7 @@ else $(BUILD)/kernel$(SUFFIX).elf: $(OBJ) $(STEPECHO) "LINK $@" $(Q)echo $(OBJ) > $(BUILD)/firmware.objs - $(Q)$(CC) -o $@ $(LDFLAGS) @$(BUILD)/firmware.objs -Wl,--start-group $(LIBS) -Wl,--end-group + $(Q)$(CC) -o $@ $(LDFLAGS) @$(BUILD)/firmware.objs -Wl,--print-memory-usage -Wl,--start-group $(LIBS) -Wl,--end-group endif $(BUILD)/kernel$(SUFFIX).img: $(BUILD)/kernel$(SUFFIX).elf diff --git a/ports/espressif/Makefile b/ports/espressif/Makefile index 03435b53a4..87d6b8b988 100644 --- a/ports/espressif/Makefile +++ b/ports/espressif/Makefile @@ -569,7 +569,7 @@ esp-idf-stamp: $(BUILD)/esp-idf/config/sdkconfig.h $(BUILD)/firmware.elf: $(OBJ) | esp-idf-stamp $(IDF_CMAKE_TARGETS) $(STEPECHO) "LINK $@" - $(Q)$(CC) -o $@ $(LDFLAGS) $^ -Wl,--start-group $(ESP_IDF_COMPONENTS_EXPANDED) $(BINARY_BLOBS) $(MBEDTLS_COMPONENTS_LINK_EXPANDED) $(LIBS) -Wl,--end-group -u newlib_include_pthread_impl -u ld_include_highint_hdl -u __cxx_fatal_exception + $(Q)$(CC) -o $@ $(LDFLAGS) $^ -Wl,--print-memory-usage -Wl,--start-group $(ESP_IDF_COMPONENTS_EXPANDED) $(BINARY_BLOBS) $(MBEDTLS_COMPONENTS_LINK_EXPANDED) $(LIBS) -Wl,--end-group -u newlib_include_pthread_impl -u ld_include_highint_hdl -u __cxx_fatal_exception $(BUILD)/circuitpython-firmware.bin: $(BUILD)/firmware.elf | tools/build_memory_info.py $(STEPECHO) "Create $@" diff --git a/ports/litex/Makefile b/ports/litex/Makefile index 7fd118de36..1caf26a4dc 100644 --- a/ports/litex/Makefile +++ b/ports/litex/Makefile @@ -138,7 +138,7 @@ $(BUILD)/firmware.elf: invalid-board else $(BUILD)/firmware.elf: $(OBJ) $(STEPECHO) "LINK $@" - $(Q)$(CC) -o $@ $(LDFLAGS) $^ -Wl,--start-group $(LIBS) -Wl,--end-group + $(Q)$(CC) -o $@ $(LDFLAGS) $^ -Wl,--print-memory-usage -Wl,--start-group $(LIBS) -Wl,--end-group $(Q)$(SIZE) $@ | $(PYTHON) $(TOP)/tools/build_memory_info.py $(LD_FILE) $(BUILD) endif diff --git a/ports/nrf/Makefile b/ports/nrf/Makefile index bd2da35eea..655d00b733 100755 --- a/ports/nrf/Makefile +++ b/ports/nrf/Makefile @@ -214,7 +214,7 @@ else $(BUILD)/firmware.elf: $(OBJ) $(GENERATED_LD_FILE) $(STEPECHO) "LINK $@" $(Q)echo $(OBJ) > $(BUILD)/firmware.objs - $(Q)$(CC) -o $@ $(LDFLAGS) @$(BUILD)/firmware.objs -Wl,--start-group $(LIBS) -Wl,--end-group + $(Q)$(CC) -o $@ $(LDFLAGS) @$(BUILD)/firmware.objs -Wl,--print-memory-usage -Wl,--start-group $(LIBS) -Wl,--end-group $(Q)$(SIZE) $@ | $(PYTHON) $(TOP)/tools/build_memory_info.py $(GENERATED_LD_FILE) $(BUILD) endif diff --git a/ports/silabs/Makefile b/ports/silabs/Makefile index ab30e5d756..de976f1c51 100644 --- a/ports/silabs/Makefile +++ b/ports/silabs/Makefile @@ -144,7 +144,7 @@ $(SILABS_BUILD)/$(PROJECTNAME).Makefile: | $(HEADER_BUILD)/mpversion.h $(OUTPUT_DIR)/firmware.out: $(SILABS_BUILD)/pin_functions.h $(SILABS_BUILD)/pins.c $(OBJ) $(OBJS) $(LIB_FILES) $(STEPECHO) 'Linking $(OUTPUT_DIR)/firmware.out' $(Q)echo "$(OBJS) $(OBJ)" > $(OUTPUT_DIR)/linker_objs - $(Q)$(CC) $(LD_FLAGS) @$(OUTPUT_DIR)/linker_objs $(LIBS) -o $(OUTPUT_DIR)/firmware.out + $(Q)$(CC) $(LD_FLAGS) @$(OUTPUT_DIR)/linker_objs -Wl,--print-memory-usage $(LIBS) -o $(OUTPUT_DIR)/firmware.out $(Q)$(OBJCOPY) $(OUTPUT_DIR)/firmware.out -O binary $(OUTPUT_DIR)/firmware.bin flash: $(OUTPUT_DIR)/firmware.bin diff --git a/ports/stm/Makefile b/ports/stm/Makefile index 03a41f526e..44d8b96d7c 100755 --- a/ports/stm/Makefile +++ b/ports/stm/Makefile @@ -270,7 +270,7 @@ else $(BUILD)/firmware.elf: $(OBJ) $(STEPECHO) "LINK $@" $(Q)echo $^ > $(BUILD)/firmware.objs - $(Q)$(CC) -o $@ $(LDFLAGS) @$(BUILD)/firmware.objs -Wl,--start-group $(LIBS) -Wl,--end-group + $(Q)$(CC) -o $@ $(LDFLAGS) @$(BUILD)/firmware.objs -Wl,--print-memory-usage -Wl,--start-group $(LIBS) -Wl,--end-group $(Q)$(SIZE) $@ | $(PYTHON) $(TOP)/tools/build_memory_info.py $(LD_FILE) $(BUILD) endif From 2d4702c79ce3c1780cb5db8092de7db7a2b3676a Mon Sep 17 00:00:00 2001 From: Pascal Bakhuis Date: Tue, 17 Oct 2023 23:30:26 +0100 Subject: [PATCH 4/4] Changed USB VID/PID to one granted by pidcodes.github.com --- ports/nrf/boards/supermini_nrf52840/mpconfigboard.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/nrf/boards/supermini_nrf52840/mpconfigboard.mk b/ports/nrf/boards/supermini_nrf52840/mpconfigboard.mk index b2eb705537..699d19b770 100644 --- a/ports/nrf/boards/supermini_nrf52840/mpconfigboard.mk +++ b/ports/nrf/boards/supermini_nrf52840/mpconfigboard.mk @@ -1,5 +1,5 @@ -USB_VID = 0x239A -USB_PID = 0x8029 +USB_VID = 0x1209 +USB_PID = 0xADF0 USB_PRODUCT = "SuperMini NRF52840" USB_MANUFACTURER = "ICBbuy"