Springe zum Hauptinhalt

Using OpenOCD with the M4 MCU on the i.MX8M Mini

giant-gd1d82756c_640.jpg

Over the last few years, SoCs targeted at embedded GNU/Linux applications became heterogenous architectures. Instead of adding more identical copies of CPU cores (Cortex-A class), a small companion micro controller core (Cortex-M class) was added. Compared to the complex architecture of Cortex-A systems, including their multi-layer caches, those cores are usually deterministic and thus predestined for low-latency "real time" jobs. NXP's first such SoC is the i.MX6 Solo X device featuring an Cortex-M4 next to an Cortex-A9 core. The i.MX8 family moved the Cortex-A cores into the 64 bit world and there are different combinations of Cortex-M companion micro controllers, but all of them do feature them as they are pretty "cheap" in terms of die space and transistor count.

From what I can see, it is still uncommon to use those micro controllers in actual projects though. Today I want to take a short look on how to run simple programs on the Cortex-M4 of the i.MX8M Mini SoC, especially we will use the official i.MX8M Mini EVK.

dzu@krikkit:~$ openocd -f interface/jlink.cfg -f board/nxp_mcimx8m-evk.cfg -c 'init; imx8mq.m4 arp_examine'
Open On-Chip Debugger 0.11.0+dev-00585-g8b740af10 (2022-03-03-20:55)
Licensed under GNU GPL v2
For bug reports, read
        http://openocd.org/doc/doxygen/bugs.html
Info : J-Link EDU Mini V1 compiled Dec  7 2021 08:38:51
Info : Hardware version: 1.00
Info : VTarget = 1.791 V
Info : clock speed 1000 kHz
Info : JTAG tap: imx8mq.cpu tap/device found: 0x5ba00477 (mfg: 0x23b (ARM Ltd), part: 0xba00, ver: 0x5)
Info : imx8mq.a53.0: hardware has 6 breakpoints, 4 watchpoints
Info : starting gdb server for imx8mq.a53.0 on 3333
Info : Listening on port 3333 for gdb connections
Info : starting gdb server for imx8mq.m4 on 3334
Info : Listening on port 3334 for gdb connections
Info : gdb port disabled
Info : imx8mq.m4: Cortex-M4 r0p1 processor detected
Info : imx8mq.m4: target has 6 breakpoints, 4 watchpoints
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : imx8mq.m4: external reset detected
zu@krikkit:/opt/src/git/mcuxsdk/examples/evkmimx8mm/demo_apps/hello_world/armgcc/debug ((MCUX_2.10.0))$ arm-none-eabi-gdb hello_world.elf
GNU gdb (GNU Arm Embedded Toolchain 10-2020-q4-major) 10.1.90.20201028-git
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "--host=x86_64-linux-gnu --target=arm-none-eabi".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from hello_world.elf...
(gdb) target extended-remote localhost:3334
Remote debugging using localhost:3334
0x00000000 in ?? ()
(gdb) load
Loading section .interrupts, size 0x240 lma 0x1ffe0000
Loading section .resource_table, size 0x10 lma 0x1ffe0240
Loading section .text, size 0x39dc lma 0x1ffe0280
Loading section .ARM, size 0x8 lma 0x1ffe3c5c
Loading section .init_array, size 0x4 lma 0x1ffe3c64
Loading section .fini_array, size 0x4 lma 0x1ffe3c68
Loading section .data, size 0x68 lma 0x1ffe3c6c
Start address 0x1ffe0378, load size 15524
Transfer rate: 53 KB/sec, 2217 bytes/write.
(gdb) 

Kommentare

Comments powered by Disqus