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.

CCS/TMS320F28379S: Problem getting TMS320F28379SZWTT device to boot from Flash?

Part Number: TMS320F28379S
Other Parts Discussed in Thread: C2000WARE, TMS320F28379D,

Tool/software: Code Composer Studio

Hi Im trying to run up a new custom board with a TMS320F28379SZWTT device.

Ive tried load both the basic Matlab supplied LED blink example and the TI CCS Blinky_cpu01 example.

For ref Im using Matlab 2020b which is the preferred tool.

The problem I have is both versions run fine but as soon as the board is power cyled the code is lost.

Im assuming for whatever reason the code is not being stored in Flash, even though in the Simulink version the "boot from Flash" is ticked?

Any help would be most appreciated.

Thanks

  • Hi Lan,

    Can you report the picture one more time? It did not came through last time.

  • Ian,

    Checking with MathWorks team to help on the issue. 

  • Hi Santosh,

    Ive already spoken to Matlab today and they say as my custom board shows the same issue with both the Simulink LED model and the Ti LED_Blinky code, ie. both versions run fine and flash the LED, until the board is power-cycled and then the code is lost. Also in CCS its possible to halt and restart the code and that also works fine. The issue is just when the board is power cycled that the board does not run until the code is reloaded through JTAG.

    Thanks

  • Ian,

    Did you try through CCS?  Through CCS, if select the Flash configuration, it should write to flash and then it should run in standalone mode.

  • Hi Santosh,

    Yes the Ti LED_Blinky was done through CCS v10.1 and teh simulink model was programmed direct from Matlab.

    Both had " Boot from Flash" selected and both gave teh same result, ie flashed the LED, but not after a power cycle?

    Thanks

  • Ian,

    Let's try with CCS first.

    You need to select the build configuration for flash. Right-Click the project, Build Configuration -> Set Active -> CPU1_FLASH. Then rebuild the project and load it. it will write the code to flash. You should see the activities in the ccs output window. Now you can disconnect the JTAG, and power-cycle the evm. It should boot from flash.

    If you are following above steps, and it is still not booting, then can you check if you are using EABI format or COFF format? Also, unload the GEL file, and then connect the target and check where is PC.

    Please refer to this link which goes through multiple steps to debug this issue.

    e2e.ti.com/.../878674

  • Hi Santosh,

    Tried building and loading the Blinky_cpu code from CCS 10.1 again and ensured the build config setting was set to to CPU1_Flash.

    I still get the same result, runs fine with the debugger connected but not after it is removed and power-cycled.

    Can you explain what is EABI and COFF formats and how to unload the GEL file?

    Regards 

  • Ian,

    Right-click the project, and select "Show Build Setting..."

    For unloading the GEL file, open the target configuration, and select C28xx_CPU1, then you can remove the GEL file, and then connect.

  • Hi Santosh,

    The build settings are set as per yor window above apart from Output Format. If I build with "legacy off" the code compiles, loads and runs and I can stop/resume the LED flashing form within CCS.

    If I change the Output Format to "eabi(ELF)" I get errors during the compile as below - not sure what this means:-

    No sure what you mean for unloading the GEL file. What is this and what will it achieve?

    Also this is a Ti LED example and all I've changed is GPIO port to "0" as that is where my LED is connected, so alittle surprised I cant load it into Flash?

    Regards

    Ian

  • Ian,

    C2000ware has two types of examples - Bitfield based (device_support) and driverlib based. Bitfield based examples are not supported in EABI format. It is only supported in COFF format. If you are looking EABI format, then take a look at example at DriverLib

    C:/ti/c2000/C2000Ware_3_03_00_00/driverlib/f2837xs/examples/cpu1/led

    If you want to use device_support example for EABI format, then you need to modify the F2837xD_usDelay.asm file. I tried locally and I was able to compile it. See below.

           .def F28x_usDelay
    
           .cdecls LIST ;;Used to populate __TI_COMPILER_VERSION__ macro
           %{
           %}
    
           .if __TI_COMPILER_VERSION__
           .if __TI_COMPILER_VERSION__ >= 15009000
           .sect ".TI.ramfunc"      ;;Used with compiler v15.9.0 and newer
           .else
           .sect "ramfuncs"         ;;Used with compilers older than v15.9.0
           .endif
           .endif
    
            .global  _F28x_usDelay
    F28x_usDelay:
            SUB    ACC,#1
            BF     F28x_usDelay,GEQ    ;; Loop if ACC >= 0
            LRETR

  • Hi Santosh, Not sure what the exact difference is between Bitfield based and Driverlib based?

    The device Im using is the F2837xS (Not F2837xD).

    What Im trying to achieve is to boot my target board from flash and then blink the LED - Do I need Bitfield or Driverlib based?

    Once I can do this I then need to make this happen using Simulink as the model is being developed in Simulink.

    Regards

    Ian

  • Ian,

    Assembly code I showed above, it should work for F2837xS device. As you are looking for simulink code you should stay with Bitfield based example.

    C:/ti/c2000/C2000Ware_3_03_00_00/device_support/f2837xs/examples/cpu1/blinky/cpu01/blinky_cpu01.c

    For newer devices, we have API based example and it is called DriverLib (low level driver for all peripherals). Simulink does not support DriverLib based framework yet.

  • Hi Santosh,

    Ok look slike I need to stay with Bitfield based examples.

    The usDelay.asm code you sent looks the same a what is in the Bitfield project, what have you changed?

    C:/ti/c2000/C2000Ware_3_03_00_00/device_support/f2837xs/examples/cpu1/blinky/cpu01/blinky_cpu01.c

    Also noticed there is an example called Blinky_with_DCSM? What is this as just need smthg to boot from Flash.

    Thanks

    Ian

  • Ian,

    You had compilation error in delay assembly function. If you use my function, it should compile properly. I just remove leading _(underscore) from function name.

  • Hi Santosh,

    I did a CCS update over the w/e and the pc crashed so I had to reinstall CCS!

    Before it crashed removed the ther underscore in usDelay but it still wouldnt compile, but not sure how this change would affect this Flash loading?

    After the install im now getting the following errors?

    Thanks

  • Ian,

    Can you reimport the project and compile? Looks like some of the paths are not set properly.

  • Hi Santosh,

    I've managed to get the Ti Blinky code to compile and this loads into my target but will NOT boot from Flash.

    Is there any any extra code I need to make it boot from Flash?

    Thanks

    Ian

  • Ian,

    Please refer to this e2e post. Our flash expert has put together steps required to run from flash and how to debug.

    e2e.ti.com/.../878674

  • Hi Santosh, Im now having problems loading any of the example projects. This is for any device. See error below:-

    Any ideas?

    Thanks

  • Ian,

    Looks like step in backward direction. Earlier you mentioned that you are able to build for RAM configuration and it fails to build for Flash. Now you cannot load using resource explorer.

    Looks like it is known issue. For now,  you can directly import the projects into CCS using the "Project->Import CCS Projects-> Select the directory within the installed version of C2000Ware"

    There is another thread, the issue is being tracked. Here is the link:

    e2e.ti.com/.../957565

  • Hi Santosh,

    Yes a big backwards step!

    I've already tried using the "Project->Import CCS Projects-> and I just get "metadata errors" for any example.

    Have tried a repair and same result.

    Wil try a fresh install...

    Thanks

  • Ian,

    Before reinstalling everything, try to create a new workspace in new folder. Then import an example, like led_blinky.

  • Hi Santosh,

    Sorry I'd already reinstalled but I'm now able to import examples.

    So I can now build again with no errors if I set the build config to active => RAM.

    But If I set the build config to active => FLASH I get the following compile errors.

    Do I have some compile settings incorrectly set or am I missing some files:-

  • Ian,

    In your project on the left side (Project explorer), I see  2837xS_Generic_FLASH_lnk.cmd. Did you add it manually?

    Please delete that and rebuild it again. The project should pick the linker command file from following location automatically: C:/ti/c2000/C2000Ware_3_03_00_00/device_support/f2837xs/headers/cmd

  • Hi Santosh,

    No havent added this file?

    Ive deleted it now and the Flash version now build with no errors..

    I then try to download the .out file to my target and I get :-

    This is the same for a RAM build.

    Have you seen this before?

    Thanks

  • Hi Santosh,

    Ive managed to load the .out file to my target by clicking the debug button, but not sure why I need to load it through the debugger this time (usually Run/Load/Select program to load), as all I want to do is load the blinky code into Flash and run it?

    Also I suspect I need to change the GPIO port in the example to match where my LEDs are connected (GPIO_0 & GPIO_1), which I did last time, but with this latest example I cant find where this is located and it doesnt seem to be in the GPIO.c file?

    Thanks

  • Ian,

    I am glad you figured to load and run the binary.

    Yes, you need to change the GPIO based on your custom board design.

    GPIO configuration is done in main C file only.

    #ifdef _LAUNCHXL_F28377S
    #define BLINKY_LED_GPIO    12
    #else
    #define BLINKY_LED_GPIO    31
    #endif

  • Hi Santosh,

    Currently my main_cpu01.c is an empty file?

    See below??

    //###########################################################################
    //
    // FILE:   main_cpu01.c
    //
    // TITLE:  Empty Example for F2837xS.
    //
    //! \addtogroup cpu01_example_list
    //! <h1> Empty Project </h1>
    //!
    //! This is an empty project for bit field development
    //!
    //! \note If using a Launchpad, use the Launchpad build configurations.
    //!
    //
    //###########################################################################
    // $TI Release: F2837xS Support Library v3.11.00.00 $
    // $Release Date: Sun Oct  4 15:58:38 IST 2020 $
    // $Copyright:
    // Copyright (C) 2014-2020 Texas Instruments Incorporated - http://www.ti.com/
    //
    // Redistribution and use in source and binary forms, with or without
    // modification, are permitted provided that the following conditions
    // are met:
    //
    //   Redistributions of source code must retain the above copyright
    //   notice, this list of conditions and the following disclaimer.
    //
    //   Redistributions in binary form must reproduce the above copyright
    //   notice, this list of conditions and the following disclaimer in the
    //   documentation and/or other materials provided with the  
    //   distribution.
    //
    //   Neither the name of Texas Instruments Incorporated nor the names of
    //   its contributors may be used to endorse or promote products derived
    //   from this software without specific prior written permission.
    //
    // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
    // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
    // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
    // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
    // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
    // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
    // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
    // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    // $
    //###########################################################################
    //
    // Included Files
    //
    #include "F28x_Project.h"
    void main(void)
    {
    }
    //
    // End of file
    //
    Thanks
  • Hi Santosh,

    Looks like when I imported the example Blinky it didnt import all the files.

    If I explore to where the example are the main_cpu01.c is correct.

    For what ever reason Iam not able to import the examples.

    If I try with project/import cs projects. I get...:-

    Can you give me instructions how to create a new workspace in new folder so I can import an example, like led_blinky.

    Thanks

  • Ian,

    Go to CCS menu File -> Switch Workspace, select Other and browse to new folder location where you want to create the workspace.

    What is CCS version and C2000ware version you are using?

  • Hi Santosh,

    Sorry still not working....

    CCS ver#10.1.10004

    C2000ware ver#3.03.00.00

    Firstly Ive copied the Blinky example from the Ti/C2000ware dir to a new dir:-

    So 

    Next I select the workspace with switch workspace:-

    Next, workspace is now opened and new project explorer tab appears:-

    Next, go to file open projects/files and point to Blinky project/cpu01:-

    Next, NO projects appear?????

    Tried repeating this several times - same result.

    Tried project/import ccs project and just get:-

    Any ideas...

    Thanks

  • Hi Ian, due to the US holiday several of our experts are out of office.  You can expect a reply by Tuesday or Wednesday next week.  I apologize for the delay.

    Regards,

    Joe

  • Ian,

    I will recommend you to start a new workspace, do not create that in C2000ware folder, keep it some place. Otherwise it may corrupt your C2000ware SDK installation.

    It will be useful to go with F28379D workshop. It illustrates the steps in details with lab work. It will help you a lot.

    training.ti.com/c2000-f2837xd-microcontroller-1-day-workshop-series

  • Hi Santosh,

    Yes tried creating new standalone workspace here:-

    Then opened workspace and tried to compile and get the following errors:-

    Course looks interesting and will look into this.

    I need to get the board booting from flash asap and the project is required very urgently now.

    I now have a simulink model running on the device, but this also will not run standalone.

    Do I need to configure the WDOG or smthg similar for standalone mode?

    Thanks

  • Ian,

    Looks like again there was issue in importing your project. The include path is not imported correctly. It should be something like below.

    I will strongly recommend you to go through the workshop. It will help you a lot.

  • Hi Santosh,

    for some reason the imported project file paths are incorrect and it has created C:\APPS\S7 PowerBox\Matlab_CCS\common and C:\APPS\S7 PowerBox\Matlab_CCS\headers that dont exist:-

    This is the correct path but cant see how to change it:-

    The example you sent links to is the TMS320F28379D which is the dual core version and I'm using the TMS320F28379S single core version so quite different.

    Thanks

  • Hi Santosh,

    Do you think there is any basic reason why I cant run in standalone mode using the Matlab modele.

    The model compiles, downloads and runs fine. I can blink LEDs and control alot of other GPIO so code dev is going well.

    I cant see any h/w signal I'm missing on my board.

    The external reset is an R/C XRS_N pin, but maybe do I need to configure the WDOG or some other register to boot in standalone?

    Is there anything else you think I need to check?

    Thanks

  • Ian,

    Please let's try to use C2000ware only. Do not use Mathlab model for now. I am not sure what code is being generated by MathLab model and how it is being linked.

  • Hi Santosh, I'm currently having to work with both C2000ware and matlab as I have working models for simulink which I'm developing (although still not able to run from Flash). Ive worked through the workshop, although the CCS is v6 which is quite different now and the device is a F28379D dual core part and mine is an "S" single core part.

    So back to the C2000ware examples and CCS. I think I've worked out the compile issues. I've reloaded C2000ware_3.03.00.00 and I'm able to load several projects incl blinky and compile without issues. 

    Note the configuration is set for "Flash" also the variant is set for "Generic C28xx":-

    This compiles as you can see with no issues but when I try to load my board I get the following message:-

    Not sure what the issue is here but I think its saying its detecting a F2837xD (dual core) device, but the device part number on my board is definitely  F28379S? So maybe this is smthg to do with the Variant build setting being set to "Generic C28xx". So If I set the Variant build setting to exactly the correct part ie. F28379S then the code wont compile, see below:-

    Interesting thing is now it doesn't seem to be possible to go back to the Generic Variant build setting and get teh code to compile again and I just get the same error  as above. I have noticed that onece you go back to the generic variant the comiler version has changed, see below:-

    So it seems once you try and compile with the device set to the correct part variant and it fails to compile, some others files get changed and to be able to successfully compile with the Generic variant option again you have to completely re-install al of the Blinky project files.

    Any ideas what is going on?

    Thanks

    Ian

  • Ian,

    Regarding multiple debugger, can you expand the target configuration in your project and check how many active configuration you have. If there is more than one configuration, then you can remove it , and make sure only one as active and default configuration. It should look something like below.

    Regarding building with exact device variant, I just tested with exact variant, and it should build it fine. Make sure you remove linker command file (I have circled it), as linker command is done through Linker File-Path.

    Here is my setup.

  • Hi Santosh,

    Looks like there is only one active configuration?

    Also I now have a LauchXL-F28379D demo board which gives me the same "multiple debuggable cores detected" error?

    Thanks

  • Hi Santosh, removing the linker command file works well when you select the exact device now and enables me to compile with the exact part selected.

    Still getting the "multiple debuggable cores detected" error, but seems I only have one active core?

    Any ideas?

    Thanks

  • Ian,

    Right-click on the project, and then check the Debug As -> debug configurations. Target Configuration should be something like this.

    ${target_config_active_default:blinky_cpu01}

    Also, I will request you again to go through the workshop. The debug configurations are explained well in workshop.

  • Hi Santosh,

    Ive already tried different debugger settings and it still gives the same "multiple debuggable cores detected" error.

    Have tried the circled option ticked/unticked and same error?

    Anything else I need to check?

    Thanks

  • Ian,

    Can you zip the project and send it? I can take a look your project setting.

  • As I'm still struggling to load into either the Lanuchpad or my board with Cware2000 I've been looking at my simulink model which is now running standalone on the Lanuchpad board.

    Could this be due to the fact that in Simulink when the LaunchXL tgt is selected it actually selects the correct part config .ccxml file :-

    But when I select my tgt device there is no #####79S.ccxml and only a ####77S.ccxml? Is this the problem?

    Thanks

  • Hi Santosh,

    Here is the blinky project...

    8662.blinky.7z

    Thanks

  • Ian,

    I am able to import your project and load and run it without any issue.

  • Hi Santosh,

    Ok thats great news.

    Anyway I still get the "multiple debuggable cores detected" error for any build or any example I build for ie, either my board, the Lanuchpad and both RAM and Flash? Any changes I should make then that you found?

    Also more importantly I feel we're really close with the Matlab option as I can now run standalone code on the Launchpad but not on my board.

    Do you think as per my previous question the problem is that matlab needs a F28379S.ccxml for the flash build? Currently there is only F28377S.ccxml available?

    If this is the case can you supply the correct .ccxml?

    Thanks