-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
STM32: Neopixel support #2291
STM32: Neopixel support #2291
Conversation
will test if you toss me a bin! |
Also, just wanted to check on the expected behavior of the on-board neopixel. On my Atmel control, it is green during runtime and flashes yellow when reset, but on my ST board, it only flashes yellow when reset and is otherwise dark. Is this a bug or a version difference? |
The Atmel behavior is the expected behavior. The yellow is a 700ms window when you can click again and get into safe mode. So sounds like the RGB status setup on the STM Feather is not correct. |
tested with neopixel library and fancyled - works like a treat :) |
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 hardware only, didn't do stylistic review
Looks like I missed some manual reset conditions in Microcontroller related to the rgb_status shared binding. I'm working on that now, should resolve how the Neopixel isn't consistently showing green during runtime properly. |
@dhalbert new commit should fix status LED issues. @ladyada bin if you'd like to try it again with good status LED |
yep neopixel status is now working as expected |
I'm seeing a brief bright flicker on the pulsing green NeoPixel (before entering REPL), and when I enter REPL then NeoPixel is extremely bright. Do you see this? |
@dhalbert I don't see any differences between my board and my m4_express. I assume you're using the binary in my latest post? |
I pulled from your repo and am building the latest |
You could try the binary, but it's possible I still missed something about the status LED guts - can you give me exact repro steps? And when you say extremely bright, is it as bright as the max LED strength if you plug in 0 FF 0 in a test sketch? |
@hierophect That STM Feather board is bad in some way. I have another board that works fine. Also the bad board is very difficult to get into DFU mode (though it gets into REPL just fine). |
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.
OK, tested good on a good board!
This PR adds Neopixel support to the STM32 port. Tested on a Feather F405 with success. This implementation uses the DWT->CYCCNT to avoid conflicts with Systick timing and allow use in a disabled interrupt context.
Timings are roughly borrowed from the Arduino implementation, but I found they did not work in practice with either external neopixels or the on-feather one, so adjusted magic values had to be used instead. In addition, I'm not entirely certain why the DWT access register assignment
ITM->LAR = 0xC5ACCE55
isn't required. These issues might warrant another look at a later time.Resolves #2264