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.

LAUNCHXL-F28069M: How boot in stand alone mode

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

Dear all,

I am a newbie to c2000 micro-controllers.  I am doing a project by using GPIO_setup example in ControlSuite and I can run it in emulation mode.  I have looked in to the threads posted in the forum and also read the spra958l but I still I could not able to understand how to run my project in stand alone mode. It will be a big help for me if anybody can guide me in simple steps. I am only using f28069M launch pad.

Thank you.

Regards,

  • Hello
    I recommend looking at "flash_28069" example from controlsuite. In few words - you have to load your project in flash memory instead of RAM memory.
    If you want to convert "gpio_setup" into standalone project, maybe these steps will be helpful:

    1) Right-click on your project, select "Properties". In the properties window, go to "CCS General" tab. In the bottom part of that tab choose "F28069.cmd" file in "Linker command file" list. This linker file maps you code to flash memory of the MCU.

    2) Add file "F2806x_CodeStartBranch.asm" file to your project (this file is located at "C:\ti\controlSUITE\device_support\f2806x\v151\F2806x_common\source". This file contains simple code, that branches your program to flash memory after reset.

    3) In the beginning of the "void main ()" add call for "memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize);
    " function. This function will copy some code from to RAM (especially function "InitFlash()"). Maybe you will need to declare external variables before "Main()":
    extern Uint16 RamfuncsLoadStart;
    extern Uint16 RamfuncsLoadSize;
    extern Uint16 RamfuncsRunStart;
    These variables are defined in the "F28069.cmd" file and they help "memcpy()" to identify where is time-critical code located and where it must be copied to.

    4) After "memcpy()" call function "InitFlash()". This function will setup flash memory for optimal speed.

    Then compile the project, load it into the MCU's memory. After load press "Reset CPU" button in the debug perspective, and then press "Run". If everything is ok, you'll find your program running.
  • Dear Disona,

    Thank you very much for your quick response and for the explanation from the scratch but I am having trouble with RamfuncsLoadSize; which is not declared in  "F28069.cmd" file. Do I need to declare that function in the cmd file

    Regards,

  • Hello

    There are different ways to define size of code, that must be copied. For example, in my "F28069.cmd" I have such part of the script:

     
       ramfuncs            : LOAD = FLASHD,
                             RUN = RAML0,
                             LOAD_START(_RamfuncsLoadStart),
                             LOAD_END(_RamfuncsLoadEnd),
                             RUN_START(_RamfuncsRunStart),
    			 LOAD_SIZE(_RamfuncsLoadSize),
                             PAGE = 0

    This part of script tells the linker, that part of code must be STORED in flash memory, but RUN from ram memory. And you tell linker to save address of flash, where code is stored, save address of ram, where the code must be copied to and save size of the code, that must be copied.

    I suggest two ways to get _RamfuncsLoadSize:

    1) Try to add string "LOAD_SIZE(_RamfuncsLoadSize)" to your cmd script just like in the code example above. I'm not sure if this is compatible with old linkers (I use compiler v.17.9.0), but it is the easiest way.

    2) If it doesn't work, that in your "main.c" declare variable "extern Uint16 RamfuncsLoadEnd;" instead of "extern Uint16 RamfuncsLoadSize;". Then in "memcpy()" function pass "(size_t)(&RamfuncsLoadEnd - &RamfuncsLoadStart)" instead of "(size_t)&RamfuncsLoadSize)". You can do it, because actually SIZE = ENDaddress - STARTaddress.

  • Dear Disona,
    Thanks again. I tried both options but still it is not working. it shows the warning "creating output section "ramfuncs" without a SECTIONS specification". what did you mean by old linkers.Do I need to update my compiler version. Is there any problem using  "DELAY_US(1000*1000);" function in this example. It will be very helpful If you can give me a link to become a c2000 programming expert or some guidance to learn from the beginning.
    Thank you.
    Regards,
    Buddhika

  • Hm, that's strange. That warning means that you have some functions, which must be pplaced into special section "ramfuncs" (that will be copied from flash to ram), but you have not described the section in your cmd file. It's strange, because this section must be in "F28069.cmd"

    Can you try to copy the attached file into your project? But delete other "F28069.cmd" or "28069_RAM_lnk" files from the project. Be careful, and do not delete "F2806x_Headers_nonBIOS.cmd". So you must have two "cmd" files in your project: "F28069M.cmd" (it's attached to this post) and "F2806x_Headers_nonBIOS.cmd" (it's a linker script with peripherals, it is needed). Then go to project properties, tab "General" and make sure, that "Linker command file" option is empty. If it is not - make it empty. This is needed, because the compiler must take "F28069M.cmd" from your project.

    You can check your build tools (compiler+linker+assembler+etc.) on the same "General" tab in project properties. If you have v15.x.x and higher - it's ok.

    Where do you have problem with "DELAY_US"? What is the problem? The project doesn't compile? Or the program hangs? 

    If you want to upgrade your skills with C2000, maybe you should take a look at workshops:

    F28069M.zip

  • Dear Disona,
    Thank you for your big support. Now it is working. The problem was with the .asm file as I think. I did not update the link location because it was already there. Thank you again for the big help.

    Regards,
    Buddhika
  • Hi Disona

    I have a similair issue...

    I tried to run the SCI echoback program in standalone mode in the 28069 Launchpad. I was able to do that
    by changing the 28069_RAM_lnk.CMD to F28069.CMD

    and using the

    memcpy(&RamfuncsRunStart, &RamfuncsLoadStart, (size_t)&RamfuncsLoadSize);

    as suggested by you..

    It worked in both emulator mode as well as standalone mode
    without changing the position of the boot switches given in the launchpad..

    We tried the same procedure to run our application in the launchpad..

    The Application code developed by us is based on the echoback example, by adding the ADC and PWM functions to it..
    However this dosen't works fully...

    In the sense the code is partially executed.. Some of the GPIO initialization done before the for loop works ( LED's in the launch pad works as intended) however the remaining part of the codes are not executed..

    It seems the code is not fully copied into the Flash..

    Kindly help resolve..

    Thanks
    Lenin.
  • Hello

    Can you give some additional info?

    Does your program crash or what?

    Can you share your code (if it is not too big)?

  • Hi

      I have attached the project file.

    Thanks

    Lenin.

    GDT_EV_LeadAcid_24V_75W_Rev 1.zip

  • Lenin

    I encourage you start your own post for best assistance.

    Best regards
    Chris