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.

UART BootLoader

Other Parts Discussed in Thread: UNIFLASH, LMFLASHPROGRAMMER, EK-TM4C1294XL

Hi

Hi I want to know if it is possible to use UART1 instead of UART0 for uploading the code using BootLoader

Thanks

Siva

  • I don't recall that answer "cold."     Yet - should you embark on any Bootloader activity - is not a thorough read/review of the "Bootloader User Guide" (or similar) very much required?     Without doubt - your answer will be revealed therein - along with many other items of interest.   

    Be mindful that certain MCUs contain a Bootloader w/in their masked ROM - and that Flash based Bootloaders are (also) an option.     Again - bit more study will alert you to the possibilities - so that you may choose the "best path."

    Success with Bootloaders often is not "instant" nor "easy" - be prepared for serious time/effort and great, "attention to exacting detail."     Should you be new to MCUs - starting too soon w/Bootloaders may not be your wisest choice...

  • Hello Siva,

    Yes you can use the UART1 as boot loader. However this would not change the ROM. The ROM boot loader will always use UART0. To do a custom boot loader you would need two important information

    1. The boot loader to be based in flash. For this TivaWare has some example code in each of the board's example folder for using a custom boot loader
    2. The required HW for connecting a PC (USB 2 UART dongle) where the master interface shall reside in form of LMFlashProgrammer, sflash or UNIFlash applications.

    Regards
    Amit
  • Thanks Amit

    BTW the Boot-Serial Example in TM4C123G uses Flash boot Loader doesn't it..
    ?
  • Hello Siva,

    Yes. The boot_serial for DK-TM4C123G does use the Flash based boot loader. Do note that the latest 2.1.1.71 release of TivaWare has made a lot of fixes to the boot loader to make it generic.

    Regards
    Amit
  • Greetings,

    I am attempting this on my EK-TM4C1294XL Tiva Launch pad with UART3. I have (U3Rx and U3Tx) Ports PA4 and PA5 connected to my PC using and FTDI USB to UART cable, and I have verified that this connection is functional by using it with the uart_echo example (after changing UART0 to UART3). I have had success with the boot_serial, boot_demo1, and boot_demo2 examples when using UART0. I would now like to do the same thing but instead using UART3.
    My UART related defines in bl_config.h (in serial_boot) are as follows;

    #define UART_ENABLE_UPDATE
    #define UART_FIXED_BAUDRATE 115200
    #define UART_CLOCK_ENABLE SYSCTL_RCGCUART_R0
    #define UARTx_BASE UART3_BASE
    #define UART_RXPIN_CLOCK_ENABLE SYSCTL_RCGCGPIO_R0
    #define UART_RXPIN_BASE GPIO_PORTA_BASE
    #define UART_RXPIN_PCTL 0x1
    #define UART_RXPIN_POS 4 // for U3Rx at PA4
    #define UART_TXPIN_CLOCK_ENABLE SYSCTL_RCGCGPIO_R0
    #define UART_TXPIN_BASE GPIO_PORTA_BASE
    #define UART_TXPIN_PCTL 0x1
    #define UART_TXPIN_POS 5 // for U3Tx at PA5

    Next I load this through ICDI with LM Flash at address 0x0

    I made modifications in boot_demo1.c SetupForUART to use UART3

    void
    SetupForUART(void)
    {
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART3);
    ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);

    ROM_GPIOPinConfigure(GPIO_PA4_U3RX);
    ROM_GPIOPinConfigure(GPIO_PA5_U3TX);
    ROM_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_4 | GPIO_PIN_5);

    ROM_UARTConfigSetExpClk(UART3_BASE, g_ui32SysClockFreq, 115200,
    (UART_CONFIG_PAR_NONE | UART_CONFIG_STOP_ONE |
    UART_CONFIG_WLEN_8));

    ROM_UARTEnable(UART3_BASE);
    }

    Next I tried loading boot_demo1.c at adress 0x4000 with LM Flash through my FTDI cable, but no luck. Again, everything has worked when I used UART0 (default in the examples).

    What did I forget?

    Any replies would be much appreciated. Thank you very much!

    -Jack
  • Hello Jack

    For UART3 the define for clock enable in the boot loader must be

    #define UART_CLOCK_ENABLE SYSCTL_RCGCUART_R0

    must be

    #define UART_CLOCK_ENABLE SYSCTL_RCGCUART_R3
  • Thank you so much! It works now.
    I don't know why I didnt check that, my mistake
  • Hello Jack,

    It would always be good to understand the defines as they make code modification easier, but can make identifying the root cause difficult at times.