AnsweredAssumed Answered

How to modify FreeRTOS to get my M4 output the Hello World example on my board?

Question asked by Friedel on May 17, 2018
Latest reply on May 22, 2018 by Friedel

Hi everyone,

I have a development board and already installed uboot and linux.

 

Problems starts while trying to work with the M4 coprocessor. I ran the hello world sample from FreeRTOS but the debug output UART3 (usually it is uart2 but it isn’t physically connected to the board) didn’t show anything than sometimes the characters “z”, ”°”, ”||” immediately after I boot up the M4.

To change from uart2 to uart3 I edited the board.h and the pin_mux.c file.

Board.h

/* Debug UART information for this board */

#define BOARD_DEBUG_UART_RDC_PDAP             rdcPdapUart3

#define BOARD_DEBUG_UART_CCM_ROOT             ccmRootUart3

#define BOARD_DEBUG_UART_CCM_CCGR             ccmCcgrGateUart3

#define BOARD_DEBUG_UART_BASEADDR             UART3

#define BOARD_DEBUG_UART_IRQ_NUM             UART3_IRQn

#define BOARD_DEBUG_UART_HANDLER             UART3_Handler

 

Pin_mux.c

void configure_uart_pins(UART_Type* base)

{

   switch((uint32_t)base)

   {

       case UART3_BASE:

           // UART3 iomux configuration

           IOMUXC_SW_MUX_CTL_PAD_UART3_RX_DATA = IOMUXC_SW_MUX_CTL_PAD_UART3_RX_DATA_MUX_MODE(0);

           IOMUXC_SW_MUX_CTL_PAD_UART3_TX_DATA = IOMUXC_SW_MUX_CTL_PAD_UART3_TX_DATA_MUX_MODE(0);

           IOMUXC_SW_PAD_CTL_PAD_UART3_RX_DATA = IOMUXC_SW_PAD_CTL_PAD_UART3_RX_DATA_PE_MASK |

                                                 IOMUXC_SW_PAD_CTL_PAD_UART3_RX_DATA_PS(3)   |

                                                 IOMUXC_SW_PAD_CTL_PAD_UART3_RX_DATA_HYS_MASK |

                                                  IOMUXC_SW_PAD_CTL_PAD_UART3_RX_DATA_DSE(0);

           IOMUXC_SW_PAD_CTL_PAD_UART3_TX_DATA = IOMUXC_SW_PAD_CTL_PAD_UART3_TX_DATA_PE_MASK |

                                                 IOMUXC_SW_PAD_CTL_PAD_UART3_TX_DATA_PS(3)   |

                                                 IOMUXC_SW_PAD_CTL_PAD_UART3_RX_DATA_HYS_MASK |

                                                 IOMUXC_SW_PAD_CTL_PAD_UART3_TX_DATA_DSE(0);

           IOMUXC_UART3_RX_DATA_SELECT_INPUT = IOMUXC_UART3_RX_DATA_SELECT_INPUT_DAISY(2);

           break;

       default:

           break;

   }

}

Is there anywhere else a file to modify to use uart3 instead of uart2 as debug_uart?

The code was successfully loaded via uboot from the emmc and tftp. In Linux, I am able to output an echo to the UART3 so the problem isn’t due to hardware issues.

I can debug over JTAG via an Amontec JtagKey-Tiny and I can read registers of both the A7 and the M4 via OPENOCD.

I already checked out this thread https://community.nxp.com/message/984055 but it isn’t solved completely.

So the only option I see is, that the FreeRTOS needs special configuration or that the uboot disables the uart access to the M4.

 

How can I output something on my M4?

Outcomes