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.

TDA4VM: Drive GPIO output high/low level on MCU of main domain

Part Number: TDA4VM

Hi team,

Here's an issue from the customer may need your help:

Linux:ti-processor-sdk-linux-j7-evm-08_02_00_03-Linux-x86-Install.bin 

RTOS:ti-processor-sdk-rtos-j721e-evm-08_02_00_05.tar.gz 

It is required to drive GPIO output high and low level on MCU2-0 of main domain. The customer has added below statements in int32_t appInit() function under rtos\vision_apps\platform\j721e\rtos\common\app_init.c file:

Board_initCfg boardCfg;
boardCfg = BOARD_INIT_PINMUX_CONFIG |
               BOARD_INIT_UART_STDIO;
Board_init(boardCfg);
While during compiling, the following error is reported:
undefined first referenced
symbol in file
--------- ----------------
Board_init /home/CN/qidong.liu/ti/tda4/server/modify_load_mcu/rtos/vision_apps/out/J7/C66/FREERTOS/release/app_rtos_common_c6x_1.lib<app_init.obj>

error: unresolved symbols remain

undefined first referenced
symbol in file
--------- ----------------
Board_init /home/CN/qidong.liu/ti/tda4/server/modify_load_mcu/rtos/vision_apps/out/J7/C66/FREERTOS/release/app_rtos_common_c6x_2.lib<app_init.obj>

error: unresolved symbols remain
error: errors encountered during linking;
"/home/CN/qidong.liu/ti/tda4/server/modify_load_mcu/rtos/vision_apps/out/J7/
C66/FREERTOS/release/vx_app_rtos_linux_c6x_1.out" not built
error: errors encountered during linking;
"/home/CN/qidong.liu/ti/tda4/server/modify_load_mcu/rtos/vision_apps/out/J7/
C66/FREERTOS/release/vx_app_rtos_linux_c6x_2.out" not built

undefined first referenced
symbol in file
--------- ----------------
Board_init /home/CN/qidong.liu/ti/tda4/server/modify_load_mcu/rtos/vision_apps/out/J7/C71/FREERTOS/release/app_rtos_common_c7x_1.lib<app_init.obj>

error: unresolved symbols remain
concerto/finale.mak:212: recipe for target '/home/CN/qidong.liu/ti/tda4/server/modify_load_mcu/rtos/vision_apps/out/J7/C66/FREERTOS/release/vx_app_rtos_linux_c6x_1.out' failed
make[2]: [/home/CN/qidong.liu/ti/tda4/server/modify_load_mcu/rtos/vision_apps/out/J7/C66/FREERTOS/release/vx_app_rtos_linux_c6x_1.out] Error 1 (ignored)
concerto/finale.mak:212: recipe for target '/home/CN/qidong.liu/ti/tda4/server/modify_load_mcu/rtos/vision_apps/out/J7/C66/FREERTOS/release/vx_app_rtos_linux_c6x_2.out' failed
make[2]: [/home/CN/qidong.liu/ti/tda4/server/modify_load_mcu/rtos/vision_apps/out/J7/C66/FREERTOS/release/vx_app_rtos_linux_c6x_2.out] Error 1 (ignored)
error: errors encountered during linking;
"/home/CN/qidong.liu/ti/tda4/server/modify_load_mcu/rtos/vision_apps/out/J7/
C71/FREERTOS/release/vx_app_rtos_linux_c7x_1.out" not built
concerto/finale.mak:212: recipe for target '/home/CN/qidong.liu/ti/tda4/server/modify_load_mcu/rtos/vision_apps/out/J7/C71/FREERTOS/release/vx_app_rtos_linux_c7x_1.out' failed
make[2]: [/home/CN/qidong.liu/ti/tda4/server/modify_load_mcu/rtos/vision_apps/out/J7/C71/FREERTOS/release/vx_app_rtos_linux_c7x_1.out] Error 1 (ignored)
Copying built libraries: /home/CN/qidong.liu/ti/tda4/server/modify_load_mcu/rtos/vision_apps/out/J7/R5F/FREERTOS/release to /home/CN/qidong.liu/ti/tda4/server/modify_load_mcu/rtos/vision_apps/lib/J7/R5F/FREERTOS/release
 
