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.

AM62A7: How can control GPIO to toggole its level in tiboot3.bin

Part Number: AM62A7

How can control GPIO to toggole its level in tiboot3.bin in programe  anywhere?

Because my tiboot3 in uboot always canot  print log in uart.

So now I should have one gpio output to know where it is run to.

I have set as follow but it can not work.Only I put it to MCU core ,it can toggle gpio normaly.

void TXEN(void)
{
// *((volatile uint32_t*)0x4081008) = 0x68EF3490U;
// *((volatile uint32_t*)0x408100C) = 0xD172BC5AU;
// *((volatile uint32_t*)0x4085008) = 0x68EF3490U;
// *((volatile uint32_t*)0x408500C) = 0xD172BC5AU;

// *((volatile int32_t*)0x04084040) |= 0007U;

// *((volatile uint32_t*)0x4081008) = 0;
// *((volatile uint32_t*)0x408100C) = 0;
// *((volatile uint32_t*)0x4085008) = 0;
// *((volatile uint32_t*)0x408500C) = 0;

///dir
*((volatile uint32_t*)0x4201010) &= ~(1<<16);
*((volatile uint32_t*)0x420101C) |= (1<<16);///clr
*((volatile uint32_t*)0x4201018) |= 1<<16;
}

  • Hello,
    For debugging R5-SPL (tiboot3.bin), I'd recommend
    - log from serial port
    As noted in code snippet below, uart log would become available afterwards...
    git.ti.com/gitweb
    - JTAG debugger
    In case it is necessary to debug the code where uart console is not available yet...
    Best,
    -Hong

  • But i dont know why my uart canot print.As also my jtag cannot connect.

    I have ask the question in e2e,but there is not valid solution for it.

    SO I try to use GPIO find out why uart can not print.

    My uart device configuration have paste in my question.The replyer dont say it have problem.

  • The following function can work if it is in tiboot3 of sbl1.But tiboot3 of uboot can not work?

    int main()
    {
    int32_t status;

    Bootloader_profileReset();
    TXEN();
    // PowerClock_init();

    }

    void TXEN(void)
    {

    uint32_t loopcnt = 5, delaySec = 1;
    uint32_t gpioBaseAddr, pinNum;
    *((volatile uint32_t*)0x4081008) = 0x68EF3490U;
    *((volatile uint32_t*)0x408100C) = 0xD172BC5AU;
    *((volatile uint32_t*)0x4085008) = 0x68EF3490U;
    *((volatile uint32_t*)0x408500C) = 0xD172BC5AU;

    *((volatile int32_t*)0x04084040) |= 0x00050007U;

    *((volatile uint32_t*)0x4081008) = 0;
    *((volatile uint32_t*)0x408100C) = 0;
    *((volatile uint32_t*)0x4085008) = 0;
    *((volatile uint32_t*)0x408500C) = 0;

    // gpioBaseAddr = (uint32_t) AddrTranslateP_getLocalAddr(CANEN_BASE_ADDR);
    // pinNum = CANEN_PIN;
    // GPIO_setDirMode(gpioBaseAddr, pinNum, GPIO_DIRECTION_OUTPUT);
    //
    // GPIO_pinWriteHigh(gpioBaseAddr, pinNum);

    ///dir
    *((volatile uint32_t*)0x4201010) &= ~(1<<16);
    *((volatile uint32_t*)0x420101C) |= (1<<16);///clr
    *((volatile uint32_t*)0x4201018) |= 1<<16;
    }

  • Hello,
    1/. Is it TI reference board or customer board?
    2/. If it is TI board, serial log from UART port would work in R5-SPL (tiboot3.bin) in Linux SDK.

    Best,
    -Hong

  • It is customer board.And it's UART port change to main uart0

  • Hello,
    The main_uart0 is used for u-boot serial terminal on TI reference AM62A-SK board.
    Some relevant u-boot DT node for main_uart0 for AM62A-SK for your reference:
    git.ti.com/.../k3-am62a-main.dtsi
    git.ti.com/.../k3-am62a7-sk.dts
    git.ti.com/.../k3-am62a7-sk.dts
    Best,
    -Hong

  • now it is OK.The GPIO is not related any other module,if the setting padconfig and output as follow.

    void TXEN(void)
    {
    // *((volatile uint32_t*)0x4081008) = 0x68EF3490U;
    // *((volatile uint32_t*)0x408100C) = 0xD172BC5AU;
    // *((volatile uint32_t*)0x4085008) = 0x68EF3490U;
    // *((volatile uint32_t*)0x408500C) = 0xD172BC5AU;

    // *((volatile int32_t*)0x04084040) |= 0x0507U;------this is the key point.

    // *((volatile uint32_t*)0x4081008) = 0;
    // *((volatile uint32_t*)0x408100C) = 0;
    // *((volatile uint32_t*)0x4085008) = 0;
    // *((volatile uint32_t*)0x408500C) = 0;

    ///dir
    *((volatile uint32_t*)0x4201010) &= ~(1<<16);
    *((volatile uint32_t*)0x420101C) |= (1<<16);///clr
    *((volatile uint32_t*)0x4201018) |= 1<<16;
    }