Tool/software:
Hi Team
Iam trying to do custom firmware upgrade via ethernet bootloader code by partitioning the FLASH for custom bootloader and custom Application
The problem iam facing is
Non RTOS Application are working and booting properly after Firmware upgrade
Whereas using RTOS based application in firmware upgrade , It get stuck in switch address function mentioned below
void SwitchAddress(uint32_t StartAddress)
{
UARTprintf("Start at %x\n",StartAddress);
IntDisable(INT_TIMER0A);
IntDisable(INT_TIMER1A);
IntDisable(INT_TIMER2A);
IntDisable(INT_EMAC0);
IntDisable(FAULT_SYSTICK);
IntDisable(FAULT_NMI);
IntDisable(FAULT_HARD);
//
// Disable all processor interrupts. Instead of disabling them
// one at a time, a direct write to NVIC is done to disable all
// peripheral interrupts.
//
HWREG(NVIC_DIS0) = 0xffffffff;
HWREG(NVIC_DIS1) = 0xffffffff;
HWREG(NVIC_DIS2) = 0xffffffff;
HWREG(NVIC_DIS3) = 0xffffffff;
HWREG(NVIC_VTABLE) = StartAddress;
// Load the stack pointer from the application's vector table.
__asm(" ldr r1, [r0]\n"
" mov sp, r1");
// Load the initial PC from the application's vector table and branch to
// the application's entry point.
__asm(" ldr r0, [r0, #4]\n"
" bx r0\n");
}
I will share my Bootloader and Application .CMD files
Bootloader.cmd file
/******************************************************************************
*
* Copyright (c) 2013-2017 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.
*
*
*****************************************************************************/
--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 0x00000000
#define RAM_BASE 0x20000000
#define APP_LENGTH 0x01000000 //0x010000000
#define EXSRAM_BASE 0x60000000
/* System memory map */
MEMORY
{
/* Application stored in and executes from internal flash */
FLASH (RX) : origin = APP_BASE, length = 0x0000B000
/* Application uses internal RAM for data */
SRAM (RWX) : origin = RAM_BASE, length = 0x00040000
SDRAM (RWX) : origin = EXSRAM_BASE, length = 0x01000000
}
/* 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
/* .sdram : > EXSRAM_BASE*/
#ifdef __TI_COMPILER_VERSION__
#if __TI_COMPILER_VERSION__ >= 15009000
.TI.ramfunc : {} load=FLASH, run=SRAM, table(BINIT)
#endif
#endif
}
__STACK_TOP = __stack + 512;
Application .cmd file
/******************************************************************************
*
* Default Linker Command file for the Texas Instruments TM4C1294NCPDT
*
* This is derived from revision 15071 of the TivaWare Library.
*
*****************************************************************************/
--retain=g_pfnVectors
#define APP_BASE 0xC000//0x04000 //000B078
#define RAM_BASE 0x20000000 + 512
MEMORY
{
FLASH (RX) : origin = APP_BASE, length = 0x00016000//(1024K - 0xB078)
SRAM (RWX) : origin = 0x20000000, length = 256K//0x01000000
}
/* 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=rtsv7M4_T_le_eabi.lib */
/* Section allocation in memory */
SECTIONS
{
.intvecs: > APP_BASE
.text : > FLASH
.const : > FLASH
.cinit : > FLASH
.pinit : > FLASH
.init_array : > FLASH
// .isr_vector : > 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
}
//_estack = 0x20040000;
__STACK_TOP = __stack + 512;
Can you please help us check any configuration mistakes in .cmd file or any changes to be made for booting RTOS based code
from Non-RTOS bootloader