cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F7-FFS-FreeRTOS Hard Fault

Jona
Associate III

I am working with a sample project for the stm32F746G. Testing on the Discovery Board. I am using VisualGDB.

The project is USB Device | MSC Host RTOS.

After importing the project and tweaking a few things It did run.

(However, all of these projects need _write() added to them in some way (syscalls.c? ) in order for them to actually printf to the LCD. But that's for another time. )

When I set LFN to 3 in ff_conf.h for long file names, the example will hit a hard fault after printing just a few of the file names on the USB flash drive.

The Call Stack says prvPortStatFirstTask() is the culprit. Though I would have thought the first task would already have occurred . But I am relatively new to ffs and FreeRTOS.

the HFSR has FORCED set.

The CFSR has PRECISEERR and BFARVALID set. (checked)

BFAR is set to 0x5f34305f (no man's land! )

I thought it might have something to do with the stack size of the task but increasing it didn't help and I believe the CFSR register contents rule that out?

I've seen this twice so far when working with examples but I haven't been able to get anywhere with it.

I am afraid I am not savvy enough to track this one any further. So ANY hints would be extremely helpful!

I am happy to provide any more info!

1 REPLY 1
Jona
Associate III

[SOLVED]

The example project I was working on had a 14 byte buffer for the file name from ffs.

When I turned on long filenames, up to 255 characters, (LFN=3) in FFS, it hard faulted

because the file names exceeded the buffer.

What took me so long was that I was following the Call Stack , which ultimately pointed to "svc 0"

assembly instruction which really means that the fault was in the task, not on the task switcher code. I kinda get that part but I am not an ARM assembly coder.