Closed laurienzu closed 3 years ago
I would really appreciate NeoPixel support for STM32F1, too.
I've tried the lib, but only get this, when building for my BTT Mini E3 v2.0:
Building in release mode
*** [/home/cf/.platformio/packages/framework-arduinoststm32-maple/STM32F1/variants/generic_stm32f103r/board.cpp]
/home/cf/src/Marlin2x_cf/.pio/build/STM32F103RC_btt_512K/.sconsign38.dblite: No such file or directory
==================================================== [FAILED] Took 6.20 seconds ====================================================
I would really appreciate NeoPixel support for STM32F1, too.
I've tried the lib, but only get this, when building for my BTT Mini E3 v2.0:
Building in release mode *** [/home/cf/.platformio/packages/framework-arduinoststm32-maple/STM32F1/variants/generic_stm32f103r/board.cpp] /home/cf/src/Marlin2x_cf/.pio/build/STM32F103RC_btt_512K/.sconsign38.dblite: No such file or directory ==================================================== [FAILED] Took 6.20 seconds ====================================================
Did you add the library to lib_deps?
Yes, at least I think so.
I replaced the default 1.5.0 lib with the URl from above:
#NEOPIXEL_LED = Adafruit NeoPixel@1.5.0
NEOPIXEL_LED = https://github.com/ccccmagicboy/Adafruit_NeoPixel/archive/master.zip
src_filter=+<src/feature/leds/neopixel.cpp>
Try to add this under your board in platformio.
lib_deps = ${common.lib_deps} Adafruit NeoPixel=https://github.com/ccccmagicboy/Adafruit_NeoPixel/archive/master.zip
Aren't you supposed to enter the location of Delay.h into the Adafruit_NeoPixel.cpp file as well? https://github.com/ccccmagicboy/Adafruit_NeoPixel/commit/087d9f714e104426029b7cbbddfd8bae7371710d
Ps. the ccccmagicboy fork just appears to be a clone of CommandoreBombardiero work: https://github.com/CommandoreBombardiero/Adafruit_NeoPixel
Aren't you supposed to enter the location of Delay.h into the Adafruit_NeoPixel.cpp file as well? ccccmagicboy/Adafruit_NeoPixel@087d9f7
Ps. the ccccmagicboy fork just appears to be a clone of CommandoreBombardiero work: https://github.com/CommandoreBombardiero/Adafruit_NeoPixel
Yes you need to put the location of Delay.h but I hope there is a way to do so automatically if this library will be implemented
Ok, I'm getting so far, that it complains about the Delay.h now, but since I don't even know where the Delay.h actually is, this is where I fold for now. But I'm still happy to test if someone creates a pull request or similar.
change the path for delay.h to
Its already in my fork, just update the following in platfomio.ini to try it. NEOPIXEL_LED = Adafruit NeoPixel=https://github.com/ellensp/Adafruit_NeoPixel
@Loreagle unfortunately this method only works for some.. there are other factors in play. Its not the full answer, its 1/2 an answer at best
@Loreagle unfortunately this method only works for some.. there are other factors in play. Its not the full answer, its 1/2 an answer at best
If I'm not wrong I tried with your library before and It was working only sometimes, when recompiling colors were messed up. With this library, at least on my robin nano 1.2, I tried recompiling a lot of times and always worked.
The Marlin delay function is currently off by about 50% for these STM32F1 boards, which throws off timing. Itβs probably on the edge of working properly, so behaved erratically.
There is an open PR to improve delay timing, but I have admittedly been holding it up on my own testing.
I got it almost working - you can check the required repositories here:
The only thing that does not work is turning the neopixel off: One green LED stays on. All other colors seem pretty stable.
@sjasonsmith Which PR is open regarding the delay timing?
I got it almost working - you can check the required repositories here:
Does it work on all STM32F1
boards or just those used in the CR6SE? The main issue (and why it's disabled in the main Marlin repo) is that NeoPixels works/mostly works on some STM32F1
boards & not others.
Does it work on all
STM32F1
boards or just those used in the CR6SE?
Let's just say on the BTT SKR CR6 board. My remark, just like the ones before me, is for the tinkerer which wants to play on his own with the neopixels.
That said, a worthy alternative might be the FastLED library which does appear to support STM32 at first glance (but it needs more research).
There's also https://github.com/rogerclarkmelbourne/WS2812B_STM32_Libmaple that makes use of the SPI's DMA engine on STM32 to generate the right timing (so it's not dependent on a correct DELAY_NS) function. It should be compatible with NeoPixel API
I propose to implement a FastLED path since IMHO NeoPixel is a dead end. It's too heavy on performance (it burns CPU for generating timing which is a no-no for realtime system like Marlin) and breaks systick period on some platforms.
There's also https://github.com/rogerclarkmelbourne/WS2812B_STM32_Libmaple that makes use of the SPI's DMA engine on STM32 to generate the right timing (so it's not dependent on a correct DELAY_NS) function. It should be compatible with NeoPixel API
Yes, but that doesn't work unfortunately for boards that actually use SPI for other things, like SD card communication.
Yes, you are right. I've just started studying the mess of handling WS2812 on STM32. So far, I'm leading to these conclusions:
I'm currently reading the code for each project to find out what would be the easiest and most powerful solution.
For STM32 I'd say that flash and RAM budget is not very important. I have a RET6 processor and plenty of flash space and free RAM.
But it seems that Neopixel implementation would need to be delegate to the HAL possibly. Good digging you did @X-Ryl669!
I found one approach that used a timer to trigger DMA to GPIO registers. In this way you were not coupled to specific pins on the board, and you could send unique patterns to many strands with a single timer, as long as they are all in the same GPIO port.
I was going my to try it, but had too many conflicts for my time.
Do you have some documentation or link about your tests ? Is it in one of your branches ? Was it described from this page ?
Yes, that seems to be it. I now see that it takes three DMA channels. I suppose that will be the next scarce resource to fight over.
With #20901 and @ellensp's fork, it's working perfectly on WS2812b strip and STM32F1:
Green M150 I0 P255 B0 R0 U255
Blue M150 I0 P255 B255 R0 U0
Red M150 I0 P255 B0 R255 U0
Black M150 I0 P255 B0 R0 U0
All reds M150 P255 B0 R255 U0
@Loreagle The bugfix branch now include the fix. Please test on your side, and if it's ok for you, close the issue. Thanks!
@Loreagle The bugfix branch now include the fix. Please test on your side, and if it's ok for you, close the issue. Thanks!
Unfortunately I'm using klipper now and I can't test it but if it's working for you I think is okay since I have a sapphire pro with robin nano too π
I will test it on my BTT SKR CR-6 board.
Met vriendelijke groet, Sebastiaan Dammann
Van: Lorenzo notifications@github.com Verzonden: Saturday, February 6, 2021 12:23:47 PM Aan: MarlinFirmware/Marlin Marlin@noreply.github.com CC: Sebastiaan Dammann sebastiaandammann@outlook.com; Comment comment@noreply.github.com Onderwerp: Re: [MarlinFirmware/Marlin] [FR] Neopixel support on STM32F1 (#19800)
@Loreaglehttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FLoreagle&data=04%7C01%7C%7C71e63f014a9647f3131608d8ca91ac1f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637482074295673636%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=HKE4Sdr7pXv7L3jAO5E4CnKzxVMF6kDDDXNjMLPLhqM%3D&reserved=0 The bugfix branch now include the fix. Please test on your side, and if it's ok for you, close the issue. Thanks!
Unfortunately I'm using klipper now and I can't test it but if it's working for you I think is okay since I have a sapphire pro with robin nano too π
β You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FMarlinFirmware%2FMarlin%2Fissues%2F19800%23issuecomment-774457263&data=04%7C01%7C%7C71e63f014a9647f3131608d8ca91ac1f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637482074295683636%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=jBCtKAPcXqYdRX430jt225K2wjaB6pXAMFBZ%2B91eEoQ%3D&reserved=0, or unsubscribehttps://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAAK4FMP5SBZIMIVACGZ24STS5UREHANCNFSM4SVHQTFA&data=04%7C01%7C%7C71e63f014a9647f3131608d8ca91ac1f%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637482074295683636%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=YgtRaNNUy6J18U%2BaZ%2FjbPbGojikTgI1v2w7G1FsbSXM%3D&reserved=0.
@X-Ryl669 Yes, it works perfectly!
Perfect I can close this so! Thanks :)
Perfect I can close this so! Thanks :)
Can you? I think the warning in the sanity check still needs to be removed.
Perfect I can close this so! Thanks :)
Can you? I think the warning in the sanity check still needs to be removed.
Has this been fully tested on more than one STM32F1
board?
I'd like to see it tested on more boards before we declare it working on all since we already get enough support requests about NeoPixels on STM32F1
(even with the sanity check) as it is.
Reopening for further testing/discussion.
To collect working board, mine: MKS Robin Nano V1.2 (the mks_robin_nano35) is working.
@X-Ryl669 which Neopixel library do you use? I get this error _.pio\libdeps\mks_robin_nano35\Adafruit NeoPixel/Adafruit_NeoPixel.h:361:3: error: 'GPIOTypeDef' does not name a type with the default Adafruit NeoPixel@1.5.0 lib
Yes, under the particular [build_configuration_name]
you are using, redirect the Adafruit Neopixel library like this:
custom_marlin.NEOPIXEL_LED = Adafruit NeoPixel=https://github.com/ellensp/Adafruit_NeoPixel
Confirmed working on a BTT SKR Mini E3 v1.2. Disabled the sanity check and pointed at @ellensp's neopixel fork, and it seems to work great.
Confirmed working on a MKS Robin E3D V1.0 (003)
Having trouble getting Neopixels to work with me SKR Mini E3 v2. I just have a small strip of 8-LED's to put near the nozzle, and I can't quite figure it out. Has anyone else gotten it to work? I'm fairly new to this so I'm not sure if/what I'm doing wrong. Looking back at my compilation of Marlin f 2.0.7 the platformio.ini looks different and had Neopixels listed and you could change the path to the library. I got the bugfix of Marlin 2.0.8 and I don't see that and I'm not sure how to add/change libraries. Could someone help me please?
Having trouble getting Neopixels to work with me SKR Mini E3 v2. I just have a small strip of 8-LED's to put near the nozzle, and I can't quite figure it out. Has anyone else gotten it to work?
Neopixels are not supported on STM32F1 at this time.
@thisiskeithb ok, thanks!
@bingston they're not supported, but with a couple of code tweaks, they can be made to work. Read back through the comment thread here, a number of us have it working. The best solution right now is to change the neopixel library to the fork by @ellensp.
You can look at my Marlin fork to see what I had to change in platformio.ini.
@floppy only unreliably they take to many resources away from Marlin, the more LEDs you have the worse it gets.
Boards under STM32F1/maple are being migrated to the STM32 HAL, so this feature request will no longer apply as NeoPixels work under the STM32 HAL.
@thisiskeithb that's fantastic news, thanks!
Anybody knows when this is released? I am using a non maple version 2.0.9.1 for my btt skr mini E3 v2 but it is super laggy and the performance of my printer has dropped.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
I discovered that Neopixels works perfectly on my MKS Robin Nano 1.2 using this library:
Adafruit NeoPixel=https://github.com/ccccmagicboy/Adafruit_NeoPixel/archive/master.zip
It would be nice to add it to lib_deps at least for Robin Nano, remove sanitycheck error and also add LED_PIN in pins file :)