Giter Site home page Giter Site logo

adafruit / tinyuf2 Goto Github PK

View Code? Open in Web Editor NEW
304.0 22.0 171.0 36.45 MB

UF2 bootloader based on TinyUSB for embedded devices such as ESP32S2, STM32F4 and iMX RT10xx

License: MIT License

CMake 0.93% C 82.28% Makefile 0.55% Assembly 0.12% C++ 3.63% Python 0.51% PHP 11.98%
tinyusb uf2-bootloader

tinyuf2's Introduction

TinyUF2 Bootloader

Build StatusLicense

This repo is cross-platform UF2 Bootloader projects for MCUs based on TinyUSB

.
├── apps              # Useful applications such as self-update, erase firmware
├── lib               # Sources from 3rd party such as tinyusb, mcu drivers ...
├── ports             # Port/family specific sources
│   ├── espressif
│   │   └── boards/   # Board specific sources
│   │   └── Makefile  # Makefile for this port
│   └── mimxrt10xx
├── src               # Cross-platform bootloader sources files

Features

Supported features are

  • Double tap to enter DFU, reboot to DFU and quick reboot from application
  • DFU with MassStorage (MSC)
  • Self update with uf2 file
  • Indicator: LED, RGB, TFT
  • Debug log with uart/swd

Not all features are implemented for all MCUs, following is supported MCUs and its feature

MCU MSC Double Reset Self-update Write Protection Neopixel TFT
ESP32 S2/S3 Need RC
K32L2
LPC55
iMXRT
STM32F3
STM32F4

Build and Flash

Following is generic compiling information. Each port may require extra set-up and slight different process e.g esp32s2 require setup IDF.

Clone

Clone this repo with its submodule

$ git clone [email protected]:adafruit/tinyuf2.git tinyuf2
$ cd tinyuf2
$ git submodule update --init

Compile

To build this for a specific board, we need to change current directory to its port folder

$ cd ports/stm32f4

Firstly we need to get all submodule dependency for our board using tools/get_deps.py script with either family input or using --board option. You only need to do this once for each family

python tools/get_deps.py stm32f4
python tools/get_deps.py --board feather_stm32f405_express

Then compile with all target:

make BOARD=feather_stm32f405_express all

Flash

flash target will use the default on-board debugger (jlink/cmsisdap/stlink/dfu) to flash the binary, please install those support software in advance. Some board use bootloader/DFU via serial which is required to pass to make command

$ make BOARD=feather_stm32f405_express flash

If you use an external debugger, there is flash-jlink, flash-stlink, flash-pyocd which are mostly like to work out of the box for most of the supported board.

Debug

To compile for debugging add DEBUG=1, this will mostly change the compiler optimization

$ make BOARD=feather_stm32f405_express DEBUG=1 all

Log

Should you have an issue running example and/or submitting an bug report. You could enable TinyUSB built-in debug logging with optional LOG=.

  • LOG=1 will print message from bootloader and error if any from TinyUSB stack.
  • LOG=2 and LOG=3 will print more information with TinyUSB stack events
$ make BOARD=feather_stm32f405_express LOG=1 all

Logger

By default log message is printed via on-board UART which is slow and take lots of CPU time comparing to USB speed. If your board support on-board/external debugger, it would be more efficient to use it for logging. There are 2 protocols:

  • LOGGER=rtt: use Segger RTT protocol
    • Cons: requires jlink as the debugger.
    • Pros: work with most if not all MCUs
    • Software viewer is JLink RTT Viewer/Client/Logger which is bundled with JLink driver package.
  • LOGGER=swo: Use dedicated SWO pin of ARM Cortex SWD debug header.
    • Cons: only work with ARM Cortex MCUs minus M0
    • Pros: should be compatible with more debugger that support SWO.
    • Software viewer should be provided along with your debugger driver.
$ make BOARD=feather_stm32f405_express LOG=2 LOGGER=rtt all
$ make BOARD=feather_stm32f405_express LOG=2 LOGGER=swo all

tinyuf2's People

Contributors

bill88t avatar ccrome avatar charkster avatar circuitart avatar dronecz avatar dumam avatar durapensa avatar fabaff avatar gsteiert avatar hathach avatar henrygab avatar jamesjnadeau avatar jepler avatar karlk90 avatar ladyada avatar lyusupov avatar m-mcgowan avatar makermelissa avatar mariopesch avatar neradoc avatar nxf58843 avatar oliver-joos avatar petejohanson avatar skieast avatar sukuwc avatar tannewt avatar tirtharajsinha avatar unexpectedmaker avatar wind-stormger avatar zvecr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tinyuf2's Issues

Error when installing CircuitPython on a Feather STM32F405 Express using TinyUF2

Operating System

MacOS

Board

Feather STM32F405 Express

Firmware/Software/Tool Version

TinyUF2 (0.5.0 release): https://github.com/adafruit/tinyuf2/releases/download/0.5.0/tinyuf2-feather_stm32f405_express-0.5.0.zip
CircuitPython (main branch): adafruit/circuitpython@b9fa06c

What happened ?

I am trying to install CircuitPython on a Feather STM32F405 Express using the TinyUF2 bootloader. When I try to install the CircuitPython firmware by copying the firmware.uf2 image onto the FTHR405BOOT mass storage device, it starts to copy the firmware:

image

However, about 5-10s later, I get the following error:

image

The CircuitPython image does not run (the board is unresponsive) and pressing the reset button bricks the board (must be recovered with DFU).

How to reproduce ?

  1. Install UF2 bootloader on the Feather STM32F405 Express:
dfu-util -a 0 --dfuse-address 0x08000000 -D ~/Downloads/tinyuf2-feather_stm32f405_express-0.5.0/tinyuf2-feather_stm32f405_express-0.5.0.bin
  1. Build circuitpython image with UF2 bootloader support
cd circuitpython
git checkout b9fa06cf6bb3c45eaf57724d351a04564d562b6a
make -C ports/stm/ BOARD=feather_stm32f405_express UF2_BOOTLOADER=1
  1. Copy build-feather_stm32f405_express/firmware.uf2 to /Volumes/FTHR405BOOT/ disk
  2. Wait for error message to occur

Debug Log

No response

Screenshots

No response

stm32f411ce blackpill does not see transfer of execution to app from boot loader

