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/TMS320F28379D: Loading application code after boot

Part Number: TMS320F28379D
Other Parts Discussed in Thread: C2000WARE

Tool/software: Code Composer Studio

Hi all community,

I load the boot code to the device and after I reset the device to load the application code. But I don't want to reset the device to load application code. Is there any way or any packet to load application code without reset ? 

Regards.

  • Hello

    Are you using a custom solution or code that we offer in C2000Ware? You should modify the loader code to not reset and start immediately receiving the application code.

    Best regards
    Chris
  • Hi Chris,

    Yes I am using sci boot code in c2000Ware. Ok, I couldn't completely understand your suggestion and what is the way to do your suggestion ?

    Thanks and Regards !
  • Hello

    If you're using the SCI flash kernel, then you should modify it (in SCI_getFunction.c) to not reset the device and behave how you want it to.

    Best regards
    Chris
  • Hi Chris,

    I viewed the SCI_GetFunction.c source file again. What should be the modifies or changes to realize my purpose ? In the code, there are DFU, Erase, Verify, ACK and NAK functions. I think that the loading of boot realizes with DFU operations. And I should modify these operations in SCI_GetFunction. But Is there any prepared reset packets or something else like that ? How can I load the application code without device reset ?

    Thanks and Regards !
  • Hi Hakan,

    if you want to run the application code after performing DFU, you can use RUN_CPU function on SCI_GetFunction.c.
    This function will jump to application entry address that sent during DFU.
    I think this way doesn't need device reset.

    Regards.
    Luis
  • Hi Luiz,

    Do you mean the below part right ?

    if(command==RUN_CPU1)
    {
    EntryAddr=(Uint32)(((Uint32)data[1]<<16) | (Uint32)data[0]);
    return (EntryAddr) ;
    }

    Should I add this part in DFU part ?

    Thanks and Regards !
  • Yes. you can jump to entry address if you want to run the application code right after DFU.

    actually, if you following the sci_kernel example from TI correctly. you can perform DFU by sending DFU command then send RUN_CPU1 command without reset.

    best regards
  • I will try after that I will notify the result !
    Thanks for your helping Luiz.

    Regards !
  • Hi Luiz,

    I have one more question.

    if(command==RUN_CPU1)
    {
    EntryAddr=(Uint32)(((Uint32)data[1]<<16) | (Uint32)data[0]);
    return (EntryAddr) ;
    }

    Is the 'EntryAddr' statement in above code for run the application code ?

    Best Regards.
  • Yes, that's the entry address for the application.

    Best regards
    Chris
  • Hi Chris,

    Can I see the value of this address ? If it's possible that how can I see this value ?

    Thanks and Regards.
  • Hello

    You can set a breakpoint in there to see what value it is getting for the address. It should be getting address set in your application as the entry address (typically code_start location).

    Best regards
    Chris
  • Hi Chris,

    The code doesn't go to that point. Actually, I need to an anything( any packet, any bit stream etc. ) which should jump to application code. Because I want to run the application code from an interface. Soi I have to reset the device with a packet or something else to run application code.  What can be this thing ? Is there any packet or any bit stream to operate my purpose ?


    Thanks and Regards

  • Hello

    This function is called as part of main in F2837xD_sci_flash_kernels_cpu01.c
    The kernel is designed to work with the serial flash programmer (~/C2000Ware_1_00_05_00\utilities\flash_programmers\serial_flash_programmer)

    See app note: http://www.ti.com/lit/sprabv4

    Best regards
    Chris
  • Thanks a lot for your replying Chris !

    Which function did you mean in F2837xD_sci_flash_kernels_cpu01.c ?
    And in sprabv4 there is a run packet table. When I send the addresses which are in that table from any interface program, will the application code run ? Actually, I want to know that is there any packet or anything to jump to application. If I know this, I can send this packet or anything from any interface and I don't need to reset to run the application code.

    Thanks and Regards !
  • The "main" function.
    The kernel is setup to work with those commands. If you send the DFU_CPU1 command and then the RUN_CPU1 command, it will load your application and then jump to it without resetting.

    Best regards
    Chris
  • Hi Chris,

    I understood this point. But I don't want to do this operation in the kernel code. I want to do this operation from an interface. I will send the DFU_CPU1 and after that I want to send a RUN command from an interface which is developed myself. So, I want to know the what is RUN command ? How does this command jump to application ? What does it operate to load my application ? 

    Actually, I need the function or value of data array in RUN_CPU1. Because 

    EntryAddr = (Uint32)( ((Uint32)data[1] << 16) | (Uint32)data[0]);

    If I know the value of data array, I can send this address from any interface to device and I can run the application code without reset, right ?    

    Is the data of run packet(at above picture) application address to jump ? I think that when I send the all packet to device from my interface, I can jump to the application code, right ? So for what purpose should I use this 32-bit data ?

    Thanks and Regards

  • Hello

    Yes, the data of the Run packet is the start address of your application (typically c_int00 location). After your application code has been loaded to flash or RAM, you can jump right to it.

    Best regards
    Chris
  • Thanks for your helping and patience Chris !
  • Hi Chris,

    I tried to send this RUN packet from my interface program. But it didn't work Chris. My packet includes following values:

    Header = 0x1BE4
    Data Length = 0x0004
    Command = 0x000E
    Data = In here I found the my entry address with _c_int00. But I wrote here 0x00080000. I am not sure that this is true or not. Which address should I write here, c_int00 location or 0x0008000 ? 
    Checksum = 0x0016 Also I am not sure that this is true or not. I made a summation with Data and Command. ( 0x000E + 0x0008 = 0x0016 )
    Footer = 0xE41B

    Also I don't use sci_flash_kernel code. Because I can't load it to device via c2prog. So, I used it just for referring.


    1.) Are these values true or not ?

    2.) Is the sci_flash_kernel code same with bootROM code for SCI communication ? Can I use this RUN PACKET to send bootROM ?

    3.) Can I use above RUN PACKET way to jump to application from bootROM ? 

    Thanks and Regards !

  • Hello

    Yes, those values look correct. Should be address of _c_int00 which should be located at the flash entry point (0x80000). Your check is correct, it is technically 0x000E + 0x0000 + 0x0008, but either way it comes out the same.

    No, although the bootloader aspect is the same, the kernel adds this additional functionality to send commands. These packets aren't compatible with boot ROM.

    Best regards
    Chris
  • Hi Chris,

    I can't load flash kernel code. Is there any way to jump to application code with boot ROM ? Or How can I load flash kernel code ?

    Thanks and Regards !
  • Hello

    Ok. I'm not particularly clear why you can't or what you are trying to achieve.
    Please refer to the technical reference manual for the options for boot ROM. You can jump to application by setting it to go to flash entry point or using one of the bootloaders to load an application.

    You could use a ROM bootloader to load your flash kernel code to RAM, jumps to it, then interface with the flash kernel code to load and program your application to flash.

    Best regards
    Chris
  • Hi Chris ,

    Just I want to achieve that jump to application with bootROM. I checked the technical reference manual and other bootROM documents which are written for other MCUs but I couldn't find any way to jump to application code. I tried to send RUN PACKET but it didn't work because I can't load the flash kernel code.

    Actually, I want to jump application with sending any packet or any address via developed interface program by myself.
    I load the application code to device via SCI module with c2prog after that I reset the device with reset button. It can jump to application code. But I don't want to press reset button to jump application code. Just I want to send anything via my interface program to jump to application code. I try to achieve this operation.

    I think another way which may be possible. If I know reset flow or execution, I may apply these operation from my interface program. So, when I reset the device, what is the going on the device (interrupt or anything else) ? 

    There is following table in bootROM section of technical reference manual. Can HWBIST reset type be my problem's answer ? If it's true how can I use this reset type ? 


    Thanks and Regards !

  • Hello

    Don't refer to other boot ROM documents, they aren't the same procedure.
    The boot flow diagram in the technical reference manual shows everything that goes on after reset of the device.

    The HWBIST reset is only if you're doing HWBIST actions which after triggers a reset. This isn't a boot mode, see the boot modes section. In the end, all reset sources boot to application code.

    The boot up flow is controlled by the boot mode select pins. This is the only option. Additionally you have the boot loaders as boot mode options which will wait for a key and then receive the application. If you want to be able to send a packet to trigger an SCI bootloader, then you have to set your boot mode to flash and put your custom bootloader/code to receive your packet in flash.

    If you can't load to flash. Then you have to boot to SCI, load your custom kernel, wait for packet, receive packet, then perform the next actions. On next reset it will go to SCI bootloader unless you change the boot mode select pin values to boot to flash and hopefully your application is at the flash entry point address.

    Best regards

    Chris
  • Hi Chris,

    My main question is that how I can run the application without using sci_flash_kernel ? How packet should I send to jump to application after load the application code via c2prog ? Is it possible ? I have just sci boot mode which is defined in bootROM embeddedly, application code and my interface program. I should send an anything from my interface program and it should reset the device. Is there an anything to do this ?

    I think that there should be an interrupt or a packet after press the reset button to make operations which are in reset flow. Is this correct ? If it's correct, I want to know this interrupt or packet.

    I couldn't understand your previous answer for my problem.

    Thanks and Regards !
  • Hello

    There is no interrupt or packet support during boot up. Boot up flow is controlled by the boot mode select pins.
    After you program with c2prog, you should reset the device and let it boot to either SCI boot if you want to take in an application to RAM or just boot to flash entry point address to start your application that was loaded via c2prog.

    Best regards
    Chris