Board_init function has been declared in <ti/board/board.h> header file and rtos\vision_apps\platform\j721e\rtos\common\app_init.c file also include this h.file by default.
The customer would like to know how to resolve this issue? Could you help check this case? Thanks.
Best Regards,
Cherry
  • Hi Cherry,

    Board_init should not be called from all cores, ie from app_init. Can you please include/call it only from mcu2_0 or one of R5F core?

    Regards,

    Brijesh

  • Hi. I changed where Board_init is called. Now the compilation can successfully compile and pass. Now I want to control GPIO0_49 -> AE26 to output high level, the corresponding GPIO initialization code is as follows:
    Board_initCfg boardCfg;
    boardCfg = BOARD_INIT_ALL
    Board_init(boardCfg);
    GPIO_init();
    GPIO_write(49, GPIO_PIN_VAL_HIGH);
    The above code is compiled and run, and the GPIO0_49 pin does not output a high level. Is there a problem with my configuration?

  • Hi,

    Please check pinmux register and see if it is setup correctly. 

    Please check below e2e ticket.

    https://e2e.ti.com/support/processors-group/processors/f/processors-forum/1110027/tda4vm-how-to-control-main-domain-s-peripherals-on-r5f-mcu

    Regards,

    Brijesh

  • root@j7-evm:/opt/vision_apps# k3conf read 0x0011c0c8
    |--------------------------------------------------------------------------------|
    | VERSION INFO |
    |--------------------------------------------------------------------------------|
    | K3CONF | (version v0.1-45-g79f007c built Wed Mar 23 21:04:31 UTC 2022) |
    | SoC | J721E SR1.0 |
    | SYSFW | ABI: 3.1 (firmware version 0x0016 '22.1.1--v2022.01 (Terrific Llam)') |
    |--------------------------------------------------------------------------------|

    Value at addr 0x11c0c8 = 0xbffdf83f

    root@j7-evm:/opt/vision_apps#

    Hello, this is the value of the corresponding register I read, is the value correct?

    The register address is calculated as follows:

    PIN_PRG0_PRU0_GPO6         = 0xC8U,
    /* MyGPIO1 -> GPIO0_49 -> AE26 */
        {
            PIN_PRG0_PRU0_GPO6, PIN_MODE(7) | \
            ((PIN_PULL_DIRECTION) & (~PIN_PULL_DISABLE & ~PIN_INPUT_ENABLE))
        },
    regaddr=0x0011c0c8
  • When controlling the GPIO output high and low level on the MCU, it is set by GPIO_write. Its prototype is: void GPIO_write(uint32_t idx, uint32_t value). How to calculate the idx parameter of this function? For example, if I want to set the pin GPIO0_49, what is the idx corresponding to this pin?

  • Hello, this is the value of the corresponding register I read, is the value correct?

    No, this value is not correct. Please try to set/overwrite this value using k3conf and check it again?

    How to calculate the idx parameter of this function? For example, if I want to set the pin GPIO0_49, what is the idx corresponding to this pin?

    Index/idx is index of the GPIO in the array, gpioPinConfigs.

    Regards,

    Brijesh

  • Hello, gpioPinConfigs is the variable assignment in GPIO_v0_Config. But where is GPIO_v0_Config called?
    code show as below:

    GPIO_PinConfig gpioPinConfigs[] =
    {
    /* Output pin GPIO0_64*/
    GPIO_DEVICE_CONFIG(LED0_PORT_NUM, LED0_PIN_NUM) |
    GPIO_CFG_OUTPUT
    };

    /* GPIO Driver call back functions */
    GPIO_CallbackFxn gpioCallbackFunctions[] =
    {
    NULL,
    };

    /* GPIO Driver configuration structure */
    GPIO_v0_Config GPIO_v0_config =
    {
    gpioPinConfigs,
    gpioCallbackFunctions,
    sizeof(gpioPinConfigs) / sizeof(GPIO_PinConfig),
    sizeof(gpioCallbackFunctions) / sizeof(GPIO_CallbackFxn),
    0
    };

    I don't know where GPIO_v0_Config is called?

  • GPIO_v0_Config  is used internally inside the driver. So please just initialize this structure and driver will use it.

    Regards,

    Brijesh