I have created a new stm32f411ce_blackpill board using the stm32f401_blackpill board files as a template. I have updated the board.mk and board.h to use the proper device name, and after flashing the board it boots properly (usb hid device). When I drag-n-drop the new uf2 file to flash it to the board I am not getting the expected result. I have a samd21 board with a UF2 bootloader which resets the board after doing the flash operation, but I am not seeing a board reset, I see the new uf2 file sitting in the same directory as the INDEX.HTM, CURRENT.UF2 and INFO_UF2.TXT files. A board reset will just enter UF2 bootloader mode and the new uf2 file is not there.

I have also updated my new board.h file to specify #define BOARD_FLASH_SIZE (512 * 1024) and #define BOARD_FLASH_SECTORS 8 (which is different to the stm32f401 board, as it is 256k flash with 6 sectors).

I don't know if this is related to my issue but, I need to keep -DHSE_VALUE=25000000U in board.mk or I will not boot and see a valid hid device. I was expecting to use -DHSE_VALUE=8000000U just like the stm32f411ve_discovery board. I am using the st-flash utility to write the bin file to 0x8000000 on my stm32f411ce_blackpill... that appears to be working as expected.

Should the UF2 bootloader be writing the drag-n-dropped uf2 file to 0x8010000? I am assuming that when 0x8010000 has a valid value then the UF2 bootloader will start execution there (and not appear as a hid device).

Another question, how would I get back to uf2 bootloader mode again? When I release the BOOT0 button after the RST_N button has been released, I will enter into DFU mode (I assume this is ROM execution). Is there a button sequence to ensure that I enter UF2 bootloader mode (double tap BOOT0 button)?
Thanks.

Support USB DFU

Since board flashing is already support, having optional std USB DFU would help as well

fail using update-tinyuf2-lolin_s2_mini-0.5.2.uf2

Operating System

Linux

INFO_UF2.TXT

TinyUF2 Bootloader 0.5.2 - tinyusb (0.10.1-109-g9b3ec69b)
Model: Lolin S2 Mini
Board-ID: ESP32S2FN4R2-S2Mini-1-0-0
Date: Sep  8 2021

What happened ?

When writing update-tinyuf2-lolin_s2_mini-0.5.2.uf2, OS reports WRITE I/O error, seemingly because of USB disconnect.

Board resets back to UF2 bootloader mode, with previously flashed firmware gone (user_fs FAT partitions seems okay).

Related #138 ?

How to reproduce ?

  1. Enter UF2 bootloader mode, S2MINIBOOT drive appears.
  2. Copy update-tinyuf2-lolin_s2_mini-0.5.2.uf2 to S2MINIBOOT

Debug Log

Flashed build with LOG=3, but board has no UART pins and USB CDC not enabled for onboard UART passthrough.

Screenshots

No response

STM32F4 is not building for gcc-11

Operating System

Linux

INFO_UF2.TXT

There is no need of info_uf2.txt file.

What happened ?

I'm unable to build current release for stm32f4, also there is no update img in github release.

How to reproduce ?

  1. Make sure you are up to date with master branch and submodules
  2. Check if your gcc version is:
arm-none-eabi-gcc (Arch Repository) 11.2.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  1. Go to ports/stm32f4
  2. Run make BOARD=stm32f411ce_blackpill all

Debug Log

    inlined from 'tud_descriptor_string_cb' at /home/dumam/Projects/tinyuf2/src/usb_descriptors.c:190:20,
    inlined from 'process_get_descriptor' at /home/dumam/Projects/tinyuf2/lib/tinyusb/src/device/usbd.c:984:50,
    inlined from 'process_control_request' at /home/dumam/Projects/tinyuf2/lib/tinyusb/src/device/usbd.c:680:11,
    inlined from 'tud_task' at /home/dumam/Projects/tinyuf2/lib/tinyusb/src/device/usbd.c:522:15,
    inlined from 'tud_task' at /home/dumam/Projects/tinyuf2/lib/tinyusb/src/device/usbd.c:474:6,
    inlined from 'main' at /home/dumam/Projects/tinyuf2/src/main.c:92:5:
/home/dumam/Projects/tinyuf2/ports/stm32f4/boards.c:241:3: error: 'memcpy' reading 12 bytes from a region of size 0 [-Werror=stringop-overread]
  241 |   memcpy(serial_id, STM32_UUID, len);
      |   ^
compilation terminated due to -Wfatal-errors.
lto1: all warnings being treated as errors
lto-wrapper: fatal error: arm-none-eabi-gcc returned 1 exit status
compilation terminated.
/usr/lib/gcc/arm-none-eabi/11.2.0/../../../../arm-none-eabi/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
make: *** [../rules.mk:44: _build/stm32f411ce_blackpill/tinyuf2-stm32f411ce_blackpill.elf] Błąd 1

Screenshots

No response

PIN_DOUBLE_RESET_RC on ESP32-S3 - using IO47 not working

Operating System

MacOS

INFO_UF2.TXT

TinyUF2 Bootloader 0.6.2-29-g06a65c8 - esp-idf (v4.4-dev-3608-gbbe2a1bf34) tinyusb (0.12.0-203-ga4cfd1c6)
Model: Unexpected Maker TinyS3
Board-ID: ESP32S3-TinyS3-01
Date: Dec 27 2021

What happened ?

I'm using IO47 for my PIN_DOUBLE_RESET_RC and it's not working and I'm not sure why.

Datasheet shows that it's Reset mode is E1 (Input enabled) but it's default function is (F0) - SPICLK_P_DIFF which is O/T, not GPIO47 which is I/O/T - (F1)

I've confirmed I have plenty of hold high time on the IO during the boot cycle. I've even gone to a 2.2uF cap with 1Mohm resistor, and I can see it's holding 3V+ for ages - way longer than I need... but for whatever reason, it never catches it as high and just moves on to load into CPY.

I've confirmed it running through the correct code as I have the LED going blue instead of purple if PIN_DOUBLE_RESET_RC code is being run, and everything looks correct.

I can't see anything in the TinyUF2 or IDF code that would prevent IO47/48 from being used as a GPIO - they are both new and exclusive to the S3, but the only difference is the F0/F1 states.

I've even tried to brute force it...

esp_rom_gpio_pad_select_gpio(PIN_DOUBLE_RESET_RC);
gpio_ll_output_disable(&GPIO, PIN_DOUBLE_RESET_RC);
gpio_ll_input_enable(&GPIO, PIN_DOUBLE_RESET_RC);

