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.
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.
((void (*)(void))g_ui32TransferAddress)();
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
#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 // //***************************************************************************** #define UART_RXPIN_CLOCK_ENABLE SYSCTL_RCGCGPIO_R2 //***************************************************************************** // // 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_PORTC_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 0x00021001 //***************************************************************************** // // 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_R2 //***************************************************************************** // // 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_PORTC_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 0x00021401 //***************************************************************************** // // 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
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
//***************************************************************************** // // 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 // validity of the application image. // // The flash image of the boot loader must not be larger than this value. // // Depends on: None // Exclusive of: None // Requires: None // //***************************************************************************** #define APP_START_ADDRESS 0x4000 //***************************************************************************** // // The address at which the application locates its exception vector table. // This must be a multiple of 1024 bytes (making it aligned to a page // boundary). Typically, an application will start with its vector table and // this value should be set to APP_START_ADDRESS. This option is provided to // cater for applications which run from external memory which may not be // accessible by the NVIC (the vector table offset register is only 30 bits // long). // // Depends on: None // Exclusive of: None // Requires: None // //***************************************************************************** #define VTABLE_START_ADDRESS 0x4000 //***************************************************************************** // // The size of a single, erasable page in the flash. This must be a power // of 2. // // Depends on: None // Exclusive of: None // Requires: None // //***************************************************************************** #define FLASH_PAGE_SIZE 0x00000400 //***************************************************************************** // // The amount of space at the end of flash to reserved. This must be a // multiple of 1024 bytes (making it aligned to a page boundary). This // reserved space is not erased when the application is updated, providing // non-volatile storage that can be used for parameters. // // Depends on: None // Exclusive of: None // Requires: None // //***************************************************************************** //#define FLASH_RSVD_SPACE 0x00000800 //***************************************************************************** // // The number of words of stack space to reserve for the boot loader. // // Depends on: None // Exclusive of: None // Requires: None // //***************************************************************************** #define STACK_SIZE 48 //***************************************************************************** // // The number of words in the data buffer used for receiving packets. This // value must be at least 3. If using auto-baud on the UART, this must be at // least 20. The maximum usable value is 65 (larger values will result in // unused space in the buffer). // // Depends on: None // Exclusive of: None // Requires: None // //***************************************************************************** #define BUFFER_SIZE 65
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
/****************************************************************************** * * 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. * *****************************************************************************/ --retain=g_pfnVectors /* The following command line options are set as part of the CCS project. */ /* If you are building using the command line, or for some reason want to */ /* define them here, you can uncomment and modify these lines as needed. */ /* If you are using CCS for building, it is probably better to make any such */ /* modifications in your CCS project and leave this file alone. */ /* */ /* --heap_size=0 */ /* --stack_size=256 */ /* --library=rtsv7M3_T_le_eabi.lib */ /* The starting address of the application. Normally the interrupt vectors */ /* must be located at the beginning of the application. */ #define APP_BASE 0x00004000 #define RAM_BASE 0x20000000 /* System memory map */ MEMORY { /* Application stored in and executes from internal flash */ FLASH (RX) : origin = APP_BASE, length = 0x000fc000 /* Application uses internal RAM for data */ SRAM (RWX) : origin = 0x20000000, length = 0x00040000 } /* Section allocation in memory */ SECTIONS { .intvecs: > APP_BASE .text : > FLASH .const : > FLASH .cinit : > FLASH .pinit : > FLASH .init_array : > FLASH .vtable : > RAM_BASE .data : > SRAM .bss : > SRAM .sysmem : > SRAM .stack : > SRAM #ifdef __TI_COMPILER_VERSION__ #if __TI_COMPILER_VERSION__ >= 15009000 .TI.ramfunc : {} load=FLASH, run=SRAM, table(BINIT) #endif #endif } __STACK_TOP = __stack + 1024;