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: Running app from flash

Part Number: TMS320F28377D
Other Parts Discussed in Thread: C2000WARE

I have difficulties with running my application from flash. I followed the instructions of Frank Bormann in this topic.

https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/385578/f28377d-flash-programming/2067367?tisearch=e2e-sitesearch&keymatch=F28377D%2525252520flash#2067367

“… To change your F28377D-project to run from FLASH, there is another option. If you inspect the code in file "F2837x_SysCtrl.c" (function InitSysCtrl()), you will find a conditional Compiler - statement "#ifdef _FLASH". You can define "_FLASH" as a predefined symbol (properties => C2000 Compiler => Advanced Options => Predefined Symbols => Pre-Define NAME). If _FLASH is defined, function "InitSysCtrl" will also call memcpy and InitFlash(). All what is left to do for you is to replace the linker command file "2837x_RAM_lnk_cpu1.cmd" by "2837x_FLASH_lnk_cpu1.cmd". …”

After I did the above changes (_FLASH symbol defined, 2837x_FLASH_lnk_cpu1.cmd us) when I compile the code (Workshop, Lab2) I got the following warning:

Building target: "Lab2_cpu01.out"
Invoking: C2000 Linker
<Linking>
warning #10247-D: creating output section "ramfuncs" without a SECTIONS specification
Finished building target: "Lab2_cpu01.out"

When I try to debug it then I got error messages what I do not understand.

C28xx_CPU1: GEL Output: 
Memory Map Initialization Complete
C28xx_CPU1: Error initializing flash programming: Interface returned from dll, but flash is not available on this device.
C28xx_CPU1: Loader: One or more sections of your program falls into a memory region that is not writable.  These regions will not actually be written to the target.  Check your linker configuration and/or memory map.
C28xx_CPU1: File Loader: Verification failed: Values at address 0x082000@Program do not match Please verify target memory and memory map.
C28xx_CPU1: GEL: File: C:\Users\lbala\ccs\workspace_v11\Lab2_cpu01\Debug\Lab2_cpu01.out: a data verification error occurred, file load failed.

What do I do wrong?

