Zephyr debug on i.MX9x (A55)

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Zephyr debug on i.MX9x (A55)

675 次查看
TheUncle
Contributor III

Hello,
according to official Zephyr documentation (here and here), it should be possible to debug a Zephyr OS image on i.MX9x (A55) using Segger J-Link. However, in Visual Studio, no runner is generated and the command west debug fails with the following error:

FATAL ERROR: no runners.yaml found in [...]build/zephyr. Either board imx91_evk/mimx9131 doesn't support west flash/debug/simulate, or a pristine build is needed.

Provided Zephyr debug is currently supported on i.MX9x AP (as of Zephyr 4.2), what am I missing?

Note that I was able to load and debug the image using Lauterbach T32, but I am looking for an alternative lightweight approach to debugging for the development team, possibly using J-Link from Segger.

Thank you in advance and best regards,
Stefano

0 项奖励
回复
3 回复数

548 次查看
June_Lu
NXP TechSupport
NXP TechSupport

I can create runners.yaml with iMX91. Following is the log. I also uploaded the file. Please ask the customer to:

  - Debug why runners.yaml is not created, since it was created in my build

  - Maybe copy my runners.yaml to build/zephyr and then run west flash/debug see if this makes a difference. I cannot upload yaml file. So I change it to runners.log. Please change the name back.

 

(venv) C:\Users\nxa08706\workspace-ZephyrProject\newproj\zephyr>dir build

Volume in drive C is OSDisk

Volume Serial Number is 9259-4D77

Directory of C:\Users\nxa08706\workspace-ZephyrProject\newproj\zephyr

File Not Found

(venv) C:\Users\nxa08706\workspace-ZephyrProject\newproj\zephyr>west build -p -b imx91_evk/mimx9131 samples/hello_world

-- west build: generating a build system

Loading Zephyr default modules (Zephyr base).

-- Application: C:/Users/nxa08706/workspace-ZephyrProject/newproj/zephyr/samples/hello_world

-- CMake version: 4.0.3

-- Found Python3: C:/Users/nxa08706/workspace-ZephyrProject/venv/Scripts/python.exe (found suitable version "3.13.5", minimum required is "3.12.1") found components: Interpreter

-- Cache files will be written to: C:/Users/nxa08706/workspace-ZephyrProject/newproj/zephyr/.cache

-- Zephyr version: 4.2.00-rc1 (C:/Users/nxa08706/workspace-ZephyrProject/newproj/zephyr)

-- Found west (found suitable version "1.4.0", minimum required is "0.14.0")

-- Board: imx91_evk, qualifiers: mimx9131

-- ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK

-- Found host-tools: zephyr 0.17.2 (C:/Users/nxa08706/zephyr-sdk-0.17.2)

-- Found toolchain: zephyr 0.17.2 (C:/Users/nxa08706/zephyr-sdk-0.17.2)

-- Found Dtc: C:/Users/nxa08706/.mcuxpressotools/dtc-msys2/tools/usr/bin/dtc.exe (found suitable version "1.6.1", minimum required is "1.4.6")

-- Found BOARD.dts: C:/Users/nxa08706/workspace-ZephyrProject/newproj/zephyr/boards/nxp/imx91_evk/imx91_evk_mimx9131.dts

-- Generated zephyr.dts: C:/Users/nxa08706/workspace-ZephyrProject/newproj/zephyr/build/zephyr/zephyr.dts

-- Generated pickled edt: C:/Users/nxa08706/workspace-ZephyrProject/newproj/zephyr/build/zephyr/edt.pickle

-- Generated devicetree_generated.h: C:/Users/nxa08706/workspace-ZephyrProject/newproj/zephyr/build/zephyr/include/generated/zephyr/devicetree_generated.h

C:/Users/nxa08706/workspace-ZephyrProject/newproj/zephyr/build/zephyr/zephyr.dts:62.37-71.4: Warning (interrupt_provider): /interrupt-controller@48000000: Missing #address-cells in interrupt provider

Parsing C:/Users/nxa08706/workspace-ZephyrProject/newproj/zephyr/Kconfig

