STM32Cube_FW_F4_V1.18.0 + SDIO + FATFS R0.12c doesn't work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-12-02 7:56 AM
I tried to use the FAT file system with a SD card and the SDIO protocol, but with the v1.18.00 of stm32Cube for F4 MCU's doesn't work correctly, I discovered the next issues.
1.- Inside of the FATFS configuration if the DMA tamplate is enable this module doesn't work
2.- BSP_SD_Init() isn't called nowhere endded I need to call manually after MX_FATFS_Init().
3.- DMA template is mandatory if FreeRTOS is enable.
Now, this issues didn't watch in the version v1.17.00 of
stm32Cube for F4. The same programe is funcional in this version but not in the v1.18.00.
Any idea regarding this topic? Is necessary to enable the DMA module to work with the protocol SDIO ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-12-07 2:31 PM
Thx.
Ill take a look at your config and see if it differs for the cube defaults.
I agree i need to walk all the code up to the first read failure.
I get back to you shortly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-12-07 4:30 PM
fatfs has built in routine to test it: test_diskio
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-12-07 5:34 PM
I was thinking of something a bit more rigorous.
That test would be better if it used different data patterns on each run, and tagged each sector uniquely.
I would test FatFs in READONLY mode first with large files containing LFSR data streams, a few dozen lines of code good of megabytes of unique data.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-12-07 6:34 PM
[Solution]
----------------------------------------------------------- main
.c
-----------------------------------------------------------
Call this function before MX_FATFS_Init
BSP_SD_Init();
>>>>>>>>>>>>
This part if just if you want to use FATfs + FreeRtos
Create a queue with the name of
SDQueueID
example:
osMessageQDef(SDQueueID_, 16, uint32_t);
SDQueueID = osMessageCreate(osMessageQ(SDQueueID_), NULL);
-----------------------------------------------------------
sd_diskio.c
-----------------------------------------------------------
put the SD QueueID declaration how to extern:
extern
osMessageQId SDQueueID;-----------------------------------------------------------sd_diskio.c
-----------------------------------------------------------
Delete the static in the
SDQueueID declaration;
static
osMessageQId SDQueueID;>>>>>>>>>>>>
//void BSP_SD_WriteCpltCallback()
void HAL_SD_TxCpltCallback(SD_HandleTypeDef *hsd)
{ osMessagePut(SDQueueID, WRITE_CPLT_MSG, osWaitForever);}//void BSP_SD_ReadCpltCallback()
void HAL_SD_RxCpltCallback(SD_HandleTypeDef *hsd)
{ osMessagePut(SDQueueID, READ_CPLT_MSG, osWaitForever);}- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-12-07 7:35 PM
Please check my suggestion
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-12-08 9:15 AM
Work fine, many thanks !!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-01-28 11:39 PM
Roberto's fix to rename the call back functions, along with the fix in the note below got it working for me.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-01-29 8:50 AM
Hi,
Could you please make a check using last CubeMX version (4.24) and last STM32CubeF4 package version (1.19).
-Amel
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-01-30 2:16 PM
Hi Amel,
Will I be able to roll back to CubeMX 4.23 if I do so? I'm in the middle of a project and don't want to have to solve other problems if they come up.
Cheers,
Daniel- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2018-01-31 6:34 AM
Hello Atmel, I was testing the new release (1.19), but i discovered new issues, If I try to generate a new project with FreeRTOS some files aren't installed and the project doesn't build
