I am attempting to step through a freertos based application on an IMX8DXL1 but whenever I hit pvPortStartFirstTask() (when starting the scheduler) and it runs the assembly code it triggers a HardFault and my debug session exits. I am currently using the basic hello world freertos example that is included with the IMX8 SDK which is running on the CM4 of the IMX8DXL1. I am using a SEGGER JLink debugger and their Ozone IDE which has the FreeRTOS awareness plugin enabled and still I have this issue. The application runs fine outside of a debugger, but of course I am trying to figure this out on a hello world app to debug a more complex ISR issue on a different project. Any pointers? I am a freertos noob and mostly live in Linux land.
This is a very strong indication that something is wrong with the debugger setup. Read this post in Segger forums which says that you need to modify .jdebug
file to let the ROM bootloader run. Likely you need to leave the functions AfterTargetDownload()
and AfterTargetReset()
empty (but not commented out) in your .jdebug
file.
Hmm, i’m not sure this is the same issue as I am able to start and execute the core and even step through up to the point vTaskScheduler is called. Once i step into that and it gets down to pvPortStartFirstTask it crashes. I did try out commenting out this function bodies with no luck on fixing the HardFault. That being said I tried an old image on my EVK and it seems to work, so I’m now suspicious this is likely some memory mapping issue in our BSP after updating it, but I’m not too certain. Anyways, thank you for the response, I’ll keep hacking away at this.
You can refer to this document to find out the exact faulting instruction.