Cortex-M4 examples for iMX8QM


Is there examples for Cortex-M4 / iMX8qm similar to these for iMX7:

Is it possible to use the same driver examples of iMX7? (if yes, where can we find: board.c/h, clock_freq.c/h , gpio_pins.c/h, pin_mux.c/h files for iMX8qm_apalis_m4)

Thank you very much in advance.

Best regards, Majd

Does the MCUXpresso SDK (which is built for MEK-MIMX8QM board from NXP) work for apalis board?:

The SDK contains some examples for M4 on imx8qm/MEK-imx8qm.

Dear @majd

We didn’t do too much about the iMX8QM M4 implementation. I ran a few examples from the MCUXpresso SDK, and they basically work.
Please note that you probably need to adjust the examples in order to select reasonable pins.

The iMX7 examples won’t work, because the resource management such as pin muxing and clock selection is different for the iMX8QM.

If you face problems with the JTAG interface, it might require a patch. Let me know if you need more information.

Regards, Andy

Hi @andy.tx,

Thank you for your answer. It would be nice if you help me with the JTAG patch, because my J-Link doesn’t work on iMX8 (even with ozone platform).

Best regards, Majd

Dear @majd.m

I found that the Segger patch is in a download area which requires you to register and agree to a license agreement.
Here’s a link to the page where the download starts.

I’m not sure whether you simply need to register to be able to download, or whether you need to go through your local NXP representative to get access to the files.
You only need a small part of this download package, which is 2 initialization scripts for the J-Link adapter, and an updated device list:

  • JLinkDevices.xml
  • NXP_iMX8QM_Connect_CortexM4_0.JLinkScript
  • NXP_iMX8QM_Connect_CortexM4_1.JLinkScript

I hope this helps. If you can’t get access, get back to me. I will try to find a way to legally get you the information.

Regards, Andy

Hi @andy.tx,

Do you have plans to release cortex-M4 examples for iMX8QM (apalis) in the near future?

Best regards,

Dear @majd.m

Yes, we are planning to release the examples on our web site.

We are currently clarifying some licensing issues, to assure we are allowed to redistribute modified samples which we originally get from NXP.

Regards, Andy

Has anyone had any luck running the Hello_world example from DDR memory? We can run the TCM examples but the DDR examples are not working for us.

We have started looking into it but I thought I would post here to see if others have already run across an issue.


Dear @mccandlt
I created a new question for this topic. Let’s continue the discussion there:

Regards, Andy

Hi @andy.tx,

just as a test for the cortex-m4 on the imx8qm, could you guide me what to change in the hello_world example of NXP to make it work on the apalis board?

According to what i understood from the code, I have to change the following defintions in pin_mux.h file, to the pins/pads of the imx8qm, with which the serial port of apalis are connected (but I couldn’t figure it out)

/* M40_I2C0_SCL (number AM44), FTDI_M40_UART0_RX */
#define BOARD_INITPINS_FTDI_M40_UART0_RX_PERIPHERAL                   M40__UART0   /*!< Device name: M40__UART0 */
#define BOARD_INITPINS_FTDI_M40_UART0_RX_SIGNAL                          uart_rx   /*!< M40__UART0 signal: uart_rx */
#define BOARD_INITPINS_FTDI_M40_UART0_RX_PIN_NAME                   M40_I2C0_SCL   /*!< Pin name */
#define BOARD_INITPINS_FTDI_M40_UART0_RX_PIN_FUNCTION_ID       SC_P_M40_I2C0_SCL   /*!< Pin function id */
#define BOARD_INITPINS_FTDI_M40_UART0_RX_LABEL               "FTDI_M40_UART0_RX"   /*!< Label */
#define BOARD_INITPINS_FTDI_M40_UART0_RX_NAME                "FTDI_M40_UART0_RX"   /*!< Identifier name */

/* M40_I2C0_SDA (number AU51), FTDI_M40_UART0_TX */
#define BOARD_INITPINS_FTDI_M40_UART0_TX_PERIPHERAL                   M40__UART0   /*!< Device name: M40__UART0 */
#define BOARD_INITPINS_FTDI_M40_UART0_TX_SIGNAL                          uart_tx   /*!< M40__UART0 signal: uart_tx */
#define BOARD_INITPINS_FTDI_M40_UART0_TX_PIN_NAME                   M40_I2C0_SDA   /*!< Pin name */
#define BOARD_INITPINS_FTDI_M40_UART0_TX_PIN_FUNCTION_ID       SC_P_M40_I2C0_SDA   /*!< Pin function id */
#define BOARD_INITPINS_FTDI_M40_UART0_TX_LABEL               "FTDI_M40_UART0_TX"   /*!< Label */
#define BOARD_INITPINS_FTDI_M40_UART0_TX_NAME                "FTDI_M40_UART0_TX"   /*!< Identifier name */

The definitions in board.h seems to me not problematic for the hello_world program.
Is there other things that should be changed?

Thanks in advance,

Best regards, Majd

Dear @majd.m

I didn’t test your changes, but I found some time to try out some M4 samples. I optimized parts of the code for our usecase and added files to support Visual Studio Code (this is not yet finished).

Look at the attached ZIP file. There is also a markdown readme ( ) that explains how to configure the Evaluation Board.

i hope this helps.
Regards, Andy