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.

TMS320F280048C-Q1: Flashing is not happening

Part Number: TMS320F280048C-Q1
Other Parts Discussed in Thread: C2000WARE

Hi,

   We are using TMS320F280048CPMQR, 64 pin PQFP for one of our applications. The development was completed using XDS100V2 debug probe. When I tried to flash the code, flashing is happening but after power cycling the code is not getting executed. Following are the steps performed.

1) Change the debug configuration to "release" and selected it as "active".

2) Excluded RAM_link.cmd file from the project and added F280048C_Flash_link.cmd. (One strange thing happened. The project build failed. The compiler include options were not the same as that of the normal debug session. Added all those and build is successful).

3) Invoked debugging session.

4) Unlike normal debugging, it takes few seconds more and displaying messages like erasing memory location, do not cancel etc.

5) After that it returns without any error in the console.

6) On disconnecting the debug probe and power cycle. The total current taken is 60mA less than when normal debug execution using the probe.

7) In my code a GPIO is continuously toggled, which is not happening. The flashing was repeated 2-3 times but with same behavior.

8) If I invoke normal debug session, its working fine.

  Please see anything wrong with the process or any additional steps are required, Any help or advice will be much appreciated.

  Thanks and Regards

      Karthik R

  • Karthik,

    Please take a look at this FAQ:  https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/878674/faq-flash---how-to-modify-an-application-from-ram-configuration-to-flash-configuration 

    Try the suggestions from the FAQ and see if they fix your issue.  Let me know how it goes.

    Hope you configured the boot mode pins for flash boot in the standalone execution scenario.

    Thanks and regards,
    Vamsi

  • Dear Vamsi,

      Thanks for the reply. I have gone through the same. As you correctly mentioned, we didn't configure the boot mode pins. We will correct it and get back to you. Meanwhile can you please confirm, whether by using the Flash_link.cmd file, the entire content of Flash will be loaded to RAM and start executing from the RAM ?

      Thanks and Regards

          Karthik R

  • Karthik,

    Not the entire flash image - only the content that is mapped to .TI.ramfunc section (or any other section that you may define for that purpose) will be copied when you call memcpy with appropriate parameters as showed in the C2000Ware examples.

    Just for my understanding:  Why do you want to copy the entire content to flash?  Is it not enough to copy only the time critical code and other things that need to execute from RAM only (like flash initialization etc)?  

    Thanks and regards,

    Vamsi

  • Karthik,

    Are you now able to execute fine from flash?  Can I close this post?

    Thanks and regards,
    Vamsi

  • Hi Vamsi,

       The problem is not solved. While debugging this some other issue happened. Please wait for 4 more days before closing the thread.

    Thanks and Regards

         Karthik R

  • Karthik,

    Ok, I will keep the thread in pause as you mentioned.  

    Let me know how it goes.

    Thanks and regards,
    Vamsi

  • Karthik,

    Do you have any update on this?

    Are you now able to execute fine from flash?  Can I close this post?

    Thanks and regards,
    Vamsi

  • Dear Vamsi,

       Sorry for late reply. We had another issue in the same card hence couldn't debug this issue. Now the other issue is sorted out. As you pointed out, our boot mode is configured for flash boot (GPIO24/Pin no 35 and GPIO32/Pin no 40 are pulled up through 10K resistor). Still its not booting from flash. Just to add, the RAM linker file in the debug mode is modified from the default linker file.

       Thanks and Regards

         Karthik R

  • Karthik,

    Flash linker cmd file will have codestart mapped to flash entry point.  Please make sure you have it in your custom linker cmd file.

    Did you try the blinky example with flash build config from C2000-Ware as is?  If you did not try that yet, I would suggest you to try that first.  

    Thanks and regards,

    Vamsi

  • Hi Vamsi,

       Thanks for the suggestion. I will do the same and get back to you after the weekend. Regarding linker file, I was mentioning RAM linker file only and not the Flash linker file. I have not changed anything in the Flash Linker file.

      Thanks and Regards

         Karthik R

  • Karthik,

    In your reply on September 17th, you mentioned "Just to add, the RAM linker file in the debug mode is modified from the default linker file.".

    Not sure why you mentioned about RAM based linker cmd file.  You should be using flash based linker cmd file.

    Thanks and regards,

    Vamsi

  • Dear Vamsi,

         As per your suggestion, we did the follwoing trials.

    Trial-1 (LED blinky in RAM with default RAM linker and Flash with Default Flash linker in Launchpad) :- Working Fine and Flashing properly.

    Trial-2 (Trial-1 in Our custom card) :- Working Fine and Flashing properly.

    Trial-3 (Our code in RAM with modified RAM linker and Flash with Default Flash linker in Launchpad) :- Working Fine for RAM but Flashing not happening

    Trial-4 (Trial-3 in Our custom card) :- Working Fine for RAM but Flashing not happening.

        So we think problem is with either our code or linker file. 

    Thanks n Regards,

           Karthik R

  • Karthik,

    Good to know the update.  Please continue your debug and let us know if you have any questions.

    Thanks and regards,
    Vamsi

  • Hi Vamsi,

      But we still don't know why flashing is not happening and back at ground zero of the support case.

      What may be the issue...? How to debug further..??

    Thanks and Regards

         Karthik R

  • Karthik,

    Just to confirm my understanding:  When you say "flashing", it is not about programming the code in to the flash using CCS flash plugin - Correct?

    It is about execution of your application from flash - correct?

    Above is what I understood from your thread.

    If it is about execution, what exactly happens when you try to execute in flash boot mode?  Do you know whether it started executing fine and stopped working at some point during the execution?  Or did it not get to start of the application at all?  

    Did you eliminate all the issues discussed in this FAQ:  https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/878674/faq-flash---how-to-modify-an-application-from-ram-configuration-to-flash-configuration  ?

    Thanks and regards,
    Vamsi

  • Karthik,

    Do you have any update on this?

    Thanks and regards,

    Vamsi

  • Hi Vamsi,

      The issue is still present. 

      One basic doubt. If I had to change my RAM linker file for debugging from RAM, whether it has any effect in the Flashing ? Should I change the Flash linker file too..?

       Regarding Flashing, I meant executing from Flash. The process of erasing the flash and programming is happening successfully. Once flashed, if I power off my board and switch it on, program is not executing properly. For eg, there is a GPIO toggling in my debug code (along with other codes) and while executing the code through debug session, the current taken is around 140mA. After flashing and power-on, the current is only 70mA and no GPIO toggle is observed.

    As per the link given by you,

    1. Replace RAM linker cmd file with flash linker cmd file (these are available in C2000ware). :- Done

    2. If you need to modify the flash linker cmd files, make sure to map any initialized sections only to flash (as you can notice in the linker cmd files provided in C2000Ware). :- Not sure whether to modify so not Modified

    3. When the device is configured for boot to flash, bootROM will re-direct to the flash entry point location (defined as BEGIN in TI provided flash linker cmd files) at the end of boot code execution.  Make sure there is a branch instruction at flash entry point to the beginning of code execution.  C2000Ware examples use CodeStartBranch.asm file to accomplish this.  The code in this file is allocated to codestart section.  In the flash linker cmd file, you will notice that the codestart section is mapped to the flash entry point (and hence CodeStartBranch.asm is the first code that gets executed after the bootROM execution).  This code branches to _c_int00 routine, which initializes all the global variables and then re-directs to the application main. 

     If we are using the default flash linker file, should we check this again ? Anyways CodeStartBranch.asm is already included in the project.

    4. To achieve the best performance for flash execution, configure the flash wait-states as per the operating frequency (check datasheet) and enable prefetch/cache.  Note that any code that configures the flash control registers (Ex: Flash_initModule() in C2000Ware) must run from RAM.  Hence, the function that configures the flash wait-states and prefetch/cache should be copied to RAM before executing it.  This can be accomplished by assigning this function to .TI.ramfunc section and then copying it to RAM at runtime using memcpy() before executing it.  In the linker cmd file, this section should be mapped to flash for load and RAM for execution.  Please take a look at the flash based linker cmd files provided in C2000Ware.   

    :- We need to replicate the same timing performances of debug code (RAM based) in the Flash based code. So with a flashed code what we need is "to load the entire code from Flash to RAM during startup and execute from RAM afterwards".  In that case should we add/change any code ?

    5. Make sure the boot mode pins are configured for flash boot.  This tells bootROM that it has to re-direct to the application programmed in to the flash after boot code execution. :- Done

      Thanks and Regards

         Karthik R

  • Karthik,

    Please expect a reply on Friday October 1st.

    Thanks and regards,

    Vamsi

  • Karthik,

    If you are going to change the RAM linker command file for your RAM based application execution, then it will not effect your flash based application.  You should not include both RAM linker and flash linker for the same application.  

    I would suggest to first target the GPIO toggle and debug the performance thing later.

    Can you check if there is any toggle on XRSn when you are executing standalone from flash?  Asking since you said that the application is not executing (GPIO not toggling).  Maybe there is a reset happening. 

    As mentioned in the FAQ, Do you have _FLASH defined in your project's predefined symbols?  It enables memcpy() execution and flash initialization.

    Did you look at the debug tips mentioned at the end of the FAQ?

    Thanks and regards,
    Vamsi

      

  • Karthik,

    Do you have any update on this?

    Thanks and regards,
    Vamsi

  • Hi Vamsi,

     I have copied my application code (.h & .c) to led_blinky project and now its flashing and code is getting executed after that. I am not sure what is wrong with my existing project.

      Thanks and Regards

         Karthik R

  • Karthik,

    led_blinky project does the things that I mentioned in the FAQ.  I would suggest you to cross-check your project with the working project/FAQ.

    Can I consider this closed now?  You can open a new post if you have new questions.

    Thanks and regards,

    Vamsi

  • Karthik,

    I am closing this post since your application is working after copying to the Blinky template.  

    If you have further questions, please open a new post (since I will be OOO and may not be able to monitor this post).

    Thanks and regards,

    Vamsi