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.

TMS320F28379S: C2000Ware_5_00_00_00 F2837xD_usb_flash_kernel example.

Part Number: TMS320F28379S
Other Parts Discussed in Thread: C2000WARE

We designed a custom motor driver board based on the TMS320F2879D.  During our last production cycle there was a parts shortage and needed to substitute the TMS320F2879S processor instead (We were only ever using a singe core on the 379D).  

As part of the development effort I used the F2837xD_usb_flash_kernel example as a basis for implementing boot loader to update the application that is flashed in the device.  When I went to follow the same steps but starting from the examples found under the /device_support/f2837xs tree I noticed that the example was removed in the f287xs tree (all of the examples from the /device_support/f2837xd/examples/dual directory were).

As a result, I am attempting to create my own 'F2837xS_usb_flash_kernel' example and need to confirm that I approached it correctly (or should I just be building against the F2837xd files using it on the single core)

The steps I took were:

  • Made a copy of F2837xD_usb_flash_kernel_cpu01
  • Changed all of the Linked Resources to point to the corresponding files in the f2837xs directories.
  • Deleted F2837xD_Ipc.c and F2837xD_Ipc_Driver_Util.c (Don't exist in the f2837xs tree).
  • Removed the DUAL build configuration (just using CPU1_RAM configuration).
  • Modified c1_bootrom.h to:  

// #include "F2837xD_device.h"
#include "F2837xS_device.h"

  • Modified USB_Boot.c to:

 

//#include "F2837xD_Gpio_defines.h"
#include "F2837xS_Gpio_defines.h"

  • Modified Shared_Boot.c to:

 

//#include "F021_F2837xD_C28x.h"
#include "F021_F2837xS_C28x.h"

  • Modified Fapi_UserDefinedFunctions.c

 

//#include "F021_F2837xD_C28x.h"
#include "F021_F2837xS_C28x.h"

  • Made the following changes to F2837xD_usb_flash_kernels_cpu01.c

71c71
< #include "F2837xD_Ipc_drivers.h"
---
> //#include "F2837xD_Ipc_drivers.h"
75,76c75,76
< #include "F021_F2837xD_C28x.h"
< 
---
> //#include "F021_F2837xD_C28x.h"
> #include "F021_F2837xS_C28x.h"
144c144,145
<     InitFlash();
---
>     //InitFlash();
>     InitFlash_Bank0();
152c153,154
<     SeizeFlashPump();
---
>     //SeizeFlashPump();
>     SeizeFlashPump_Bank0();
249c251,254
<     oReturnCheck = Fapi_initializeAPI(F021_CPU0_BASE_ADDRESS, 150);
---
>     // BUG:? Is 150 (MHz correct here) CPU's clock rate is 200MHz unless example is
>     //       changing the system clock rate to 150MHz elsewhere in the code.
>     //oReturnCheck = Fapi_initializeAPI(F021_CPU0_BASE_ADDRESS, 150);
>     oReturnCheck = Fapi_initializeAPI(F021_CPU0_W0_BASE_ADDRESS, 200);

When I compile I get a error linking.

Building target: "F2837xS_usb_flash_kernels_cpu01.out"

Invoking: C2000 Linker

"/Applications/ti/ccs1240/ccs/tools/compiler/ti-cgt-c2000_22.6.0.LTS/bin/cl2000" -v28 -ml -mt --float_support=fpu32 --cla_support=cla1 --tmu_support=tmu0 --vcu_support=vcu2 -g --define=CPU1 --display_error_number --diag_suppress=10063 --diag_warning=225 -z -m"F2837xS_usb_flash_kernels_cpu01.map" --stack_size=0x100 --warn_sections -i"/Applications/ti/ccs1240/ccs/tools/compiler/ti-cgt-c2000_22.6.0.LTS/lib" -i"/Applications/ti/ccs1240/ccs/tools/compiler/ti-cgt-c2000_22.6.0.LTS/include" -i"/Applications/ti/c2000/C2000Ware_5_00_00_00/device_support/f2837xd/common/cmd" -i"/Applications/ti/c2000/C2000Ware_5_00_00_00/libraries/flash_api/f2837xd/lib" -i"/Applications/ti/c2000/C2000Ware_5_00_00_00/device_support/f2837xd/headers/cmd" --reread_libs --disable_auto_rts --display_error_number --xml_link_info="F2837xS_usb_flash_kernels_cpu01_linkInfo.xml" --entry_point=code_start --rom_model -o "F2837xS_usb_flash_kernels_cpu01.out" "./F2837xD_usb_flash_kernels_cpu01.obj" "./F2837xS_DefaultISR.obj" "./F2837xS_GlobalVariableDefs.obj" "./F2837xS_Gpio.obj" "./F2837xS_PieCtrl.obj" "./F2837xS_PieVect.obj" "./F2837xS_SysCtrl.obj" "./F2837xS_usDelay.obj" "./Fapi_UserDefinedFunctions.obj" "./Shared_Boot.obj" "./USB_Boot.obj" "./USB_Boot_Funcs.obj" "./USB_Structs.obj" "./fwupgradec1toc2_start.obj" "/Applications/ti/c2000/C2000Ware_5_00_00_00/libraries/flash_api/f2837xs/lib/F021_API_F2837xS_FPU32.lib" "../flash_programming_cpu1_RAM.cmd"  -llibc.a -lF2837xD_Headers_nonBIOS_cpu1.cmd 

<Linking>

error #10056: symbol "_Fapi_setupEepromSectorEnable" redefined: first defined

   in "./Fapi_UserDefinedFunctions.obj"; redefined in

   "/Applications/ti/c2000/C2000Ware_5_00_00_00/libraries/flash_api/f2837xs/lib

   /F021_API_F2837xS_FPU32.lib<FlashStateMachine.obj>"

error #10056: symbol "_Fapi_setupBankSectorEnable" redefined: first defined in

   "./Fapi_UserDefinedFunctions.obj"; redefined in

   "/Applications/ti/c2000/C2000Ware_5_00_00_00/libraries/flash_api/f2837xs/lib

   /F021_API_F2837xS_FPU32.lib<FlashStateMachine.obj>"

When I examined the F021_API_F2837xS_FPU.lib and F2837xD_FPU.lib it seems as if the single core version of the library includes these functions while the dual core does not. Is there a reason for this?  Are the functions included in the single core of the library the same as the ones I see in local copy of Fapi_UserDefinedFunctions.c? or perhaps the symbols intentionally removed from the Dual Core flash library and added as a local function to address a bug?

My second question comes from the changes I had to make in F2837xD_usb_flash_kernels_cpu01.c.  The changes that I had to make for the call InitFlash() and SeizeFlashPump() seem to trace back to differences between F2837xD_SysCtrl.c and F2837xS_SysCtrl.c.  For some reason the single core processor has calls for both _Bank0() and _Bank1() for these functions while the dual core version only has calls for _Bank0() so they dropped the differentiation.  I could see the reverse being true, but it seems as if both parts have the same flash configuration.  Am I missing something?

  • Gary,

    I'm going to loop in some others to comment on the API library differences, but for the last question the difference in the bank structure is that on the dual core each CPU is allocated 512KB of flash, whereas on the single core it gets the full 1MB of flash.  I suspect that CPU2's 512KB is "Bank 1" on the Single core device.

    Will get some answers for the rest of your questions directly.

    Best,
    Matthew

  • Hi Matthew,

    When you are saying each CPU is allocated 512KB on the dual core, are you implying that on the dual core CPU1 can only access flash Bank0, and CPU2 only access flash Bank1?  I was under the impression that CPU1 has access to all of the peripherals by default and it explicitly needs to assign them to CPU2 before CPU2 can use them.

    Regarding the flash memory differences.  When I was reading the Flash API Reference Guide for both the single and dual core F2837x the examples for the single core part shows:

        //
        // Call Flash Initialization to setup flash waitstates
        // These functions must reside in RAM
        //
        InitFlash_Bank0();
        InitFlash_Bank1();

    while the same reference guide for the dual core part shows:

        //
        // Call Flash Initialization to setup flash waitstates
        // These functions must reside in RAM
        //
        InitFlash();

    And when I compare the functions I found in F2837xS_SysCtrl.c and F2837xD_SysCtrl.c it looks as if InitFlash() is the same as InitFlash_Bank0().  Unless I am misunderstanding something, on the dual core part, either I would not be able to access flash bank1, or I would need to have my own copy of the InitFlash_Bank1() function. 

    - Gary

  • Hi Gary,

    Regarding your latest reply:

    On dual core F2837xD devices, CPU1 has access only to its bank.  CPU1 does not have access to CPU2's flash bank.  And each CPU should execute InitFlash() for it's own flash wrapper/bank.

    On Single core F2837xS devices with two banks, there are two flash wrappers (one for each bank) - hence, there are two InitFlash functions (one for each bank).

    Regarding your first message on this post:  I can review the other questions in a day or two and get back to you.

    Thanks and regards,

    Vamsi

  • Hi Gary,

    Regarding the differences in the Fapi_UserDefinedFunctions.c between the dual core and single core libraries:  In the Single core flash API library, the Fapi_setupEepromSectorEnable() and Fapi_setupBankSectorEnable() functions are moved in to the library itself instead of Fapi_UserDefinedFunctions.c.  Previously (during dual core flash API library development), we used to share our codebase with another team and hence kept these functions in Fapi_UserDefinedFunctions.c.  These functions are not configurable for F2837xD/S devices.  Hence, later when we stopped using the shared code base with other teams, we decided to move these functions in to the flash API library itself.

    If you are using the single core flash API library, then you need to use the Fapi_UserDefinedFunctions.c provided at C2000Ware_5_00_00_00\libraries\flash_api\f2837xs\source.

    Let me know if you have further questions on this.  If no questions on this, I can loop in our kernel expert to help you on other questions.

    Thanks and regards,
    Vamsi