Repository navigation
stm32duino port (Maple, Blue Pill etc.) - #568
Conversation
|
@focalintent PTAL, and let me know if I can improve anything |
|
@kolyshkin Works great on APA102, but when I used it on WS2813 (a clockless chipset) the animation ran half as fast as the exact same code running on Uno. Any idea could be causing that? Thanks for your work on this! |
|
Seems that when interrupts are disabled in order to send WS281x data then the SysTick isn't running. I set up a sketch to print seconds since program start. Each "second" took 2 seconds. When I disabled FastLED.show() the timer operated correctly. Not sure if this is an issue with this port or Arduino_STM32. I'm hoping there's a way to tweak the interrupt priority so SysTick always runs. |
|
The stm code defaults to not allowing interrupts while writing out WS2812 style led data - you can try changing this by putting: before you include FastLED.h. The initial stm32 code was done for the sparkcore MCUs, and I think I defaulted to keeping interrupts disabled because some of their interrupts always ran too long, but honestly I don't fully remember. |
|
@focalintent Thanks for the suggestion. I tried allowing interrupts and it seems to fix the SysTick issue but then I experience the LED strip glitching or freezing on some animations (but not others, weirdly). I'll keep investigating. |
|
The glitching might be a sign of the WAIT_TIME parameter being a bit off. It also might be the frame retry that attempts to happen if an interrupt takes too long, that can cause some glitching effects - the stm clockless code is out of date compared to some of the others, so comment out lines 32 and 33 in platforms/arm/stm32/clockless_arm_stm32.h: |
|
Would love to see this get merged. What work is still required here? |
|
The pin definitions need to be fixed to be numbers, among other things |
This mostly builds on previous work for SparkCore STM32103 (Cortex M3), and patches from Evey Quirk. Unfortunately, stm32duino distribution does not include a header with definitions for CoreDebug registers and flags etc. (used in ) so they were added to a newly created cm3_regs.h from https://github.com/ARM-software/CMSIS/blob/master/CMSIS/Include/core_cm3.h [v2: changed PIN numbers to be int] Signed-off-by: Kir Kolyshkin <[email protected]>
@focalintent thank you for your review; commit updated accordingly; also rebased to current master |
|
@kolyshkin, what exactly should I do with https://github.com/ARM-software/CMSIS/blob/master/CMSIS/Include/core_cm3.h file to make things work? I get |
|
Maybe it was a problem with FaslLED version, I updated it and now I get |
|
Same as what @Fxlr8 explains here! #elif defined(STM32F10X_MD) || defined(__STM32F1__)
#include "platforms/arm/stm32/led_sysdefs_arm_stm32.h"Where no matter which STM32 platform I select, it doesn't catch this #ifdef. |
|
is there any solution yet ? |
|
@Simon-L per your request: |
|
Please see #741 for latest discussions about |
|
Proposed fix: #742 |
This mostly builds on previous work for SparkCore STM32103 (Cortex M3),
and patches from Evey Quirk @evq.
Unfortunately, stm32duino distribution does not include a header
with definitions for CoreDebug registers and flags etc.
so they were added to a newly created cm3_regs.h from
https://github.com/ARM-software/CMSIS/blob/master/CMSIS/Include/core_cm3.h
Tested on my Blue Pill, works fine