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.

TMS320F28388D: Problem using "IPC message copy to RAM boot" to start CM

Part Number: TMS320F28388D
Other Parts Discussed in Thread: C2000WARE

Tool/software:

Hi im trying to boot a quite simple program to the using the "IPC message copy to RAM boot" method ,i do the following actions:

1.I use the armhex tool to create and array out of the program.

2.I fix the array as it created with uin8_t type cmds and it should be uint16_t (before i fixed it Ive got a "Hard fault occurred" status).

3.I copy the fixed array to CPU1TOCMMSGRAM1 at address 0x00039400.

4.I configure the CPU1TOCMIPCBOOTMODE to the following value:0x5A02640C , which states 100Mhz freq and 200 words copy.

5.Reset the CM (Tried both with and without).

6.Set CPU1TOCMIPCFLG0 flag0 to start the copying.

What i see is that CPU1TOCMMSGRAM1 receives the array ,but the copying doesnt happen, since address 0x20000800 in the CM which is the destination of the copy is filled with zero's only.

Am i missing some part of the process i followed the manual and tried to check other posts but to no avail.

Any help will be much appreciated.

  • Hi Michael,

    Have you had a chance to take a look at the ipc_ex2_msgqueue_c28x1, ipc_ex2_msgqueue_cm examples examples provided in C2000Ware? 
    https://dev.ti.com/tirex/explore/node?node=A__ANwwURrRiqh4Fp5sl6q1qQ__C2000WARE__1kRFgrO__LATEST

    there are C28 and CM based examples that you can use as a starting point.

    Regards,

    Ozino


    Regards,

    Ozino

  • Thank u i got it to run, Ive experienced a minor issue and i was hoping maybe someone knows something about it,
    I made a basic delay function with nested for loop ,when i loaded the program to the cm the program got stuck in the for loops for good as in didn't get out of the function.

    After i took out the delay out of the function and into the main code the CM run as it should,is there any chance it happened due to optimization?
    Also the code with the nested loop in a function runs correctly when i load it directly into the CM using the CCS.

  • Hi Michael,

    Glad to hear you have gotten started working. As far as the code being stuck in the for loop, what routine is being executed when you halt the debugger? Is it in a while loop in a driverlib function? Or is it running code in your main code?

    How are you loading the code to the target? CM first or CPU first?

    Regards,

    Ozino

  • I start the CPU1 only and it loads the code through "IPC copy msg RAM boot" the function going in a loop a function written by me, i didnt use any TI libs.

  • If you turn of optimization does it work as expected? 

    If i understand correctly, the code works when loading CM directly via CCS instead of through CPU1 at runtime?

  • I tried another few codes once i implement a function it breaks when i just put the same code as in function in main it works, any speculation what causes it?

  • So the issue is that when you place the code in a separate function it is no longer working? Do you know if you've added a function prototype and included a reference to it in the #includes. Please also double check if the paths to the file with the function are listed in the project properties.

    Regards,

    Ozino

  • Yes if i load the code through the debugger after i connect to target(CM) it works ,then without changing anything i turn it into an array(Using arm hex) and load through "IPC msg ram copy boot" it wont work for some reason,the same code not using functions works.

    It seems only functions with loops as:while and for seem to be problematic.

    EDIT:

    after some digging i found that the R14 register is not properly  updated after i copy my program to S2RAM and branch there the register R14 stays the same ,therefore when bx r14 occurs the program jumps back to my msg ram code,how can i properly branch to an exact address? i used asm("mov PC,R1") when R1 holds the desired address and it made problems.

    EDIT #2:
    For all people having the same issue ,use code start and place a jump to "_c_int00" there it sets up all the registers as in PC ,R13,R14 and more which are crucial for the flow of your program.