Hello
I have spent couple days to get that far but it looks I need some advice regarding the problem.
SHORT STORY - few months back I have successfully developed test bootloader app sitting at location 0x00 and two programs flashing leds at location 0x2800 and 0x3800 that where booting alternatively without any issues.
| TivaWare Bootloader | App1 - LED Blink | App2 - LED Blink |
------------------------------------------------------------------------------------
In recent months I switched to TI-RTOS and the project is nearly finished. For the field testing I need the updates to be working, but my old solution is not working with the TI-RTOS
I have found number of helpful post that got me that far; bootloader jumps to 0x2800 location and I can run the TI-RTOS code (led blink once) all SPI, GPIO inits going well, I get to BIOS_start(); after that nothing more happens. When I halt target the code execution is around Idle_Task all the time.
Trying to find more details about the problem I set few break points at each task begging. For example Task that blinks LEDs
while(true) { switch(LEDs_Switch_State) { case LEDs_INIT_0:{ Task_sleep(100); GPIO_toggle(LED_1); GPIO_toggle(LED_2); GPIO_toggle(LED_3); GPIO_toggle(LED_4); } break;
The execution stuck on the Task_sleep(100); , occasionally it will run once through the while loop but then it stops. (When I halt the target code execution is around Idle task as I mentioned before and I can run it step by step).
Once my linker script is reversed to the original location 0x00 everything is working fine.
//***************Bellow bootloader code (Tiva Ware);
IntMasterDisable(); // disable interrupts
HWREG(NVIC_VTABLE) = 0x00002800;//0x00002C00;//0x00002800;
__asm(" ldr r1, [r0]\n"
" mov sp, r1");
__asm(" ldr r0, [r0, #4]\n"
" bx r0\n");
// __asm(" movw r0, #0x0000;"
// "movt r0, #0x0040;"
// "ldr sp, [r0, #0];"
// "ldr pc, [r0, #4];");
///////**************Bootloader Linker:
/******************************************************************************
*
* Default Linker Command file for the Texas Instruments TM4C123GH6PM
*
* This is derived from revision 11167 of the TivaWare Library.
*
*****************************************************************************/
#define APP_BASE 0x00000000 //0x00002800
#define RAM_BASE 0x20000000
--retain=g_pfnVectors
MEMORY
{
FLASH (RX) : origin = 0x00000000, length = 0x00030000
SRAM (RWX) : origin = 0x20000000, length = 0x00008000
}
/* 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: > 0x00000000
.text : > FLASH
.const : > FLASH
.cinit : > FLASH
.pinit : > FLASH
.init_array : > FLASH
.vtable : > 0x20000000
.data : > SRAM
.bss : > SRAM
.sysmem : > SRAM
.stack : > SRAM
}
__STACK_TOP = __stack + 512;
-----------
///*****************TI-RTOS Linker:
#define BL_BASE 0x00000000
#define APP_BASE 0x00002800
#define APP_BASE_PLUS_RSTVECS 0x00002C00
--retain=g_pfnVectors
MEMORY
{
FLASH_BL (RX) : origin = BL_BASE, length = APP_BASE
FLASH_VEC (RX) : origin = APP_BASE, length = 0x00000400
FLASH (RX) : origin = APP_BASE_PLUS_RSTVECS, length = 0x0000F000
SRAM (RWX) : origin = 0x20000000, length = 0x00008000
}
/* 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
.vtable : > 0x20000000
.data : > SRAM
.bss : > SRAM
.sysmem : > SRAM
.stack : > SRAM
}
__STACK_TOP = __stack + 256;
--------
//*********Lines added to the TI-RTOS cfg file:
// Import the device specific Hwi module
var m3Hwi = xdc.useModule('ti.sysbios.family.arm.m3.Hwi');
//m3Hwi.vectorTableAddress = 0x00002800;
m3Hwi.resetVectorAddress = 0x00002800;
// Program.sectMap[".resetVecs"] = new Program.SectionSpec();
//Program.sectMap[".resetVecs"] = "FLASH_VEC";
//////****************************
Please note that Im not using external oscillator - only internal, but I tested on the development board that had the external osc with no visible difference in the code.
Please advice
Regards
Patrick