Skip to content
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

Merged
merged 8 commits into from
Nov 19, 2019
Merged

STM32: Neopixel support #2291

merged 8 commits into from
Nov 19, 2019

Conversation

hierophect
Copy link
Collaborator

@hierophect hierophect commented Nov 15, 2019

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

@ladyada
Copy link
Member

ladyada commented Nov 15, 2019

will test if you toss me a bin!

@hierophect
Copy link
Collaborator Author

firmware.bin.zip

@hierophect
Copy link
Collaborator Author

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?

@dhalbert
Copy link
Collaborator

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.

@ladyada
Copy link
Member

ladyada commented Nov 17, 2019

tested with neopixel library and fancyled - works like a treat :)

ladyada
ladyada previously approved these changes Nov 17, 2019
Copy link
Member

@ladyada ladyada left a 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

@hierophect
Copy link
Collaborator Author

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.

@hierophect
Copy link
Collaborator Author

@dhalbert new commit should fix status LED issues.

@ladyada bin if you'd like to try it again with good status LED
firmware.bin.zip

@ladyada
Copy link
Member

ladyada commented Nov 18, 2019

yep neopixel status is now working as expected

@dhalbert
Copy link
Collaborator

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?

@hierophect
Copy link
Collaborator Author

@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?

@dhalbert
Copy link
Collaborator

@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 stm32-neopixel branch version. Hmm.

@hierophect
Copy link
Collaborator Author

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?

@dhalbert
Copy link
Collaborator

@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).

Copy link
Collaborator

@dhalbert dhalbert left a 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!

@dhalbert dhalbert merged commit 1a22d8a into adafruit:master Nov 19, 2019
@hierophect hierophect deleted the stm32-neopixel branch November 19, 2019 14:46
@hierophect hierophect added the stm label Feb 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support neopixel_write on STM
3 participants