I don't have access to driver/gpio.h in bootloader-start.c so I was unable to try gpio_config to set the GPIO to Input.

Any ideas what I can do? IO47/48 are the only IO I have spare that I can use for PIN_DOUBLE_RESET_RC so I need to get this working.

Thanks!

How to reproduce ?

Not sure how you can repo this.

Debug Log

No response

Screenshots

No response

TinyUF2 is missing for Lolin S2 Pico in release 0.5.2

Operating System

Windows 10

INFO_UF2.TXT

N/A

What happened ?

The "download bootloader zip" link from the circuitpython.org board page for the Lolin Pico S2 (https://circuitpython.org/board/lolin_s2_pico/) indicates there should be a bin file for the board in the latest release, but the bin file does not exist and the link is broken.

How to reproduce ?

Go to https://circuitpython.org/board/lolin_s2_pico/
Click the "Download Bootloader Zip" button
The bin file is "not found"

Debug Log

No response

Screenshots

No response

support for ESP32-C3

in the CircuitPython documentation it says ESP32-C3 is in beta -
any chance that the tinyuf2 is also available for the C3 modules?

it also states:

Note: The USB connection cannot be used for a CIRCUITPY drive.

is this a memory / processor limitation or just not jet implemented ?

Hardware Status

What is the status of various hardware ports, specifically mimxrt10xx?
Wondering how stable it is before adding additional ports.

ESP32-C3

when can you support ESP32-C3?

Integrate TinyUF2 into SAME54 bootloader and add CDC functions

Hi, I am attempting to integrate TinyUF2 into an existing bootloader on custom SAME54 board. Here are my issues,
A) I want to add 2 channels of CDC, and although I can get them to run when only using TinyUSB, I cant make them function as part of TinyUF2 despite the config option to include CDC. I believe its a config/enumeration issue.
B) The board will be enclosed in a box so I need the CDC channels to communicate with the board, as it does not have any user buttons, to start the upgrade process and erase the flash ready for the UF2 file (drag and drop on WIndows) copy to the target. I am looking at the possibility of executing the flash erase on arrival of the the first UF2 block, but as this takes some time I am concerned that the USB connection wout time out.
C) I am baffled as to the role of the HID interface as it seems to only provide debug message functionality.

Any guidance my misconceptions and on potential strategies to achieve the above would be gratefully received.

there are many warning when building bootloader for an stm32f4

/mnt/c/workspace/tinyuf2/ports/stm32f4/board_flash.c: In function 'flash_write':
/mnt/c/workspace/tinyuf2/ports/stm32f4/board_flash.c:158:71: warning: cast increases required alignment of target type [-Wcast-align]
  158 |   if (HAL_FLASH_Program(FLASH_TYPEPROGRAM_WORD, dst + i, (uint64_t) (*(uint32_t*)(src + i)) ) != HAL_OK) {
      |                                                                       ^
/mnt/c/workspace/tinyuf2/lib/st/stm32f4xx_hal_driver/Src/stm32f4xx_hal_flash_ex.c: In function 'FLASH_MassErase':
/mnt/c/workspace/tinyuf2/lib/st/stm32f4xx_hal_driver/Src/stm32f4xx_hal_flash_ex.c:953:60: warning: unused parameter 'Banks' [-Wunused-parameter]
  953 | static void FLASH_MassErase(uint8_t VoltageRange, uint32_t Banks)
      |                                                   ~~~~~~~~~^~~~~
/mnt/c/workspace/tinyuf2/lib/st/stm32f4xx_hal_driver/Src/stm32f4xx_hal_flash_ex.c: In function 'FLASH_OB_EnableWRP':/mnt/c/workspace/tinyuf2/lib/st/stm32f4xx_hal_driver/Src/stm32f4xx_hal_flash_ex.c:1032:74: warning: unused parameter 'Banks' [-Wunused-parameter]
 1032 | static HAL_StatusTypeDef FLASH_OB_EnableWRP(uint32_t WRPSector, uint32_t Banks)
      |                                                                 ~~~~~~~~~^~~~~
/mnt/c/workspace/tinyuf2/lib/st/stm32f4xx_hal_driver/Src/stm32f4xx_hal_flash_ex.c: In function 'FLASH_OB_DisableWRP':
/mnt/c/workspace/tinyuf2/lib/st/stm32f4xx_hal_driver/Src/stm32f4xx_hal_flash_ex.c:1068:75: warning: unused parameter 'Banks' [-Wunused-parameter]
 1068 | static HAL_StatusTypeDef FLASH_OB_DisableWRP(uint32_t WRPSector, uint32_t Banks)
      |                                                                  ~~~~~~~~~^~~~~
/mnt/c/workspace/tinyuf2/lib/st/stm32f4xx_hal_driver/Src/stm32f4xx_hal_uart.c: In function 'HAL_UART_Transmit':
/mnt/c/workspace/tinyuf2/lib/st/stm32f4xx_hal_driver/Src/stm32f4xx_hal_uart.c:1061:15: warning: cast increases required alignment of target type [-Wcast-align]
 1061 |         tmp = (uint16_t *) pData;
      |               ^
/mnt/c/workspace/tinyuf2/lib/st/stm32f4xx_hal_driver/Src/stm32f4xx_hal_uart.c: In function 'HAL_UART_Receive':
/mnt/c/workspace/tinyuf2/lib/st/stm32f4xx_hal_driver/Src/stm32f4xx_hal_uart.c:1148:15: warning: cast increases required alignment of target type [-Wcast-align]
 1148 |         tmp = (uint16_t *) pData;
      |               ^
/mnt/c/workspace/tinyuf2/lib/st/stm32f4xx_hal_driver/Src/stm32f4xx_hal_uart.c: In function 'UART_Transmit_IT':
/mnt/c/workspace/tinyuf2/lib/st/stm32f4xx_hal_driver/Src/stm32f4xx_hal_uart.c:2927:13: warning: cast increases required alignment of target type [-Wcast-align]
 2927 |       tmp = (uint16_t *) huart->pTxBuffPtr;
      |             ^
/mnt/c/workspace/tinyuf2/lib/st/stm32f4xx_hal_driver/Src/stm32f4xx_hal_uart.c: In function 'UART_Receive_IT':
/mnt/c/workspace/tinyuf2/lib/st/stm32f4xx_hal_driver/Src/stm32f4xx_hal_uart.c:2999:13: warning: cast increases required alignment of target type [-Wcast-align]
 2999 |       tmp = (uint16_t *) huart->pRxBuffPtr;
      |             ^
LINK _build/circuitart_stm32f4core/tinyuf2-circuitart_stm32f4core.elf
CREATE _build/circuitart_stm32f4core/tinyuf2-circuitart_stm32f4core.bin
CREATE _build/circuitart_stm32f4core/tinyuf2-circuitart_stm32f4core.hex

stm32f4 build warnings

RT1060 EVK issues

I'm having a couple issues with the imxrt1060 port.
First, double tap is not activating the bootloader.
Second, the fcfb origin for RT1060 does not seem to be correct. The linker scripts in the NXP SDK place it at 0x0
If you load a valid program (like hello world from the SDK) first, you will not see the issue because the tinyuf2 image gets written after the valid FCFB, but if you mass erase the part and load the tinyUF2 image, when the part powers on it will fail to the ISP ROM.

Move to IDF 4.4 for ESP32-S3 support

Hi @hathach :)

