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.
Hi,
I am working on a custom CAN bootloader for 28069 MCU,
I have managed to flash the application using the bootloader and have verified that the flash passes CRC check.
I am calling to the application by using the jump instruction which should be stored in sector A (address 0x3F7FF6), which calls c_init00.
The application then loads, but acts strangely (sometimes no CAN comm, or ADC gives inaccurate readings).
When loading the application directly by JTAG, everything is fine.
Is it ok to call c_init00 twice after MCU power-up (once for bootloader and once for application startup)?
Do I need same addresses for stack and RAM for bootloader and application in the command file (i.e different flash sectors, but RAM location = same)?
Any suggestions would be great.
thanks,
Ben.
Ben,
Instead of jumping to c_init00, I recommend having the processor reset itself. This will give you the same state as a cold-boot. You can do this easily with the watchdog timer.
Regards,
Bill
Hi,
Thank you for your answer,
1. I couldn't find the sci flash kernel example in controlSuite.
I have done the following steps:
1. changed application cmd file do it will store application c_init00 location in special address which bootloader calls to ->
MEMORY...
APP_BEGIN : origin = 0x3E7F6E, length = 0x000030 /* Stores application Start Point */
SECTIONS...
appcodestart : > APP_BEGIN, PAGE = 0
2. changed F2806x_CodeStartBranch.asm do it would jump to _main instead c_int00 ->
WD_DISABLE .set 1 ;set to 1 to disable WD, else set to 0
.ref _main
.global app_code_start
***********************************************************************
* Function: codestart section
*
* Description: Branch to code starting point
***********************************************************************
.sect "appcodestart"
code_start:
.if WD_DISABLE == 1
LB wd_disable ;Branch to watchdog disable code
.else
LB _main;Branch to start of application
.endif
;end appcodestart section
***********************************************************************
* Function: wd_disable
*
* Description: Disables the watchdog timer
***********************************************************************
.if WD_DISABLE == 1
.text
wd_disable:
SETC OBJMODE ;Set OBJMODE for 28x object code
EALLOW ;Enable EALLOW protected register access
MOVZ DP, #7029h>>6 ;Set data page for WDCR register
MOV @7029h, #0068h ;Set WDDIS bit in WDCR to disable WD
EDIS ;Disable EALLOW protected register access
LB _main;Branch to start of boot.asm in RTS library
.endif
;end wd_disable
.end
;//===========================================================================
;// End of file.
;//===========================================================================
3. bootloader calls the special address.
The results are worse when tried to run this code.
can you tell me what i am doing wrong.
Thanks,
Ben.
Ben, I believe your entry point should be at 0x3F7FF6 for the F28069. In you cmd file, change origin = 0x3F7FF6 and a length = 0x000002.
Check Figure 2-8 of http://www.ti.com/lit/ug/spruh18e/spruh18e.pdf
Ben,
Fulano is correct. Please see www.ti.com/lit/spruh18
Page 206 in the Boot Rom section reads:
Jump to flash is the default behavior of the Get Mode boot option. Jump to flash is also available as an emulation boot option.
In this mode, the boot ROM software configures the device for 28x operation and branches directly to location 0x3F 7FF6. This location is just before the 128-bit code security module (CSM) password locations. You are required to have previously programmed a branch instruction at location 0x3F 7FF6 that will redirect code execution to either a custom boot-loader or the application code."
You have a couple options.
Hope this helps.
sal
Hello sal,
Thank you for your prompt reply.
I am running flash API and flash kernel (CopyData() function) from RAM. My data is getting written into the Flash memory successfully (except location 0x003F7FF6).
FYI - Here, I am not using "Exit_Boot.asm" in my program to enter into bootloader mode or to exit from bootloader application. My application is getting invoked from _c_int00 module. (As per entry address given in codestartbrach.asm)
As suggested, I have already called statement "return EntryAddr;" after CopyData() function execution. But in this case code is not jumping to application's starting address of flash memory. Instead, bootloader's main loop program gets terminated without invoking a application code.
[Query]
1) As per datasheet, we have to call exit boot function before entering into application code. So is it okay, if we use LB instruction to branch directly to the application's EntryAddr, without using ExitBoot function? If not, please let me know how to implement ExitBoot function in bootloader's main loop.
2) Is it okay, if I do not write the value (read from application hex file) for memory location 0x003F7FF6? (As my boot loader code is also stored in FLASH memory, so I cannot write starting address for both projects - FLASH Bootloader code and Application code)
Regards,
Vishal