CAlex
Contributor
2 years agoCycloneVsoc baremetal with SDMMC issue
Hi
Im using micro sdcard to receive the data from the HPS.
What I want to achieve is that store some data when HPS is running, after it shut down, I can take out the data and analysis the data.
My operation flow looks like this:
Clk ticking ---> buffer take the data of lastest period of time ---> STOP sig ---> Clk stop ticking ---> buffer send data to the SDcard --> take the sdcard and read the data inside form my computer
I made some test using the baremetal example form yours, the codes are shown:
hps_fifo_pop(&SERDES_Y_FIFO, data_out); // a simple circular fifo api
alt_sdmmc_write(&HPS_FIFO_CARD_INFO,0x00000000, data_out, sizeof(uint32_t));
alt_sdmmc_read(&HPS_FIFO_CARD_INFO,&data, 0x00000000, sizeof(uint32_t));
RTOS_PRINTF("data from the sdcard is %lf.",data);
RTOS_PRINTF("\n");
RTOS_PRINTF("data from the fifo is %lf.",*data_out);
The result are shown:
data from the fifo is -0.154103.
data from the sdcard is 0.000000. <=== should be the same number from the fifo
The questions are followed:
1. Does the micro sd need some file system? So that I can read form my computer?
2. Why the two data doesn't match? How can I fix it?
Thank you for your help
Alex