I'm having a Hard Fault issue with MQX4.2 in the TCP/IP task. I am able to display the exception information (R0 - 3, R12, LR, PC, PSW), but don't know how to find the line that caused the exception since I don't have the assembly list for my code.
I'm using KDS 3.2 and GNU tools for compiling. How can I generate an assembly list file for my code so I can find where the exception is happening?
Is there another way to find where it is happening in the code without an assembly list file?
I can't step through with the debugger since it happens at random, and not on my test board. It only happens when its in the field at a customer site.
Solved! Go to Solution.
See Creating Disassembly Listings with GNU Tools and Eclipse | MCU on Eclipse for an overview with different methods.
There is an option in the compiler settings:
Instead of using the diassembly listing files, you can use the Disassembly view in the debugger while debugging.
For hard faults, I recommend to install a special hard fault handler. Articles on that subject:
Debugging Hard Faults on ARM Cortex-M | MCU on Eclipse
Debugging ARM Cortex-M0+ Hard Fault with MTB Trace | MCU on Eclipse
Debugging ARM Cortex-M Hard Faults with GDB Custom Command | MCU on Eclipse
A Processor Expert Component to Help with Hard Faults | MCU on Eclipse
Debugging ARM Cortex-M0+ HardFaults | MCU on Eclipse
I hope this helps,
Erich
See Creating Disassembly Listings with GNU Tools and Eclipse | MCU on Eclipse for an overview with different methods.
There is an option in the compiler settings:
Instead of using the diassembly listing files, you can use the Disassembly view in the debugger while debugging.
For hard faults, I recommend to install a special hard fault handler. Articles on that subject:
Debugging Hard Faults on ARM Cortex-M | MCU on Eclipse
Debugging ARM Cortex-M0+ Hard Fault with MTB Trace | MCU on Eclipse
Debugging ARM Cortex-M Hard Faults with GDB Custom Command | MCU on Eclipse
A Processor Expert Component to Help with Hard Faults | MCU on Eclipse
Debugging ARM Cortex-M0+ HardFaults | MCU on Eclipse
I hope this helps,
Erich
Thanks.
I tried checking the "Generate assembler listing" option but it created a file called $@.lst and would overwrite it for each file. I had to go into each file individually and put this in for each one with the filename instead of $@. Not sure why it wouldn't replace the $@ with the filename automatically. Anyway, I got list files for hopefully the right file and will send the code to the customer and see what happens.
Will update when I find the bug if its in MQX 4.2.