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.

CCS/TMS320F28069: Tms320f28069

Part Number: TMS320F28069
Other Parts Discussed in Thread: C2000WARE

Tool/software: Code Composer Studio

Hello ,

I am using TI DSP controller TMS320f28069 . I want to develop a basic custom bootloader which will jump to my application code area. I have refered to many threads but couldnt get this right. Below are the steps i have performed:

-- I have taken the reference from C:\ti\C2000Ware_1_00_06_00_Software\device_support\f2806x\examples\c28\f28069_sci_flash_kernel example code and changed the following:

1) Changed the Ram linker to Flash .

2)Modified the SCI_Boot ( )  function to poll the UART . If recieved the character 'j ' then jump to application address.

SCI_Boot(void)
{
    Uint32 EntryAddr;
    GpioDataRegs.GPBCLEAR.bit.GPIO34 = 1;
    SCIA_Init(115200);
    checksum = 0;

 while(1)

{
    ReceivedChar = SciaRegs.SCIRXBUF.all;
    if(ReceivedChar== 'J' || ReceivedChar== 'j')
    {
        SciaRegs.SCITXBUF ='C';
        EntryAddr = 0x3D8002 ;

    }
    return EntryAddr;
}
}

--Made a application code project which is in Flash sector H.

-- This address of Application code is set as EntryAddress in Bootloader.

Problem statemnt: After recieving the command to jump the PC goes out of reach from bootloader code ,but the application code is not executing.

Please let me know if there is any mistake or i need to do any othe steps for the jumping to application code.

Rohit Sawa

  • Hi,

    Please see www.ti.com/lit/sprabv4

    This will help you understand the boot loader and kernel and host tool. Also see the Boot ROM chapter of the Technical Reference Manual.

    It appears your issue is with branching to your application. You can use the CCS debugger to see exactly what your code is doing and use the SCI kernel for your help.

    sal
  • Hello Sal,
    Thank you for your response. I will go through the document you have sent . Jumping problem have been resolved by adding the assembly instruction asm(" LB 0x3D8000"). I still have to remap the Interrupt vector table.
    Please help me in understanding the following:
    1) From what i understood EntryAddr is the address to which my PC will jump after bootloader exits. So why i have to add a assembly instruction to move my PC .
    2)in section 2.2.11 of TRM "For an 8-bit data stream, the key value is 0x08AA and for a 16-bit stream it is 0x10AA. If a bootloader
    receives an invalid key value, then the load is aborted" is written . Please let me know why is this really required , as i have not used the key in my code.

    Thank you
    Rohit Sawa
  • 1) Yes your understanding is correct. You may need to modify the Exit code when returning from main or your function to properly branch to the entry address. The kernel does this. You can see this for example.

    2) This is the way the bootloader is written to ensure the format of data is correct.

    sal
  • Hello Sal,
    1) Can you please let me kow the changes to be done in exit assembly file for correct branching.
    2) Also please let me know can we directly use the assmebly code to fetch the appliation address area.
    3) Now a i told i am trying to remap the vector but after enabling the interrupts in Application code i am not able to write the flash with Application .

    Thankyou
    Rohit Sawa
  • Hi

    1) Please see the exit boot assembly file and function in the SCI kernel. You can build and load the kernel into CCS and step through the exit function. It basically takes what is returned from main() and branches there. Main will return the entry address in the ACC register and then the assembly code branches there. It is easy.

    Alternatively, you can just add a LB to the entry point as well in your code. It should not have any negative affects on the stack or anything.

    Alternatively, You can create a function which passes then entry point as a parameter, which should be passed in ACC and then write an inline assembly function to LB to the ACC address.

    All three options are easy enough. You can pick one.

    2) I am not sure what this question is. The SCI will communicate the entry point address. It is part of the hex file header information.

    3) I am not sure what this question is.

    sal
  • Hello Sal,
    I am trying to load my application code . I have unchecked the erase for sector A as my bootloader resides in that area. After that when i am trying to load my application code follwing run time error is coming:
    C28xx: Flash Programmer: Error encountered when writing to flash memory
    C28xx: File Loader: Memory write failed: Unknown error
    C28xx: GEL: File: D:\ccs-workspace-Mastermind\Example_2806xLEDBlink\Debug\Example_2806xLEDBlink.out: Load failed.

    Please let me know the possible solutions.
  • This is a different issue. Please close this thread and open another so that we can better assist you.

    In the mean time, it may be because you are trying to program code into Sector A which has not been erased, so it fails.

    sal