Repository navigation
Conversation
|
Edit: pin numbering should work, if anyone else could test. |
| #else | ||
| /* Workaround for STM32duino Core. | ||
| Because F_CPU is defined in stm32_def.h */ | ||
| #define CPU_F 72000000 |
There was a problem hiding this comment.
Why not just use the defined F_CPU in stm32_def.h? It doesn't need to be redefined here - and then this way there isn't special case code for the STM32 littered everywhere (I'm trying to pull those out - and keep platform specific code/definitions in the platforms/* files/headers. There's still some that need to be cleaned out, but I'd like to minimize adding more)
There was a problem hiding this comment.
Because of this error it doesn't work the value of 'SystemCoreClock' is not usable in a constant expression
If you could help me fix this problem, I tried a few things but it didn't work. I am not very experienced in C++.
There was a problem hiding this comment.
I've made a PR to help on this issue.
stm32duino/Arduino_Core_STM32#613
See my comment here:
stm32duino/Arduino_Core_STM32#612 (comment)
any feedbacks are welcome and discussions are opened ;)
There was a problem hiding this comment.
Pretty much every other Arduino platform has F_CPU as a compile time constant. I'd really like to not pepper the code with special casing for the stm32 (and I have a way to work around F_CPU possibly not being constant, but it is for the redesign/refactor - I don't think I'll pull it back to the FastLED 3.x tree)
There was a problem hiding this comment.
Right, but the main topics is that clock freq can change during execution then constant is no more relevant.
There was a problem hiding this comment.
Because of what FastLED does at compile time it can’t really handle the clock speed being changed dynamically (I’ll work on fixing that for some platforms with the rgbw refactor - but that is still a little bit away) - so programs using FastLED shouldn’t be changing it.
|
It looks like the underlying stm32duino core was updated here to allow re#definition of F_CPU stm32duino/Arduino_Core_STM32@a107d29 Now that that's been merged there, what's the suggestion for merging this PR here? Any changes needed, @GianniDPC, or should this be good to merge now as-is? Thank you for all the work on this issue! Much appreciated! |
|
My ¢2: with slight patching of library I've un-broken software Pin access, and now able to compile FastLED library using -DFASTLED_FORCE_SOFTWARE_PINS with both STM32 cores exist: either with "official" STM32 core from ST Microelectronics or with Roger Clarke's Maple port. UPD: to use official STM32 core I wrote build_opt,h in Fire2012 directory with "-DF_CPU=72000000". |
I suggest to change #ifdefs and file names to conform to real life more closely. :) For example, it's wrong to assume that all STM32F103 variants of boards will have the same pin layout, as such, one should check for, e.g, ARDUINO_BLUEPILL_F103C8 when it comes to pin definitions -- while checking for ARDUINO_ARCH_STM32 in more generic fields is pretty o.k. |
Hmm... More portions of patching brings core-independent hardware pins support for STM32, but does not change leds behaviour -- using Roger Clarke's core ends with antsy leds. :( UPD: Downshifting MCU speed to 48 kHz resolves issue, but... |
|
Hi. any update about this PR? greetings |
|
Bumping. Needed this PR to get FastLED to compile for Generic STM32F1 / BluePill F103CB |
|
BluePill boards are now supported. Will be rolled out to the public with 3.7.8 |
|
Sorry, i thought this was an issue with the pins. It looks like this is an issue with F_CPU. Which I haven't investigated. |
6fdf45c to
f18be6e
Compare
|
Everything looks supported now. We have the option for real time instead of F_CPU time timings for the clockless. Bluepill seems to be working too. I don't know even if this bug is still relevant. But I'm closing it and it can be re-opened if needed. |
|
@zackees I think that this should be re-opened. I'm still having trouble getting the Blink example just to compile for a STM32 F103C8T6. I'm using 2.9.0 version of the core and 3.9.7 of FastLED: Core: https://github.com/stm32duino/Arduino_Core_STM32/releases/tag/2.9.0 This gist contains the compilation error for Blink. Most errors are about
|
|
@zackees you pointed out that STM32 support entered in 3.7.8, so I downgraded FastLED to that, and Core to 2.8.1 which is the version which existed at the time, to check if this is a regression, but I'm still getting the same errors. I'd be happy to provide more details to fix this! With FastLED at @GianniDPC's PR I'm able at least to compile and get one of the LEDs of my strip to light up. I didn't do extensive testing on it but there's definitely still some value in this PR! |
|
Thanks, i'll check it out |
|
Hey wanted to follow up and see if any user with the STm32 can rebase this change. I do not use this chipset and can't do any dev work on it. |
|
@lmancini are you using PlatformIO or Arduino IDE? I have used mainline FastLED ( |
|
@zackees I quickly checked on my STM32 test board (using STM32duino core) that with FastLED 3.9.11 I can compile and run a small test program of mine, the same one which I couldn't compile before FastLED 3.9.11 . The new version works on both the Arduino IDE and PlatformIO. Whatever changed between these two versions restored compatibility. Thanks for unknowingly fixing it! 🙂 |
|
yeah a bunch fixes went in. |
I have not tested it extensively, but this should finally fix the compile errors when using STM32duino Core for the BluePill at least.