-
-
Notifications
You must be signed in to change notification settings - Fork 38.5k
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
Add generalised support for stm32 f103 to simplify bluepill based boards #5669
Conversation
If I'm reading this right, this extends the STM32 support so If so, I like this change. Anything that helps boost STM32 adoption (lowers the barrier of entry, eases integration with QMK, etc.) is good by me. |
Correct, it should help reduce the duplication within the code base by providing those defaults. As bluepill is the same width (slightly longer) as a pro micro, but more importantly a similar price, I can see it as a potential successor. Its not quite a Proton C, but at less than $2 its a solid alternative when designing a PCB. |
@zvecr qmk_firmware/tmk_core/chibios.mk Lines 237 to 238 in 68fad7b
|
@drashna I understand the concept of the option ortho48 has a # GENERIC STM32F103C8T6 board - stm32duino bootloader
OPT_DEFS = -DCORTEX_VTOR_INIT=0x2000
MCU_LDSCRIPT = STM32F103x8_stm32duino_bootloader
BOARD = GENERIC_STM32_F103 Makes me think there should be something like |
we can use DFU_ARGS to properly pass the correct dfu-util parameters for bluepills We need these:
If the stm32duino bootloader is present, -a 2 exposes 0x8002000 as the starting flash zone, and -R will reset into the normal firmware at the end of flashing |
@awkannan Awesome, thanks for that info. Whats your view on the That way, bluepill support is basically a 2 liner MCU = STM32F103
BOOTLOADER = stm32duino |
70c535b
to
1e9e3c9
Compare
1e9e3c9
to
816694f
Compare
Currently the rules.mk file is cut down to only the following, # MCU name
MCU = STM32F103
# bluepill (with stm32duino bootloader) overrides
OPT_DEFS = -DCORTEX_VTOR_INIT=0x2000
MCU_LDSCRIPT = STM32F103x8_stm32duino_bootloader
DFU_ARGS = -d 1eaf:0003 -a2 -R
DFU_SUFFIX_ARGS ?= -v 1eaf -p 0003 Just need a decision if |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
---How hard would it be to add stm32f3xx support? I have a couple of bluepills in a draw I could use to test.--- My bad, I see you already added it?
@yanfali We currently have STM32F303 done in the same way for the Proton C, and I would been keen to do it for some of the other popular MCU. There will always be a place for the obscure, but reducing the duplication for something like the Teensy 3.2 can provide a ton of benefits. |
OK, just for posterity's sake. Turns out there are some chinese clones for STM32 chips in the CS32 family. They are almost perfectly compatible, except they have a different chipid which is the same as chips in the F3 family from STM. So stlink doesn't officially support them. However if you follow this issue: stlink-org/stlink#756 you will find a commit which will allow you to use st-flash on these chips and be able to follow instructions like the ones from cannonkeys to flash them with QMK and stm32 boot loader. |
Yeah. I know that the Planck Rev6, Planck EZ, and Preonic Rev3 use this method already. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tested this on a blackpill. works perfectly |
Can you confirm what -R in dfu actually resets. it didnt work for me... |
|
Yes but it didnt work on me so:) |
im on mac dfu-util 0.9 which bootloader u using? |
|
ah sorry, yes thats what I got as well:) |
Might be the MacOS |
@zvecr mine doesn't reset, I usually just unplug. |
I would then consider it a best effort until the exact circumstances can be worked out. |
Is this ready to ship, as is? Or should it wait? |
There might be some extra stuff, as @yanfali sent me a PR to add some docs, and given the extra time with my bluepills, I was thinking of some suggested changes to the defaults. |
Yeah, |
There are some merge conflicts here. |
Most of this PR has now been reimplemented, missing bits are just default central conf files. This will be tackled separately. |
Description
Similar to how the Proton C support was integrated into the core of the firmware, the aim is to provide a solid base for bluepill boards. The main goals are to minimise the amount of configuration by just requiring the MCU (and maybe the bootloader type) to be set.
Types of Changes
Checklist