Hi,
I want to port imx-m4fwloader to support imx8m mini board, but I have some issues.
The imx-m4fwloader is downloaded from GitHub - NXPmicro/imx-m4fwloader: Tool for loading firmware to M4 core on i.MX6SX and 7D ,and I modify it to adapt imx8m mini board.
The modified code m4fwloader.c is in the attachment.
After I compile imx-m4fwloader, I use it in the Linux shell:
root@imx8mmevk:~# ls
hello_world.bin
root@imx8mmevk:~# m4fwloader /home/root/hello_world.bin 0x7e0000 --verbose
LoadAddr is: 7E0000
Will stop CPU now...
STOP - before (0x3039000C): 0x000000AB
STOP - after (0x3039000C): 0x000000AB
Will ungate M4 clock source...
i.MX8MM specific function for M4 clock enabling!
CCM_ANALOG_PLL_400 (0x30360104): 0x8AAAAA00
CCM_ANALOG_PLL_480 (0x30360104): 0x8AA6AA00
CCM_ANALOG_PLL_480 done
CCM1_CCGR1 (0x303809D0): 0x00000002
CCM1_CCGR1 (0x303809D0): 0x00000003
CCM_CCGR1_SET done
Will load M4 firmware...
fdf=0x1fbc5670
size=15108
It hangs on and the shell is died. No debug message outputs.
There is no way to bring up the board except reboot.
Can you take a look m4fwloader.c in the attachment and help me fix this?
Hi,
Worked for me.
Start/Stop and load is working.
Modified memcpy size to be aligned to 8 bytes, otherwise I get "Bus error".
Modified to work for TCM, changed maximum size to 128K from 64K.
Left debug printf's, should be removed.
printout:
./m4fwloader /boot/m4exec.bin 0x7e0000 --verbose
LoadAddr is: 7E0000
Will stop CPU now...
STOP - before (0x3039000C): 0x000000A8
STOP - after (0x3039000C): 0x000000AB
Will ungate M4 clock source...
i.MX8MM specific function for M4 clock enabling!
CCM_ANALOG_PLL_400 (0x30360104): 0x8AA6AA00
CCM_ANALOG_PLL_400 (0x30360104): 0x8AA6AA00
CCM_ANALOG_PLL_400 done
CCM1_CCGR1 (0x303809D0): 0x00000003
CCM1_CCGR1 (0x303809D0): 0x00000003
CCM_CCGR1_SET done
Will load M4 firmware...
fdf=0x2dff270
size=7460
test 7
i.MX M4 Loader - FILENAME = /boot/m4exec.bin; loadaddr = 0x007e0000
i.MX M4 Loader - start - end (0x007e0000 - 0x00800000)
test 8 7460 7464
test 9
test 10
Will set PC and STACK......Done
Will start CPU now...
START - before (0x3039000C): 0x000000AB
START -after (0x3039000C): 0x000000A8
Done!
Daniel.
Hi wang
for debugging issue one can check common guidelines for running M4 from Linux given in
AN5317 Loading Code on Cortex-M4 from Linux for the i.MX 6SoloX and i.MX7Dual/7Solo Application Processors
https://www.nxp.com/docs/en/application-note/AN5317.pdf
Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------