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

smt32 F103 failed to flash qmk #17689

Closed
jeromeli002 opened this issue Jul 15, 2022 · 6 comments
Closed

smt32 F103 failed to flash qmk #17689

jeromeli002 opened this issue Jul 15, 2022 · 6 comments
Labels
help wanted question stale Issues or pull requests that have become inactive without resolution.

Comments

@jeromeli002
Copy link

https://github.com/rogerclarkmelbourne/STM32duino-bootloader/blob/master/bootloader_only_binaries/generic_boot20_pc13.bin
image
image
image
The first time I used stm32f103, I flashed the bootloader provided in qmk, and the device displayed maple003, but I couldn't flash the qmk firmware. Is there any modification?

@sigprof
Copy link
Contributor

sigprof commented Jul 15, 2022

Apparently the flashing tool detected “Target: STM32F1_Low-density_32K”, which means that you have the STM32F103x6 chip (or maybe even some non-ST clone of that chip) with only 32K flash. The stm32duino bootloader reserves 8K for itself, leaving only 24K (24576 bytes) for the firmware, but apparently your firmware is larger than that, therefore the flashing process fails after crossing the 24K boundary.

If you really want to use this chip, you would need to get the firmware size down, probably by disabling some features; but you may end up wasting a lot of time on it without getting a usable result in the end. Note that the support for STM32F103x6 chips may not be 100% functional in current QMK versions (e.g., see #15297). Although the ChibiOS fix for USB support should be included now, the EEPROM emulation code would probably need to be turned off (EEPROM_DRIVER = transient); it could be possible to reconfigure it, but then the usable amount of flash will decrease even more. Also the firmware size check for STM32 chips does not take the emulated EEPROM area into account yet, so you may get firmware corruption when the emulated EEPROM overwrites a part of firmware code.

@myst729
Copy link
Contributor

myst729 commented Jul 22, 2022

How about extended flash, say, W25Q128. Does that possibly work?

@sigprof
Copy link
Contributor

sigprof commented Jul 22, 2022

No, this is not RP2040 — STM32F103 cannot run code directly from an external flash chip.

(Well, maybe some STM32 chips can do that using the FSMC peripheral, but it supports only flash chips with a parallel interface, and is present only in larger package variants (>= 100 pins) with lots of internal flash; it's also many times slower than the internal flash.)

@sigprof
Copy link
Contributor

sigprof commented Jul 30, 2022

Can you test the STM32F103C6 support code from #17853?

Note that you need to use at least board.h and the bootloader-related section of rules.mk from the handwired/onekey/bluepill_f103c6 keyboard in your custom code, because the bootloader parameters also specify MCU_LDSCRIPT = STM32F103x6_stm32duino_bootloader. Also use EEPROM_DRIVER = transient for now, because the proper firmware size check which takes the EEPROM backing store into account is not implemented yet, and with only 24 KiB of flash available for QMK it would be easy to get the backing store overlapping the firmware code.

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had activity in the last 90 days. It will be closed in the next 30 days unless it is tagged properly or other activity occurs.
For maintainers: Please label with bug, in progress, on hold, discussion or to do to prevent the issue from being re-flagged.

@github-actions github-actions bot added the stale Issues or pull requests that have become inactive without resolution. label Jan 22, 2023
@github-actions
Copy link

This issue has been automatically closed because it has not had activity in the last 30 days. If this issue is still valid, re-open the issue and let us know.
// [stale-action-closed]

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted question stale Issues or pull requests that have become inactive without resolution.
Projects
None yet
Development

No branches or pull requests

3 participants