Hi All,
I am uisng MQX 3.8 and TWRK60N512. I want to know how to get information from the PSP and MSP memory dump in unhandled interrupt message.Below is an example memory dump.
PC: 0x0002ab92 LR: 0x0001852d PSP: 0x20001668 MSP: 0x1fffcd58 PSR: 0x60000043
Memory dump:
0x20001668 : 0x4006d000 0x000000ac 0x00000000 0x000077cd
0x20001678 : 0x000669fc 0x00038c01 0x00038c18 0x2100f000
0x20001688 : 0x00000002 0x0001846d 0x00052a65 0x00000055
0x20001698 : 0x00000002 0x20000128 0x1fffbb5c 0x2000004a
0x200016a8 : 0x00000004 0x00052975 0x00000002 0x20000040
0x200016b8 : 0x00000000 0x00000000 0x00000000 0x00000000
0x200016c8 : 0x00000000 0x00000000 0x00000000 0x00052795
0x200016d8 : 0x2000012a 0x00000055 0x000001f4 0x1fff0514
Memory dump:
0x1fffcd58 : 0x1fff3eb2 0x00000002 0x1fff3eb2 0x00000002
0x1fffcd68 : 0x1fffaf44 0x000001f4 0x0005299d 0x0001852d
0x1fffcd78 : 0x1fffc640 0x00000002 0x00000003 0x0005ce29
0x1fffcd88 : 0x1fffc640 0x00000000 0x00000043 0x000000c0
0x1fffcd98 : 0x00000000 0xfffffffd 0x7374616b 0x7374616b
0x1fffcda8 : 0x7374616b 0x00000000 0x000000f0 0x1fffc95c
0x1fffcdb8 : 0x0001ffff 0x00000000 0x00000000 0x00000000
0x1fffcdc8 : 0x00000000 0x00000000 0x00000000 0x00000000
Thanks,
Mohsin
hello Mohsin455,
have you figured out which fault caused this memory ?If you went directly to the unexpected isr through vector table, you can obtain PC which was stacked and find out where that error happened.
This link could help you more :
https://community.freescale.com/thread/86130
I recommend to read an Application note which is pasted there :smileywink:
Regards,
MartinK
Hi Kojto,
Thanks for your reply. I am trying to use same approach as unexpected ISR for watchdog timeout. I am trying to print out the similar information (PC, LR and Memory dump) when the watchdog timeout occurs i.e. when watchdog timeout occurs I get an interrupt. In this interrupt I am trying to find the task which was active.
Please advise if this is possible. I need to confirm if the interrupt still has the PC of the active task or the unexpected ISR works in some other way (i.e. directly to the unexpected isr through vector table).
Thanks,
Mohsin
Hello,
please read the application note which I attached previously. Particularly last chapter "Determining where the exception occurred" ( current link register contains EXC_RETURN which indicates which stack was used and then browse in memory to the address of used stack to get stored registers).
Regards,
MartinK
Hi,
Thanks very much for your reply. I just want to confirm if the same rule applies if a task is interrupted by a higher priority task or it is only true when an exception occurs.
In other words, will the link register contain EXC_RETURN which indicates which stack was used, even when a task is interrupted by a higher priority task.
Thanks,
Mohsin
Hello,
Is this thread still active?
I need to get the PC of all the threads before the watchdog occurs / not in the watchdog interrupt as it gives you some what 250 cycles to execute that interrupt handler.
So I need PC from all the task descriptors, as TD_STRUCT in MQX does not give you this information, I am looking for alternative.
Now I don't have any idea about psp, msp but I will go through it.
But meanwhile can anyone please tell me whether it is possible to get value of PC from the Task Descriptors as normally all the threads in most of the OSes has PC in its TD, but I am unable to find in MQX.
I am not dumping or gathering any data in any kind of interrupt so there is no handler for such to track.
Preet...