Part Number: TMS320F28069
Tool/software: Code Composer Studio
Hi,
I have been through numerous posts and articles about the custom boot-loader, but I still find myself having few questions about the process.
So, here it is. I am trying to develop a CAN based firmware upgrade technique for my device which runs on an F28069 microcontroller. And I will be using the CAN boot method provided by TI as my Second bootloader and I have used the "f28069_flash_kernel" example provided by TI as my base for Second bootloader project(replacing SCI with CAN).
Two different CCS projects have been created(I also understand each one comes with a codestart.asm routine of its own), one for the CAN bootlader and the other one for Main Application. I have decided I will be using sector A of the Flash to store my "CAN Bootloader" and sector B to store my Main Application.So the way it is supposed to work is when my second bootloader comes up it waits for few seconds to see if it receives "08AA" CAN packet data, and if it doesn't, after a certain period it times out and returns to the FLASH ENTRY POINT which is the address "0x3F3FFE" where my code_start routine for my main application happens to be located.
As far as my Main App goes its located in sector B and I have used the last two addresses of the Flash Sector B to put my code_start routine. So my .cmd Linker file for the Main app looks like this :
MEMORY:
FLASHB : origin = 0x3F0000, length = 0x003FFE /* on-chip FLASH */
BEGIN : origin = 0x3F3FFE, length = 0x000002 /* Part of FLASHA. Used for "boot to Flash" bootloader mode. */
SECTIONS:
/* Allocate program areas: */
.cinit : > FLASHFE, PAGE = 0
.pinit : > FLASHB, PAGE = 0
.text : > FLASHB, PAGE = 0
codestart : > BEGIN, PAGE = 0
And my F28069_codestartbranch.asm looks something like this
.sect "codestart"
code_start:
.if WD_DISABLE == 1
LB wd_disable ;Branch to watchdog disable code
.else
LB _c_int00 ;Branch to start of boot.asm in RTS library
.endif
and .cmd file for Bootloader app() is something like
PROGRAM:
SECTIONS:
codestart : > BEGIN, PAGE = 0
.cinit : > FLASHA, PAGE = 0
.pinit : > FLASHA, PAGE = 0
.text : > FLASHA, PAGE = 0
.InitBoot : > FLASHA, PAGE = 0
Question 1: Is this correct ? when the second boot-loader gets routed to the address 0x3F3FFE(if time out occurs) and the code_start gets executed which will route to main() of Main Application via c_int00. OR DO I NEED O MODIFY my codestartbranch.asm with asm(' LB 0x3F0000") to make it jump to my flash sector B where the application is stored.
If the LB c_int00 does work how does it differentiate between the c program main() routine of the Bootloader project and the one of the Main APP project ?
Question 2: Also my .stack , .ebss, and .esysmem of both the projects happen to be in the same location. This is what they look like in both projects,, Is this a cause for concern ? Especially when we need to have the Lash API running from the RAM to write/erase the flash ?
.stack : > RAMM0, PAGE = 1
.ebss : > RAML4, PAGE = 1
.esysmem : > RAMM1, PAGE = 1
.scratchpad : > RAML1, PAGE = 1
Question 3: Should I just flash my Bootloader project first and then transmit hex file of my main application via CAN bus ?
And I apologize for the long post.