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.

[参考译文] TM4C129XNCZAD:UART3上的引导加载程序

Guru**** 2397345 points


请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1507431/tm4c129xnczad-bootloader-on-uart3

器件型号:TM4C129XNCZAD

工具/软件:

我使用 TIVA 的引导加载程序示例并在 UART1上正常工作。 现在同样, 我想修改 UART3 什么更改必须在 blconfig.h .

 

void Uart3_Boot_init (uint32_t ui32SysClock){
MAP_GPIOPinTypeUART (GPIO_PORTA_BASE、GPIO_PIN_4 | GPIO_PIN_5);//将 GPIO A6设置为 UART 引脚。

MAP_UARTConfigSetExpClk (UART3_BASE、ui32SysClock、115200、
(UART_CONFIG_WLEN_8 | UART_CONFIG_STOP_ONE | UART_CONFIG_PAR_NONE);


MAP_IntEnable (INT_UART3);
MAP_UARTIntEnable (UART3_BASE、UART_INT_RX | UART_INT_RT);


write_ptr_uart3 = cir_buffer_uart3;
READ_PTR_uart3 = cir_buffer_uart3;
rcv_buff_end_uart3 =&cir_buffer_uart3[UART3_size];

}

e2e.ti.com/.../7522.bl_5F00_config.h

在 blconfi 中会发生什么变化

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    您好、

     我可以在 bl_config.h 文件中看到您指定 UART1、而不是 UART3。 下面是与 UART 设置相关的 bl_config.h 片段。  您需要更改 UART3的所有#define。  

    //*****************************************************************************
    //
    // Selects the UART as the port for communicating with the boot loader.
    //
    // Depends on: None
    // Exclusive of: CAN_ENABLE_UPDATE, ENET_ENABLE_UPDATE, I2C_ENABLE_UPDATE,
    // SSI_ENABLE_UPDATE, USB_ENABLE_UPDATE
    // Requires: UART_AUTOBAUD or UART_FIXED_BAUDRATE, UART_CLOCK_ENABLE,
    // UARTx_BASE, UART_RXPIN_CLOCK_ENABLE, UART_RXPIN_BASE,
    // UART_RXPIN_PCTL, UART_RXPIN_POS, UART_TXPIN_CLOCK_ENABLE,
    // UART_TXPIN_BASE, UART_TXPIN_PCTL and UART_TXPIN_POS
    //
    //*****************************************************************************
    #define UART_ENABLE_UPDATE

    //*****************************************************************************
    //
    // Enables automatic baud rate detection. This can be used if the crystal
    // frequency is unknown, or if operation at different baud rates is desired.
    //
    // Depends on: UART_ENABLE_UPDATE
    // Exclusive of: UART_FIXED_BAUDRATE
    // Requires: None
    //
    //*****************************************************************************
    //#define UART_AUTOBAUD

    //*****************************************************************************
    //
    // Selects the baud rate to be used for the UART.
    //
    // Depends on: UART_ENABLE_UPDATE, CRYSTAL_FREQ
    // Exclusive of: UART_AUTOBAUD
    // Requires: None
    //
    //*****************************************************************************
    #define UART_FIXED_BAUDRATE 115200

    //*****************************************************************************
    //
    // Selects the clock enable for the UART peripheral module
    //
    // Depends on: UART_ENABLE_UPDATE
    // Exclusive of: None
    // Requires: UARTx_BASE
    //
    //*****************************************************************************
    #define UART_CLOCK_ENABLE SYSCTL_RCGCUART_R1

    //*****************************************************************************
    //
    // Selects the base address of the UART peripheral module
    //
    // Depends on: UART_ENABLE_UPDATE
    // Exclusive of: None
    // Requires: UART_CLOCK_ENABLE
    //
    //*****************************************************************************
    #define UARTx_BASE UART1_BASE

    //*****************************************************************************
    //
    // Selects the clock enable for the GPIO corresponding to UART RX pin
    //
    // Depends on: UART_ENABLE_UPDATE
    // Exclusive of: None
    // Requires: UART_RXPIN_BASE, UART_RXPIN_PCTL and UART_RXPIN_POS
    //
    //*****************************************************************************
    #define UART_RXPIN_CLOCK_ENABLE SYSCTL_RCGCGPIO_R14

    //*****************************************************************************
    //
    // Selects the base address for the GPIO corresponding to UART RX pin
    //
    // Depends on: UART_ENABLE_UPDATE
    // Exclusive of: None
    // Requires: UART_RXPIN_CLOCK_ENABLE, UART_RXPIN_PCTL and UART_RXPIN_POS
    //
    //*****************************************************************************
    #define UART_RXPIN_BASE GPIO_PORTQ_BASE

    //*****************************************************************************
    //
    // Selects the port control value for the GPIO corresponding to UART RX pin
    //
    // Depends on: UART_ENABLE_UPDATE
    // Exclusive of: None
    // Requires: UART_RXPIN_CLOCK_ENABLE, UART_RXPIN_BASE and UART_RXPIN_POS
    //
    //*****************************************************************************
    #define UART_RXPIN_PCTL 0x1

    //*****************************************************************************
    //
    // Selects the pin number for the GPIO corresponding to UART RX pin
    //
    // Depends on: UART_ENABLE_UPDATE
    // Exclusive of: None
    // Requires: UART_RXPIN_CLOCK_ENABLE, UART_RXPIN_BASE and UART_RXPIN_PCTL
    //
    //*****************************************************************************
    #define UART_RXPIN_POS 4

    //*****************************************************************************
    //
    // Selects the clock enable for the GPIO corresponding to UART TX pin
    //
    // Depends on: UART_ENABLE_UPDATE
    // Exclusive of: None
    // Requires: UART_TXPIN_BASE, UART_TXPIN_PCTL and UART_TXPIN_POS
    //
    //*****************************************************************************
    #define UART_TXPIN_CLOCK_ENABLE SYSCTL_RCGCGPIO_R14

    //*****************************************************************************
    //
    // Selects the base address for the GPIO corresponding to UART TX pin
    //
    // Depends on: UART_ENABLE_UPDATE
    // Exclusive of: None
    // Requires: UART_TXPIN_CLOCK_ENABLE, UART_TXPIN_PCTL and UART_TXPIN_POS
    //
    //*****************************************************************************
    #define UART_TXPIN_BASE GPIO_PORTQ_BASE

    //*****************************************************************************
    //
    // Selects the port control value for the GPIO corresponding to UART TX pin
    //
    // Depends on: UART_ENABLE_UPDATE
    // Exclusive of: None
    // Requires: UART_TXPIN_CLOCK_ENABLE, UART_TXPIN_BASE and UART_TXPIN_POS
    //
    //*****************************************************************************
    #define UART_TXPIN_PCTL 0x1

    //*****************************************************************************
    //
    // Selects the pin number for the GPIO corresponding to UART TX pin
    //
    // Depends on: UART_ENABLE_UPDATE
    // Exclusive of: None
    // Requires: UART_TXPIN_CLOCK_ENABLE, UART_TXPIN_BASE and UART_TXPIN_PCTL
    //
    //*****************************************************************************
    #define UART_TXPIN_POS 5