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.

TMS320F28377D: the ramfunc copy operation during cpu2 flash boot

Part Number: TMS320F28377D
Other Parts Discussed in Thread: C2000WARE, SYSCONFIG

Hi.

I have a question about the ramfunc copy operation during cpu2 flash boot.

My project calls the Device_init() function first on cpu2. This function is automatically generated and cannot be modified.

Inside the function, it disables the watchdog and then immediately executes the ramfunc copy.

If the copy is to LSRAM, there is no problem. However, if it is to GSRAM, there may be a problem if cpu2 writes to GSRAM before cpu1 grants write permission to cpu2.

Do I need to worry about this?

  • Hello Jaejun,

    You can try to use IPC to check certain flags and make sure CPU1 can 'grant' access by setting/clearing an IPC flag. There are examples of using the IPC in C2000Ware:

    C2000Ware_5_01_00_00\driverlib\f2837xd\examples\dual\ipc

  • Thank you for your reply.

    I am already using the function by referring to the IPC example.

    Please review the following code.

    // CPU1 Main

    void main(void)

    {   

       Device_init();

       Interrupt_initModule();

       Interrupt_initVectorTable();

       Board_init(); // Initialize settings from SysConfig , Grant write access to GSRAM on CPU2

       IPC_sync(IPC_CPU1_L_CPU2_R, SYNC_FLAG);     

    // CPU2 Main

    void main(void)

    {   

       IPC_clearFlagLtoR(IPC_CPU2_L_CPU1_R, IPC_FLAG_ALL);

       IPC_sync(IPC_CPU2_L_CPU1_R, SYNC_FLAG);          // <----- Wait until CPU1 grants write permission to GSRAM.

       Device_init();   // Watch dog Disable, RamFunc Copy

    I think the way you are telling me is like the following method? 

    Is there any problem with the above code?.

  • Hi Jaejun,

    When your debug probe is not connected (standalone mode), CPU1 needs to release CPU2 from reset. Please place Device_bootCPU2() function right after Device_init() on CPU1. 

    This function will actually cause your program to stall out when loading the code from your debug probe, since CPU1 sits in a while loop until it is able to bring CPU2 out of reset. When loading code with the debug probe, CPU2 will jump to main, and CPU1 will wait forever to boot.

    In standalone mode, however, none of your CPU2 code will run until CPU1 runs the Device_bootCPU2() function. Your method may also work, but I recommend you take advantage of this Device_bootCPU2() function. 

    Best Regards,

    Ben Collier