Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CURRENT.UF2 always blank #322

Closed
zvecr opened this issue Jun 5, 2023 · 2 comments · Fixed by #367
Closed

CURRENT.UF2 always blank #322

zvecr opened this issue Jun 5, 2023 · 2 comments · Fixed by #367
Labels
bug Something isn't working

Comments

@zvecr
Copy link
Contributor

zvecr commented Jun 5, 2023

Operating System

Windows 11
Fedora 38
Arch

INFO_UF2.TXT

TinyUF2 Bootloader 0.14.0-10-g86a054f - st/cmsis_device_f3 (v2.3.6) st/stm32f3xx_hal_driver (v1.5.6-9-g75cf4fc) tinyusb (0.15.0-331-ge3b3229d6)
Model: ST STM32F303 Discovery
Board-ID: STM32F303 discovery
Date: Jun 5 2023

What happened ?

Content of CURRENT.UF2 is always just zeros, and does not reflect the current flash contents,

hexdump ~/Desktop/CURRENT.UF2
0000000 0000 0000 0000 0000 0000 0000 0000 0000
*
0080000

(Where hexdump truncates identical lines as *)

This has been reproduced on both a STM32F303 discovery and stm32f401_blackpill, so the issue is not isolated to a single port.

How to reproduce ?

Reboot to bootloader
Copy .uf2 to device
Reboot to bootloader again
Copy CURRENT.UF2 to host
Inspect content

Debug Log

No response

Screenshots

No response

@zvecr zvecr added the bug Something isn't working label Jun 5, 2023
@MiyukiDark
Copy link

This issue will be on all MCUs where the flash did not start at address 0
It just calculates it totally wrong
The issue is in ghostfat.c on lines 486 and on

// CURRENT.UF2: generate data on-the-fly
      uint32_t addr = BOARD_FLASH_APP_START + (fileRelativeSector * UF2_FIRMWARE_BYTES_PER_SECTOR);
      if ( addr < _flash_size ) // TODO abstract this out
      {

addr is always bigger than the size of a flash

@hathach hathach mentioned this issue Dec 15, 2023
@hathach
Copy link
Member

hathach commented Dec 15, 2023

should be fixed by #367, pleaes check it out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants