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.

branch address values gets changed while executing through Targetlink software

Hi,

Precondition:

Developed one set of project files. executing through 1. CCS4 and 2. MATLAB TargetLink. I flashed the boot-loader in flash bank-0 and flashing and executing the project files from Flash bank -1.

In this, i observed two different scenarios.

First one, while executing with Code composer studio, all the functions are executing normally and proceed to main function.

second one, i executed the same project files, using TargetLink software. because of, change in core register and branch address values, the execution is not proper.

Please advice me how to rectify this issue? or any other details you need to know, let me know.

Thanks and Regards

Gowdham Natarajan

  • Gowdham,

    Thank you for your post.  Can you please provide more specific details on your configuration set up?  Including which target hardware and versions of the MATLAB code you are using?

  • Hi Brian,

    Sure. Here you go.

    Target HW: TMDX570LS20SUSB.

    MATLAB Version: MATLAB R2008b Integrated with TargetLink v3.2

    Compiler: Texas Instruments 4.2.

    Model used for compilation: tl_demos pipt1

    Communication port: USB and 115200 bps

    Actually it got stuck in two different places while executing sys_startup.c file after flashing the code. First, once it get into the systeminit() function, it's not coming out and Second, after that i commented that systeminit() function i did the flashing again. This time, it get into the copy_table() and global variable declaration function, it's not coming out.

    May be this will be helpful for you. Is that anything you need?

    I have attached that file for your reference. Also, i have attached the .fld file and .abs file used for flashing.

    Thanks and Regards

    Gowdham Natarajan

    HALCoGen.zip
  • Hi Gowdham,

    It is most likely caused by the unproper stack pointers definition. Please check them in sys_core.asm. Normally the stack pointers are in RAM (0x0800 0000). If you swap the memory map (RAM: 0x0000 0000, and Flash: 0x0800 0000), you also need to change the pointers to RAM (0x0000 0000). 

    Regards,

    QJ

  • Hi QJ,

    I tried the same way, but no change in execution. Still issue remains. Is there anything i need to check.

    Thanks and Regards

    Gowdham Natarajan

  • Let me see if I understand it correctly.

    1. Compile the project with CCS. Flash the device with CCS or NowFlash. Press PORRST. Everything runs OK.

    2. Compile the same project with target link. Flash the device with targetlink. Press PORRST. Code is stuck.

    I am not familar with targetlink. Do you know which core register or branch address is changed?

    Can you publish your project and the .out file you got from targetlink?

    Thanks,

    Haixiao

  • Hi Gowdham,

    Please check your systemInit() to see if it contains memory initialization code at the very last. It looks like:

     

    SYSTEM_1->MINITGCR = 0xAU;

    SYSTEM_1->MSINENA = 0xFFFFFFFFU;

     

     

    while(SYSTEM_1->MINISTAT != 0x0000657EU);

    SYSTEM_1->MINITGCR = 0x5U;

     

    VIM_PARITY->PARCTL = 0xA;

    It may damage you pointers saved in RAM. You can remove the RAM module from SYSTEM_1->MSINENA and comment all this section to try your test.

    Regards,

    QJ

  • Have you solved your problem or need further help?

    Regards,

    Haixiao

  • Dear QJ / Brian / Haixiao,

              Thanks for reminding me about this and sorry for not updating this form with the mistake found in our code.

    In the bootloader part, there is a function which performs data alignment(32-bit value) before flashing the code. This is not done properly. So, the compiler added "0xFFFFFFFF" for the blank spaces which results in the unexpected change in execution.

    Now we made the data alignment properly and application runs properly as well.

     

    Thanks and Regards

    Gowdham Natarajan