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-F28027F: Code being erased on reset

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

Hi

I'm new to C2000 development and am just getting off the ground. I've F28027F LDK and I'm facing a small problem:

When I flash the code and try to debug it via CCS, everything is behaving as it should. However, after I power-cycle the system, MCU is reverting back to the Out Of Box Experience code and not the code I loaded into CCS. Can you help me understand why it is behaving like this? What do I do to run the code that I flashed using CCS on reset?

Note: 3 Switches, GPIO34, TDO, TRST, are in ON position.

Thanks in advance

  • Hello,

    From your description it sounds like when you "flash" the device you're actually running your program from RAM. This would explain why your device is reverting back to the Out of Box program since you haven't actually erased & reprogrammed the device's flash memory and it's set to boot from Flash.

    Check which linker command file (the .cmd file) is being used in your CCS project, it's probably a RAM one. If you are wanting to program the flash you will have to change to a flash linker command file, which you may be able to do by changing the active build configuration (Look in project properties).

    If your project doesn't have a flash linker command file, you can find one in ControlSuite: C:\ti\controlSUITE\device_support\f2802x\v230\f2802x_common\cmd

    For info on your device's boot modes read section 2.9 of http://www.ti.com/lit/sprufn6.

    Hope this helps,
    Kevin
  • Hi,

    Additionally if you are just wanting to erase the flash memory of your device to remove the Out of Box code you can perform the following:

    1. Connect to your target device and be in the CCS debug view
    2. Go to View --> Other --> Debug Folder --> Control Panel
    3. Click "On-Chip Flash" and scroll down to "Erase Flash" on the right side

    Best,
    Kevin
  • Hi Kevin

    Thanks for your inputs. The linker command file that was present earlier is RAM one and as you explained, that's the reason that the code is lost on power cycle.

    I tried changing the linker command file by going to Properties -> General -> Linker CMD file and selecting F2802x_generic_flash.cmd and F28027.cmd. However, on selecting either of them, the program isn't working the way it should. Is this process of changing linker command file correct? Do I have to do something more? I have an F28027F launchpad. Can you please tell me which file to use?

    Thanks again for your inputs.

  • Hi Teja,

    I believe you are close, but there may still be more you need to do. The F2802x_generic_flash.cmd should be good for your purpose.

    The issue you're having is probably multiple linker command files within your project. Your project should only have F2802x_generic_flash.cmd active when wanting to run your program from Flash. In your project, right click the other linker command files you have and select "Exclude from Build", this will grey out the file and exclude it from your current build.

    It should look something like this:

    You could also create a RAM and FLASH build configuration, if your project doesn't already have them, to easily switch between running from RAM or FLASH. This would be done by going to Properties --> General --> Manage Configurations (top right) --> New. Then you'd set up one Flash config to include the flash linker command file while excluding the RAM file and vise versa for the RAM build config. Then easily switch between builds by right clicking your project, scrolling to build configurations, and then setting the one you desire to be active.

    If you feel like digging into the linker command file or want more information, check out this wiki!

    http://processors.wiki.ti.com/index.php/C28x_Compiler_-_Understanding_Linking

    Hope this helps,

    Kevin

  • Hi Kevin,

    I apologise for the delay in responding. Thank you for your inputs.

    I've excluded other linker files and still couldn't get this to work. I've shot a small clip for you to better understand what's going on when I change the linker file. Please have a look at it here:.

    In this program, I am just generating 20KHz square wave on GPIO0 and GPIO1 with varying duty cycle. On changing the linker file, you can see that the program goes haywire. I have checked the device in properties. It's set to F28027. However, I have F28027F. I believe that doesn't make any difference.

    Thanks

  • Hi Teja,

    You may need to play around with the boot mode selection switches on your LauchPad to have your device correctly running from flash. Look into section 2.9 "Bootloader Modes" of the Boot ROM guide: http://www.ti.com/lit/sprufn6

    Do you receive any warnings/errors (Check Console) after building your project? I haven't dug too deep into the linker command file you're using, but I wouldn't imagine there would be any issue there.

    Best,
    Kevin
  • Hi Kevin!

    Thanks for the inputs. I'll have a look.

    Thanks