cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F407ZG + FATFS + FREERTOS + CMSISv1

MSilv.1
Associate II

Sorry about my English.

I am doing a project, where, since I put the CMSISv1, the FATFS is freezing. Before I put FreeRtos, the FATFS work very fine, but now, its freezing.

I a using debug, i see that, if using rtos, the fatfs forces the lock file, and call the ff_req_grant function, inside Syscall.c (fatfs file). This function, calls:

if(osSemaphoreWait(sobj, _FS_TIMEOUT) == osOK).

Well, this osSemaphoreWait, cal anothers functions, but the problem is all is freezing in the:

configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );

I do not know what happening, or whats setting i need to do in SDIO or FATFS, I have tried all, since DMA up to Interrupts on SDIO. Nothing worked..

Anyone know what i need to do?

Annexed, the .ioc

Thanks all, and if I need supply more information, let me know

Moacir Jr.

4 REPLIES 4
Jack Peacock_2
Senior III

Do you actually start the FreeRTOS scheduler? What does xTaskGetSchedulerState() return?

Jack Peacock

MSilv.1
Associate II

I am delete this project, and made a new. The file .ioc e the main.c is here annexed. What happening now.

FreeRtos using CMSIS v1, and task stack size is width 1024, 2x more greater than 512.

The SDIO is with DMA on TX and RX and with NVIC interrupt in the SDIO. All pins, except SDIO_CLK, are with pull_up.

The fatfs now, when I call the f_mount, with debug, the system generate a HardFault_Handler. I cant see where is having this problem.

If I remove DMA from SDIO, then HardFault from f_mount not happen anymore, but return DISK_ERROR.

The SDIO preescaller is in 20, and the clock of AHB1 and AHB2 for the peripheral, is with 42MHZ. (I tried since preescaller= 2).

Without FREERTOS, all works very well, with SSDIO preescaller in 8.

Any Ideas?

MSilv.1
Associate II

i cant put 2 files? this is the ioc

Thanks for return.

I do not know. I think yes... I am starting the osKernelStart(), i think he starts all of this. About the xTaskGetSchedulerState, i need to see... I will return.