I'm working on ESP32-S3 support for CPY and that means we'll also need support for S3 in TinyUF2 and that requires being on the latest master IDF branch - 4.4.bleeeeeeeeeding edge, and we'll also need to stay updated often.

I'm happy to do the work on this, but I wanted to check it's ok before I start as it may need a substantial change like CPY needed - where we seperate esp32s2 and esp32s3 stuff into partitioned folders.

So can you all let me know if there is a preference on how you want this done? Or can I do what I did in CPY and run it all from Makefile variables and skconfig definitions?

Thanks!

Logging on RT1010 EVK

Has anyone tried the LOG=2 option on the imxrt1010_evk?
I do not see any activity on the UART when set LOG=2

Porting guide

The ports structure here is different than the structure in tinyUSB. Is there a straightforward way to bring an example from tinyUSB into tinyUF2 to add support? I would like to add LPC55 which is already supported in tinyUSB. I know that I will need to add the flash routines, I'm mostly looking for recommendations to keep the structure maintainable.
The LPC55 has internal flash, so it is quite different from the i.MX RT parts.

Factory reset option

There is another way to restart from uf2 partition. IDF is using something called factory reset, it can be enabled in menuconfig and is using selected pin to erase ota_data partition and boot from factory partition. I think this is better than:

GPIO is attached to an 100K resistor and 1uF Capacitor to serve as 1-bit memory, which hold the pin value long enough for double reset detection

Thanks for this project.

PS is there a way or tool to build UF2 partition?

ESP32S2 self-update not working

We have two different self-update UF2 firmware files. But uploading one or another file does not work. The UF2 bootloader that was last burned via the idf.py tool is always active and cannot be overwritten.

ESP32 S3 C1 N8R2 stays in boot mode after CircuitPython install

Operating System

MacOS

INFO_UF2.TXT

TinyUF2 Bootloader 0.8.0 - tinyusb (0.12.0-203-ga4cfd1c6)
Model: Espressif ESP32S3 DevKitC 1
Board-ID: ESP32S3-DevKitC-v1.0
Date: Jan 5 2022

What happened ?

After copy of cp 72x onto S3DKC1BOOT and reboot, device remains in boot mode.

see https://forums.adafruit.com/viewtopic.php?f=60&t=189819

How to reproduce ?

see https://forums.adafruit.com/viewtopic.php?f=60&t=189819

Debug Log

none

Screenshots

No response

Can't build for my FeatherS2

Did a brand new fork and clone - got all submodules.
Git status shows I'm all updated and clean.

This is what I get when I try to build for my featherS2...

 ❯ make BOARD=unexpectedmaker_feathers2 all                                                                                                                           [16:43:46]
idf.py -B_build/build-unexpectedmaker_feathers2 -DBOARD=unexpectedmaker_feathers2 build
Executing action: all (aliases: build)
Running cmake in directory /Users/seon/tinyuf2/ports/esp32s2/_build/build-unexpectedmaker_feathers2
Executing "cmake -G Ninja -DPYTHON_DEPS_CHECKED=1 -DESP_PLATFORM=1 -DBOARD=unexpectedmaker_feathers2 -DIDF_TARGET=esp32s2 -DCCACHE_ENABLE=0 /Users/seon/tinyuf2/ports/esp32s2"...
-- Found Git: /usr/bin/git (found version "2.24.3 (Apple Git-128)") 
-- The C compiler identification is GNU 8.4.0
-- The CXX compiler identification is GNU 8.4.0
-- The ASM compiler identification is GNU
-- Found assembler: /Users/seon/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/xtensa-esp32s2-elf-gcc
-- Check for working C compiler: /Users/seon/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/xtensa-esp32s2-elf-gcc
-- Check for working C compiler: /Users/seon/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/xtensa-esp32s2-elf-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /Users/seon/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/xtensa-esp32s2-elf-g++
-- Check for working CXX compiler: /Users/seon/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/xtensa-esp32s2-elf-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Building ESP-IDF components for target esp32s2
Loading defaults file /Users/seon/tinyuf2/ports/esp32s2/sdkconfig.defaults...
Loading defaults file /Users/seon/tinyuf2/ports/esp32s2/boards/unexpectedmaker_feathers2/sdkconfig...
Traceback (most recent call last):
  File "/Users/seon/circuitpython/ports/esp32s2/esp-idf/tools/kconfig_new/confgen.py", line 641, in <module>
    main()
  File "/Users/seon/circuitpython/ports/esp32s2/esp-idf/tools/kconfig_new/confgen.py", line 328, in main
    update_if_changed(temp_file, filename)
  File "/Users/seon/circuitpython/ports/esp32s2/esp-idf/tools/kconfig_new/confgen.py", line 618, in update_if_changed
    with open(destination, "w") as f:
