Purpose: Introduce how to debug M4 using trace32 and the difference with general debug case.If you are using other jtag debug tools, maybe you need to do the similar configuration.
Debug tools: Trace32 – you can refer to http://www.lauterbach.cn/ for more information about this tool.
Firmware: Here we using Freertos as the example, but not limited to this.
There is one small difference with general debug case to M4 in 6sx, which when you attach M4 and break M4, it may impact the peripheral that A9 is using. You may have found when you break M4, A9 uart console also was frozen at the same time.
Here is the details of uart dbgen in the RM:
So if we want debug M4 separately,we should disable this bit, as A9 was using this peripheral.
Here we take Freertos as the example to illuminate how to debug M4 step by step:
Enable DBGEN case:
=>fatload mmc 2:1 0x9ff00000 hello_world_ddr.bin
reading hello_world_ddr.bin 18748 bytes read in 30 ms (609.4 KiB/s)
=>dcache flush
=>bootaux 0x9ff00000
##Starting auxiliary core at 0x9FF00000
...
Note: You can find the elf file at the same folder of binary:
So now you can debug your code step by step.If you go back to A9 side uart console, you would find the console have been frozen.
Disable DBGEN case at A9 side:
=>mm 0x20200b4
020200b4:00000020 ? 0x820
=>fatload mmc 2:1 0x9ff00000 hello_world_ddr.bin
reading hello_world_ddr.bin 18748 bytes read in 30 ms (609.4 KiB/s)
=>dcache flush
=>bootaux 0x9ff00000
##Starting auxiliary core at 0x9FF00000
...
In this case you will the A9 uart console still can work, after you break M4.
Disable DBGEN case at M4 side:
reading hello_world_ddr.bin 18748 bytes read in 30 ms (609.4 KiB/s)
=>dcache flush
=>bootaux 0x9ff00000
##Starting auxiliary core at 0x9FF00000
In this case you will the A9 uart console still can work, after you break M4.
Notes: For more trace32 usage, please refer to http://www.lauterbach.cn/
For more imx6sx information, please refer to i.MX 6SoloX Family of Applications Processors|NXP.