Spark Logic

ws2812b… again… Sorry… on F4

Nutsy Sat Mar 24, 2018 11:45 pm

So with my project I need to use addressable leds again…

However rogers library hes bundled with the stm32core isnt compiling with the f4vet6 genric core.

https://pastebin.com/6UmWGUJJ the compile command line….

Im already using SPI1 so i changed the hardware spi call to SPI2, didnt work…

i had assumed the spi calls are identical between the two cores. Am i missing something?

Replies

stevestrong Sun Mar 25, 2018 9:06 am

You are not allowed to mix the cores.
Either use Roger’s one, or stick to generic as detected from your log:
Arduino\hardware\STM32GENERIC\STM32\libraries\SPI\src/SPI.h

Nutsy Sun Mar 25, 2018 10:35 am

Oh….

In that case what else would I need to do to get the library to run?

Nutsy Sun Mar 25, 2018 11:00 am

And to add, just tested, It also doesnt compile on rogers F4 core. Only the f1 cores.

stevestrong Sun Mar 25, 2018 12:53 pm

If you would post the error codes we might be able to help.

Alternatively, you could give it a try with my repo, is further developed than Roger’s core regarding F4 stuff.

Nutsy Sun Mar 25, 2018 1:15 pm

I commented out wireing private, as it was included but was an empty file….

installed your core

https://pastebin.com/dLARf02H

my guess is something to do with the way it calls dma transfer. i honestly dont know… My brain is turning into mush

stevestrong Sun Mar 25, 2018 1:24 pm

I see, there is a missing DMA related function in the SPI lib for F4.
It needs to be implemented, which takes time, a missing ingredient.

Nutsy Sun Mar 25, 2018 4:24 pm

Im assuming just copying the f1 SPI library wont work?

stevestrong Sun Mar 25, 2018 4:47 pm

It won’t work, the DMA of F4 is different from F1.

mrburnette Sun Mar 25, 2018 5:09 pm

[stevestrong – Sun Mar 25, 2018 9:06 am] –
You are not allowed to mix the cores.
…

Words of pure wisdom. … in addition to not mixing the cores, one also should not cross-the-streams.

Egon: Don’t cross the streams.
Peter: Why?
Egon: It would be bad.
Peter: I’m fuzzy on the whole good/bad thing. What do you mean “bad”?
Egon: Try to imagine all life as you know it stopping instantaneously and every molecule in your body exploding at the speed of light.
Raymond: Total protonic reversal.
Peter: That’s bad. Okay. Alright, important safety tip, thanks Egon.

Image

Nutsy Sun Mar 25, 2018 6:47 pm

That would be bad :p

Nutsy Mon Mar 26, 2018 6:31 pm

So do you feel this library would work, if the SPI library was updated to include all the functions?

mrburnette Mon Mar 26, 2018 6:56 pm

[Nutsy – Mon Mar 26, 2018 6:31 pm] –
So do you feel this library would work, if the SPI library was updated to include all the functions?

Is that not what Steve implied here?

[stevestrong – Sun Mar 25, 2018 1:24 pm] –
I see, there is a missing DMA related function in the SPI lib for F4.
It needs to be implemented, which takes time, a missing ingredient.

Frédéric (and team) have done a good job with the Nucleo F4 boards
STM32F4

  • Nucleo F401RE
  • Nucleo F411RE
  • Nucleo F429ZI
  • Nucleo F446RE
  • STM32F407G-DISC1

and the wrappers for CubeMX + HAL.

The F4 support in libmaple has been somewhat weak from the start; Steve has made remarkable inroads with advancing the code, but I understand priorities and time constraints – which is why I simply shy away from backend core work … difficult to please the crowds.

IMO, the longterm solution to STM32 & ArduinoIDE is the https://github.com/stm32duino/Arduino_Core_STM32 … it is Official, it is supported, it utilizes current STM thinking on tools, and migrating to pro-tools is straightforward.

Ray

stevestrong Mon Mar 26, 2018 10:12 pm

[Nutsy – Mon Mar 26, 2018 6:31 pm] –
So do you feel this library would work, if the SPI library was updated to include all the functions?

Yes, it is the function dmaSendAsync(), which was implemented by Victor for F1.
It is not yet ported to F4.

stevestrong Sat Apr 07, 2018 8:20 am

I have ported the dmaSendAsync() function to my F4 repo, you may give it a try.

Nutsy Sun Apr 08, 2018 11:00 pm

I havnt got my main dev computer running…

But i just tried to compile the strand test, copying the library over from the f1 lib directory… and commenting out the wire private include.

Sadly still didnt compile…

https://pastebin.com/Ey5Hf2rs << the error

stevestrong Mon Apr 09, 2018 8:13 am

You should get my repo, it was updated 2 days ago with the changes related to “__IO”

Nutsy Mon Apr 09, 2018 10:14 am

I really thought I did… :/

Will try again now.

stevestrong Mon Apr 09, 2018 11:31 am

I have corrected the errors occurred during conflict merging the __IO stuff.
It should compile now error free.

Nutsy Mon Apr 09, 2018 1:04 pm

Excellent… I cant do an in depth test with regards to the neo pixels… but it does indeed compile. When i get my main rig back up and running (waiting for PSU) i can do a propper test :D

Thanks Steve, this is a great help :)

Sign in to reply