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.

TM4C1294NCPDT: UART Bootloader

Part Number: TM4C1294NCPDT
Other Parts Discussed in Thread: EK-TM4C1294XL

Tool/software:

Hi, i am trying to test the boot loader for TM4C1294NCPDT with boot_serial project but i have encountered a problem.

I am sending my firmware which is a blink with a button project as binary and get all the ack's in the process and get to the Run stage.
When it gets the run command it just doesn't jump to the firmware but all my configurations seem correct.
I can see it in the memory map that my firmware is indeed present in the address i have set it to (0x4000).
 Even when i reset my device the boot loader doesn't try to call the firmware that is already loaded and it just goes into boot loader mode.


Fullscreen
1
((void (*)(void))g_ui32TransferAddress)();
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


and g_ui32TransferAddress comes as 16384 which is consistent because its hex 0x4000.

i have only configured uart 0 to be uart 7 for my testing purposes and changed the BL_FLASH_SIZE_FN_HOOK to  SysCtlFlashSizeGet().

Does anybody encountered a similar problem before ?


  • Hi,

     Have you got the stock example to work as is? The stock bootloader (located 0x0) is in C:\ti\TivaWare_C_Series-2.2.0.295\examples\boards\ek-tm4c1294xl\boot_serial and the example firmware (located at 0x4000) to be loaded from UART0 is at C:\ti\TivaWare_C_Series-2.2.0.295\examples\boards\ek-tm4c1294xl\boot_demo1?

    i have only configured uart 0 to be uart 7 for my testing purposes and changed the BL_FLASH_SIZE_FN_HOOK to  SysCtlFlashSizeGet().

    If this is the only thing you changed then it is not enough. Have you changed all the below parameters for UART7 in the bl_config.h file? They are currently defined for UART0. 

    //*****************************************************************************
    //
    // 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_R0

    //*****************************************************************************
    //
    // Selects the base address of the UART peripheral module
    //
    // Depends on: UART_ENABLE_UPDATE
    // Exclusive of: None
    // Requires: UART_CLOCK_ENABLE
    //
    //*****************************************************************************
    #define UARTx_BASE UART0_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_R0

    //*****************************************************************************
    //
    // 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_PORTA_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 0

    //*****************************************************************************
    //
    // 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_R0

    //*****************************************************************************
    //
    // 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_PORTA_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 1

  • no i have not used the boot_demo_1 or 2, should i convert them to binary and try them

    and yes i have configured the uart accordingly

     

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    #define UART_CLOCK_ENABLE SYSCTL_RCGCUART_R7
    //*****************************************************************************
    //
    // Selects the base address of the UART peripheral module
    //
    // Depends on: UART_ENABLE_UPDATE
    // Exclusive of: None
    // Requires: UART_CLOCK_ENABLE
    //
    //*****************************************************************************
    #define UARTx_BASE UART7_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
    //
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • I will suggest you try out the stock example and make sure it works with UART0. Afterward, you can modify for UART7. boot_demo.bin is already there in the TivaWare installation. See

  • okey i will try this out 

    would this configuration be correct

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    //*****************************************************************************
    //
    // The frequency of the crystal used to clock the microcontroller.
    //
    // This defines the crystal frequency used by the microcontroller running the
    // boot loader. If this is unknown at the time of production, then use the
    // UART_AUTOBAUD feature to properly configure the UART.
    //
    // Depends on: None
    // Exclusive of: None
    // Requires: None
    //
    //*****************************************************************************
    #define CRYSTAL_FREQ 25000000
    //*****************************************************************************
    //
    // The starting address of the application. This must be a multiple of 1024
    // bytes (making it aligned to a page boundary). A vector table is expected at
    // this location, and the perceived validity of the vector table (stack located
    // in SRAM, reset vector located in flash) is used as an indication of the
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


  • I will suggest you NOT change the stack and buffer size yet. Use the default and get it to work first and then change these parameters later if you believe you need to customize these sizes. 

    You should have the FLASH_PAGE_SIZE set to 0x4000 for correctness. 

    #define FLASH_PAGE_SIZE         0x4000

  • thank you, after i have tried sending the boot_demo_2  it has worked correctly

    then i changed the linker file for the blink_with_button project to this and that also worked

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    /******************************************************************************
    *
    * boot_demo2_ccs.cmd - CCS linker configuration file for boot_demo2.
    *
    * Copyright (c) 2015-2020 Texas Instruments Incorporated. All rights reserved.
    * Software License Agreement
    *
    * Texas Instruments (TI) is supplying this software for use solely and
    * exclusively on TI's microcontroller products. The software is owned by
    * TI and/or its suppliers, and is protected under applicable copyright
    * laws. You may not combine this software with "viral" open-source
    * software in order to form a larger program.
    *
    * THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
    * NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
    * NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    * A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
    * CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
    * DAMAGES, FOR ANY REASON WHATSOEVER.
    *
    * This is part of revision 2.2.0.295 of the EK-TM4C1294XL Firmware Package.
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX