I am using STM32H7 board and integrated an SD card using SPI and able to mount it in "/". I am storing a file inside the SD card.
- 5 replies
- 2391 views
HAL_Delay (500);
fresult = f_mount(&fs, "/", 1);
if (fresult != FR_OK)
Serial_PutString ("ERROR!!! in mounting SD CARD...\n\n");
else
{
Serial_PutString("\n\r SD CARD mounted successfully...\n\n");
fresult = f_open (&fil, "zephyr_20210506_nbiot_quad_12ec59.bin", FA_READ);
result = Ymodem_Transmit(&fil, (const uint8_t*)"zephyr_20210506_nbiot_quad_12ec59.bin", 5601949);
My requirement is to pass the start address of the file stored in SD card to the function "Ymodem_Transmit" and transfer file using Y MODEM protocol to some other microcontroller connected to STM32. I used SD card because the above mentioned file is of large size which cannot fit in internal flash of STM.
Remaining small files i am putting in flash and reading by giving the address in flash as below
result = Ymodem_Transmit((uint8_t*)APPLICATION_ADDRESS, (const uint8_t*)"sbl_7243i_v1.0_test.bin", size);
where #define APPLICATION_ADDRESS (uint32_t)0x08100000
Complete implementation is given in the attached code.
I am not getting the starting address of file by giving like this.
result = Ymodem_Transmit(&fil, (const uint8_t*)"zephyr_20210506_nbiot_quad_12ec59.bin", 5601949);
Is by passing &fil will get the address of file stored in SD card?
Or otherwise what i need to get access the file in SD card.
Waiting for the reply. Please help...
Thanks,
Jestina