Loaded configuration 'C:/Users/nxa08706/workspace-ZephyrProject/newproj/zephyr/boards/nxp/imx91_evk/imx91_evk_mimx9131_defconfig'

Merged configuration 'C:/Users/nxa08706/workspace-ZephyrProject/newproj/zephyr/samples/hello_world/prj.conf'

Configuration saved to 'C:/Users/nxa08706/workspace-ZephyrProject/newproj/zephyr/build/zephyr/.config'

Kconfig header saved to 'C:/Users/nxa08706/workspace-ZephyrProject/newproj/zephyr/build/zephyr/include/generated/zephyr/autoconf.h'

-- Found GnuLd: c:/users/nxa08706/zephyr-sdk-0.17.2/aarch64-zephyr-elf/aarch64-zephyr-elf/bin/ld.bfd.exe (found version "2.38")

-- The C compiler identification is GNU 12.2.0

-- The CXX compiler identification is GNU 12.2.0

-- The ASM compiler identification is GNU

-- Found assembler: C:/Users/nxa08706/zephyr-sdk-0.17.2/aarch64-zephyr-elf/bin/aarch64-zephyr-elf-gcc.exe

Load components for MIMX9131:

driver_cache_armv8a component is included.

-- Found gen_kobject_list: C:/Users/nxa08706/workspace-ZephyrProject/newproj/zephyr/scripts/build/gen_kobject_list.py

-- Configuring done (31.2s)

-- Generating done (2.2s)

-- Build files have been written to: C:/Users/nxa08706/workspace-ZephyrProject/newproj/zephyr/build

-- west build: building application

[1/123] Generating include/generated/zephyr/version.h

-- Zephyr version: 4.2.00-rc1 (C:/Users/nxa08706/workspace-ZephyrProject/newproj/zephyr), build: v4.2.0-rc1-90-g0903efa88221

[123/123] Linking C executable zephyr\zephyr.elf

Memory region Used Size Region Size %age Used

FLASH: 0 GB 0 GB

RAM: 176 KB 1 MB 17.19%

IDT_LIST: 0 GB 32 KB 0.00%

Generating files from C:/Users/nxa08706/workspace-ZephyrProject/newproj/zephyr/build/zephyr/zephyr.elf for board: imx91_evk

 

(venv) C:\Users\nxa08706\workspace-ZephyrProject\newproj\zephyr>dir build\zephyr\runners.yaml

Volume in drive C is OSDisk

Volume Serial Number is 9259-4D77

Directory of C:\Users\nxa08706\workspace-ZephyrProject\newproj\zephyr\build\zephyr

07/03/2025 08:51 AM 665 runners.yaml

1 File(s) 665 bytes

0 Dir(s) 48,964,829,184 bytes free

0 项奖励
回复

567 次查看
June_Lu
NXP TechSupport
NXP TechSupport

I have reproduced the original same issue on the IMX91-EVK, investigating the issue now.

If you have any update for this issue, please let me know.

0 项奖励
回复

651 次查看
TheUncle
Contributor III

Hello again - adding some findings.

I forced the generation of the runner by copying a board.cmake file to the board folder I am working with. Now the "debug" command is responsive, but two problems arise:

  1. gdb client (and objdump/nm) from the arm-zephyr-eabi toolchain are invoked - instead of aarch64-zephyr-elf. This makes gdb client fail, because the executable (zephyr.elf) is not recognized as valid. Manually setting gdbClientPathobjdumpPath, and toolchainPrefix in launch.json seems to fix the issue with gdb client.
  2. gdb seems to proceed, but jlink fails to halt the target and often the iMX enters a state in which every register access returns 0xDEADBEEF. 

I am trying to debug a Zephyr image using the stock u-boot found on i.MX9x EVK, stopping it at boot. I suspect that debug access is disabled by ELE in u-boot proper - which could explain why the target can be halted. Note however that, in the same conditions,  debugging with Lauterbach T32 works just fine.

Thank you for any help you may provide.
Stefano

 

0 项奖励
回复