-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
STM32F1xx (really just f103xe): support for SDIO flashing #6679
base: master
Are you sure you want to change the base?
STM32F1xx (really just f103xe): support for SDIO flashing #6679
Conversation
f5be9cb
to
4bf9f63
Compare
I had a couple of initial comments. In addition to those, as you note, the SDIO peripheral is only available on the high capacity and XL capacity variants of the STM32F103. It will likely be necessary to add a new KConfig choice to make sure we dont attempt to enable the SDIO peripheral on standard capacity F103s. |
It does seem 'ok' for the current F103's in the Klipper configuration set. Unfortunately the defines aren't in the direction I was hoping for (where a define for a specific MCU would bring in the appropriate density define also). I might need to create additional options in menuconfig for the sub-specialities of the STM32F103xx |
Not sure if this is worth it. |
What's the counter option?... are you suggesting no support for SDIO? There's at least two significant groups of devices in the STM32F103 series of mcus (XL and LD), |
So far, I haven't seen anyone requesting this feature, and if there is no compelling real-world benefit, then yes, I suggest not adding more options, as the complexity is already too high, even if it means that it can't be used. |
The compelling real world benefit is touchless firmware updates. Perhaps the STM32F103x8 mcu support could be dropped. I don't see any printer that actually uses this mcu, they all use the high/XL density versions that I'm aware of. So the STM32F103 could equate to high/XL density. |
There are likely numerous boards like the blue pill used as an auxiliary MCU to drive LEDs, displays, etc. In fact, there is a boolean option to support the x6 variant with 10KiB of RAM, so we know those are being used. I don't see the harm in adding another STM32F103 variant to the |
I'm ok with it, however Kevin may have some additional feedback since its a change to the build configuration. I do think the default needs to be equivalent to the current STM32F103 configuration, so I suspect its going to need to be the
You can't do that, however you do not need to add another boolean. Instead you need to modify @@ -236,18 +246,19 @@ config RAM_SIZE
default 0x1800 if MACH_STM32F042
default 0x4000 if MACH_STM32F070 || MACH_STM32F072
default 0x2800 if MACH_STM32F103x6
- default 0x5000 if MACH_STM32F103 && !MACH_STM32F103x6 # Ram size of stm32f103x8
+ default 0x5000 if MACH_STM32F103x8 || MACH_STM32F103xB
default 0x8000 if MACH_STM32G431
default 0x20000 if MACH_STM32G474
- default 0xa000 if MACH_STM32L412
+ default 0xa000 if MACH_STM32L412 || MACH_STM32F103xC
default 0x20000 if MACH_STM32F207
- default 0x10000 if MACH_STM32F401
+ default 0x10000 if MACH_STM32F401 || MACH_STM32F103xD || MACH_STM32F103xE
default 0x20000 if MACH_STM32F4x5 || MACH_STM32F446
default 0x80000 if MACH_STM32F765
default 0x9000 if MACH_STM32G07x
default 0x24000 if MACH_STM32G0Bx
default 0x20000 if MACH_STM32H7
default 0x10000 if MACH_N32G45x
+ default 0x18000 if MACH_STM32F103xF || MACH_STM32F103xG
|
Thanks. I haven't reviewed this PR, but I can provide a couple of high-level comments (take with a "grain of salt"):
Cheers, |
I was hoping for the opposite here. My thoughts are that the Klipper printer.cfg file should ideally specify the low level MCU model codes for each mcu. So that less advanced end users don't even need to concern themselves with which board / mcu their stock printer has. They can just use the stock printer.cfg, which would give them 'the right' firmware for it.
The SDIO was actually just a step on my path to something else. I want to bring in FSMC/FMC support for the STM32 series, so that I can use the LCD on my Tronxy from within Klipper. I would think vendors (both OEM and 3rd party LCD) could then leverage this to stay closer to stock Klipper (without dodging up LCD add-ons / proprietary gcodes etc). I just got tired of having to turn the mainboard off all the time... I'd think SDIO support in Klipper would be nice for Katapult also. |
62dd403
to
5a1953f
Compare
this just sets them to 50MHz instead of the 10MHz fixed currently. Adds SDIO mode for STM32F103 MCUs Signed-off-by: Bevan Weiss <bevan.weiss@gmail.com>
5a1953f
to
149be97
Compare
Add support for GPIO_HIGH_SPEED mode for STM32F1xx mcus, allows for them to be set to 50MHz (with GPIO_HIGH_SPEED flag) instead of the 10MHz limit currently imposed.
Also change how Alternative Output / Open Drain mode is selected, now it needs both GPIO_FUNCTION(n) AND GPIO_OUTPUT / GPIO_INPUT. This is to allow for GPIO_FUNCTION(n) usage with default Pull Ups on other STM32 series (like for SDIO where STM32F4 configure these with pullups).This has required the addition of GPIO_OUTPUT flags on several AF outputs. (FD)CAN, SERIAL, SDIO, PWM, SPI and USB.
Also fixed up the clock line selection for SDIO and FMSC lines. These don't appear to fit with the magic calculation previously in use.
The addition of SDIO for the stm32f103 allows for upgrades of the Tronxy X5SA Chitu-v6 mainboard without needing to touch the power switch at all :)
I've left (commented out) the swspi configuration for the flashsd, since it's still the easiest way of getting the SDIO compatible firmware onto the unit.
Also added some distinction between the SPI and SDIO modes of SD card updating.