IOError: [Errno 2] No such file or directory: '/Users/seon/tinyuf2/ports/esp32s2/build/sdkconfig'
CMake Error at /Users/seon/circuitpython/ports/esp32s2/esp-idf/tools/cmake/kconfig.cmake:226 (message):
  Failed to run confgen.py
  (/Users/seon/.espressif/python_env/idf4.3_py2.7_env/bin/python;/Users/seon/circuitpython/ports/esp32s2/esp-idf/tools/kconfig_new/confgen.py;--kconfig;/Users/seon/circuitpython/ports/esp32s2/esp-idf/Kconfig;--sdkconfig-rename;/Users/seon/circuitpython/ports/esp32s2/esp-idf/sdkconfig.rename;--config;/Users/seon/tinyuf2/ports/esp32s2/build/sdkconfig;--defaults;/Users/seon/tinyuf2/ports/esp32s2/sdkconfig.defaults;--defaults;/Users/seon/tinyuf2/ports/esp32s2/boards/unexpectedmaker_feathers2/sdkconfig;--env-file;/Users/seon/tinyuf2/ports/esp32s2/_build/build-unexpectedmaker_feathers2/config.env).
  Error 1
Call Stack (most recent call first):
  /Users/seon/circuitpython/ports/esp32s2/esp-idf/tools/cmake/build.cmake:442 (__kconfig_generate_config)
  /Users/seon/circuitpython/ports/esp32s2/esp-idf/tools/cmake/project.cmake:396 (idf_build_process)
  CMakeLists.txt:35 (project)


-- Configuring incomplete, errors occurred!
See also "/Users/seon/tinyuf2/ports/esp32s2/_build/build-unexpectedmaker_feathers2/CMakeFiles/CMakeOutput.log".
cmake failed with exit code 1
make: *** [all] Error 2

I've tried with python2 and python 3, and this is using the export.sh from CircuitPython latest.

Issues with block size speedup of copying on ESP32-S2

While the increased speed of copying is a really welcome change in 4.0, I am experiencing boards (FeatherS2 and TinyS2) that don't copy properly and don't re-mount afterwards - both flashing/copying on macOS and on raspberrypi os.

Often a board that fails multiple times in a row with v4 can be fixed by erasing it's flash and then a re-flash with v3 UF2, and then it works ok again. Note, erasing the flash and re-installing v4 doesn't work on these boards, but going back to v3 does.

So far I've had this with 6 of the first 20 FeatherS2 boards I've tried v4 on and 11 of the first 50 TinyS2s.

So this is an issue with both internal and external Flash as the TinyS2 uses the ESP32-FN4R2 with internal Flash and PSRAM.

I've had to move my test jigs back to flashing with v3 now and I am back on 100% reliability again.

Maybe it's just too aggressive? Or has issues with QIO or flash speed?

Like CURRENT.UF2, could there be EVERYTHING.UF2 w/ entire flash filesystem? (code.py,libs,etc)

A Discord discussion led me to want the ability to have something like CURRENT.UF2, but contained both the current version of CircuitPython and the contents of the CP filesystem (code.py, lib, etc)

Would it even be possible for this hypothetical EVERYTHING.UF2 virtual file to be created? I know this is outside of the purview of the bootloader, but if the bootloader takes an entire snapshot of all known flashes and restores them, would it work?

Board name inconsistency in tinyuf2 for the Lolin S2 Pico - causing templating problems on circuitpython.org

Operating System

Others

INFO_UF2.TXT

NA

What happened ?

There is a board naming inconsistency between Circuitpython and tinyuf2 for the Lolin S2 Pico. This is causing the templating for the tinyuf2 download on circuitpython.org board page to be a dead link.

CP: lolin_s2_pico tinyuf2: lolin_s2-pico - I think tinyuf2 is the inconsistent one here in that other tinyuf2 board names use all underscores.

How to reproduce ?

Go to https://circuitpython.org/board/lolin_s2_pico/ and click on the "Download Bootloader ZIP" button.

Debug Log

No response

Screenshots

No response

Wrong partition sizing for FeatherS2

Using the new merged UF2 bootloader, then flashing with CPY 6 rc.1, We are only seeing 960KB free on the drive instead of the 12(ish)MB we should see. Using the old UF2 bootloader (pre tinyUF2 merge) it works correctly.

The FeatherS2 sdkconfig is definitely pointing to the 16MB partition scheme, but it's it doesn't seem to be working.

Have had more than 4 people confirm this so far, and can repro this myself on several boards.

info_uf2.txt is empty in latest master

Operating System

MacOS

INFO_UF2.TXT

empty

What happened ?

just built latest from masterful my S3 boards, as a final test before I committed the to the repo, and though they work fine, the info_uf2.txt is empty.

How to reproduce ?

Not sure how you can repo this. I lent out my S3 devkit, so cant test it on that here, but it might also have the same issue.

Debug Log

No response

Screenshots

No response

Can't build UF2 from source for ESP32S2

Hi, I'm trying to build from source (latest) and it won't compile

FAILED: esp-idf/boards/CMakeFiles/__idf_boards.dir/boards.c.obj 

Followed by...

../boards/boards.c:29:10: fatal error: esp_rom_gpio.h: No such file or directory
 #include "esp_rom_gpio.h"
          ^~~~~~~~~~~~~~~~
compilation terminated.
[924/969] Building CXX object esp-idf/asio/CMakeFiles/__idf_asio.dir/asio/asio/src/asio.cpp.obj
ninja: build stopped: subcommand failed.
ninja failed with exit code 1

I've tried using the esp-idf included in lib and the CircuitPython one. Same error with both.

esp_rom_gpio.h exists at /Users/seon/tinyuf2/lib/esp-idf/components/esp_rom/include/esp_rom_gpio.h but the error suggests it doesn't :(

Also tried with Python 2.7 and 3 just for giggles.

Any ideas?

building error

I followed every step of the tutorial, but I always get this error when I try to compile the boot loader for the esp32-s2:

