Tool/software: TI-RTOS
Hi,
I need some guidance on how to program two applications in the flash of a CC1310.
I am using a CC1310 Launchpad.
Until now, I did the following:
1. Create a simple project in the Code Composer Studio which blinks the red led. The project is called bootloader.
2. Create a simple project in the Code Composer Studio which blinks the green led. The project is called application.
3. In the .cfg file, comment the ROM configuration in both bootloader and application.
/* ================ ROM configuration ================ */ /* * To use BIOS in flash, comment out the code block below. */ /* var ROM = xdc.useModule('ti.sysbios.rom.ROM'); if (Program.cpu.deviceName.match(/CC26/)) { ROM.romName = ROM.CC2650; } else if (Program.cpu.deviceName.match(/CC13/)) { ROM.romName = ROM.CC1350; } */
4. Leave the .cmd file of the bootloader as it is.
/* * ======== CC1310_LAUNCHXL.cmd ======== * CC26x0F128 PG2 linker configuration file for Code Composer Studio */ /* Override default entry point. */ --entry_point ResetISR /* Allow main() to take args */ --args 0x8 /* Suppress warnings and errors: */ /* - 10063: Warning about entry point not being _c_int00 */ /* - 16011, 16012: 8-byte alignment errors. Observed when linking in object */ /* files compiled using Keil (ARM compiler) */ --diag_suppress=10063,16011,16012 /* The starting address of the application. Normally the interrupt vectors */ /* must be located at the beginning of the application. */ #define FLASH_BASE 0x0 #define FLASH_SIZE 0x20000 #define RAM_BASE 0x20000000 #define RAM_SIZE 0x5000 /* System memory map */ MEMORY { /* Application stored in and executes from internal flash */ FLASH (RX) : origin = FLASH_BASE, length = FLASH_SIZE /* Application uses internal RAM for data */ SRAM (RWX) : origin = RAM_BASE, length = RAM_SIZE } /* Section allocation in memory */ SECTIONS { .text : > FLASH .const : > FLASH .constdata : > FLASH .rodata : > FLASH .cinit : > FLASH .pinit : > FLASH .init_array : > FLASH .emb_text : > FLASH .ccfg : > FLASH (HIGH) #ifdef __TI_COMPILER_VERSION__ #if __TI_COMPILER_VERSION__ >= 15009000 .TI.ramfunc : {} load=FLASH, run=SRAM, table(BINIT) #endif #endif .data : > SRAM .bss : > SRAM .sysmem : > SRAM .stack : > SRAM (HIGH) .nonretenvar : > SRAM }
5. Change the flash address of the application in the .cmd file.
/* * ======== CC1310_LAUNCHXL.cmd ======== * CC26x0F128 PG2 linker configuration file for Code Composer Studio */ /* Override default entry point. */ --entry_point ResetISR /* Allow main() to take args */ --args 0x8 /* Suppress warnings and errors: */ /* - 10063: Warning about entry point not being _c_int00 */ /* - 16011, 16012: 8-byte alignment errors. Observed when linking in object */ /* files compiled using Keil (ARM compiler) */ --diag_suppress=10063,16011,16012 /* The starting address of the application. Normally the interrupt vectors */ /* must be located at the beginning of the application. */ #define FLASH_BASE 0x10000 //0x0 #define FLASH_SIZE 0x10000 //0x20000 #define RAM_BASE 0x20000000 #define RAM_SIZE 0x5000 /* System memory map */ MEMORY { /* Application stored in and executes from internal flash */ FLASH (RX) : origin = FLASH_BASE, length = FLASH_SIZE /* Application uses internal RAM for data */ SRAM (RWX) : origin = RAM_BASE, length = RAM_SIZE } /* Section allocation in memory */ SECTIONS { .text : > FLASH .const : > FLASH .constdata : > FLASH .rodata : > FLASH .cinit : > FLASH .pinit : > FLASH .init_array : > FLASH .emb_text : > FLASH .ccfg : > FLASH (HIGH) #ifdef __TI_COMPILER_VERSION__ #if __TI_COMPILER_VERSION__ >= 15009000 .TI.ramfunc : {} load=FLASH, run=SRAM, table(BINIT) #endif #endif .data : > SRAM .bss : > SRAM .sysmem : > SRAM .stack : > SRAM (HIGH) .nonretenvar : > SRAM }
6. Change the reset vector address of the application in the .cfg file.
/* * Assign an address for the reset vector. * * Default is 0x0, which is the start of Flash. Ordinarily this setting should * not be changed. */ m3Hwi.resetVectorAddress = 0x10000; //0x0;
7. Program the bootloader in the CC1310 using the Code Composer Studio.
8. Program the application in the CC1310 using the Code Composer Studio.
After all that, when I turn on the launchpad it starts blinking the red led (which represents the bootloader). It works as expected.
Now, the questions:
1. Are the steps I made correct?
2. I will add a button function in the bootloader and I would like to jump to application when the button is pressed. How can I do that jump?