This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMDX654IDKEVM: Baremetal UART driver doesn't print and questions in general

Part Number: TMDX654IDKEVM
Other Parts Discussed in Thread: SYSBIOS

Hello,

I got the TMDX654IDKEVM. I want to run a baremetal application on the ARM Cortex-A53 (Compute Cluster) of the processor on the board.

I found the Processor Development Kit () and was able to integrate libraries and headers into my project.

The code I have is the following:

#define SOC_AM65XX
//#define NON_JTAG_BOOT

#include <stdio.h>

#include "board/board.h"
#include "am65xx_idk/include/board_cfg.h"
#include "drv/uart/soc/UART_soc.h"
#include "drv/uart/UART.h"

/**
 * main.c
 */
int main(void)
{
    printf("Starting driver test!\n");
    /**************************************************************************/
    /* INIT BOARD */
    Board_initCfg boardCfg;
    boardCfg =
#ifdef NON_JTAG_BOOT
            BOARD_INIT_MODULE_CLOCK |
            BOARD_INIT_PINMUX_CONFIG |
#endif
            BOARD_INIT_UART_STDIO;

    Board_STATUS status = 0;
    printf("Initializing Board...\n");
    status = Board_init(boardCfg);
    if(status != BOARD_SOK)
    {
        printf("!BOARD_SOK. Exiting.\n");
        return 1;
    }
    printf("BOARD_SOK\n");

    /**************************************************************************/
    /* INIT UART*/
    UART_HwAttrs uart_cfg = {0};
    UART_socGetInitCfg(0, &uart_cfg);
    UART_socSetInitCfg(0, &uart_cfg);

    UART_init();
    /**************************************************************************/
    /* USE UART */
    UART_Handle handle;
    UART_Params params;
    UART_Params_init(&params);
    params.baudRate = 115200;
    handle = UART_open(0, &params);
    if (!handle)
    {
        printf("UART did not open...\n");
    }

    int cnt = 20;
    for(int i = 0; i < cnt; i++)
    {
        const unsigned char hello[] = "Hello World\n";
        int ret = UART_write(handle, hello, sizeof(hello));
        printf("[%d] The UART wrote %d bytes\n", i+1, ret);
    }

    /**************************************************************************/
    printf("Done driver test!\n");
	return 0;
}

The project strucute looks like this:

where the file linker_a53.lds file is from the PDK

  • <PDK INSTALL PATH>/packages/ti/build/am65xx/linker_a53.lds

The drivers and other abstraction layers, which were needed to build the project successfully were here: 

  • C:\ti\pdk_am65xx_08_02_00_21\packages\ti
  • C:\ti\pdk_am65xx_08_02_00_21\packages\ti\drv
  • C:\ti\pdk_am65xx_08_02_00_21\packages\ti\drv\uartC:\ti\pdk_am65xx_08_02_00_21\packages\ti\drv\uart
So far the information for the project I am trying to undertake.
However, the processor gets stuck on line 29...

Now, here are the things I dont understand:
  1. Where does the Board_init() get its information from, which things need to be done when the Board_init() is called? I assume it is because the PDK is the PDK for AM65xx and thus the included "board/board.h" header has this information?
  2. I am not sure whether I need the Board_init() at all. The baremetal example from the freertos demo uses this. I think I need this step only when the processor shall run on its own, not in a JTAG debug session, am I right?
  3. What are the lines 39-41 for, are they correctly implemented, and are they even needed?
  4. What does UART_init()?
  5. If so, why don't I see a message on my UART output? I use the J42 jack with the XDS110 USB debug probe, so I get 4 virtual COM ports. Based on my code, I should have initialized UART0 of the Computing Cluster (A53) and get a message on that COM port, right?
  6. What processor am I supposed to choose in the project properties? I mean, obviously I have the TMDX654IDKEVM board, which means I should choose the IDK_AM65x_SiRevA [Cortex A] processor (the debug messages told me they detected silicon revision 2). But all examples and hints tell me to select the GPEVM_AM65x [Cortex A]. Why is that so?

Last but not least: Is there any working example for any driver, which is not the rtos-baremetal-example? I need to use SYSBIOS with the PDK shipped baremetal example. But since that is deprecated, I dont want to use it and just use my own baremetal approach. The rtos-baremetal-example also doesn't work because of that and also seems to be not 100% explanatory.

Sites I used for my approach:

So these sites did help but did not solve my problem(s).


Could you tell me what I am doing wrong? Is there any way this is going to work, or is it mandatory to use FreeRTOS/TI RTOS for the drivers to work (I don't think so, but maybe)?
Thank you very much in advance!