[29/72] Building C object esp-idf/log/CMakeFiles/__idf_log.dir/log_noos.c.obj
FAILED: esp-idf/log/CMakeFiles/__idf_log.dir/log_noos.c.obj
/home/alexandre/.espressif/tools/xtensa-esp32s2-elf/esp-2020r3-8.4.0/xtensa-esp32s2-elf/bin/xtensa-esp32s2-elf-gcc -Iconfig -I/home/alexandre/esp/esp-idf/components/log/include -I/home/alexandre/esp/esp-idf/components/esp_rom/include -I/home/alexandre/esp/esp-idf/components/esp_common/include -I/home/alexandre/esp/esp-idf/components/xtensa/include -I/home/alexandre/esp/esp-idf/components/xtensa/esp32s2/include -I/home/alexandre/esp/esp-idf/components/esp32s2/include -I/home/alexandre/esp/esp-idf/components/soc/include -I/home/alexandre/esp/esp-idf/components/soc/esp32s2/. -I/home/alexandre/esp/esp-idf/components/soc/esp32s2/include -mlongcalls -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -Wall -Werror=all -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -Wextra -Wno-unused-parameter -Wno-sign-compare -ggdb -Os -freorder-blocks -fno-stack-protector -std=gnu99 -Wno-old-style-declaration -D_GNU_SOURCE -DIDF_VER="v4.3-dev-1720-g494a124d9" -DESP_PLATFORM -DBOOTLOADER_BUILD=1 -MD -MT esp-idf/log/CMakeFiles/__idf_log.dir/log_noos.c.obj -MF esp-idf/log/CMakeFiles/__idf_log.dir/log_noos.c.obj.d -o esp-idf/log/CMakeFiles/__idf_log.dir/log_noos.c.obj -c /home/alexandre/esp/esp-idf/components/log/log_noos.c
/home/alexandre/esp/esp-idf/components/log/log_noos.c:17:10: fatal error: soc/cpu.h: No such file or directory
#include "soc/cpu.h" // for esp_cpu_get_ccount()
^~~~~~~~~~~
compilation terminated.
[30/72] Building C object esp-idf/log/CMakeFiles/__idf_log.dir/log.c.obj
[31/72] Building C object esp-idf/log/CMakeFiles/__idf_log.dir/log_buffers.c.obj
ninja: build stopped: subcommand failed.
[160/1042] Building CXX object esp-idf/nvs_flash/CMakeFiles/__idf_nvs_flash.dir/src/nvs_partition_manager.cpp.obj
ninja: build stopped: subcommand failed.
ninja failed with exit code 1

I do not have knowledge enough on the subject to discover what I am doing wrong.

Can anybody help me?

Help with mounting errors on GigaDevice GD32VF103 port

I started porting tinyuf2 (great project!) to the RISC-V GigaDevice GD32VF103 on the Sipeed Longan Nano Board, which has supposedly the same USB OTG peripheral as the STM32F105/107 or STM32F4s. Flash writing and jumping to the application is not possible ATM, but that should be easy to implement. Now to my problem:

So far I got it to boot and enumerate successfully. But it crashes the moment that it tries to mount the ghost fast partition, already the first READ10 command of the boot block never succeeds. I have attached an dmesg dump of the problem, I can also post the debug log of LOG=2 if this is any help. When stepping into the code with a debugger it sometimes hits this breakpoint. Unfortunately I have limited experienced when it comes to debugging USB and I'm a bit lost where to look for the root cause, that's why I'm asking directly here. (although a logic analyzer and oscilloscope is at hand). To be clear I don't want anybody else to do my work but maybe point in a direction where to look 🙂.

I have uploaded the current state of affairs in my personal fork, which should be easily compileable e.g. with an embecosm toolchain if somebody want to have a look.

DMESG output
[ 5575.780639] usb 1-1.4.2: new full-speed USB device number 50 using xhci_hcd
[ 5576.126100] usb 1-1.4.2: New USB device found, idVendor=239a, idProduct=0069, bcdDevice= 1.00
[ 5576.126104] usb 1-1.4.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 5576.126106] usb 1-1.4.2: Product: LonganNano
[ 5576.126107] usb 1-1.4.2: Manufacturer: GD
[ 5576.126108] usb 1-1.4.2: SerialNumber: 56F34235363501000055396D
[ 5576.169130] usb-storage 1-1.4.2:1.0: USB Mass Storage device detected
[ 5576.169267] scsi host8: usb-storage 1-1.4.2:1.0
[ 5576.199265] hid-generic 0003:239A:0069.0010: hiddev1,hidraw3: USB HID v1.11 Device [GD LonganNano] on usb-0000:03:00.0-1.4.2/input1
[ 5577.184461] scsi host8: scsi scan: INQUIRY result too short (5), using 36
[ 5577.184465] scsi 8:0:0:0: Direct-Access     Adafruit UF2 Bootloader   1.0  PQ: 0 ANSI: 2
[ 5577.184630] sd 8:0:0:0: Attached scsi generic sg2 type 0
[ 5577.184972] sd 8:0:0:0: [sdc] 65801 512-byte logical blocks: (33.7 MB/32.1 MiB)
[ 5577.185144] sd 8:0:0:0: [sdc] Write Protect is off
[ 5577.185145] sd 8:0:0:0: [sdc] Mode Sense: 03 00 00 00
[ 5577.185324] sd 8:0:0:0: [sdc] No Caching mode page found
[ 5577.185326] sd 8:0:0:0: [sdc] Assuming drive cache: write through
[ 5577.283653] usb 1-1.4.2: reset full-speed USB device number 50 using xhci_hcd
[ 5577.603637] usb 1-1.4.2: reset full-speed USB device number 50 using xhci_hcd
[ 5586.104818] usb 1-1.3: Failed to suspend device, error -110
[ 5592.976398] usb 1-1.4.2: device descriptor read/64, error -110
[ 5608.660128] usb 1-1.4.2: reset full-speed USB device number 50 using xhci_hcd
[ 5624.083872] usb 1-1.4.2: device descriptor read/64, error -110
[ 5626.983180] usb 1-1.4.2: USB disconnect, device number 50
[ 5626.987785] print_req_error: 33 callbacks suppressed
[ 5626.987786] blk_update_request: I/O error, dev sdc, sector 1 op 0x0:(READ) flags 0x0 phys_seg 7 prio class 0
[ 5626.987791] buffer_io_error: 75 callbacks suppressed
[ 5626.987792] Buffer I/O error on dev sdc, logical block 1, async page read
[ 5626.987795] Buffer I/O error on dev sdc, logical block 2, async page read
[ 5626.987796] Buffer I/O error on dev sdc, logical block 3, async page read
[ 5626.987797] Buffer I/O error on dev sdc, logical block 4, async page read
[ 5626.987798] Buffer I/O error on dev sdc, logical block 5, async page read
[ 5626.987799] Buffer I/O error on dev sdc, logical block 6, async page read
[ 5626.987800] Buffer I/O error on dev sdc, logical block 7, async page read
[ 5626.987963] blk_update_request: I/O error, dev sdc, sector 1 op 0x0:(READ) flags 0x0 phys_seg 7 prio class 0
[ 5626.987967] Buffer I/O error on dev sdc, logical block 1, async page read
[ 5626.987968] Buffer I/O error on dev sdc, logical block 2, async page read
[ 5626.987970] Buffer I/O error on dev sdc, logical block 3, async page read
[ 5626.987979] blk_update_request: I/O error, dev sdc, sector 1 op 0x0:(READ) flags 0x0 phys_seg 7 prio class 0
[ 5626.987984] ldm_validate_partition_table(): Disk read failed.
[ 5626.987989] blk_update_request: I/O error, dev sdc, sector 1 op 0x0:(READ) flags 0x0 phys_seg 7 prio class 0
[ 5626.987997] blk_update_request: I/O error, dev sdc, sector 1 op 0x0:(READ) flags 0x0 phys_seg 7 prio class 0
[ 5626.988004] blk_update_request: I/O error, dev sdc, sector 1 op 0x0:(READ) flags 0x0 phys_seg 7 prio class 0
[ 5626.988012] blk_update_request: I/O error, dev sdc, sector 1 op 0x0:(READ) flags 0x0 phys_seg 7 prio class 0
[ 5626.988016] Dev sdc: unable to read RDB block 0
[ 5626.988021] blk_update_request: I/O error, dev sdc, sector 1 op 0x0:(READ) flags 0x0 phys_seg 7 prio class 0
[ 5626.988027] blk_update_request: I/O error, dev sdc, sector 1 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[ 5626.988031] blk_update_request: I/O error, dev sdc, sector 2 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0
[ 5626.988106]  sdc: unable to read partition table
[ 5626.988352] sd 8:0:0:0: [sdc] Read Capacity(10) failed: Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
[ 5626.988355] sd 8:0:0:0: [sdc] Sense not available.
[ 5626.988357] sd 8:0:0:0: [sdc] 0 512-byte logical blocks: (0 B/0 B)
[ 5626.988363] sdc: detected capacity change from 65801 to 0
[ 5626.988365] sd 8:0:0:0: [sdc] Attached SCSI removable disk
[ 5628.265768] usb 1-1.4.2: new full-speed USB device number 5

