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.

Compiler/LAUNCHXL-F28379D: For dual-cpu software, how can we share functions and data?

Part Number: LAUNCHXL-F28379D
Other Parts Discussed in Thread: CONTROLSUITE

Tool/software: TI C/C++ Compiler

I didn't realize until I went to convert my project from the F28377S to the F28379D all of the hoops that are required to load and run code for 2 CPUs. One of the biggest surprises was that two projects are required, which are compiled and linked separately - which will make development and testing much slower. Now, I understand that each CPU has it's own M0/1, D0/1, and LS0-5 RAM, and that they share GS0-15. Since GS0-3 fall under the 64k limit, I believe, they can contain program data. What I'm curious about is, besides (the obvious) including the same shared source code in both projects, how does one make sure that shared functions and/or data occupy the same locations in the GS RAM, so that both CPUs can point to them? Regarding the shared data, I'm thinking about readonly constants - I would obviously use the IPC RAM to share information between the two CPUs.

(as an aside, the TI compiler makes it simple to program for 1 CPU, and it surely seems that all of the steps for loading for two could be automated by the IDE/compiler - including having shared and complementary memory cmd files, and common includes).

  • Hi Adam,

    You can not share the code. It's only for share the data. It is because CPU which has the master ownership of a GSx RAM block, can only execute the code from that GSx RAM block. To enable this you have to keep changing the ownership of GSx RAM block via CPU1 code (CPU2 can not change the ownership) which will make it a bit complicated.

    Vivek Singh

  • Adam,

    One feature which may be of interest to you is the project build configurations in Code Composer Studio. Instead of having two separate projects for CPU1/CPU2, you could have different build configurations for them. You'll see these being used in our controlSUITE code as different builds for RAM/Flash examples. You can do the exact same for CPU1/CPU2. This is just a matter of personal preference, but I found that less cumbersome than maintaining two separate projects.

    Regards,
    Kris
  • Vivek and Kris,

    Thank you. I overlooked the issue of code section ownership. Also, I've been making using for the RAM/FLASH build configurations, but I hadn't thought of CPU1 vs 2. However, right now I've been able to manage without needing CPU2.

    -Adam

  • Hi Chris and Vivek,

    Please can you tell me how to download the code in both CPU?? I have followed the Control suite document for downloading but the problem while select the FLASH configuration then CPU2 code not executing.

    Second thing How can I access the data from CPU1 to CPU2?

    Regards,
    Dnyanesh
  • Hi,

    How are you downloading code in CPU1? If using CCS then you should be able to load the code in CPU2 by selecting CPU2 and loading the code.  Is that not working? Also what do you mean by CPU2 code not executing? Is it getting stuck in some loop?

    Second thing How can I access the data from CPU1 to CPU2?

    If the data is in shared RAM (GSx RAM) then you should be able to access it by using the absolute address or variable name but make sure you use #pragma to assign the data at specific address location.

    Regards,

    Vivek Singh

  • Dear Vivek,

    I am using ccs7 only. Can you just elaborate the how to download in both CPUs code. What are steps I need to follow. As I have followed steps as per TI documents which is given in the control suite. TI has given the code which running in RAM only. what things I need to change in the ccs properties?

    Please share the steps to download both CPU code.

    CPU 2 code not executing means. I have downloaded the code of LED blink GPIO34 in CPU2 but it is not working.

    Regards,
    Dnyaneshwar

  • I built the FLASH STANDALONE project for CPU01

    I then built the FLASH project for CPU02

    I followed Vivek Singh's thread for CPU02

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

    I had to power cycle the board to get the second LED to blink

  • Hi Dnyaneshwar, I hope you were able to get it working. Let us know if you have any further queries.