fix ci release build failed due to migration
#tinyuf2
1 messages · Page 2 of 1
I can aslo test loin S3 pro but there is no new release for it
Description of Change
updating neopixel pin for vindie s2
@ladyada vindie s2 update
tested with hardware 👍
Added my new OMGS3
Added my new RGB Touch Mini
Added my TinyWATCH S3
TinyWATCH S3 doesn't have a status LED or RGB LED, so I commented out the DATA and POWER pins, and set the number of RGB LEDs to 0.
I hope that is the correct way to handle this use case. It seems to work ok, but I am not sure if there's an alternate way to handle no status LED.
PIDs/VID supplied by Espressif
thanks, that is ok, when there is no NEOPIXEL_PIN defined, the rest won't be used.
This is Revision 2 of a board that has already been added through an older pull request by me.
43e5ee3 only attempt to wait for 2nd reset if reset by ... - hathach
This partly fixes an issue https://github.com/adafruit/Adafruit_TinyUSB_Arduino/issues/436, when S3 is enumerated as USB JTAG while waiting for 2nd reset
- only attempt to wait for 2nd reset if reset by by by power on (En/nRST pin)
- temporarily change USB phy to OTG while waiting for 2nd reset to prevent S3 is enumerated with USB JTAG.
typo mistake in previous pill request(https://github.com/adafruit/tinyuf2/pull/405)
tft reset should be 40 not 4
Operating System
Others
INFO_UF2.TXT
n/a
What happened ?
when making a new release, build failed when trying to upload artifacts/binaries to aws with esp32 build.
https://github.com/adafruit/tinyuf2/actions/runs/10703503616/job/29674841712
I am not familiar with this @makermelissa since you fixed this a couple of time previously, could you please lease a hand whenever you have time. Thank you.
How to reproduce ?
make a new release
Debug Log
No response
#...
I should be able to look at this today.
I see "Unable to locate credentials".
thank you for looking at this.
1efd2ad - switch esp32 dcd driver to use dwc2 - hathach
- switch esp32 dcd driver to use dwc2
- update tinyusb to commit 3eea46056ea20aa12b73eea7c01d6c6e5b2d490a
Add M5Stack CoreS3 board
VID & PID comes from EspressIf pids repository
This is fixed by 23362cd. Secrets need to be explicitly passed to sub-jobs.
thanks @tannewt for the fix
I fixed the CI issue with release 0.20.1 and https://github.com/adafruit/circuitpython-org/pull/1469 updates the website to use it.
Thanks @tannewt. I wasn't aware of this new option.
Checklist
By completing this PR sufficiently, you help us to review this Pull Request quicker and also help improve the quality of Release Notes
- [ ] Please provide specific title of the PR describing the change
- [ ] Please provide related links (eg. Issue which will be closed by this Pull Request)
- [ ] If you are adding an new boards, please make sure
- [ ] Provide link to your allocated VID/PID if applicable
- [ ]
UF2_BOARD_IDin your board.h follow correct format ...
The PIDs have been merged by espressif, you we can use them for the Bootloader now :)
Checklist
By completing this PR sufficiently, you help us to review this Pull Request quicker and also help improve the quality of Release Notes
- [x] Please provide specific title of the PR describing the change
- [x] If you are adding an new boards, please make sure
- [x] Provide link to your allocated VID/PID if applicable: https://github.com/espressif/usb-pids/blob/main/allocated-pids.txt
- [x]
UF2_BOARD_IDin your board.h follow correct format from [uf2 specs](https:/...
The neopixel has red and green inverted, added support for that with an #ifdef.
Ok, so tinyuf2 stm32f4 port: I'm seeing conflicting information about the sectors used by tinyuf2 itself... One spot says first two 16K sectors are tinyUF2, another says the first 4
I'm trying to do the following for an f401cb (128K total flash) keyboard device:
- Fit tinyUF2 into the first 2x16K sectors
- Use the next two 16K sectors for application settings storage
- Keep application itself in the last large 64K sector.
I tweaked the stm32f4_boot.ld file to specify FLASH and CONFIG to squeeze into the first 32K and that seems fine.
Any reason the above won't work?
(I don't have the hardware on hand to test, trying to set this up for someone else to test)
im gonna try to make one rn with the yd-esp32-s3 n8r8 as base because it already works
ah, I wouldn't want bootloader to know too much of app knowledge and just want to write as less code as possible. Putting them all into CURRENT.UF2 is better way to go.
NOTE: currently max size is ar
igual mente gracias . gracias por todo pe osti jajaja, o ye com2 estas
Boards:
- Seed Arch Mix RT1052
- Olimex RT1011
- Makerdiary RT1011 Nano Kit
All sets differ only slightly from the respective imxrt10xx-evk files. Major changes are flash size and LED pin. All have been tested with theses boards.
Thank you for your PR, everything look goods, there is a minor request to change board-id to match uf2 specs format.
Also I have a question regarding VID/PID, are these assigned specifically for these board for bootloader purpose and re-use/shared with other application/board.
The VID/PID are set on best knowdledge.
Olimex RT1011: PID and VID have been supplied by the vendor and are set by the APP as well.
Makerdiary RT1010 Nano Kit: The VID/PID are the values shown in their bootstrap loader. So I use the same here, even if the VID is one of Seeed Technologies.
Seeed Arch Mix: 0x2886 is tve VID of Seeed. No specific PID was supplied by the vendor. But I can ask.
The VID/PID are set on best knowdledge. Olimex RT1011: PID and VID have been supplied by the vendor and are set by the APP as well. Makerdiary RT1010 Nano Kit: The VID/PID are the values shown in their bootstrap loader. So I use the same here, even if the VID is one of Seeed Technologies. Seeed Arch Mix: 0x2886 is tve VID of Seeed. No specific PID was supplied by the vendor. But I can ask.
I guess olimex and makerdiary is OK, for Seed Arch, maybe if you could just ask to see if they allo...
I requested NXP set aside a VID/PID that could be used for generically for
UF2. I would suggest using that for UF2 on NXP based boards. Otherwise you
always need two PID if your application has a different USB configuration
than UF2.
Greg
On Fri, Oct 11, 2024, 7:01 AM Ha Thach @.***> wrote:
The VID/PID are set on best knowdledge. Olimex RT1011: PID and VID have
been supplied by the vendor and are set by the APP as well. Makerdiary
RT1010 Nano Kit: The VID/PID are the...
I guess olimex and makerdiary is OK, for Seed Arch, maybe if you could just ask to see if they allocated any PID for the board (you can @ their developer here know one).
I asked both Makerdiary and Seeed. Makerdiary swiftly responded that 0x2886/0xf00f is the right one. The have an agreement with Seeed. Seeed did not respond yet about the Arch Mix board. Maybe on Monday,
@hathach Seeed responded and told me, that they cannot tell me a PID for the Arch Mix board. Maybe they never assigned one, or they could not find the number. The board I have is not any more in the delivery state, so I cannot just check. Anyhow I've set it to 0x0010. Maybe 0x1052 would be a good number as well.
I requested NXP set aside a VID/PID that could be used for generically for UF2. I would suggest using that for UF2 on NXP based boards. Otherwise you always need two PID if your application has a different USB configuration than UF2. Greg
That sounds great, do you think that makes sense to ask for a PID per mcu since they are a bit different from each other. Though I think a general one for imxrt is OK as well for board that does not has a private PID. Btw, @gsteiert since you are here, ...
I have the same issue with a STM32F411,
Is there an issue with the PR?
you're welcome, I am still stuck with dwc2 host driver for the time being. Will test out the imxrt1015 later on when possible
Do not hurry. The imxrt1015 is not important, unless it indicates a general problem.
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Is there any plan to add STM32F072 tinyuf2 bootloader supports?
Even tho stm32f072 has usb-dfu directly, but i will be very helpful if tinyuf2 can add supports for this specific mcu, since user can just drag and drop the firwmare for update.
This is mainly to achieve qmk keyboard firmware with tinyuf2 supports
**Describe the solut...
Hi everyone,
I am working on support for STM32H503RB on STM32H503 Nucleo board. I used F4 code as a template. I have a working code that can update application on the microcontroller.
I noticed that despite VTOR being set to BOARD_FLASH_APP_START in board_app_jump(), it is restored to default value by SystemInit() in startup code delivered by ST. I have to manually set VTOR to BOARD_FLASH_APP_START on the beginning of my main() in the app. I did not find any workaround for it without m...
Hello. How to generate the favicon data array?
In order to free up sectors 2 and 3 for the application, limit the bootloader to the first 16K sector, config to the next 16K. We keep the application still starting at 0x10000 so that 0x8000 and 0xC000 sectors can be used by the application for settings/config storage.
Checklist
By completing this PR sufficiently, you help us to review this Pull Request quicker and also help improve the quality of Release Notes
- [ ] Please provide specific title of the PR describing the change...
[adafruit/tinyuf2] New comment on pull request #420: ports/stm32f4: Keep bootloader within first 32K
So, based on the CI failure... A few things are clear:
- tinyuf2 only fits with bare minimum features enabled. Feather build fails, for example, when the neopixel code gets built too. Setting the number of pixels to 0 for that board makes the build pass again here locally.
- I realize that changing this also means the config location would change for a lot of boards, probably breaking things for existing devices.
Thoughts on making this an optional different linker file/set of offsets ...
[adafruit/tinyuf2] New comment on pull request #420: ports/stm32f4: Keep bootloader within first 32K
Ok, I've made this change "opt in" by setting COMPACT_BOOTLOADER in board.mk, so existing boards don't have any change to the flash usage. Thoughts?
[adafruit/tinyuf2] New comment on pull request #420: ports/stm32f4: Keep bootloader within first 32K
Great work. one question I tried, seems after this change , we still can't change starting at 0x10000 ? to 0x0C000 ? is there any restrict on APP Start Addr ?
[adafruit/tinyuf2] New comment on pull request #420: ports/stm32f4: Keep bootloader within first 32K
Great work. one question I tried, seems after this change , we still can't change starting at 0x10000 ? to 0x0C000 ? is there any restrict on APP Start Addr ?
I haven't tried, but I don't see why you couldn't. In my case, I specifically need the two sectors starting at 0xC000 for application settings storage, so I want to keep the same start address.
[adafruit/tinyuf2] New comment on pull request #420: ports/stm32f4: Keep bootloader within first 32K
Thanks your reply, yes, I am not sure where is the issue, after check log , it stuck on __set_MSP(sp); from board.c
Checklist
By completing this PR sufficiently, you help us to review this Pull Request quicker and also help improve the quality of Release Notes
- [x] Please provide specific title of the PR describing the change
- [x] Please provide related links (eg. Issue which will be closed by this Pull Request)
- [x] If you are adding an new boards, please make sure
- [x] Provide link to your allocated VID/PID if applicable:
https://github.com/espressif/usb-pids/blob/main/al...
- [x] Provide link to your allocated VID/PID if applicable:
[adafruit/tinyuf2] New comment on pull request #420: ports/stm32f4: Keep bootloader within first 32K
Sorry, I clearly needed more coffee/sleep when working on this. This keeps it in the first 16K, but that's really not needed for my use case, so closing.
Anyway to convert a hex to uf2?
thank you very much, this is a really great PR. I don'thave h503nucleo to test with, but I do have h563 nucleo. I am pulling your code, and making some changes to h563 for testing. Hopefully we could merge this soon.
Operating System
Windows 11
INFO_UF2.TXT
Build time issue. No INFO_UF2.txt
What happened ?
The readme specific that the ESP IDF 5.1.4 should be used.
However https://github.com/adafruit/tinyuf2/blob/4858e9071e05827efa9b27e9472e4c46cfc5a65c/ports/espressif/boards/boards.c#L348 uses "hal/usb_fsls_phy_ll.h" which is already removed in ESP IDF 5.1.4 in this commit https://github.com/espressif/esp-idf/commit/a77e5cc718de7c582f29e8fde5e8019e24046f4e
How to reproduce ?
Clon...
It turns out I made a mistake. I had some issues with 5.1.4 earlier, so I switched the folder to v5.1.1 and forgot about it. (My issue was because when I rebase my fork the tinyuf2 repo stuck at old version)
Perfect, thank you very much for the PR. I made some changes, but mostly refactor and abstract thing. This is a great PR, I settle with 24KB for H503, and 32KB for the rest due to how the flash protect bit work. Let me know if this work for you, and/or you want to make any further changes. For the self-update, we can do it later on as follow-up PR.
PS: Sorry for the delay, I got into issue when adding/testing blinky app, which is caused by system_stm32h5xx.c reset the VTOR table --> caus...
Thanks for all work that you have done on this PR. I gave TinyUF2 entire 64kB of flash because I thought it is unified across families. I also had this problem with VTOR and I even mentioned it in PR description.
What about VID/PID pair?
I am a bit busy this week but I hope I will test it again on H503 before weekend.
Thanks for all work that you have done on this PR. I gave TinyUF2 entire 64kB of flash because I thought it is unified across families. I also had this problem with VTOR and I even mentioned it in PR description.
Yeah, I overlook that, and thank to your comment, I am able to fix that. I am having issue with flash protect I think. Since for h563 (what I am testing), 1 bit is a group of 4 sectors, 0x03 is 8 sectors and that is tinyuf2 trying to write to protected flash.
What about VI...
Hi,
I checked bootloader and it works for STM32H305. I also flashed blinky app and self update.
I noticed that stm32h5_app.ld does not utilize entire flash memory available for STM32H503 but I assume end user will modify this anyway for their specific project.
The only thing to add is relevant VID/PID pair but I can't access your link. Are you sure it is accessible?
Hi, I checked bootloader and it works for STM32H305. I also flashed blinky app and self update.
Thank you for testing it out, will merge it
I noticed that stm32h5_app.ld does not utilize entire flash memory available for STM32H503 but I assume end user will modify this anyway for their specific project.
Yeah, I skip the flash_size define since most app here is simple, mostly faactory reset, self-update and blinky for testing. User should write their own code/linker.
The on...
VID/PID allocation: https://github.com/espressif/usb-pids/blob/388e9af066ac0b88342a397c208b0a6c05043a2e/allocated-pids.txt#L328
Display
The display uses a Parallel Bus instead of SPI, so I was not able to get that working with this build. However, I defined the pins and can re-test if support for Parallel Bus is added in the future.
Testing
Build was compiled and flashed using ESP-IDF v5.1.4
Output from INFO_UF2.TXT
TinyUF2 Bootloader 0.20.1-25-g46de518 - tinyusb ...
I didn't find a clear documentation of the color order of the neopixel on the board, but the Micropython demo from Waveshare does swap red and green instead of the default (1, 0, 2, 3), so I think it's good.
# Set the color order for the NeoPixel object
rgb_led.ORDER = (0, 1, 2, 3)
Tested and the color is now correct (LED green when connected to USB, red when on a power bank).
332868d bump up tinyusb, add walkaround for s3 enumerat... - hathach
This pull request includes several changes to the ESP32 build configuration, updates to dependencies, and improvements to USB handling. The most important changes are summarized below:
Build Configuration Updates:
- Renamed the
espjob toespressifand updated the toolchain version fromv5.1.4tov5.3.2in the.github/workflows/build.ymlfile. [1] [[2]](diffhunk://#diff-5c3fa597431e...
Operating System
Linux
INFO_UF2.TXT
TinyUF2 Bootloader 0.20.1-25-g46de518-dirty - tinyusb (0.16.0-1090-g3eea46056)
Model: NXP RT1020 EVK
Board-ID: MIMXRT1020-EVK-revA
Date: Jan 27 2025
Flash Size: 0x00800000 bytes
What happened ?
The bootloader changes the flash clock frequency for the imxrt10xx boards. For most boards it is lowered from 100Mhz to 60Mhz or 30MHz. For the Teensy it it raised from 100Mhz to 133Mhz. Is is possible either
- not to lower the frequency? I made tri...
Looking at the code of main.c it seems that the flash mode is re-configured only if the board is in DFU mode & the firmware image is to be uploaded. That would be option 2 about. But flash is slow even if the app is called.
Note: how do I get access to the LOG messages?
CLK is increased to the highest value defined in the data sheets of the respective flash device. The previous values of 60MHz and 30MHz reduce the speed of the APP. Tested with:
- arch_mix_1052
- imxrt1010_evk
- imxrt1015_evk
- imxrt1020_evk
- makerdiary_rt1011
- metro_m7_1011
- olimex_rt1010
Thanks you for your PR. Though I am off for TET (Lunar New Year) and won't be able to review this in 2 weeks. Happy New Year
@ladyada Thanks for noticing Scott. I'm not sure if the change I suggested is fine under all conditions. The flash chip in these boards would not support 100Mhz or 133Mhz with the simple read command (0x03). No problem with fast read. An alternative would be to change the flash frequency one the app is started, but I did not find a way to do so. Maybe not yet.
Operating System
Windows 10
INFO_UF2.TXT
Not yet uploaded
What happened ?
Hi, I'm a beginner. My hardware board is based on STM32F405RGT6 + USB3300. The STM32F405RGT6 uses an 8 MHz crystal, and the USB3300 uses a 24 MHz crystal. Only the ULPI-related pins are connected between the USB3300 and STM32F405RGT6, with the USB_HS interface exposed via the USB3300. I have flashed other firmware and confirmed that USB High-Speed is recognized, proving the hardware is functional. I a...
I think this is ok because the LUT commands all do quad reads. This will speed up app startup. Thanks!
It is possible to change the frequency after startup. We do it here in CircuitPython: https://github.com/adafruit/circuitpython/blob/3236a0f200a3eb10594e6fec6f077fe0a2812d30/ports/mimxrt10xx/supervisor/internal_flash.c#L40-L85
Thank you for both merging the PR and the hint for changing the frequency change. I have another question:
In the memconfig structure there are elements around deviceModeCfgEnable, which are configured to enable quad mode. It is configured to send a Write Status command (hex 01), with argument 0x40; LUT entry 4. So far that's ok. But writing to the status register requires to send the write Enable command before. But that's missing. So I wonder how this enabling happens. Actually, the...
I'm not sure how QE is set initially. I haven't looked at this in ages.
I hooked up a logic analyzer to see what happens after reset
The ROM code executes:
a) A large block of data is read using command 0x03.
b) A write enable command 0x06 is sent
Then:
c) The startup command as defined by the arg of deviceModeCfgEnable is sent. So no magic. The ROM code itself send the Write Enable command.
Description of Change
The settings for the initialization sequence of my last PR were not the right ones. Instead of the W25Q16 flash listed initially in the first Olimex documentation, the production boards now use an EN25Q16B-104HIP chip, which needs different arguments to enable quad mode. With the existing arguments, the flash may get write locked.
Tested with an Olimex RT1010Py board.
P.S.: In case the flash got write locked can then be unlocked using the flash-sfdp mode for ...
thanks, I think this is already fixed by https://github.com/adafruit/tinyuf2/pull/428. If so we could close this one ?
About changing the flash clock at runtime. I used the code from your link as template. As an element of pedantic, I add a mechanism to change the clock to any of the possible frequencies by modifying both the pfd_480 and the flexspi PODF dividers, using the values below which give the closest match.
typedef struct _ps_div_t {
uint8_t pfd480_div;
uint8_t podf_div;
} ps_div_t;
static ps_div_t div_table_mhz[] = {
{ 35, 8 }, // Index 0 is not valid, map it to 30 MHz
...
Hi @hathach -- Our plan for CircuitPython 10 is to change the partition table for ESP32-S3 4MB flash boards from partitions-4MB.csv to partitions-4MB-noota.csv. Currently there is not enough room in the ota_0 partition to include BLE support.
These are the boards that would be affected:
`
adafruit_feather_esp32s3_reverse_tft
adafruit_feather_esp32s3_tft
adafruit_qtpy_esp32s3_n4r2
deneyap_kart_1a_v2
lolin_s3_mini
magiclick_s3_n4r2
waveshare_esp32_s3_zero
We will warn CircuitPyth...
Thanks for writing this up Dan.
I want to point out that we'd like to do this before CircuitPython 10. It'll work with CP9 too. It is needed for 10 so that we can have a larger firmware image. When the bootloader hasn't been updated, then the bootloader should error.
@dhalbert I think it is better to just produce 2 zip/uf2, it is much easier to maintain than duplicate every boards. Defult build script will use the noota partiion, ci will produce both with/without_ota. For naming, it is up to you, but I think we can add _with_ota for dual banks and keep the default (no ota) which user will tend to download.
We can make the change with version 0.30.0 (or even 1.0.0 if you like) we can keep producing dual uf2/zip for a few version in the future and can dro...
it is probably due to the VTOR is set to 0x0 by system_stm32xxx.c try to add this line to your main() https://github.com/adafruit/tinyuf2/pull/419/files#diff-19aa9dc949d3bb8855bb23418f05fc68134dcbc6a74aa6a63a4f311d8a3adc45R67 . I will revise and add blinky app for testing for this port later.
Per email from github, the 20.04 runners will soon be removed. switch up to the latest github ubuntu version instead.
Checklist
By completing this PR sufficiently, you help us to review this Pull Request quicker and also help improve the quality of Release Notes
- [ ] Please provide specific title of the PR describing the change
- [ ] Please provide related links (eg. Issue which will be closed by this Pull Request)
- [ ] If you are adding an new boards, please make sure
...
Checklist
By completing this PR sufficiently, you help us to review this Pull Request quicker and also help improve the quality of Release Notes
- [X ] Please provide specific title of the PR describing the change
- [X ] Please provide related links (eg. Issue which will be closed by this Pull Request)
- [X ] If you are adding an new boards, please make sure
- [ X] Provide link to your allocated VID/PID if applicable
- [X ]
UF2_BOARD_IDin your board.h follow correct fo...
1d9515a Added support* for Waveshare ESP32-S3-Matrix - SomeSpaceNerd
e94350a Changed neopxel brightness - SomeSpaceNerd
9066ba1 Update board.h to not invert the neopixel's RG - SomeSpaceNerd
da7f58e Reduce neopixel brightness and fix RG inversion - SomeSpaceNerd
f22457e Merge pull request #436 from SomeSpaceNerd/master - hathach
Checklist
By completing this PR sufficiently, you help us to review this Pull Request quicker and also help improve the quality of Release Notes
- [ ] Please provide specific title of the PR describing the change
- [ ] Please provide related links (eg. Issue which will be closed by this Pull Request)
- [x] If you are adding an new boards, please make sure
- [x] Provide link to your allocated VID/PID if applicable
- [x]
UF2_BOARD_IDin your board.h follow correct format ...
Currently Circuitpython is supported on the lolin S3 mini pro
https://circuitpython.org/board/lolin_s3_mini_pro/
I installed it successfully using the bootloader from the S3 mini, but since the onboard neopixel is wired differently the LED in not signaling the boot.
on this board neopixel data is on IO8
and the LED gets power form IO7 that need to be high to enable the LED
the board also has 3 built in buttons, on IO0 IO47 and IO48 but I'm not sure they can be usefull to the bootloader.
I...
Added support for Electrosmith's Daisy Seed board: https://electro-smith.com/products/daisy-seed
Application is loaded for this board, like the rest of stm32h7, on the external (Q)SPI flash.
Code includes refactoring for the stm32h7 port to be able to support different external flash chips.
There are two variants of the Lilygo T-QT Pro. I only own one but the difference is the ram/flash setup (N8 and N4R2 version). I used the VID/PID requested by @tyeth who didn't get to adding the board at the time.
It has a display, and no status LED.
PID: https://github.com/espressif/usb-pids/pull/80
Product page: https://lilygo.cc/products/t-qt-pro
Github page: https://github.com/Xinyuan-LilyGO/T-QT
Note that the non-pro are no longer available on Lilygo's site, but should be compat...
You mean you didn't add some custom sexy boot screen, I'm shocked ;)
Nice work on this @Neradoc, much appreciated!
The board is Waveshare part No ESP32-S3-Touch-LCD-2
ESP32-S3 2inch Capacitive Touch Display Development Board
https://www.waveshare.com/esp32-s3-touch-lcd-2.htm?sku=29667
PID requested: https://github.com/espressif/usb-pids/pull/228
I see the action exists, but does not appear to ever get executed. The point of these tests was to address the very high cost of manual validation of the file system generation ... by ensuring those same inputs give identical outputs ... and thus avoid unintentional changes in what's generated.
I imagine some changes have been intentional since this was written. If I get this action running again, would you consider running it weekly?
@hathach Would you mind doing this now? We'd like to start release 10 pre-releases.
How? Will STM32H7 be supported eventually?
How? Will STM32H7 be supported eventually?
There already is support for the H7 and a H750 board , this PR is just adding another board.
We need to ensure that the Arduino options still align with this change.
sure, I will also update the Arduino for our board to have signle OTA as default.
8d600e7 change default partition for S3 4M to use no-ota - hathach
[tinyuf2] Branch change-s3-4m-partition-to-noota was force-pushed to `5224624`
Description of Change
Board configuration updates:
- Updated the partition table filenames from
partitions-4MB.csvtopartitions-4MB-noota.csvfor multiple boards, includingadafruit_feather_esp32s3,adafruit_feather_esp32s3_reverse_tft,adafruit_feather_esp32s3_tft,adafruit_qtpy_esp32s3_n4r2,deneyap_kart_1a_v2,lilygo_tqt_pro_psram,lolin_s3_mini,magiclick_s3_n4r2,waveshare_esp32_s3_matrix, andwaveshare_esp32_s3_zero. [[1]](diffhunk://#diff-62166c16d...
Thank you! Let's release this as a new major version.
implemented by #442 , since the partition table is dictated by partition-binary at 0x8000. Currently we don't erase/rewrite patition table (a bit dangerous), so we cannot switch from no-ota to ota with just using drag-and-drop update-tinyuf2.uf2. It needs to be done using esptool.py with combined.bin. The actual binary for tinyuf2 partition does not channge at all.
Checklist
By completing this PR sufficiently, you help us to review this Pull Request quicker and also help improve the quality of Release Notes
- [x] Please provide specific title of the PR describing the change
This checklist items that are not applicable to your PR can be deleted.
Description of Change
Updated the USB Descriptors to accommodate MCUs where the endpoint number can only be used in a single direction. These devices are identified in Tin...
@hathach We decided that we want to remove the second OTA partition now for all 4MB boards, both S2 and S3. Should I make a new issue for that?
We are also going to do that for the non-UF2 boards, like ESP32, C3, etc.
Could you make that release 1.0.0? Maybe let's drop the 0.30.0 release, since it is partial. I was thinking of renumbering that release anyway. Thanks.
@dhalbert there is no need to create a new issue, let me check all the s2 and move it to the non-ota partition.
Checklist
By completing this PR sufficiently, you help us to review this Pull Request quicker and also help improve the quality of Release Notes
- [ ] Please provide specific title of the PR describing the change
- [ ] Please provide related links (eg. Issue which will be closed by this Pull Request)
- [ ] If you are adding an new boards, please make sure
- [ ] Provide link to your allocated VID/PID if applicable
- [ ]
UF2_BOARD_IDin your board.h follow correct format ...
Sorry, meant to pull to my own fork.
I think the current CI already do some test with before and after changes and then compare with known-good file system images. You make that brilliant PR, but I kind of forgot the details
b5b1ffa change all 4mb esp32s2 to use no-ota partition - hathach
similar to #442, this PR change all 4MB board for S2 to use no-ota partition
[tinyuf2] Branch change-s2-4m-partition-to-nooat was force-pushed to `bad2968`
This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests wi...
[tinyuf2] Branch change-s2-4m-partition-to-nooat was force-pushed to `d4722ff`
Checklist
By completing this PR sufficiently, you help us to review this Pull Request quicker and also help improve the quality of Release Notes
- [X] Please provide specific title of the PR describing the change
- [X] If you are adding an new boards, please make sure
- [X] Provide link to your allocated VID/PID if applicable
- [X]
UF2_BOARD_IDin your board.h follow correct format from uf2 specs
*This che...
df62ef8 espressif: generate combined.bin and combined_o... - hathach
[tinyuf2] Branch change-s2-4m-partition-to-nooat was force-pushed to `9c2e9f3`
[tinyuf2] Branch change-s2-4m-partition-to-nooat was force-pushed to `74210ed`
[tinyuf2] Branch change-s2-4m-partition-to-nooat was force-pushed to `61b051a`
3658478 use postbuild script to generate combined/ota.b... - hathach
[tinyuf2] Branch change-s2-4m-partition-to-nooat was force-pushed to `2c2996b`
[tinyuf2] Branch change-s2-4m-partition-to-nooat was force-pushed to `736a6e0`
b5b1ffa change all 4mb esp32s2 to use no-ota partition - hathach
d4722ff bump up,, update codeql - hathach
61b051a espressif: generate combined.bin and combined_o... - hathach
736a6e0 use postbuild script to generate combined/ota.b... - hathach
3419f43 Merge pull request #445 from adafruit/change-s2... - hathach
implemented, in release 0.31.0 for board with 4MB flash (s2 and s3), there will be combined.bin and combined_ota.bin.
f89bfbd include flash_args to artifact - hathach
Description of Change
include flash_args to artifact, to make it easier for user to know which address to flash for each binaries
implemented, in release 0.31.0 for board with 4MB flash (s2 and s3), there will be combined.bin and combined_ota.bin.
So combined_ota.bin includes ota_0 and ota_1, and combined.bin includes only a twice-as-large ota_0? That looks like what is happening.
I noticed the file list above only has one partititon-table.bin, but I would expect two, one with ota_0 and ota_1, and one with only ota_0. Which partition layout is in partition-table.bin?
yeah, the default is single bank (noota). I can add the partion-table-ota.bin as well. in the follow up PR.
25e2274 include partition-ota.bin, flash_args to artifacts - hathach
perfect thank you, please give me a bit of time to review and test this. I have a question, Since these are similar, should we merge them together as max32/analog ports, that would reduce the duplication. I plan to do that with tinyusb as well when having time. But if you think this is ok, we can leave this for now.
Merging the devices together also crossed my mind when doing the port. There are just enough nuances between the underlying API calls and operation between parts that I worry having some pre-processor conditional blocks for the variations will make things unreadable and hard to follow. Diff'ing the board.c and board_flash.c files between parts will give you an idea of what I mean by nuances.
I am open to any suggestions you have to combine things together. Let me know, as well as if you...
Doesn't UF2 simply serves as a raw/binary transfer esncapsulation?
Can´t you just transfer the encrypted copy of your firmware, and have your custom code decrypt before flashing.
thanks, I will try to make some update and testing, since PR is rather large, this may take a bit of time.
Description of Change
enhance cmake, update build, move f4, h5 to cmake build and artifact
hi @BrentK-ADI thank you for the great PR, the code work super well, I have tested the blinky app and update-tinyuf2 (self_update), both are working well on my feather max32666 and max32690evkit. Furthermore, I have merged all the maxim mcu into common ports/maxim in this branch https://github.com/adafruit/tinyuf2/tree/add-max32-support, but I have only done that with cmake, which I found much easier to manage and is primarily using. To build you need
cd ports/maxim
mkdir build
cd...
@hathach , thanks for the review and feedback. Got a little busy with a couple things, hopefully can get back to this this week.
@hathach , thanks for the review and feedback. Got a little busy with a couple things, hopefully can get back to this this week.
no problems at all, we are all busy.
@hathach, Had a chance to run through all this. Thanks for putting all this extra work in!
The cmake build system is fine with me. I was able to use the tools that come with our MSDK installer, no need to have an independent Make wrapper. I like how you were able to combine the different MCUs into a single port, that all looks good.
One issue:
Not sure the root cause of this, whether it be the cmake optimization rules, or something else, but the bootloader executable ends up linki...
@hathach, Had a chance to run through all this. Thanks for putting all this extra work in!
The cmake build system is fine with me. I was able to use the tools that come with our MSDK installer, no need to have an independent Make wrapper. I like how you were able to combine the different MCUs into a single port, that all looks good.
Great, I am plannig to do only cmake for future ports.
One issue: Not sure the root cause of this, whether it be the cmake optimization rules, or...
also update README for cmake build instruction and removed make-related files. Please pull and try again (it is rebased to master, you may need a clean checkout). Feel free push any update to readme or any files. Also I am only able to test with max32666fthr and max32690ekit (I bricked the maax32650 when mistakenig flashing 32666 firmware on it), so please test with other board in the maxim. If everything is good, we can merge this
also update README for cmake build instruction and removed make-related files. Please pull and try again (it is rebased to master, you may need a clean checkout). Feel free push any update to readme or any files. Also I am only able to test with max32666fthr and max32690ekit (I bricked the maax32650 when mistakenig flashing 32666 firmware on it), so please test with other board in the maxim. If everything is good, we can merge this
I made an update to family_support.cmake for OpenOCD fla...
perfect, thank you. This will be a great port.
perfect, thank you very much and sorry for the late response. I actually don't have the H750 to test with at the moment. But the change to add more external flash support look great.
Operating System
Windows 11
INFO_UF2.TXT
What happened ?
The repository under ports/stm32l4 shows build errors from GitHub automations:
Can you please validate the STM32L4 port to check whether these errors are relevant or need to be fixed?
Thank you very much! I want to use your bootloader but I need to ensure that i...
In Learn Guides, we sometimes want to point to the combined.bin for a particular board, for use with esptool.py or the Adafruit ESPTool. Right now we have to describe downloading the .zip and, unzipping it, and choosing the combined.bin, which is unlabeled. (Keeping track of anonymous combined.bin files is not easy. I often rename them or keep them in folders.)
The combined.bin is referenced far more often than anything else in the zip file. What would you think about uploading it sep...
I am trying to think of a way to do this dynamically rather than upload so many files. Maybe a github.io page could extract files from .zip when requested.
I consulted with the the Learn developers, and there is no existing feature to do this dynamically. They suggested uploading the combined.bin separately, and organizing https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bootloaders/esp32/ better, which was also on my mind. So I wrote a script to break out the combined.bin and combined-ota.bin files, and also copy the current .zip and .uf2 files into board-specific directories. I've now done this on S3, which a structur...
Description of Change
Intension of this PR is to add UF2 family ID for ESP32-P4
https://github.com/microsoft/uf2/blob/master/utils/uf2families.json#L228
This action paves the way to further addition of ESP32-P4 target boards.
- Fixes #452
During a release
- Upload the
tinyuf2*.zipandupdate-tinyuf2*.binto, in a board-specific directory. The upload path used to be, for example:
s3://adafruit-circuit-python/bootloaders/esp32/tinyuf2-adafruit_feather_esp32s3-0.32.0.zip
and now it is
s3://adafruit-circuit-python/bootloaders/esp32/adafruit_feather_esp32s3/tinyuf2-adafruit_feather_esp32s3-0.32.0.zip
This groups by board name, and reduces the large number of files at one level in S3. - Also upl...
look great, I don't know how to test this without an actual release as well, release on fork does not work since aws isn't valid. But this should be fine. I think we could change the upload aws using if fi to make it cleaner than ||, but that is optional :)
perfect, I think we can merge and test release with revision bump
Do you want to do the merge? And did you mean do a release now? Thanks.
Do you want to do the merge? And did you mean do a release now? Thanks.
yeah we can merge and then make an relesae to test with
This broke in the 0.33.0 release as well.
This broke in the 0.33.0 release as well.
it build just fine, ci failed due to file name/path change. I will check.
@BionicCode can you post the link to the ci build
https://github.com/adafruit/tinyuf2/actions/runs/12871120851
However, this is 6 months old, so all the logs are gone already.
Therefore I have pushed a file to trigger the build action.
This is the log: https://github.com/BionicKeyboards/tinyuf2/actions/runs/16022984162/job/45204115240
Description of Change
fix prepare release asset
@dhalbert there seems to have issue with uploading combined-ota.bin to s3 in release https://github.com/adafruit/tinyuf2/actions/runs/16029529896
current version build just fine
What do you mean by "too obsolete"? If I fork the current version and push something to trigger the CI engine I get errors. That's why I have shared the log files. Same errors? Also I can't build it locally. I have only tried to build the STM32L4 port.
What is it that makes the CI build fail for this port and not for others?
6 months old is too obsolete, current code build L4 wihtout issue on CI
I know that 6 months is a long time. But there weren't any changes to the sources of the STM32L4 port. Can please explain why CI build fails on my end when I fork your repo and trigger a CI build? I get the exact same errors that is currently showing in your master repo for the STM32L4 port.
I have just forked your repo and then enabled the original actions. Could you do me a favor and modify the ports/stm32l4/README.md like addinig a whitespace etc. and then commit to trigger the CI build of this particular port? This is what fails.
Also, if it doesn't fail it will remove the error batch from the port which is also nice. Thank you
have you followed my above linked to action run from yesterday build ? What you suggest doesn't make sense to me, and I don't have time to do that. If the issue only exists in your fork, try to analyze its message and troubleshoot it.
9c9a332 fix release asset with esp without combined-ota... - hathach
Description of Change
fix release asset with esp without combined-ota.bin
Thanks for coming bacjk
have you followed my above linked to action run from yesterday build ?
Of course! I do read your messages and follow links to check the information you provide. I don't know you as a person but I can value you enough to show some respect. Also ignoring your content would make this discussion pointless. You shouldn't have asked that.
Obviously, whatever you have done or whatever action you have run it did not clear the CI build error flag from the STM32L4 port., wh...
oh, I just read your 1st post again, and I see what you mean by "CI build error". You misunderstand ci check displayed in the folder by github. Let me sum up
- the latest changes to L4 port is 6 month ago and that commit has a failed build. the failed build can be any run/port as long as it is trigger by that commit. That does not means the folder itself has something failed.
- the issue no longer exist at the momemnt
Please try to get familliar with github action status and how github web d...
Please try to get familliar with github action status and how github web display status for the last commit in a folder view.
Yeah, I think I understand it. In my original post I asked "Can you please validate the STM32L4 port to check whether these errors are relevant or need to be fixed?". The whole idea of contacting you was to ensure that these errors are not relevant. I don't have time to waste like configuring a custom board just to find out ((probably late in the development proce...
fixed build with https://github.com/adafruit/tinyuf2/pull/456. The lasts command [-f combined-ota.bin] when failed will cause the shell step to return as failed, changed it to use if-fi
Thanks! I was following the previous style, but I understand now how it causes an issue.
Hello, I would like to ask about using TinyUF2 on ESP32. During my research, I found that "TinyUSB must rely on USB device mode." I want to know if this is a correct understanding. Furthermore, in the ESP32-S3 and ESP32-S2 chips, there is a peripheral called "USB-OTG," which supports "USB device mode." However, in the data sheets for the ESP32-C3 and ESP32-C6, they use "USB Serial/JTAG," so from what I read in the issues on your GitHub (https://github.com/adafruit/tinyuf2/issues/378 and https...
Description of Change
Added tinyuf2 support Unexpected Maker's new EdgeS3D board.
PID/VID provided by Espressif.
Checklist
By completing this PR sufficiently, you help us to review this Pull Request quicker and also help improve the quality of Release Notes
- [ ] If you are adding an new boards, please make sure
- [ ] Provide link to your allocated VID/PID if applicable: https://github.com/espressif/usb-pids/pull/230
- [ ]
UF2_BOARD_IDin your board.h follow correct format from uf2 specs
Description ...
CircuitPython version and board name
n/a; M5Stack Dial
Code/REPL
n/a
Behavior
file note found at https://adafruit-circuit-python.s3.amazonaws.com/bootloaders/esp32/m5stack_dial/tinyuf2-m5stack_dial-0.35.0-combined.bin
NoSuchKey
The specified key does not exist.
bootloaders/esp32/m5stack_dial/tinyuf2-m5stack_dial-0.35.0-combined.bin
72H3P2CEBHJY9JF6
x0dDo+1+LIr0f8PEepejXh+yu2500mFsxVpT+5+L5mFoUQC5zzpY2ohUj+omVr/Q8PokZIQHUQU=
Descr...
There is no board definition for m5stack_dial in the tinyuf2 repo. Transferring this issue to there, though I think we might await a community contributor of a board def. There may be another one that would work.
Checklist
By completing this PR sufficiently, you help us to review this Pull Request quicker and also help improve the quality of Release Notes
- [x] Please provide specific title of the PR describing the change
- [x] Please provide related links (eg. Issue which will be closed by this Pull Request)
- [x] If you are adding an new boards, please make sure
- [x] Provide link to your allocated VID/PID if applicable
- [x]
UF2_BOARD_IDin your board.h follow correct format ...
Description of Change
This pull request adds support the the Heltec Vision Master T190 board.
Product: https://heltec.org/project/vision-master-t190
PID: Espressif default 0x303A:0x1001
A comment in board.h shows how to rotate the display if needed.
Description of Change
- Fix the order of shell commands in build instructions
- Removed dollar signs in shell commands for ease of use and consistency across the project
Checklist
By completing this PR sufficiently, you help us to review this Pull Request quicker and also help improve the quality of Release Notes
- [x] Please provide specific title of the PR describing the change
- [x] Please provide related links (eg. Issue which will be closed by this Pull Request)
- [ ] If you are adding an new boards, please make sure
- [ ] Provide link to your allocated VID/PID if applicable
- [x]
UF2_BOARD_IDin your board.h follow correct format ...
Checklist
- [ x] Please provide specific title of the PR describing the change
- [x ] If you are adding an new boards, please make sure
- [x ]
UF2_BOARD_IDin your board.h follow correct format from uf2 specs
- [x ]
Description of Change
This PR adds the WeACT STM32H503 Coreboard to ports/stm32h5. The Coreboard is an inexpensive generic breakout board but is sufficiently different from the stm32h503 ...
Pull request overview
This PR adds support for the MIMXRT1176 (i.MX RT1170) microcontroller with flash boot capability (XIP - Execute In Place). The implementation differs from other RT10xx chips by supporting both RAM-based SDP loading and direct flash boot, using a two-stage flashloader approach with blhost instead of sdphost. The PR includes support for the MIMXRT1170-EVKB evaluation board and fixes a cache invalidation bug affecting all IMXRT boards.
Key Changes:
- Added MIMX...
I have been getting a lot of reports with issues using TinyUF2 with Mac OS, but I'm unsure if they can be fixed.
A lot of time copy into the drive returns Unexpected Error (100093)
I also gotten some reports that the firmware isn't working correctly if the uf2 is >6mb.
I have no idea how to debug those, but I'm pretty sure other facing the same issue?
After copying, mac OS always complains about the disk not ejected properly. But I don't know if there are ways to fix this.
The big issue with UF2 in general right now with macOS Tahoe (26.0 / 26.1 as of this writing) is that it refuses to mount and show these small "suspicious" drives at all in the Finder, so a casual user will not be able to do an update.
you can see the UF2 disk waiting to be mounted at:
diskutil list
but you have to explicitly mount it to see it in the Finder:
diskutil mountDisk /dev/diskN
alternatively, you can not mount it and send the firmware directly:
sudo dd if=firmware.uf2...
The big issue with UF2 in general right now with macOS Tahoe (26.0 / 26.1 as of this writing) is that it refuses to mount and show these small "suspicious" drives at all in the Finder, so a casual user will not be able to do an update.
you can see the UF2 disk waiting to be mounted at:
diskutil listbut you have to explicitly mount it to see it in the Finder:
diskutil mountDisk /dev/diskNalternatively, you can not mount it and send the firmware directly:
`...
The big issue with UF2 in general right now with macOS Tahoe (26.0 / 26.1 as of this writing) is that it refuses to mount and show these small "suspicious" drives at all in the Finder, so a casual user will not be able to do an update.
you can see the UF2 disk waiting to be mounted at:
diskutil listbut you have to explicitly mount it to see it in the Finder:
diskutil mountDisk /dev/diskNalternatively, you can not mount it and send the firmware directly:
`...
I really wish TinyUF2 kept the HF2 interface, so at least the user can upload via a third-party app or something.
if you can make a PR for it we can surely add it. Though it can be disable by default e.g TINYUF2_HF2 = 0.
I really wish TinyUF2 kept the HF2 interface, so at least the user can upload via a third-party app or something.
if you can make a PR for it we can surely add it. Though it can be disable by default e.g TINYUF2_HF2 = 0.
I will look into it. But even if I add it, I can only make sure it works with esp32 sx target. Is that OK?
that is ok, I can refactor to make it work with other ports as well.
@APIUM exellent work, thank you very much of the PR. I refactor and update PR to get SRAM version working as well. Binary is flashable via either jlink and/or sdp using blhost. For BLhost we need to create image with ivt at zero address there for need to cook the ivt header (boot start + size). Also when loaded by blhost, fcfb is not part of the image, therefore I added an fcfb copy and ivt/boot copy so that we can re-create those section.
I think we should only keep the flash-store ram-exe...
@APIUM exellent work, thank you very much of the PR. I refactor and update PR to get SRAM version working as well. Binary is flashable via either jlink and/or sdp using blhost. For BLhost we need to create image with ivt at zero address there for need to cook the ivt header (boot start + size). Also when loaded by blhost, fcfb is not part of the image, therefore I added an fcfb copy and ivt/boot copy so that we can re-create those section.
Thanks for the changes and explanation, I’m on p...
@APIUM great, I am glad that makes sense to you. Jan is OK, though I would be busy with other works so I think I will just do it now while having all the imxrt evk from 1011 to 1170 on my desk now.
thank you very much for your PR. I have wrap up the rt117x support with flash stored, ram executed like other rt10xx. blhost and cooked ivt0 give me a bit of troubleshooting, but it is on running OK now. I would expect newer imxrt would use blhost instead of sdphost, so it is great to get it supported. @APIUM should there is any issue when you get back to your pc. Let me know, we can fix it with follow up pr.
46ba35e Add MIMXRT1176 (i.MX RT1170) support with flash... - APIUM
9021780 RT1170: Add flash-sdp make target using SPSDK b... - APIUM
4c0de66 refactor linker script for imxrt - hathach
2db699c tinyuf2 run with blhost load-image and flash us... - hathach
dda895f fix rt1176 linker, flash with jlink working - hathach
thank you very much for your PR. I have wrap up the rt117x support with flash stored, ram executed like other rt10xx. blhost and cooked ivt0 give me a bit of troubleshooting, but it is on running OK now. I would expect newer imxrt would use blhost instead of sdphost, so it is great to get it supported. @APIUM should there is any issue when you get back to your pc. Let me know, we can fix it with follow up pr.
Great to have this merged, thanks for your help and follow up work @hathach. I ...
This pull request introduces several improvements and refactorings across documentation, build scripts, and board support for multiple MCU families. The main themes are: moving board lists from individual family READMEs to a centralized supported_boards.md, improving build and flash processes for NXP iMXRT (MIMXRT10xx), adding new erase functionality for J-Link, and updating formatting and toolchain settings for consistency.
Documentation and Board List Refactoring
- Updated fam...
@APIUM I made an follow up PR to fix rt1170 evk LED and also refactor to use the .mex (mcux pinconfig tool) to make it easier to config pin/clock. Though I found that rt1170 run with very low cpu frequency i.e. 24MH comparing to other smaller chip with 600Mhz. I tried to tweak it to its nominal freq at 900mhz, although tinyuf2 can boot, but jumping to app e.g blinky does not work. Not sure what is wrong but If you could find time to fix it, it would be great thank you.
Checklist
By completing this PR sufficiently, you help us to review this Pull Request quicker and also help improve the quality of Release Notes
- [x ] Please provide specific title of the PR describing the change
- [x ] Please provide related links (eg. Issue which will be closed by this Pull Request)
This checklist items that are not applicable to your PR can be deleted.
Description of Change
Clean and disable caches before jumping to application. ...
@hathach was able to have a look at this today, does this change fix it for you? I could only test on my customboard so not 100% it sorts it out on the EVK but I'm not sure why it wouldn't.
https://github.com/adafruit/tinyuf2/pull/470
Still does initial SDP flash at 24MHz, but as soon as it's on flash it's full speed and working well for me.
perfect, thank you. I would love to have bootloader to run at full speed as well instead of just 24Mhz i.e same clock as applicaton generated with the config tool with .mex file as other rt10xx.
Of course, that can be done with separated PR whenever you manage the time to make one.
@hathach Hello, I'd like to ask how to convert an icon into a favicon_data array. What tool did you use? This function is quite interesting.
Checklist
By completing this PR sufficiently, you help us to review this Pull Request quicker and also help improve the quality of Release Notes
- [X] Please provide specific title of the PR describing the change
- [X] Please provide related links (eg. Issue which will be closed by this Pull Request)
- [ ] If you are adding an new boards, please make sure
- [X] Provide link to your allocated VID/PID if applicable
- [X]
UF2_BOARD_IDin your board.h follow correct format ...
Checklist
By completing this PR sufficiently, you help us to review this Pull Request quicker and also help improve the quality of Release Notes
- [ ] Please provide specific title of the PR describing the change
- [ ] Please provide related links (eg. Issue which will be closed by this Pull Request)
- [ ] If you are adding an new boards, please make sure
- [ ] Provide link to your allocated VID/PID if applicable
- [ ]
UF2_BOARD_IDin your board.h follow correct format ...
Your board URL of https://padel-on.app" doesn't seem to go with the board. Instead it goes to a scoreboard company.
My bad, I wasn't planning to open the pr to your repo yet. For now it will stay internally. Sorry I will close the pr.
Checklist
By completing this PR sufficiently, you help us to review this Pull Request quicker and also help improve the quality of Release Notes
- [x] Please provide specific title of the PR describing the change
This checklist items that are not applicable to your PR can be deleted.
Description of Change
On testing a performance critical application I found I was getting slow LVGL performance compared to just flashing the hex files. Turns out the FlexS...
Pull request overview
Adjusts the i.MX RT1170/1176 (FlexSPI1) initialization so the external flash clock is restored to a higher speed after boot clock setup, avoiding leaving the system at a slow FlexSPI clock when jumping to an application.
Changes:
- Restore FlexSPI1 root clock to a higher frequency for MIMXRT117x in
board_init(). - Issue a FlexSPI1 software reset after changing the root clock to re-sync the peripheral.
💡 Add Copilot custom instructions for smarter, mo...
perfect, thank you. I forgot we currently doing manual clock config (intead of using mcxconfig for rt1170). But having it in the clock_config.c is right way to do
Summary
Add tinyuf2 bootloader support for the Waveshare ESP32-S3-Tiny board.
The circuitpython.org board page references a tinyuf2 bootloader file (tinyuf2-waveshare_esp32_s3_tiny-0.35.0.zip) that doesn't exist because this board hasn't been added to the tinyuf2 build system yet.
Board Specs
- Chip: ESP32-S3FH4R2 (dual-core Xtensa LX7, up to 240MHz)
- Flash: 4MB
- PSRAM: 2MB
- Neopixel: GPIO38 (GRB co...
First.
Hi 👋
uf.
Fourth
but what about #uf2-samdx1 ?
Sixth.
w00p!
last
lol
Last release https://github.com/adafruit/tinyuf2/releases/
More stuff since then.
anyone know how the magtag_tinyuf2_combo.bin is made, and if maybe it could be generated for the other boards ? that could make it easier for the first install by having a single file and removing the need to know what offset to use for a board
https://learn.adafruit.com/adafruit-magtag/install-uf2-bootloader
I guess you could create a single image that can be flashed from 0x0000 using something like join_bins.py
Its in the circuitpython repo / tools folder
You still need the flash offsets to create the file.
ah thanks, so that's how it's done
And thinking about it there are only two different flash layouts, one for 4MB flash (almost everything) and one for 16MB flash (UM FeatherS2)
yes, for the ESP32S2 there's partitions-4MB.csv partitions-8MB.csv and partitions-16MB.csv but a text search returns 0 occurences of 8 in the source
(16 is the FeatherS2 and microdev's micro S2)
https://github.com/adafruit/tinyuf2/pull/71
Board is basically a Saola with mproved USB-OTG (none of which is actually populated yet). I believe there will be a future board with better native USB.
Can we have GitHub bot setup for the TinyUF2 repo here like it is for CircuitPython.
@earnest sentinel I don't see why not. I'll mention it today.
ok, bot should be connected up
Thanks, Scott!
np
Is there a way to enter the uf2 bootloader by code?
When the UF2 bootloader is installed on my metro-esp32s2 -- I am unable to access an I2C device after a software reboot
I can access after a hard reset but then it fails after a soft reboot if I try to access it again.
see issue at https://github.com/adafruit/circuitpython/issues/4147
The issue does not occur if I do not use the UF2 Bootloader on the Metro-esp32s2
[adafruit/tinyuf2] New comment on issue #74: cannot access I2C after soft reboot with UF2 bootloader
do ya have a logic analyzer trace of the scl/sda lines? it may be illuminating
[adafruit/tinyuf2] New comment on issue #74: cannot access I2C after soft reboot with UF2 bootloader
Yes -- I'll see what I can find.
[adafruit/tinyuf2] New comment on issue #74: cannot access I2C after soft reboot with UF2 bootloader
With UF2 bootloader -- this is a "normal" I2C accessing the SHTC3 sensor

This is the failed aces after a soft reboot -- no activity on SDA

[adafruit/tinyuf2] New comment on issue #74: cannot access I2C after soft reboot with UF2 bootloader
wanna see if you can query the i2c SDA pin mux? thats the only thing i can imagine it is
[adafruit/tinyuf2] New comment on issue #74: cannot access I2C after soft reboot with UF2 bootloader
Can you give some instructions. I don't understand what you are asking for. sorry...
[adafruit/tinyuf2] New comment on issue #74: cannot access I2C after soft reboot with UF2 bootloader
lets wait till @hathach is back from TET holiday - could you verify that the other 'weird i2c issues' with esp32s2 in circuitpython are resolved when uf2 is not used?
[adafruit/tinyuf2] New comment on issue #74: cannot access I2C after soft reboot with UF2 bootloader
The issue with the mcp9600 https://github.com/adafruit/circuitpython/issues/3894
occurs on my metro-esp32s2 even without the UF2 bootloader so does not appear to be related.
Auto-reload is on. Simply save files over USB to run them or enter REPL to disable.
Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 6.2.0-beta.2 on 2021-02-11; Adafruit Metro ESP32S2 with ESP32S2
>>> import mcp9600_simpletest
Traceback (most recent call last):
File "<stdin>...
[adafruit/tinyuf2] New comment on issue #74: cannot access I2C after soft reboot with UF2 bootloader
the test code in https://github.com/adafruit/circuitpython/issues/4046 also causes a crash - drop USB and resets
import board
import busio
print(dir(board))
i2c = busio.I2C(board.SCL, board.SDA)
def printdevices():
i2c.try_lock()
# Find the I2C devices available.
devices = i2c.scan()
print("I2C devices:", len(devices))
for device in devices:
print(hex(device))
i2c.unlock()
print("I2C unlocked! ")
printdevices()
[adafruit/tinyuf2] New comment on issue #74: cannot access I2C after soft reboot with UF2 bootloader
mcp9600 is a bad chip to use for testing, use something that is 'normal' acting
[adafruit/tinyuf2] New comment on issue #74: cannot access I2C after soft reboot with UF2 bootloader
mcp9600 is a bad chip to use for testing, use something that is 'normal' acting
Agreed! I was just trying to reproduce the issue. So far, not having issues with other boards - shtc3 or bme680
I have created a new stm32f411ce_blackpill board using the stm32f401ce_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 don't know if this is related but... I have found that in board.mk I need to keep -DHSE_VALUE=25000000U or the new uf2 bootloader will not appear a...
This is from dmesg when I see the hid device.
[ 6459.105034] usb 1-1.4: new full-speed USB device number 10 using xhci_hcd
[ 6459.254544] usb 1-1.4: New USB device found, idVendor=239a, idProduct=005d, bcdDevice= 1.00
[ 6459.254558] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 6459.254569] usb 1-1.4: Product: STM32F411CxUx
[ 6459.254580] usb 1-1.4: Manufacturer: STM32
[ 6459.254590] usb 1-1.4: SerialNumber: 2B002C000351303033343331
[ 6459.260507] usb-sto...
CURRENT.UF2 appears to be 1MB in size on the STM32F411CE_BLACKPILL. On my samd21 the CURRENT.UF2 appears as 512.KiB. This looks proper as the on-chip flash for the STM32F411CE is 512KiB and the samd21 has 256KiB (the CURRENT.UF2 appears as twice the available flash memory size).
This corrects the FCFB address on RT1060.
The RT1060 expects the FCFB at 0x0. The existing code places it at 0x400, but does not overwrite 0x0 - 0x400, so if an image was loaded there previously with a valid FCFB it would work anyway.
This also moves the double tap to LPGPR which works better with the POR button SW3 on the RT1060 EVK, but the timing for the POR button is sensitive because the delay after releasing the button is longer than SW9.
In looking at the stm32f411ce datasheet, there are 7 flash sectors.
Sector 0 0x0800 0000 - 0x0800 3FFF 16 Kbytes
Sector 1 0x0800 4000 - 0x0800 7FFF 16 Kbytes
Sector 2 0x0800 8000 - 0x0800 BFFF 16 Kbytes
Sector 3 0x0800 C000 - 0x0800 FFFF 16 Kbytes
Sector 4 0x0801 0000 - 0x0801 FFFF 64 Kbytes
Sector 5 0x0802 0000 - 0x0803 FFFF 128 Kbytes
Sector 6 0x0804 0000 - 0x0805 FFFF 128 Kbytes
Sector 7 0x0806 0000 - 0x0807 FFFF 128 Kbytes
I updated the board.h file and re-ran but no improvem...
I am seeing that the uf2 bootloader is written from 0x8000000 to 0x8003880.

I am seeing that nothing has been written to 0x8010000.

excellent works as usual. Thank you very much of fixing the issue with rt1060. Pulled out the board and tested, It works much better now, don't worry about the button timing. I found it perfectly find to use double tap with the SW9.
1663579 Merge pull request #1 from adafruit/master - nxf58843
aa92d3c fixed RT1060 FCFB address, switched doubletap t... - nxf58843
b1629a7 Merge branch 'master' of https://github.com/ada... - nxf58843
9e1c96f Merge branch 'master' of https://github.com/ada... - nxf58843
e4ed4c7 Merge pull request #76 from nxf58843/master - hathach
556209d fix flash-pyocd-bin address for imxrt 1062 - hathach
Added date of compiled to INFO_UF2.TXT
TinyUF2 Bootloader 0.2.1-20-g3811298-dirty - esp-idf (v4.3-dev-1197-g8bc19ba89) tinyusb (0.7.0-45-g4a2baf40)
Model: Espressif Saola 1R WROVER
Board-ID: ESP32S2-Saola1R-v1.2
Date: Feb 17 2021
-DHSE_VALUE=25000000U in board.mk is correct because the board uses a 25MHz oscillator (just like the STM32401 blackpill).
Good to know that refers to the board oscillator.
I programmed various values into 0x8010000, and then did a drag-n-drop of the new uf2 file to see if the bootloader would at least erase the 0x8010000 sector... it did not get erased. I am certain that this is a valid uf2 file (it was created using the python tool, and that same tool has made successful uf2 files for the samd21). Is there a jlink logger that I can enable to help see where the first problem is occuring?
Is "self-update" the flash programming of the uf2 file to the application address?
Here is the RTT logfile with the USB attach and the uf2 file drag-n-drop.
tinyuf2_stm32f411ce_blackpill_rtt_logfile.txt
With LOG=1 no errors are reported. With LOG=2 I am definitely seeing the logfile reacting to the new UF2 file drag-n-drop. As no errors are being reported, I am assuming that the flash erase is the issue (as I can have random values at 0x8010000 and they are never erased). If the UF2 file had a problem with size or formatting, I would hope that with LOG=1 something would have been indicated.
thanks for the issue, I am currently working on other projects. Will try to help whenever I could. Feel free to update any finding meanwhile
yes, though it isn't supported yet. Currently it is only supported on esp32s2 and imxrt
[adafruit/tinyuf2] New comment on issue #74: cannot access I2C after soft reboot with UF2 bootloader
Hello, I think I figured out something in regards to this. I hooked up a project that used a bme280 and pm25 sensor (to a MagTag). It always worked fine when I initialized the pm25 sensor first, but failed as described when I did the bme280 sensor. I noticed in the library that the main difference between the init of the drivers is the pm25 is attempted to be probed multiple times and the bme280 is attempted to only be probed once. I made a local change in my bme280 lib to attempt multiple ti...
[adafruit/tinyuf2] New comment on issue #74: cannot access I2C after soft reboot with UF2 bootloader
This may be more circuitpython related though.
Added board files for my new TinyS2 board
Hi all. I'm running into a weird problem with a custom board with an ESP32-S2-WROVER-I on it, with 4MB flash and 2MB PSRAM. I'm able to put the ESP into DFU mode (holding down Boot0 button while plugging it in, as well as get it to flash with firmware using esptool.py as per the instructions provided in the README, but whenever I click the reboot pin to load it, nothing happens - no boot drive shows up, and even the /dev/tty.usbmodem01 in my devices list goes away, until I reset it with Boot0 held down again.
I mostly used the Metro ESP32-S2 board as a reference, so there's nothing too funky going on with pin assignments. I'm wondering if I'm just missing a step somewhere.
Has anyone else experienced this before?
@jolly fulcrum it can be very helpful to have a serial to usb converter on the uart. the bootrom will spit out messages about what it's doing there
Ah, I did actually split out the UART pins, thankfully. I'll try that, thank you!
Solved it. Turned out to be an analog problem. I was using the wrong reverse-protection diode for my VBUS which was severely undervolting the ESP32-S2. Apparently, the bootrom will turn on and even let you flash it at +2V, but will cut out once it tries to load the stage 2 bootloader.
Replaced it and everything works great now.
Just the small changes needed to make it work. Using this to flash a peripheral.
[adafruit/tinyuf2] Pull request opened: #81 Add support for multiple sectors per cluster in GhostFAT
Add support for multiple sectors per cluster in GhostFAT to enable larger flash sizes.
It is indeed a small change, though since rp2040 support uf2 in bootrom. I am not sure whether we will ever port it into this repo. Are you doing rp2040 ?
We're using this to flash a peripheral that's connected to an rp2040. Not rp2040 itself. (Uploading our tool to the rp2040 in no_flash mode, flashing our peripheral, and then rebooting back into rp2040 bootrom.) Greatly simplifies workflow. :)
Thanks for the context, look good to me.
Affects the size of the FAT table (each entry points to a cluster, not to a sector), so the FAT table is smaller with a larger sector per cluster value. Affects the generation of FAT table entries (clusters instead of sectors.)
Affects the size of the text files. Each file takes a cluster at minimum, not a sector. This affects the offset of the current.uf2 file.
Writing is not affected.
to be honest, I am not FAT expert. This file is single handed by @henrygab to increase the capacity from 8MB to 32MB. Which is already large enough for bootloader. The changes look great to me and it shouldn't affect existing port with CFG_UF2_SECTORS_PER_CLUSTER =1 Therefore it is good for a merge.
Out of curiosity, what is your setup/platform that requires a much larger storage for firmware ?
For flashing Bridgetek EVE graphics controller (as peripheral).
It includes both program and graphics data. Support is up to 256MB flash.
For flashing Bridgetek EVE graphics controller (as peripheral).
It includes both program and graphics data. Support is up to 256MB flash.
One last question, have you tried to read back the CURRENT.UF2 and use that file to flash the Bridgetek peripheral (with a bit of modified like date, verion). It is like an sanity check to make sure both read/write behave correctly.
Yep, data between repeated read and write matches. Text and html file look good too.
Superb !! Thank you very much for the PR. It greatly increase the virtual disk capacity. I hope more user will find it useful since it is really neat but rarely see in mcu world.
FAT16 is relatively simple.
- Header (the struct with all the size values)
- FAT (just a big array of uint16, one for each cluster - a cluster is just a combined bunch of physical sectors to reduce the size of this array (and speed up allocation) - the value of the uint16 is either empty, EOF, or pointing to the next cluster of the file)
- Root directory (just an array of file entries, one or more sectors, can be smaller than a cluster)
- Data (the clusters, may also contain directories, ...
Thank you for detail explanation, I also understand the basic but it is still complicated though 🤯
- Improve Dotstar APA102 driver
- Add funhouse board support
- Add DISPLAY_VSCSAD for vertical offset control for st7789
Since board flashing is already support, having optional std USB DFU would help as well
red LED, TFT and dotstars all work
pin 42 isn't working for the 'double tap support' - do you want to try testing?
@kaetemi, Excellent work.
@hathach, there are a number of changes I would recommend. Some of them strongly.
Let me know if any questions.
@henrygab With the standardized terminology it'll be clearer, yes. Thanks for the suggestions. I'll do a cleanup tomorrow.
Fixes a few bugs.
Renames some variables for clarity / to avoid confusion.
@kaetemi -- I actually put together a PR. After updating some names, I found at least three bugs.
Check out https://github.com/adafruit/tinyuf2/pull/81 to see most of the changes, broken into many individual, tiny commits for easier review.
@kaetemi ... I listed the wrong PR... mine WIP PR is #84. Would appreciate if you could try out the changes from my PR. The changes pass the automated builds.
FYI, I think your changes had some unexpected results, including effectively duplicating the small files' data (first sector per cluster) on all the other sectors of that same cluster. Not visible from the file system, but visible from a dump of the volume.
I think my PR addresses all the above items. Let me know if you agree....
Clarifies various sections of code.
Fixes a few bugs.
Enhanced long-term maintainability.
Most significantly, this enhances the consistent use of terms "sector" vs. "Cluster Number" vs. "Cluster Index".
Sectorrefers to the sector, relative to the BPB.- If the media is partitioned, this is the sector offset within the partition.
- For unpartitioned media, the sector is equivalent to the logical block address (LBA).
Cluster Numberis what FAT defines as the same term....
@henrygab actually they allow it to switch back (right around the reviewers name), maybe you only need repo permission. I just sent an collaborator invitation, if you are interested in the project, please consider to accept it.

I lost that wrapper code. Maybe, if @hathach agrees, I can create a proper stub that generates well-defined patterns of data via board_flash_read() and dumps the full volume... with the goal of allowing automated testing of this ghostfat code (by generating images and running custom comparison that excludes directory entry date/time stamp changes).
Thank you @henrygab for taking a deep look at this PR, I am totally clueless. For the stub, sure, you could just put it somewhere in the ghos...
Thanks for the great PR as usual. The rename make everything clearer. I have tried it on esp32s2, however, seem like the v value at line 282 is mis-computed at bit. Here is what I got in the dmesg
[337632.000452] sd 6:0:0:0: [sda] Attached SCSI removable disk
[337632.553736] FAT-fs (sda): error, fat_bmap_cluster: request beyond EOF (i_pos 8275)
[337632.553741] FAT-fs (sda): Filesystem has been set read-only
[337632.553748] FAT-fs (sda): error, fat_bmap_cluster: request beyond EOF...
I'll try it on hardware here.
Seems to work with the following patches applied.
@@ -171,8 +171,8 @@ STATIC_ASSERT( CLUSTER_COUNT >= 0x1015 && CLUSTER_COUNT < 0xFFD5 );
((UF2_SECTOR_COUNT % BPB_SECTORS_PER_CLUSTER) ? 1 : 0))
#define UF2_BYTE_COUNT (UF2_SECTOR_COUNT * BPB_SECTOR_SIZE) // always a multiple of sector size, per UF2 spec
-#define UF2_FIRST_CLUSTER_NUMBER ((NUM_FILES + 1 + 2))
-#define UF2_LAST_CLUSTER_NUMBER (UF2_FIRST_CLUSTER_NUMBER + UF2_CLUSTER_COUNT - 1...
@kaetemi , Wow! Thank you for finding a workaround and code that appears to work.
I am confused by the use of the UF2_FIRST_CLUSTER_INDEX macros causing this to work here. I am therefore not entirely comfortable with this first part of the patch (yet).
The first for setting uint32_t v = (sectionRelativeSector * FAT_ENTRIES_PER_SECTOR) + i; is 100% spot-on. This was my error, and both yourself and @hathach noted the correct fix for this line.
I think I will have to rewrite the wr...
Wow! I certainly didn't notice that before, but you're absolutely right. Thanks for giving me better options! :)
- Esp32s2 increase flash cache from 4K to 64KB. This allow esp to use block erase instead of sector erase and gain 2x
speed flashing - Also skip erase & write if contents already matches.
Before PR
written 1249536 bytes in 19.38 seconds.
Speed : 64.48 KB/s
After PR
written 1249536 bytes in 9.69 seconds.
Speed : 128.95 KB/s
take your time, there is no rush at all :)
70633db screen framebuf is allocated from heap (malloc) - hathach
no problems, we all learn something new from each other :)
notice some changes in revB schematics and update board file accordingly
- Pin double reset RC change from 42 to 38
- There is no
DOTSTAR_PIN_PWR - Dispaly CS, DC, RST is all +1
- TODO need new PID for funhouse
Yeah, perhaps it's off by 2 elsewhere. I'll prepare some disk dumps.
Start of the FAT table.
F8 FF FF FF FF FF FF FF 05 00 06 00 07 00 08 00 09 00 0A 00 0B 00 0C
Oh.
((NUM_FILES + 1))
NUM_FILES is 3, it includes the UF2 file. Then the +1 already makes this the cluster number.
So patch should just be...
((UF2_SECTOR_COUNT % BPB_SECTORS_PER_CLUSTER) ? 1 : 0))
#define UF2_BYTE_COUNT (UF2_SECTOR_COUNT * BPB_SECTOR_SIZE) // always a multiple of sector size, per UF2 spec
-#define UF2_FIRST_CLUSTER_NUMBER ((NUM_FILES + 1 + 2))
+#define UF2_FIRST_CLUSTER_NUMBER ((NUM_FILES + 1))
#define...
Repeated FAT table looks good too.
Text files are repeating themselves through the whole cluster, but it's not really an issue.
UF2 file looks good.
@kaetemi -- well done, well done indeed! Yes, the issue was that NUM_FILES included the UF2 file, and thus the calculation of v was off ... by exactly two. It was simply coincidence that it matched FAT's cluster number offset.
Text files are repeating themselves through the whole cluster, but it's not really an issue.
Really? I thought I already included a fix for that. If any file was more than 512 bytes, it would cause ghostfat to crash when reading that file's sector, so th...
I'll double check if that part got merged in.
@kaetemi / @hathach -- I've marked this PR as ready for review. I must rely on your testing for now (I don't have any testing setup currently), but based on early results, it seems now fully functional.
TODO: Would be good to have a few "fake" boards that exercise multi-cluster and some additional options (e.g., a non-UF2 file that is > 512 bytes in size).
Tested again. Text files are OK. Everything else looks good too.
Dumps attached.
Currently (at least, for me) the reset of the board is always causing Windows to report a write error (which is not very user friendly) when the file is finished uploading.
Deferring the reset, until after tud_task has completed, appears to solve this.
(It does not fix the write error case when multiple firmware families are concatenated in a single file, though. Is there any mechanism to request a safe eject from the OS?)
hmm that is weird, the while(1) {} I added in recent commit is to solve this issue. Look like it indeed cause the issue. Without the while(1) at tud_msc_write10_complete_cb(). Will the issue occur with your setup ?
My reason is that tud_msc_write10_complete_cb() is invoked after WRITE10 is complete, returned from that function will allow tinyusb stack to queue and receive more SCSI command, and board reset could occur before device response and cause the error. Maybe OS expect device...
Excellent work as usual. Thank you very much @henrygab and @kaetemi for further improving the ghostfat. I have tested with my esp32s2 board ( since i am working with it). Able to write uf2 using CURRENT.UF2 and it works perfectly.
TODO: Would be good to have a few "fake" boards that exercise multi-cluster and some additional options (e.g., a non-UF2 file that is > 512 bytes in size).
To be honest, I am not sure what is best way to make fake boards/ports, for non-UF2 may be @kaetemi can help with that by filling the info file with bunch of texts as long as its contents is less than 1 cluster :)
@hathach -- I have confirmed from @kaetemi 's dump files the following:
- FAT generated for both appears accurate.
- Large clusters (32k) no longer causes duplicated data in entire cluster.
@hathach -- I think this is ready to be merged. However, as I submitted this PR, I will wait for you (or another contributor) to approve and merge.
Ah. I had the issue before you added the while(1). I just merged that into my workaround. Let's try.
merged now since it got approved already, thanks again :+1:
With while(1) in tud_msc_write10_complete_cb (as currently on master): Error when file is uploaded.
With while(1) removed there (as it was before): Error when file is uploaded.
With this workaround (including the while(1): No error.
With this workaround (without the while(1)): No error.
Tested with tinyusb stack that comes with the Pico SDK.
My reason is that tud_msc_write10_complete_cb() is invoked after WRITE10 is complete, returned from that function will allow tinyusb stack to queue and receive more SCSI command, and board reset could occur before device response and cause the error. Maybe OS expect device to also response with TEST UNIT READY after WRITE10 or something. I will do more in-depth test.
Hmmm. Perhaps even deferring the reset until the main loop has cycled at least once without any commands received, could i...
Do you have a USB bus trace (or even storage command block level trace), as viewed from the host PC?
(e.g., http://www.bustrace.com/, or other form that can be readily viewed)
There may be interactions caused by deeply rooted architectural decisions in both ghostfat and windows. (note: my windows knowledge is from >10 years ago, so it might be dated).
<details><summary>Random thoughts on potential examples</summary><P/>
<hr>
GhostFAT sets the BPB to indicate it has a uniqu...
Is there any mechanism to request a safe eject from the OS?
@kaetemi -- that's an excellent question. you would think that some USB storage device somewhere exposed an "eject button", but my search skills couldn't find any suggestion that this was the case.
It would be fairly useful for storage devices. Expose an "eject button" (e.g., via HID), and then get notified by the OS in some way that the OS is ready for the device's departure. Of course, the device could disappear at any t...
@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:
https://github.com/adafruit/tinyuf2/blob/15fa707341df119583e5241e3acf91320859be82/src/uf2.h#L45-L47
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 ...
Enable configuration of the ghostfat options via compiler defines.
Yeah, that would be more practical. :)
Does ghostfat (or another part of this stack) ensure that the entirety of the UF2 file has been sent to the device, before it considers the write as being complete?
UF2 contains an ID in each block and the total number of blocks in the "file". When the device got all the blocks it's interested in, it'll happily reset. From the device POV, everything's OK.
But, that block numbering does not actually apply to the whole file either, it only applies to each portion of the UF2 file respect...
In the past, this included caching writes to the media, for a period of time.
Then it would not give write errors when the user is copying the file, though. Just the badly ejected media notification (which in this situation is more acceptable than "write failure" with the giant red X error icon).
Can we include the tested large value combination in the comments?
Thanks, this is still TODO, we will move it to per ports/boards later on
Yeha, there is still lots of TODO, we will move it to per ports/boards later on. But this look good
One option to consider:
After all the needed writes are received, wait until no writes occur for a time (e.g., 1 second?).
We're well into "hack" territory here.
As to prevent/allow medium removal ... that command only applies to devices with removable media. CDROMs, Iomega ZIP / JAZZ drives, etc. Here, the UF2 device is removable, not the media in the device, so it doesn't apply.
This is to simplify the process of generating repeatable ghostfat images from tests.
Supporting this will help automate validation that the resulting image files are unchanged.
the name is too long how about changing it to FAT_DATE and FAT_TIME, there is no need for underscore since these aren't system macro. In case of conflict we could add TUF2_ prefix.
@kaetemi please try to use the tinyusb that is included with this repo, that's way we are testing the same software. There are lots of improvement for rp2040 in latest release https://github.com/hathach/tinyusb/releases/tag/0.9.0 . I will also bump up tinyusb version for this repo soon as well.
To be honest, this walk-around isn't look good to me. It delay the reset a bit (probably enough to response with TEST_UNIT ready) and could have timing/race condition. We should reset at the right ...
Here's the logs I'm getting, two variations. (With this workaround enabled, and some extra prints added.)
tud_msc_write10_cb 0, 66181, 0, 2000f7d4, 4096
Write firmware addr 0x0
Write firmware addr 0x100
Write firmware addr 0x200
Write firmware addr 0x300
Write firmware addr 0x400
Write firmware addr 0x500
Write firmware addr 0x600
Write firmware addr 0x700
Queue EP 01 with 4096 bytes ... OK
USBD Xfer Complete on EP 01 with 4096 bytes
MSC xfer callback
SCSI Data
tud...
Swapping the callback to happen before the status is sent does appear to fix the issue.
Log at the end becomes as follows.
board_flash_flush
Queue EP 81 with 13 bytes ... OK
tud_msc_write10_complete_cb 0
Oh. You're right. There's some different behaviour there.
This is under MSC_STAGE_STATUS in Pico SDK tinyusb, but under MSC_STAGE_STATUS_SENT in 0.9.0.
Log with 0.9.0.
Issue does not occur with the latest tinyusb.
board_flash_flush
Queue EP 81 with 13 bytes ... OK
USBD Xfer Complete on EP 81 with 13 bytes
MSC xfer callback
SCSI Status: 0
tud_msc_write10_complete_cb 0
All macros are now have the prefix COMPILE_, and short names.
Can we include the tested large value combination in the comments?
Yeah, I think having a working/tested value combination would be great. It is removed recently (probably mistaken as obsolete value). Would you mind added it, maybe along with a bit of detail on your setup e.g like this combination appear as 1.5 GBs disk and tested on abc hardware would be helpful as well.
Np. Thanks for the help. :)
#define CFG_UF2_FLASH_SIZE (256*1024*1024)
#define CFG_UF2_NUM_BLOCKS (0x300000) // 1.5 GB
#define CFG_UF2_SECTORS_PER_CLUSTER (64)
That's for 256MB flash, so 2x a 512MB UF2 file, and plenty for space remaining for the two text files (or for the remainder of a UF2 file with non-flash content).
Tested on RP2040, for flashing BT815-series graphics chip. (Maybe add a note on the memory required for the buffer that keeps the written block flags... `CFG_UF...
#define CFG_UF2_FLASH_SIZE (256*1024*1024) #define CFG_UF2_NUM_BLOCKS (0x300000) // 1.5 GB #define CFG_UF2_SECTORS_PER_CLUSTER (64)That's for 256MB flash, so 2x a 512MB UF2 file, and plenty for space remaining for the two text files (or for the remainder of a UF2 file with non-flash content).
Tested on RP2040, for flashing BT815-series graphics chip. (Maybe add a note on the memory required for the buffer that keeps the written bloc...
On my Linux system, "uname -i" just prints "unknown". "uname -m" prints "x86_64".
i think its ok but will also wait for thach to reply!
It is odd, on my machine, both -i and -m has the same value x86_64. Accept for ?= false. I think it is good to merge
@kaetemi - It was my PR that removed the large commented-out values. Sorry!
@hathach - Having the CFG_* values is important ... I am close to having self-validation code working, at least to the point I must hand it to you for proper integration. I will open a separate issue/PR for that. :)
@henrygab ah ok, actually, I have no plan/time to remove it anytime soon. But rather will evolve slowly when needed :) I am looking forward to your PR.
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 siz...
I researched the "why" a bit and found:
POSIX doesn't define -p or -i. In GNU coreutils they are marked as non-portable, as you indicate; the default implementation relies on two optional operating system features, the three-argument form of sysinfo(2) (from SunOS) and the six-argument form of sysctl(3) (from the BSDs; neither of which are available on Linux).
Thus on Debian and derived distributions (apart from Ubuntu and its derivatives), you simply get unknown.
O...
Thanks @jepler it is good reading :+1: :+1:
The goal of this branch is to enable, as part of the normal build process, validation of GhostFat image generation.
- [x] Create framework to execute own custom
test_main()function, using existing code - [x] Ensure ghostfat initialization completes prior to calling
test_main() - [x] Generate disk image file from
test_main() - [ ] Validate bit-for-bit accuracy of disk image file from
test_main() - [x] Use common framework code for variations of desired file system image
- [ ] ...
@hathach -- Can you help with two things?
- Getting this to compile in the CI builds
- Getting the compiled , and ensuring CI will execute the resulting binary.
Compilation:
On my Ubuntu system, to make the test ports compile requires removing two options from make.mk and rules.mk:
https://github.com/adafruit/tinyuf2/blob/54cff8b6a2c84f2ea944d5df27fd5099763d3674/p...
See PR #94 for file system validation solution.
At time of writing, code is written that:
- Defines a "port" called test_ghostfat
- Defines various boards under that port which exercise different ghostfat configuration (clusters per sectors, flash size)
- Compiles executable that is native to the build environment
- Each build outputs a file "ghostfat.img"
- Each build attempts to validate "ghostfat.img" against "knowngood.img"
In short, it's essentially written, except for th...
Mostly done, except for a couple build/CI steps I need help with. See PR #94.
@ladyada would like a "nuke" program for this platform. It would just issue the general flash erase command, so that uf2 would have to be re-loaded via sdphost or j-link.
The code just looks for the FCFB tag to trigger a reload. Just take a file with 0x404 bytes of 0 and create a .UF2 file starting from 0x0.
Using a 0x404 long file will make it universal since some parts look for the tag at 0x0 and some at 0x400.
yah what we want is particularly special - a RAM-loading bin that sdphost can load in that will call chip erase. there are some times you really just want to start over from the beginning :)
All the pieces to do that are in the existing code. Let me know if you need help.
@hathach please make an attempt and we'll ask @nxf58843 for help if we need advice :)
thanks @henrygab very comprehensive, I always admire your passionate and effort put into PRs. This is a great idea, we can also include this test in the CI to make sure we won't break it while refactoring. Normally I would use Ceedling/CMock/Unity for testing since mocking/faking hardware make it easier to test with. Though please continue with your great work, later on I will try to see if I could use part of them as unit test :)
Use bootmode from SRC->SBMR2 to determine whether we are in Serial Download mode. If so write the tinyuf2 image to flash. So basically everytime SDPHost is uesd, it will write contents to flash. This works better as
- recovery method or when reworking components swapping mcu and/or flash chip.
- prototyping/simulate other boards e.g using evk board without actually drag & drop uf2 once loaded via SDP
- At worse, user load SDP with the same image on flash, the write caching will compare w...
various modification to optimize ci
- local copy of CMSIS_5 mostly for header
- local copy of micro_cc in IDF bootloader
- cache toolchain for arm gcc
- optimize submodule fetch for esp32s2 ci
There is still more to optimize such as only fetch needed submodule i.e nxp submodule for imxrt build, st for stm32f4 build etc... but that is for another PR. It is good enough for now.
the nuke binary is an application, doesn't sound like part of the bootloader project. Though I will try to fit it :sweat_smile: sweat_smile:
& change product to match CircuitPython. @ladyada I'm not sure whether it's this or a change in CircuitPython that is needed to fix copying CIRCUITPY content more than 1MB..
8fba536 adding support for flash nuke to build system - hathach
adding flash nuke to build system
I've been noodling on this and I think we can add this function to the same standard bootloader image so that you can make it erase or force an overwrite when you load it. We can add a tiny image that sets a flag and then jumps to the main image so you can pick the behavior by the jump address. Or, has anyone considered adding USB CDC commands for erasing? That would be more cross platform.
I will try to check on hardware this weekend.
@nxf58843 thank you for reviewing, I have tried it locally and it works well. Since there are several folks at Adafruit working on and need this to test out the prototype hardware. I will merge it now, should there is any issues, we will fix it with follow up PR.
this worked on a metro m7!
@nxf58843 thanks, regardless, I have added the PR for this https://github.com/adafruit/tinyuf2/pull/101 . Although it is technically not bootloader, but it is nice to have. I plan to generalize it so basically we will have 3 buidable binaries in this repo
- tinyuf2 bootloader (itself)
- self-udpate: for iMX RT it is actually the tinyuf2 itself. For other ports, it is an application than update the bootloader
- erase-app / nuke: to erase application firmware flash (factory reset), or even b...
update: trigger it via USB Control message is nice as well, though It will be more problematic to get it done in the host than firmware. With the spaghetti of driver installing, claiming interface on wins/linux/macos etc ... It is just much easier to drag an pre-built uf2 to do the work in my experience.
this worked on a metro m7!
thanks for testing, CI failed miserably. Will wrap it up later on.
sdphost also has a write register command. We could use that to set flags that configure the behavior before jumping. That would be simpler and save generating multiple images. We could also specify what to erase (bl, app, everything) that way. Only check the flags for sdp mode.
hmm, maybe we can have an magic number (similar to double tap), so that application can perform the factory reset by itself :thinking: :thinking: seem like there is several ways to implement this. Of course, we can implement it all, just make sure we document it well :)
sdphost also has a write register command. We could use that to set flags that configure the behavior before jumping. That would be simpler and save generating multiple images. We could also specify what to erase (bl, app, everything) that way. Only check the flags for sdp mode.
Yeah, I just think of this before seeing your reply. Therefore both app and sdphost can "execute" it. Also I was thinking for all other ports as well :)
We could probably even create a .UF2 file that writes the magic number to trigger it through MSD.
Right, nice suggestion, I will gather these all and put it into a pr
merged this for now, after giving it more thought, I think we should have an erase-app which is more useful and much less dangerous than an erase-all (chip erase). What is useful of blank flash. Will do another PR for all port erase-firmware target much like the update- one.
89f490d add stubs for other ports to pass ci - hathach
Mocking is insufficient for testing of such a complex item as file system generation. I will focus on this.
However, those seems like a very good fit for verifying the UF2 blocks "written" via ghostfat are properly translated into writes to the appropriate flash offset. I will leave this to you.
5b402ec add erase firmware to ci and artifact - hathach
This PR add
- ground work for
erase_firmware-BOARD.uf2for all ports - new board API: board_reset() and board_flash_erase_app()
- add erase_firmware as std application that reset board with MAGIC ERASE_APP
- IMXRT implement board_flash_erase_app() add makefile to support erase_firmware. For iMXRT it is much quicker to perform chip erase and re-write bootloader from sram to flash. (sector/block erase probably takes longer).
erase_firmware-BOARD.uf2is also uploaded as ci artifact/r...
7845c98 add sdphost binaries for rpi4 (tested) - hathach
- Remove src since it is not buildable
- Add note to external source repo for building binary
@jepler added binaries for RPI4 (arm 32 bit), and tested on actual hardware as well, work well. The current src is indeed not compilible and removed. I give the link to https://github.com/apexrtos/nxp_blhost_sdphost instead.
Collapsing to reduce thread length
@hathach -- Can you help with two things?
- Getting this to compile in the CI builds
- Getting the compiled , and ensuring CI will execute the resulting binary.
Compilation:
On my Ubuntu system, to make the test ports compile requires removing two options from
make.mkandrules.mk:
@hathach -- Yes, it was a few days back. Since then, I got it to work with CI.
So, you can do nothing, and it will validate the file system generation continues to work.
OK, this is ready for review. See success in checks from commit deae8ca ... listing the four GhostFAT code compiling, comparing against known-good images, and even ignoring the two very narrow exceptions required.
<details><summary>Two exceptions detailed</summary><P/>
Two variations allowed from the known good file system:
- Contents of
UF2_INFO.TXTfile will have a variable-length s...
Brilliant !! Thank you very much for your effort and time put into this PR. Though I still think we should separate the native build from current build system for unit test cmock/unity. I will merge this now and make a follow up PR to decouple the native build. Thank you very much for your awesome work !!!!
f4a31d5 skip fetch submodule for ci - hathach
follow up to #94 to separate native build tests from cross-compile (for target hardware). NO_TINYUF2_BUILD is used for this purpose (along with SKIP_NANOLIB, some later ports especially non-ARM may skip this lib later on). NO_TINYUF2_BUILD introduced in recent PR to allow make.mk and rule.mk to build other executable image such as erase_firmware (will also migrate self_update later on).
Eventually, test_ghostfat/main.c run on its own and interact with a small subset of board_api, thos...
ae84ff6 complete esp32 programmer app, need more testing - hathach
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/board...
I tried again but this time I closed my terminal and reopened it, ran the esp-if ./install.sh and . ./export.sh and then ran the make and it worked. Weird, but it works now. I'm closing this ticket as it seems to be working.
Sorry, please ignore this "review request" ... accidental click.
OK, will review....
Well done! Just two minor questions. I can approve now, as they are so minor.
thank you for reviewing
no problem at all :)
- Refactor build system to allow building useful applications such as erase_firmware, self-update, esp32programmer. Although they are not considered as part of bootloader, they are useful for production/recovery purpose. Put it in this repo allow to use the current board_api abstraction easily. These should not be used for complicated application though.
- Separate NO_TINYUF2_BUILD into
BUILD_APPLICATIONandBUILD_NO_TINYUSB` (some app may still use tinyusb) - Add esp32programmer app f...
side note for myself regarding epstool using dtr, rts to put esp32 into bootloader
VID/PID as assigned by Espressif (see https://github.com/espressif/usb-pids)
i tested, this is great!
all look good, except the board id must follow the sdd format from uf2 specs.
Thank you, it looks good. CI failed on esp32s2 build, but it is hardly fault of this issue. Will merge it now, and try to fix ci later on.
When starting with a blank flash chip, the board will enter sdp bootloader mode even if the jumpers are in the FlexSPI boot position. However, since b28b83a24990624961b1af80be8257a91e24f14e, tinyuf2 would not write itself to flash in this situation. Make it do so in both the "boot switch" or "fcfb invalid" cases.
Look good, though could you merge these 2 into 1 if. We can skip the log. It is not really needed.
if ( (boot_mode == 1) || !fcfb_valid)
{
write_tinyuf2_to_flash();
}
Added board definition for the ATMegaZero ESP32-S2
VID/PID as assigned by Espressif
https://github.com/espressif/usb-pids/blob/main/allocated-pids.txt
This PR adds support to Franzininho WiFi Wrover and Wroom boards
Hi Guys!
Sorry, I've messed up trying to open a pull request to another fork, but already closed this one.
I submitted a patch for file(1) so that it can better identify UF2 files. https://github.com/file/file/commit/f027887361450a5a58b472da72117cfb7f9a5f7e
- update tinyusb to latest
- speed up ci by only checkout needed submodules by each board
ed8390a bump idf submodule for reference - hathach
- Update ESP32S2 port to build with IDF v4.3 beta
- Use IDF from docker tag to speed up ci build
[adafruit/tinyuf2] Issue opened: #116 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 p...
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.
It is hard to comment without the actual code, could you make an PR to add SAME54 port. That would make it easier to analyze problem. Also that would s...
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?
it depends on the port, can you tell which board you are using ?
I was hoping it could be platform-independent. I use almost all the platforms pretty regularly: ESP32-S2, SAMD, and RP2040. (I understand RP2040 is ROM-based UF2)
Platform-independent still need port specific implementation to pull this off.
- SAMD is not supported by this repo, you should check out its implementation at https://github.com/adafruit/uf2-samdx1 and/or https://github.com/microsoft/uf2-samdx1
- ESP32S2 currently only support the actual firmware since its flash is partitioned, and the filesystem is placed on a separated parition. Having EVERYTHING.UF2 is possible, though current implementation limit the flash write to only 1 app partition...
We are also interested in exact the same feature. Mainly on ESP32S2.
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 fa...
[adafruit/tinyuf2] New comment on issue #119: Issues with block size speedup of copying on ESP32\-S2
to be honest, I am not entirely sure, I only test it on the module wroom/wrover, It is probably issue with block erase command. Here is the pr https://github.com/adafruit/tinyuf2/pull/86/files . maybe your flash device need a bit of delay or something. I think the solution for now is adding an flag in your board to skip the block erase and keep using sector erase command so that it could move along with other feature. Feel free to tag me for review when making PR for thi.
I had a chance to look at this again. I manually programmed data to 0x8010000 so that it was not blank. Ran the RTTViewer with LOG=2 and did a drag-n-drop of the uf2 file. The drag-n-drop now shows a message box that says it is waiting for the write to complete (but hangs). The last RTT log message is "Erase: 08004000 size = 16384". I will insert some more log messages in "board_flash.c" to see if I can identify the code which causes the hang. I did check the HAL_FLASH_Unlock() routine and...
maybe you could try to change the flash latency to see if it is an issue.
I switched parts and manually erased 0x08004000 sector 1. I verified that it was erased. I then programmed tinyuf2 boot loader using j-link. I noticed that 0x08004000 had data in it. I thought that tinyuf2 bootloader had to fit inside 0x08000000 to 0x08003FFF. I believe I am getting stuck when I am executing from 0x08004000 and trying to erase it at the same time.
I compiled again without the "LOG=2 LOGGER=rtt" and I fit into 0x08003FFF. So I believe my debugging efforts were causing me to hang. I believe if I want to RTT log, I will need to modify "board_flash.c" to have it not erase sector 1 (like it avoids sector 0).

Added bootloader for both versions of Muse Lab nanoESP32-S2, WROOM and WROVER.
A PID was assigned by Adafruit for the WROOM version, I got the PID for WROVER version from Espressif.
look good, you should also include the board in the ci so that it is built and binary is released
Oops, I forgot that, it should be good now :)
After looking at my original uf2 file that I was testing with, it was created with a base address of 0x08000000, which conflicts with the bootloader... I believe this is why sectors below 0x080100000 were getting erased. I manually run the uf2conv.py script now and specify the 0x08010000 as the base address (as confirmed in the following screen capture). There still is no flash write.
Would it not be better/safer to use the APP_LOAD_ADDRESS defined in board_flash.c and ignore the address in ...
I checked my testing uf2 file again for the expected stm32f4 family_id (as defined in the Makefile) UF2_FAMILY_ID = 0x57755a57... and it was not matching... which explains why no flash writes were happening. I am seeing my expected writes at 0x08010000 now.
Here is my manual uf2 conversion script:
uf2conv.py -o stm32f411blackpill_app.uf2 -b 0x08010000 -f 0x57755a57 stm32f411blackpill_app.bin
Now my issue is that the bootloader is not passing execution to the app at 0x08010000. It is alwa...
After looking at my app's bin file and the values at 0x08010000, they appear identical (hooray!). I was expecting that the tinyuf2 bootloader would look at the first couple of values at APP_LOAD_ADDRESS to see if it was programmed... and then transfer execution.
Without the double press method, I guess it would be impossible to restart the bootloader and skip the transfer of execution to the app (so that the app could be over-written with a new app).
Does new code need to be written before ...
UF2_VOLUME_LABEL has limit of 11 characters, it will get truncated, you may want to test it or rename it
OK, so sum up, the DFU process is complete, all the binary data is written to correct address. However, bootloader just does not perform jump to app. This is probably easier to fix. Btw, I don't see the f411ce blackpill in the board list, could you make PR to add it, so that I could try to see if there is any issue with the configuration in compare with f411 discovery.
Successfully tested this new board. This is the same board sold on Adafruit and Aliexpress.
https://www.adafruit.com/product/4877
Please checkout review feedback for request changes
can you update the vid/pid as shown in the comment, I made an typo to refer to VID (should be PID in previous review).
look good now, thanks for the pr
one last comment, you need to add stm32f411ce_blackpill to ci build list, so that it is built and upload binaries when having release. I should mentioned this earlier but kind of forgot.
https://github.com/adafruit/tinyuf2/blob/master/.github/workflows/build.yml#L116
Updated workflows/build.yml with stm32f411ce_blackpill board added to ARM list.
perfect now, thank you. I have the board somewhere, I will try to find it to test with.
please correct the label to limit of 11 chars
[adafruit/tinyuf2] New comment on issue #119: Issues with block size speedup of copying on ESP32\-S2
block erase
I'd had a look through that PR, but really don't understand it. Def not something I can see my self reverting, sorry.
Can I just change the FLASH_CACHE_SIZE back to 4096?
I don't see how using an ESP32-S2 WROOM/WROVER would be any different to the chips I'm using... My FeatherS2 uses the same S2 & Flash as the WROVER.
How many modules have you tested on? As I mentioned It's failing on around 20-30% - so unless you've tested this on enough modules you could easily be...
[adafruit/tinyuf2] New comment on issue #119: Issues with block size speedup of copying on ESP32\-S2
I also just tried creating a branch of release 0.3.0 - to build my TinyS2 UF2 boot loader from that, but I couldn't complete the submodule - keeps failing on nxp, and my git fu is just not good enough to solve why.
So basically I cant deploy CircuitPython on my TinyS2 boards via UF2 - super sad :(
Any guidance you can give me to how to specifically revert the 0.4.0 changes for ESP32-S2 so I can make a working UF2 boot loader, I'd really appreciate it.
[adafruit/tinyuf2] New comment on issue #119: Issues with block size speedup of copying on ESP32\-S2
Can I just change the FLASH_CACHE_SIZE back to 4096?
Possibly, I did a quick look, should work. please try. Ultimately, you need to add an board specific flag that defined in your board.h to overwrite the default one. Let just say USE_FLASH_SECTOR_ERASE or something similar. Then you could use that define to change the FLASH_CACHE_SIZE to 4096 in the board_flash.
Hi please add support to my 2 new boards: circuitart_esp32s2core & circuitart_stm32f4core
thx
look good, there is only a couple of requests (check out comment). Also as part of VID/PID requirement, could you tell how you obtain the VID/PID for your boards.
look good, there is only a couple of requests (check out comment). Also as part of VID/PID requirement, could you tell how you obtain the VID/PID for your boards.
from the repo of pid.codes
board ID has been corrected in both board.h files, also website has this comment now (// TODO update link)
build.yml abc order has been corrected
VID/PID are from pid.codes but the pull requested has not been made yet
[adafruit/tinyuf2] Issue opened: #123 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_...
most of the wwarnings come from st hal. The only warning from the project is the -Wcast-align, will fix it later.
board ID has been corrected in both board.h files, also website has this comment now (// TODO update link)
build.yml abc order has been corrected
VID/PID are from pid.codes but the pull requested has not been made yet
Can you give link to the PR, we will merge once that PR is merged.
board ID has been corrected in both board.h files, also website has this comment now (// TODO update link)
build.yml abc order has been corrected
VID/PID are from pid.codes but the pull requested has not been made yetCan you give link to the PR, we will merge once that PR is merged.
ok thanks I will update the pull request with PID.CODES PR link
board ID has been corrected in both board.h files, also website has this comment now (// TODO update link)
build.yml abc order has been corrected
VID/PID are from pid.codes but the pull requested has not been made yetCan you give link to the PR, we will merge once that PR is merged.
ok thanks I will update the pull request with PID.CODES PR link
I mean can you give the link to the PID.CODES PR link here in the comment section, adding it to the c...
This is a single file ready to flash at 0x0, similar to the combined.bin for funhouse (except that combined.bin also has an arduino program baked in)
I think you also need the ota_data_initial.bin as well for it to boot into tinyuf2 by default.
c8aae89 fix build, skip ci with self-update - hathach
refactor. update self-update makefile. Move it to apps for specific ports.
make it clear that self-update is not yet implemented on ports such as stm32 and lpc55
This PR refactor and clean up romapi for nor flash.
- Except for RT1011, all other mcus has ROM_FLEXSPI_NorFLASH() that we could use https://github.com/NXPmicro/mcux-sdk/blob/main/devices/MIMXRT1062/drivers/fsl_romapi.c for flashing.
- romapi_flash.h/c is addded to abstract that out and implement the ROM_FLEXSPI for rt1011 based on existing code
- romapi_flash.c = bl_romapi_MIMXRT1011.c + flexspi_nor_flash.c to reduce code duplication when adding new rt1011 board
tested and should not ...
Since esp_reset_reason_set_hint() is not working/supported anymore (see: https://github.com/espressif/esp-idf/issues/7230) I decided to rewrite the corresponding code using NVS storage instead.
Please note that this pull request does not work at the moment. There is still a compilation error:
tinyuf2/lib/esp-idf/components/nvs_flash/src/nvs_platform.hpp:31:10: fatal error: freertos/FreeRTOS.h: No such file or directory
#include "freertos/FreeRTOS.h"
^~~~~~~~~~~~~~~~~~~...
add support for rt1024 and rt1064 with 4MB on-chip flash which is connected to
- rt1024 as flexspi
- rt1064 as flexspi2
@T94T I dived a bit into this, there is no need for using NVS, the reason hint is still accessible within stage2 bootloader. IDF just slightly changes the reset reason for esp_restart(). I will make an PR to update this.
77e58d2 fix esp32s2 request to uf2 using reset hint - hathach
reset reason for esp_restart() changed with recent IDF. This fix request to uf2 bootloader. related to #128
@T94T would you mind trying this out.
This seems to work now. Thank you so much for your help!
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...
[adafruit/tinyuf2] New comment on issue #131: Help with mounting errors on GigaDevice GD32VF103 port
you should try to get the stack debug log with LOG=2 to see at which command it failed. Since GD32Vf is a new port, it would be easier if you test it with https://github.com/hathach/tinyusb first to see if all stock example work to verify it is not the tinyusb stack issue. I think I have this GD32VF103 somewhere in my drawer as well, if you submit an PR to add BSP for it and, I could help to troubleshoot if it is indeed usb stack issue.
[adafruit/tinyuf2] New comment on issue #131: Help with mounting errors on GigaDevice GD32VF103 port
Thank you very much :slightly_smiling_face:! I have openend a draft PR at tinyusb. I have run the tinyuf2 again with LOG=2 and captured the output of two runs that produced slightly different points where it fails:
tinyutf2
log_hid.txt
log_scsi_read10.txt
tinyusb examples
This is an output of the cdc_msc example, that seems to work f...
Is the weact blackpill port for this project in a state where it's possible to compile a CP image to UF2 and flash it yet?
[adafruit/tinyuf2] New comment on issue #119: Issues with block size speedup of copying on ESP32\-S2
Hi folks, I realised I never reported back here - super sorry.
So I did have to set my cache size back to 4096 - but that wasn't enough, It was still failing 1 out of every 6-7 times on both my FeatherS2 and TinyS2 and what I found was that I also had to wait 3-5 second's after I copied the CPY.uf2 firmware on, even after it finished copying before I could allow it to remount and that brought me back to 100% reliability.
Because of this pause that I have to do on my test jigs, and no on...
[adafruit/tinyuf2] New comment on issue #119: Issues with block size speedup of copying on ESP32\-S2
You should wait for the board to do its own self reset. Else you could reset it while writing the last block. finished copying is to the pc side only. Glad you work it out.
Also remembered to dded FeatherS2 Neo to build script this time :)
VID/PID is from Espressif:
https://github.com/espressif/usb-pids/blob/main/allocated-pids.txt
Cheers :)
Board id must follow the uf2 specs, please correct
The Board-ID field is machine-readable and consists of a number of dash-separated tokens. The first token is the CPU type, second is the board type, and third is the board revision. More tokens can be also added.
great! Thank you for your pr, yeah I try to enforce the board id specs since it is common mistake from user. Sometimes I forgot about it as well.
Hello,
I would like some advice for using the tinyuf2 bootloader on a STM32F401CCU6 Blackpill module.
I flashed the tinyuf2-stm32f401_blackpill-0.5.0 firmware on the module, once plugged in I have a "BlackPill" drive which contains "current.uf2", "index.html" and "info_uf2.txt", so everything looks good.
I tried to convert a bin file to UF2 format (the orginal bin works fine when it is flashed directly to address 0x08000000 without the bootlader), for that I used the following command (uf2conv is a Rust crate):
uf2conv firmware.bin -b 0x08010000 -f 0x57755a57
I also tried with the uf2conv.py script provided by Microsoft on the microsoft/uf2 repo:
uf2conv.py firmware.bin -c -b 0x08010000 -f 0x57755a57
I got the chip family id and base address directly from the tinyuf2 port code to be (a bit more) sure of what values to use.
When I copy the generated uf2 file into the bootloader drive, the drive disconnects (looks normal) but instead of booting on my program the bootloader restarts.
I have tried several base address values and the only difference is that sometimes the bootloader cannot be restarted (not surprisingly in case I overwrite the bootloader).
For information I use the same method without problem on Adafruit SAMD21/51 modules.
Do you have any advice or is there an error in my approach?
Thanks a lot for your help !
<never mind, I was commenting about the port of that board with the F411 chip (which is currently known to be nonfunctional). I don't know the status on the F401 version>
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.
can you provide more information on the issue:
- which board you are running
- step to reproduce
- all the version of firmware, software that are in used.
- ESP32-S2-Saola-1RI
2./3. We are using latest https://github.com/adafruit/tinyuf2/commit/7b92803108d77e94ada567fd9fbaf496256984eb and building withmake BOARD=espressif_saola_1_wroom all self-update. The generatedupdate-tinyuf2.uf2can be uploaded to the board but it does not take effect.
2.Step to reproduce: please provide your procedure detail, what have you done to test and how you verify that it does not take effect.
Just started all over again with following steps:
git clone --recurse-submodules https://github.com/adafruit/tinyuf2install.shcd tinyuf2/ports/esp32s2get_idfidf.py -p /dev/ttyUSB0 -DBOARD=espressif_saola_1_wroom flash
After this last step I have the UF2 bootloader correctly burned to the module.
Then I created the update-tinyuf2.uf2 for backup:
make BOARD=espressif_saola_1_wroom all self-update
To check wheter self-update works or not I created a new...
update-uf2 is an actually an app like circuit python, it covert tinyuf2.bin to carray then erase and write once when updating. Maybe you modify but didn't recompile the tinyuf2 first (all target) and updater use the old bin file which make you think it does not do the work.
We now applied all the changes we made before. Unfortunately it still does not work. It gets confusing even more.
One bootloader is the original without changes. The second one should enter UF2 stage when hard resetting the board.
update-tinyuf2-factory.uf2
UF2_VOLUME_LABEL:FACTORY- tinyuf2 codebase without changes
update-tinyuf2-failover.uf2
UF2_VOLUME_LABEL:FOVER- tinyuf2 codebase with changes:
added
if (reset_reason == POWERON_RESET) {
boot_i...
Ok now I see what you mean, the changes you did isn't part of the tinyuf2, it is stage2 bootlaoder, tinyuf2 is actually factory app. Right now the updater only update tinyuf2 since I am not sure if it is safe and/or possible to update stage2 bootloader. I didn't say it is not possible, I just haven't tried it yet.
Thank you very much for investigating your time! Now some things become clear. Closing for now...
If you still want to update the boot2 as well. You could open an issue for it, I will try to see if that is possible to do when having time
I tried to update the boot2 binary with update-uf2, there is a couple of issue
- There is a macro check to validate the address, though it is easily by passed by enabling unsafed write https://github.com/espressif/esp-idf/blob/master/components/spi_flash/esp_flash_api.c#L51
- There is some meta data required for boot2 bin
Invalid image block, can't boot.
ets_main.c 386
Digging to esptool.py https://github.com/espressif/esptool/blob/master/esptool.py#L3488, look like it does ...
Thank you for digging even deeper. "unsafe" does not sound good. We are now flashing the boards directly with the upload tool. The failover bootloader we only need during the development phase. So it is not a big problem. Thank you very much again.
b4c66b9 try to implement esp32s2 boot2 stage update - hathach
after giving a bit more thought, I think it is still worth updating, since ROM loader is there to unbrick. However, I don't quite feel comfortable following the esptool code, maybe if someone know where is the specs for the layout. We could get this done. I push my interim work to the branch here https://github.com/adafruit/tinyuf2/tree/esp32s2-update-boot2 . If anyone could help with meta data part, that would nail it.
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@b9fa06cf6bb3c45eaf57724d351a04564d562b6a
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...
FYI, if I program the UF2 bootloader and the CircuitPython firmware.bin firmware images manually via DFU, the board boots the CircuitPython image without issues:
dfu-util -a 0 --dfuse-address 0x08000000 -D ~/Downloads/tinyuf2-feather_stm32f405_express-0.5.0/tinyuf2-feather_stm32f405_express-0.5.0.bin
dfu-util -a 0 --dfuse-address 0x8010000 -D ports/stm/build-feather_stm32f405_express/firmware.bin
:
make -C ports/stm/ BOARD=feather_stm32f405_express UF2_BOOTLOADER=1
I'm not sure if this will help but here is a copy/paste of my [recent message on adafuit/tinyuf2 discord channel](#tinyuf2 message), the behavior might be related.
I would like some advice for using the tinyuf2 bootloader on a STM32F401CCU6 Blackpill module.
I flashed the tinyuf2-stm32f401_blackpill-0.5.0 firmware on the module, once plugged in I have a "BlackPill" drive which contains "current.uf2", "index.html" and...
I am able to reproduce the issue, looking into it now.
0dd94a0 fix updating issue with circuipython due to lar... - hathach
take chance to clean up flashing code.
it has been a while, I have made an pr #137 that fixed an issue with updating circuitpython firmware, it could also fix this issue as well. Please give it a try to see if that is indeed the case.
fa1e611 change default flash for feather 405 to dfu-util - hathach
de2e89f change default flash for feather 405 to dfu-util - hathach
should be fixed by #137, please try again
Thanks for letting me know. I pulled the latest changes and built stm32f411ce_blackpill. I did a chip erase and programmed the new bin file. It booted as a flash drive as expected and I then copied over the uf2 file. I disconnected the USB and connected it again. It booted as a flash drive... so branch execution to the app did not occur. I checked the flash memory in stm32 cube programmer and saw that location 0x08010000 was programmed properly. I am not sure if any STM32 control registers ne...
- @charkster could tell me more about the application you are compiling, please make sure you compile with linker script starting from 0x08010000 (instead of 0x08000000 then shift it with uf2, I am not so sure, it may not be the same).
- Also please try with a super simple app such as blinky just for verification first.
- Could you provide your uf2, I will try to test to see if I could spot something unusual. Note: preferably an simply blinky with correct address as mention in 1 and 2
@hathach 1. I am using the TINYUSB example (USBTMC device). I had been using the uf2 make option, but it is reporting that it is using 0x08000000. I updated STM32F411CEUx_FLASH.ld to use 0x08010000.
FLASH (rx) : ORIGIN = 0x08010000, LENGTH = 512K
After using this file, it appears that execution was transferred to the app. The app did not work correctly, but it did not appear as a flash drive any more.
I believe I can close this issue, as the bootloader is working. Maybe my apps are ...
thanks for confirmation, depending on the linker, or the code could reference to absolute address somewhere. especially the ISR vector. The app run but look like it hit the hardfault, the tinyusb example uf2 version is general option, I didn't test it with all ports/boards. Glad we finally find the root cause.
Draft PR to allow boot2 stage update for esp32s2. I have tried to update the boot2 binary with update-uf2, there is a couple of issue
- There is a macro check to validate the address, though it is easily by passed by enabling unsafed write https://github.com/espressif/esp-idf/blob/master/components/spi_flash/esp_flash_api.c#L51
- There is some meta data required for boot2 bin
Invalid image block, can't boot.
ets_main.c 386
Digging to esptool.py https://github.com/espressif/e...
Tried again with #137 and everything appears to be working correctly. Thanks @hathach!
Thanks for confirmation, It is released as 0.5.1
This PR is for the Morpheans MorphESP-240 board, ESP32S2 basedm w/ST7789 240x240 display
VID/PID from espressif.
As per title - I forgot to add the status LED
everything looks spot-on, thanks for the pr