Hard Lock-up on Saola-Wroom

Up front: this is probably user error...

I've built and flashed the latest from this repo's master branch.

I am using the latest idf-tools.

I've enabled level 2 TinyUSB logging and added some extra logging:

--- idf_monitor on /dev/cu.usbserial-14430 115200 ---
--- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H ---
ESP-ROM:esp32s2-rc4-20191025
Build:Oct 25 2019
rst:0x1 (POWERON),boot:0x8 (SPI_FAST_FLASH_BOOT)
SPIWP:0xee
mode:DIO, clock div:1
load:0x3ffe6100,len:0x8
load:0x3ffe6108,len:0x1aa8
load:0x4004c000,len:0x1cd4
load:0x40050000,len:0x1c08
entry 0x4004c454
I (46) boot: ESP-IDF v4.3-dev-1197-g8bc19ba89 2nd stage bootloader
I (46) boot: compile time 19:13:47
I (46) boot: chip revision: 0
I (49) boot.esp32s2: SPI Speed      : 80MHz
I (54) boot.esp32s2: SPI Mode       : DIO
I (59) boot.esp32s2: SPI Flash Size : 4MB
I (63) boot: Enabling RNG early entropy source...
I (69) boot: Partition Table:
I (72) boot: ## Label            Usage          Type ST Offset   Length
I (80) boot:  0 nvs              WiFi data        01 02 00009000 00005000
I (87) boot:  1 otadata          OTA data         01 00 0000e000 00002000
I (95) boot:  2 ota_0            OTA app          00 10 00010000 00160000
I (102) boot:  3 ota_1            OTA app          00 11 00170000 00160000
I (110) boot:  4 uf2              factory app      00 00 002d0000 00040000
I (117) boot:  5 user_fs          Unknown data     01 81 00310000 000f0000
I (125) boot: End of partition table
I (129) boot: Defaulting to factory image
I (134) boot: JULIAN- boot_index: -1
I (138) boot: JULIAN- RESET_REASON: 1
I (142) boot: JULIAN- boot_index-2: -1
I (147) esp_image: segment 0: paddr=0x002d0020 vaddr=0x3f000020 size=0x037f4 ( 14324) map
I (159) esp_image: segment 1: paddr=0x002d381c vaddr=0x3ffbb360 size=0x019c4 (  6596) load
I (166) esp_image: segment 2: paddr=0x002d51e8 vaddr=0x40022000 size=0x00404 (  1028) load
0x40022000: _WindowOverflow4 at /Users/julian/Documents/MakeItZone_Projects/esp/esp-idf/components/freertos/xtensa/xtensa_vectors.S:1730

I (174) esp_image: segment 3: paddr=0x002d55f4 vaddr=0x40022404 size=0x08f50 ( 36688) load
0x40022404: _coredump_iram_end at ??:?

I (192) esp_image: segment 4: paddr=0x002de54c vaddr=0x00000000 size=0x01acc (  6860)
I (194) esp_image: segment 5: paddr=0x002e0020 vaddr=0x40080020 size=0x105f8 ( 67064) map
0x40080020: _stext at ??:?

I (219) boot: Loaded app from partition at offset 0x2d0000
I (219) boot: Disabling RNG early entropy source...
I (231) cache: Instruction cache 	: size 8KB, 4Ways, cache line size 32Byte
I (231) cpu_start: cpu freq: 160
I (233) cpu_start: Pro cpu up.
I (290) cpu_start: Pro cpu start user code
I (290) cpu_start: Application information:
I (290) cpu_start: Project name:     uf2-esp32s
I (294) cpu_start: App version:      47c7e86-dirty
I (299) cpu_start: Compile time:     Sep 27 2020 01:03:42
I (305) cpu_start: ELF file SHA256:  c62dcfbf23055695...
I (311) cpu_start: ESP-IDF:          v4.3-dev-1197-g8bc19ba89
I (318) heap_init: Initializing. RAM available for dynamic allocation:
I (325) heap_init: At 3FFC1358 len 0003ACA8 (235 KiB): DRAM
I (331) heap_init: At 3FFFC000 len 00003A10 (14 KiB): DRAM
I (338) spi_flash: detected chip: generic
I (342) spi_flash: flash io: dio
I (346) cpu_start: Starting scheduler on PRO CPU.
I (351) uf2: Hello
USBD init
MSC init
HID init
VENDOR init
I (351) uf2: _part_ota0->type = 0
I (361) uf2: _part_ota0->subtype = 0x10
I (361) uf2: _part_ota0->address = 0x10000
I (361) uf2: _part_ota0->size = 0x160000
I (371) uf2: _part_ota0->encrypted = 0
I (371) uf2: flash->chip_id = 0x204016
I (381) uf2: flash->size = 0x400000
I (381) uf2: block_erase = 0x10000
I (391) uf2: JULIAN-hit usb dev task
I (391) uf2: JULIAN-pre tud task loop

