Question
Hard Fault with FreeRTOS+FatFS on STM32
Posted on December 08, 2012 at 20:25
Hi all.
I have never really been the RTOS guy but I have decided to give it a try now, especially because of the need of a proper IP stack with Socket integration.So I decided to get the FreeRTOS example with the lwIP stack provided by ST running on my STM32-E407 from Olimex, that contains an STM32F407ZGT6.After successfully adding the FatFS library I was able to both get Ethernet and SD card working great.But then I started making my LCD library and got that working, but when I tried my BMP writing routine, which repeatedly fetches 512 bytes (fills a buffer) from a file the application reads and displays two full buffers but then goes into a Hard Fault.I have tried getting most information out of this Hard Fault exception as possible which can be seen below:[Hard fault handler - all numbers in hex]R0 = 20001158R1 = 1eaf00b4R2 = 80031a5R3 = 80031a5R12 = 20000cacLR [R14] = a5a5a5a5 subroutine call return addressPC [R15] = fffffffd program counterPSR = 80078c2BFAR = 1eaf00b4CFSR = 8200HFSR = 40000000DFSR = 1AFSR = 0SCB_SHCSR = 400I am using the pvPortMalloc(512) to get a pointer to the required 512 bytes buffer, but that didn't fix the problem.You can download the CoIDE project (IDE for GCC compiler) and have a look for yourself:http://www.tkjelectronics.dk/uploads/TheBlastFootball_FreeRTOS_HardFault.zip
I really hope that someone can bring me some suggestions.Best RegardsThomas Jespersen #freertos #fatfs #lwip #hardfault