Thanks,
Louis

  • Hi Louis,

    Which version of C2000Ware, CCS and compiler are you using?  Please use the latest versions and see if that helps.

    The linker command files and the driverlib should have references to .TI.ramfunc section and not the ramfunc section.  

    FAQs that can help:

    1. [FAQ] Flash - How to modify an application from RAM configuration to Flash configuration?: 

        https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/878674 

    2. [FAQ] Product Change Notice (PCN) 20180523001.1 and PCN 20200115000.2 for TMS320F2837x and TMS320F2807x devices: 

         https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/729543?-FAQ-Product-Change-Notice-PCN-20180523001-1-for-TMS320F2837x-and-TMS320F2807x-devices

    Thanks and regards,
    Vamsi

  • Hi Vamsi,

    Thanks for quick reply abd your help!

    CCS: 11.1.0.00011 

    C2000Ware: 4_00_00_00. I just installed it, but it looks like the Workshop LAB2 does not use it. I do not know how can I use it in 1-day Workshop LAB2.

    Compiler: TI v21.6.0.LTS (Project properties General tab)

    Linker command file: TI 2837x_FLASH_lnk_cpu1.cmd (Selected from Linker Command File dropdown list box in Project properties General tab)

    Yes, the first thing I found in the forum your great description about running program from flash. I think I kept all the rules.

    By the way: The 1 day workshop LAB2 has a bug. The manual "speaks" about GPIO08/pin57 (Square wave generator) but the application initializes and toggles GPIO18/pin71. It caused a couple hours headache to me: why not GPIO08 is toggling. The fix is either initialize and toggle GPIO08 (instead of GPIO18) or connect the ADC input to GPIO18/pin71. Maybe somebody else runs into this problem.

    Best regards,

    Louis

  • One more thing...

    I Imported the C2000ware's "module2_getstarted_blinkyled" project for device F28377D, what I have. This project has a FLASH configuration. I made the FLASH configuration active and I recompiled the project without any error message. Then I started the debugger and I got the same errors what I reported earlier.

    But this project is from C2000Ware with a dedicated FLASH configuration. Who understands this? I am using MCU/CPU in the last 30 years but I have never seen anything like this TI's processor. What is good for running an app from RAM? You cycle the power and your application has gone. I really do not understand this.

    Why running app from flash (which should be the default configuration) is so complicated? It is not quantum physics. Stuck out tongue winking eye

    Thanks for your help!

    Louis

  • Louis,

    Regarding the example projects you mentioned: Sorry for the inconvenience that our examples caused to you.  I will pass this feedback to the example owners - they will check and file a ticket if they have to be fixed.

    Regarding the RAM based examples:  Many customers like to develop/execute their code from RAM at first and move to flash later.  Hence, examples are provided with both RAM and flash build configs. 

    Regarding the feedback on running an application from flash:  Please provide your feedback and we will incorporate it in to the FAQ that I shared with you.  Also, please suggest any changes that may help to ease the usage of the flash build configuration - we will update examples accordingly after discussing with our team.  

    If I understand your original concern correctly, you (or the examples) are using ramfuncs instead of the .Ti.ramfunc section and hence was the warning.  And coming to the CCS load error, you are still getting the below errors (taken from the snap you shared in your first post of this thread) when you try to load the code to flash - correct?  Below error looks as if you are trying to do a standalone verification and not erase/program - correct?

    C28xx_CPU1: GEL Output:
    Memory Map Initialization Complete
    C28xx_CPU1: Error initializing flash programming: Interface returned from dll, but flash is not available on this device.
    C28xx_CPU1: Loader: One or more sections of your program falls into a memory region that is not writable. These regions will not actually be written to the target. Check your linker configuration and/or memory map.
    C28xx_CPU1: File Loader: Verification failed: Values at address 0x082000@Program do not match Please verify target memory and memory map.
    C28xx_CPU1: GEL: File: C:\Users\lbala\ccs\workspace_v11\Lab2_cpu01\Debug\Lab2_cpu01.out: a data verification error occurred, file load failed.

    For the CCS version that you are using, you should be able to load to flash without any issues.  Please take a look at this post and see if that helps: https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/802468/ccs-tms320f28377d-ccs-flash-error-with-data-verification-failed 

    I can try to reproduce the issue on my side to help you further; please provide the below files.

    1) .out file

    2) Linker cmd file

    3) Map file

    Thanks and regards,
    Vamsi

  • Hi Vamsi,

    Here is the whole "module2_getstarted_blinkyled" project zipped. Try to debug it. You will probably get the mentioned errors. It contains the MAP, OUT and linker CMD files.

    module2_getstarted_blinkyled.zip

    Thanks!

    Louis

  • Hi Vamsi

    New discovery. After connecting the USB ports of the F28377F controlCard and docking card to PC (Windows 11), if I click on the Debug button - regardless of the application runs from RAM - the console shows an error massage, about FLASH memory is not available in this chip. What?

    C28xx_CPU1: GEL Output: 
    Memory Map Initialization Complete
    C28xx_CPU1: Error initializing flash programming: Interface returned from dll, but flash is not available on this device.
    

    If I run the app, the it runs fine without any error message. (It reads AD7175 24-bit ADC). Now if I terminate the debug session then click on the debug button again then the error message is not shown anymore.

    The error message is shown only after power on reset (connecting the development kit to a PC running CCS11) when I first star debugging.

    I think this is a false error message because the chip has got 1MB flash memory. Funny, is not it?

    Thanks,
    Louis

  • Oops, the error message is not show but I got the following message. (Not red):

    C28xx_CPU1: If erase/program (E/P) operation is being done on one core, the other core should not execute from shared-RAM (SR) as they are used for the E/P code. Also, CPU1 will be halted to determine SR ownership for the CPU which will run the Flash Plugin code, after which CPU1 will be set to run its application. User code execution from SR could commence after both flash banks are programmed.

    Who understands this?

    Louis

  • Hi Louis,

    Thank you for the information.  I will review and get back to you in a day or two.

    Thanks and regards,
    Vamsi

  • Many thanks for that!

    Louis

  • Hi Louis,

    I read your replies. If I understand your latest updates correctly, the only error that you get now is below - correct?

    C28xx_CPU1: If erase/program (E/P) operation is being done on one core, the other core should not execute from shared-RAM (SR) as they are used for the E/P code. Also, CPU1 will be halted to determine SR ownership for the CPU which will run the Flash Plugin code, after which CPU1 will be set to run its application. User code execution from SR could commence after both flash banks are programmed.

    If yes, it is not an error, it is a note.  It is explaining that flash plugin uses shared-RAM to run the flash plugin code (code that erases/programs the flash).  Hence, if you need to use the shared RAM for your application (meaning, if your application is going to copy the code from flash to shared RAM), you need to first load both the flash banks and then execute the application.  Instead, if you load CPU1 flash application and execute it before loading CPU2 flash application, when you load CPU2 flash application, flash plugin code gets loaded to shared-RAM and it will corrupt the CPU1's application content in the shared RAM.  

    Regarding the "Interface returned from dll, but flash is not available on this device" error that you got previously:  This happens if the flash plugin code is not able to read the TI-OTP correctly.  This can happen if the device is not powered properly.  

    Please let me know if you have further questions.

    Thanks and regards,
    Vamsi

  • Hi Wamsi,

    Thanks for the answer. I just reported addition error/warning messages. The main problem is still the same: I cannot program the flash, I cannot use the F2877D controlCARD in stand alone mode (without debugger) After turning on the power it forgets the last programmed code.

    I am using the linker command file what TI supplied without any modifications. I thought if I switch to Configuration to “CPU1_FLASH” from “CPU1_RAM” then it will burn the code to flash and I can turn cycle the power but the program will be retained.

    I would like to achieve this level. My program must run form flash otherwise our users could not use the transmitter.

    Please try to debug the project I sent to you (Official C2000ware example without any modification) from flash memory and please tell me how you did it.

    Best regards
    Louis

    PS: Yesterday morning after I turned on my PC, then the development kit and tried to debug my application, the CCS dropped the following error:

    “Error connecting to the target: (Error -2131 @ 0x0) Unable to access device register. Reset the device and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 9.6.0.00172)”

    Of course, I checked the cables, I tried another USB cable another USB port, another PC but none of these helped. Then I noticed that the 2nd green LED is off on the controlCARD. I also noticed that the CPU is getting warmer and warmer: you almost unable to touch it. Some ghosts seem to have corrupted the CPU card during the night. Now I am waiting for the replacement card. I do hope that the docking station still works. Again $300 cost, for nothing. If it could happen with this CPU then we must find another processor from another vendor which is not so sensitive for the ghosts.

  • Hi Louis,

    I tried the project that you sent.  I am able to successfully program the executable in to the flash and execute it successfully.  

    You said the application does not work after the power cycle:  How are the boot mode pins configured?  Hope they are configured for flash boot option.  Please confirm.

    Regarding the new error that you posted, please see if these can help

    1)  https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/547154/28377d-unable-to-access-device-register

    2) https://www.ti.com/lit/pdf/spracf0 

    If above does not help you to resolve the issue, I will assign this post to our emulation expert.  Please let me know.

    Thanks and regards,
    Vamsi 

  • Hi Wamsi,

    The new error is: my CPU board dead. It is not "unable to access to register" problem. I can't start ANY debug session. I can't do anything with the CPU card. The CCS does not recognize  it. The replacement board is on it's way.

    (I did nothing with the CPU card. I just turned it on 2 days ago. The docking station's green LED is on, The USB green LED is on, but the LED beside the CPU us off.The CPU is hot. I can't connect it to CSS)

    But, can you give the a list how did you flashed the provided sample program? Step by step please.

    My switch configuration:

    Thank you!

    Louis

  • Louis,

    I asked our team to check the boot mode config from your snapshot.

    Regarding the flash load:

    1. Launch the target config

    2. Connect to the target 

    3. Load program -> Select the out file

    4. Once load is complete, reset/restart and execute the code.

    5. Power cycle with flash boot option and check for code output.

    I will assign this post to our workshop lab experts - they will help you further.  

    Thanks and regards,
    Vamsi

  • Thanks Vamsi!

    It is a bypass, but it might work. I will try it when the replacement CPU card arrives and it works.

    By the way: Does debugging work only for programs located int RAM?

    Louis

  • Louis,

    You can debug the code programmed in to flash as well.

    Note: Our control card expert confirmed that you configured the boot mode pins correctly for flash.

    Thanks and regards,
    Vamsi

  • Hi Louis,

    There is an error in the projectspec file for module2_getstarted_blinkyled, specifically pertaining to the flash configuration. I apologize for any inconveniences this may have caused. When your new EVM arrives can you please try the following .projectspec file instead?

    https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/171/module2_5F00_getstarted_5F00_blinkyled.projectspec

    Best Regards,

    Marlyn

  • Hi Marlyn,

    The new board arrived on Friday. It contains newer CPU, the F28379D instead of F28377D. I programmed the usual blinky LED app into the card. It showed the following warning message what I could not “decode”:

    C28xx_CPU1: If erase/program (E/P) operation is being done on one core, 
    the other core should not execute from shared-RAM (SR) as they are used 
    for the E/P code. Also, CPU1 will be halted to determine SR ownership 
    for the CPU which will run the Flash Plugin code, after which CPU1 
    will be set to run its application. User code execution from SR could 
    commence after both flash banks are programmed.

    Anyway, whatever the above warning means debugging the blinky LED app has been started and the program was retained in flash after cycling the power without replacing the projectspec file you sent me. Should this file be replaced?

    C:\Users\[USER_NAME]\ccs\workspace_v11\module2_getstarted_blinkyled\device\driverlib\ccs\driverlib.projectspec


    If you can explain how can I get rid form the above warning that would be nice.


    Thank you for your help.
    Louis

  • Louis,

    As I already explained in this thread on January 24th, above is not an error.  It is a note that gets printed in the console.  I also explained the note in that reply - please read.  For an error or warning, you will see "Error" or "Warning" prefix for the console messages.  That helps you to identify whether it is an error or warning or note.    

    Glad your application is now retained after the power cycle.

    I will let Marlyn answer your question on the file replacement for the project.

    Thanks and regards,

    Vamsi

  • Hi Louis,

    Anyway, whatever the above warning means debugging the blinky LED app has been started and the program was retained in flash after cycling the power without replacing the projectspec file you sent me. Should this file be replaced?

    If you got the program executing on flash now then no, you don't have to replace the projectspec file. 

    Best Regards,

    Marlyn