The last log message is from main/main.c where I added:

void usb_device_task(void* param)
{
  (void) param;
  ESP_LOGI(TAG, "JULIAN-hit usb dev task");
  // RTOS forever loop
  while (1)
  {
    ESP_LOGI(TAG, "JULIAN-pre tud task loop");
    tud_task();
    ESP_LOGI(TAG, "JULIAN-post tud task loop");
  }
}

tud_task() seems to be locking up. Plugging native USB into a Mac or PC -> nothing.

The board has run CircuitPython fine.

I have tried erasing the flash first and then flashing with the uf2 build.

What's the next step to debug this?

Enable capability to use >1 sector per cluster in ghostfat

@kaetemi ... maybe I'm missing something, but I think there needs to be a way to enable the use of the new >1 sector per cluster support.

For example, shouldn't the following:

tinyuf2/src/uf2.h

Lines 45 to 47 in 15fa707

#define CFG_UF2_FLASH_SIZE (4*1024*1024) // TODO absolute max flash size
#define CFG_UF2_NUM_BLOCKS (0x10109) // just under 32MB
#define CFG_UF2_SECTORS_PER_CLUSTER (1)

Be changed to:

#ifndef CFG_UF2_FLASH_SIZE
    #define CFG_UF2_FLASH_SIZE          (4*1024*1024)    // TODO absolute max flash size
#endif
#ifndef CFG_UF2_NUM_BLOCKS
    #define CFG_UF2_NUM_BLOCKS          (0x10109)        // just under 32MB
#endif
#ifndef CFG_UF2_SECTORS_PER_CLUSTER
    #define CFG_UF2_SECTORS_PER_CLUSTER (1)
#endif

If so, I'll mark PR #90 as ready....

STM32F4 self-update

self-update feature is implemented for esp32s2 and imxrt10xx but not stm32f4 just yet.

Enable GhostFat auto-validation

GhostFAT requires unit tests

GhostFAT is quite complex (file systems are inherently complex), and is critical functionality relied upon for updating devices. As seen with the RPi Pico, sometimes it even gets burned into ROM.

The need to validate GhostFAT is thus critical. However, today this is an extremely manual process.

For example, validation that it generates a correct file system:

  • Build bootloader with all substantial variations (base, >1 sector per cluster, various sized flash files, etc.)
  • Loading those bootloaders onto real devices
  • Plus those devices into machines
  • Dump the exposed USB flash drive to a disk image
  • Manually validating the file system image is correct

Similar steps are needed to validate that GhostFAT will extract the relevant portions of a .UF2 file, and send them to the board at the correct offset.

In short, it's a huge manual test effort, and confidence drops as additional features / combinations are supported.

The automated validation should compile as board variants, to keep the build environment identical where possible.

Here's a straw man of features and test cases that should be part of automated CI checks:

Features:

  • Verify generated file system is bit-for-bit match of known-good version (catch regressions)
    • Requires reproducible FS generation (explicit date/time stamp)
    • Requires compiling code native to build environment
    • Requires availability of known-good versions of file system
    • CI build to include new ports
    • CI build copies known-good file system to bin directory
    • CI build runs the native built test code after compilation

Test Cases:

  • Basic Image (512-byte sector, 1 sector per cluster, FAT16, Flash size of 4MB @ offset zero)
  • Various sectors per cluster (at least 8 and 64 sectors per cluster for 4k and 32k clusters)
  • Various flash sizes and starting offsets (at least all those currently in use)
  • Flash sizes that are not multiples of cluster size (only affects cases with >1 sector per cluster)
  • Edge cases for compilation date / time stamps ? (e.g., Feb 29th)

For Hathach to add via Ceedling/CMock/Unity

  • Verify written UF2 block result in writes to correct flash offsets, with expected data
  • Verify written UF2 blocks for non-matching BOARD_UF2_FAMILY_ID are NOT written to flash

Finalize partition layout

Hey, could we finalize the partition layout? I've added native WiFi to the CircuitPython build and I'm over 0x130000 bytes per partition. I'm thinking we'll want to do 1MB for the filesystem and then split the rest between two OTA and UF2. We aren't using NVS at all. What size do we want to leave for UF2?

It'd be great to share the partition layout with Arduino as well. @me-no-dev what partition layout are you using for Arduino?

fatal error: esp_rom_gpio.h: No such file or directory - ESP32-S2

I'm trying to create a custom bootloader for my board but when I run the make script I keep getting an error that the esp_rom_gpio.h is not found.

Am I missing something?

I saw a similar ticket from @UnexpectedMaker related to this that was closed but his issue was resolved by rebooting his machine, I tried that, and is not helping.

Any help will be greatly appreciated.

FAILED: esp-idf/boards/CMakeFiles/__idf_boards.dir/boards.c.obj 
CMakeFiles/__idf_boards.dir/boards.c.obj -MF esp-idf/boards/CMakeFiles/__idf_boards.dir/boards.c.obj.d -o esp-idf/boards/CMakeFiles/__idf_boards.dir/boards.c.obj -c ../../boards/boards.c
../../boards/boards.c:29:10: fatal error: esp_rom_gpio.h: No such file or directory
 #include "esp_rom_gpio.h"
          ^~~~~~~~~~~~~~~~
compilation terminated.
[9/28] Building C object esp-idf/src/CMakeFiles/__idf_src.di...lib/tinyusb/src/portable/espressif/esp32s2/dcd_esp32s2.c.ob
ninja: build stopped: subcommand failed.
ninja failed with exit code 1
make: *** [all] Error 2

Thank you!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.