Problem Running Hello world on i.MX8DX's Cortex M4 with Aster Carrier Board

Hi,
I am currently trying to work on an application for the Cortex M4 core of my Colibri i.MX8DX 1GB v1.0 E, mounted on an Aster v1.1 B. I wanted to test the examples of the MCUXpresso SDK in order to ensure the core was working as expected, but I struggle to read anything on the UART B that would tell me the M4 is flashed and working.

I use the version SDK_2_9_0_MIMX8UX5xxxFZ MCUXpresso with the arm-gnu toolchain version 14.2.rel1-x86_64-arm-none-eabi and my board is flashed with a Linux BSD VERSION_ID=7.1.0-build.3 from Toradex Easy Installer.

I successfully compiled the hello world example, with the modifications to the pin_mux.c and .h recommended for the imx8, even though it needed a slight fix (caddr_t being undefined, changed it to void* as shown in caddr_t is not available in modern toolchains · Issue #162 · nxp-mcuxpresso/mcux-sdk · GitHub), scp’ed it to my board at /home and followed the tutorial to run the binary.

On the U-Boot terminal :

> setenv load_cmd “ext4load mmc 0:2”
> setenv m4_0_image “/home/hello_world.bin”
> setenv loadm4image_0 “${load_cmd} ${loadaddr} ${m4_0_image}” #(NB : if i’m not mistaken, there is a typo on the tutorial on that command How to Load Compiled Binaries into Cortex-M | Toradex Developer Center)
> saveenv
Saving Environment to MMC… Writing to MMC(0)… OK
> run m4boot_0
15104 bytes read in 3 ms (4.8 MiB/s)
Power on aux core 0
Copy image from 0x95c00000 to 0x34fe0000
Start M4
bootaux complete

I have connected a USB/TTL converter to the UART_B_TXD, UART_B_RXD and GND pins of the X20 connector but nothing appears on this terminal. Even with the help of multiple other similar issues raised on this forum, I can’t seem to find what I missed. If anybody has an idea, I’d gladly take it.

Edit: I also tried with the armg-gcc toolchain version 11.2 as used in the tutorial, no more tweaking fsl_sbrk needed to recognize the caddr_t type but no output either …

Edit: I realize I could be very wrong with my assumption I should get anything on UART B having read a bit too much about M4 Hello World on Aster / iMX7D not working - #4 by gustavo.tx, normally I should expect to find my M4 UART output on SODIMM pins 144 and 146 on the i.MX8DX but if I’m not mistaken these are not connected anywhere on the aster card. SO my real problem should rather be, how can I get that output on UART B?

In that spirit, I tried using the pins UART_B_RX and UART_B_TX (SODIMM 36 and 38) that I should have tried by using the pin names UART0_TX/RX and the functions SC_P_UART0_TX/RX but still nothing.

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello!

To set up your Colibri iMX8X module for FreeRTOS on the Cortex-M4 core, here are some key steps to follow:

  1. Pin Configuration:

    • Connect your USB-TTL converter to the following pins on the Colibri iMX8X:
      • RX to SODIMM 144 (A40)
      • TX to SODIMM 146 (A41)
      • GND to any ground pin on the board
  2. Code Modifications:

    • If you’re using the hello_world example from NXP, you’ll need to modify the pin_mux.c and pin_mux.h files. Change the default ADC pins to SCU_GPIO0_00 and SCU_GPIO0_01 to match the Colibri iMX8X configuration.
  3. Device Tree Overlay:

    • Apply a device tree overlay to disable the CM40 UART. This step is crucial to prevent Linux from taking control of the UART pins, ensuring the M4 core can output data correctly.
  4. Build Process:

    • Ensure you are using the correct SDK for building. For the Colibri iMX8DX, the appropriate SDK is MIMX8UX5xxxFZ.

I recommend verifying your hardware connections to ensure they match the specified pinout. After applying the device tree overlay, rebuild your project and test again. If you still encounter issues, check the Linux kernel logs for any messages related to UART initialization or conflicts.

I hope this helps you get your setup running smoothly!

Best regards,
Toradex AI Assistant.

Well, found the problem, the BOARD_InitDebugConsole function was partially hardcoded in board.c to use the default M40 UART. The pinmuxxing to UARTB worked perfectly once correctly setup.