-
Notifications
You must be signed in to change notification settings - Fork 120
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
stuck DMA in sd_readblocks_sync #18
Comments
Sounds like your SD and UART pins are overlapping
the prototype SD card code u r using does not deal with higher clock frequencies automatically;l you should set |
I am using the Pimoroni VGA demo board. My understanding of that is that for that the UART overlaps 4-pin SD Card, but not 1-pin. |
As a work around of the SD card issue, I am just using a loop to call sd_readblocks_sync() multiple times with count=1, incrementing the sector number and buffer pointer after each call. That seems to be working for the moment. |
I am getting this same stuck DMA channel error trying to use SD card on a Pimoroni VGA demo board but its inside the Here is my code.
The message I get in the console is
It never completes the sd_init_1pin() call. What is odd is even when I disconnect the pico from the Pimoroni VGA demo board I get the same error. So the only conflict could be the usb connection. What am I missing? |
I've never actually tried it with USB - there could be a problem there |
I have ruled out USB, I built the sd card circuit on a breadboard, tried different card readers etc and used UART with pins GPIO-0 and GPIO-1 just to be sure there was no conflict with the I/O lines. Also slowed the clock speed down to match the sd_card_test.c code to 48Mhz, and then switched to using exactly the same pico-extras sd_card_test.c program. I get the same error with the sample code. I am still getting the same stuck DMA message in the init function.
The error source is right in the middle I think of
I changed
|
There was a silly inverted flag bug in |
I have the latest SDK and Extras code from yesterday. I checked the inverting |
Hello! I'm having the exact same problems using the sd_card_test.c program. I can even reproduce the same crc error if I try to change the DMA channel. Did you ever figure out what was wrong and how to fix it? Thanks! |
No I never solved the issue with the SD card code from pico-extras. Instead I developed my own code using SPI, implemented using PIO as the SD Card on the VGA demo board is on the wrong pins for Pico hardware SPI. You can find the low level code (sd_spi.pio and sd_spi2.c) in a couple of my repos, including https://github.com/Memotech-Bill/PicoBB/tree/master/src/pico. Also in that repo is wrapper code which implements much of stdio.h with a LFS file-system on Pico Flash memory and FAT on the SD card, see lfswrap.h and associated files. |
Thanks for the reply. I'm afraid that SPI may not be fast enough for what I'm trying to do. I'm trying to stream high sample rate audio to the SD card at 10.4 megabits/sec. Would you happen to know how fast your library can write? |
Sorry, no I have never done a speed test. My library is "good enough" for what I need so I have not had any need to investigate actual performance. |
After having initialised SD card access using sd_init_1pin(), calling sd_readblocks_sync() with a count > 1 results in the following error message:
stuck dma channel 11 rem 00000002 1 @ 12
The following information may or may not be relevant:
My CMakeLists.txt file includes:
I am running scanvideo on core 0, and usb_host (hid) and sd_card on core 1.
My Pico is clocked at 200MHz.
I have found that after calling sd_init_1pin(), it is necessary to call setup_default_uart() again in order to obtain any further UART output.
The text was updated successfully, but these errors were encountered: