-
Notifications
You must be signed in to change notification settings - Fork 622
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
RPi0W: SD card errors while running around 40 LEDs #224
Comments
Change the dma channel to 10. The default dma channel 5 now clashes with recent OS versions |
This seems to have abated the problem for now, thanks! Is there a command to figure out which DMA channels are reserved by the OS? My system info:
|
Not that I know of. This snippet of code might be a good start: |
I had the very same problem of OP with DMA channel 5. I think that the documentation should be updated and the code should use DMA channel 10 by default. I do not know which DMA channels are safe to use, so I'm not posting a pull request right now. However this forum post says:
|
Going to confirm that after running into the same issue with the latest version of raspbian, switching the DMA to 10 fixed my problem. All this after 15 Pi W's, 15 SD cards, multiple power supply swaps, and much head>desking. Thank you for the solution! I would also recommend that the DMA be switched to 10 in the docs. While 5 "should be acceptable" it clearly isn't. So a solution that works is better than a solution that should work in my opinion. Also, Thanks for the hard work in general. This library is totally awesome! |
@totterfree I just submitted a pull request to change the defaults and add a note in the documentation. IMHO it's important for the default settings to be safe. |
Do you know how safe dma 10 is ? 5 was safe ... |
We used dma=10 in production on two Raspberry Pi 3 Model B mounted on two drones, controlling both flight and lighting. There were no filesystem problems and the drones kept flying :) |
Ok, I found some official documentation. The Raspberry Pi 3 Model B, in the latest Raspbian, has a file called According to the Linux kernel documentation, this file contains the
For my Raspberry Pi 3 Model B, this file contains four bytes: I guess that the first 2 bytes (the first 16 zeroes) are not significant since the RPI's DMA has only 16 channels. Update (2018-01-01): sorry, I started counting from the most significant byte, opposite to the specification... the reserved channels should be: 0, 1, 3, 6, 7, 15. The strange thing is that 5 isn’t marked as reserved. |
And this is where the Pi is a bit crap. At least it’s documented now in the readme! |
oh man, this was causing a crazy amount of errors on my pi 3b. I was thinking my sdcard was dying, haha. Is it a problem with all pi's on their newest firmwares now, or just the 3b/zero W? If it's only a subset, it might be worth it to just have no default set, if there's no guaranteed safe default. |
I suspect it’s all models on newer firmware (or kernel - I don’t know which is responsible) |
I'll try to downgrade my kernel/firmware later and see if I can bisect it to a specific version, if I have time. My suspicion is that it's baked into the kernel rather than done at the firmware level, but they're coupled anyways. edit: my internet for the holidays is awful; guess I'll have to try again in a few weeks |
I can confirm this happens to recently purchased raspberry pi zero w's on the latest lite image. We switched to DMA 10. No more corrupt SD cards so far. Every so often, we see a blip or two in animations after they've been running for awhile, but that could be something going on in our application. Kind of curious to try 0, 8, 9, 12, 14, or 15 to see if one of those smooths things out |
Guys, # Create NeoPixel object 2 LEDs, 64 Brighness GRB leds
strip = Adafruit_NeoPixel(2, gpio_led, 800000, 5, False, 64, 0, ws.WS2811_STRIP_GRB) I think the code should fire a python warning/error if DMA used is 5, like this LED will not work but save your SD Card or OS, Because we can't guarantee that there is not sample code or code with DMA setup to 5 anywhere, by precaution, at least fire a big warning. Anyway after 2 days, found my issue ;-) |
The problem is that we have no way to query the OS for which DMA channels are free to use. |
yeah, some versions use it, some don't; it's pretty much all undocumented, right? The defaults are just kinda shots in the dark so there's no real point in warning at all; it's kinda expected to read the readme and stuff. |
Switch to use DMA channel 10 for LED control as per issue jgarff/rpi_ws281x#224.
Switch to use DMA channel 10 for LED control as per issue jgarff/rpi_ws281x#224.
phew, so glad I found this thread. was battling to fix this for hours! |
…5 might corrupt the OS! jgarff/rpi_ws281x#224
Rrunning the test
sudo ./test -c
produces SD card errors indmesg
:[33490.769029] mmcblk0: error -110 transferring data, sector 137216, nr 16, cmd response 0x900, card status 0xc00
More verbose log here: https://pastebin.com/AZUijQmW
This error will pop up every few minutes if I leave the test running just by itself. With my other processes running (full project: https://github.com/pinheadmz/ClockJr) these errors pop up as frequently as every few seconds.
My project displays the "rainbow wheel" effect for a few seconds then stops and goes blank. A few seconds later I will see this mmcblk0 error in dmesg.
I've been through FOUR SD CARDS, all different brands. It's not the card.
The text was updated successfully, but these errors were encountered: