You are currently viewing Tutorial on TMS320F2812 Flash Programming

Tutorial on TMS320F2812 Flash Programming

Spread the love

The objective of this article  is those who are successes in TMS320F2812 programming a RAM memory and they want to do a same code in flash memory for a dedicative application or embedded solution then it is right place to reach here and go further.

Volatile into NON-Volatile Memory :

Usually TMS320F2812 internal volatile memories are used to store the code of projects. When it comes to production versions with a standalone embedded control unit based on the TMS320F2812, we no longer have the option to download our source/control code using Code Composer Studio.

For standalone embedded control applications, we need to store our control code in NON-Volatile memory. This way it will be available immediately after power-up of the system. The F2812 is also equipped with an internal Flash memory area of 128Kx16. This is quite a large amount of memory and more than sufficient for all projects.

There are 6 different options to start the C28x out of power-on. The options are hard-coded by 4 GPIO-Inputs of Port F (F4, F12, F3 and F2). The 4 pins are sampled during power-on. Depending on the status one of the following options is selected.

Boot mode of tms320f2812

Simple Procedure to convert RAM into Flash Memory Out file :


The files which are asked to add in projects all available at this C:\tidcs\c28\dsp281x\v120 installation path.


1)Remove F2812_EzDSP_RAM_lnk.cmd from the project & add the F2812.cmd.

F2812.cmd file – C:\tidcs\c28\dsp281x\v120\DSP281x_common\cmd


2)Add the following source file in the project

 DSP281x_CodeStartBranch.asm – C:\tidcs\c28\dsp281x\v100\DSP281x_common\source

 DSP281x_SysCtrl.c [C:\tidcs\c28\dsp281x\v100\DSP281x_common\source]

 3)Add the following line to your inside of main code

memcpy(&RamfuncsRunStart,&RamfuncsLoadStart,&RamfuncsLoadEnd – &RamfuncsLoadStart);



 4)Add the following lines to your outside of main code

extern unsigned int RamfuncsLoadStart;
extern unsigned int RamfuncsLoadEnd;
extern unsigned int RamfuncsRunStart;

 5)Rebuild the project.

If build was successful you’ll get: Build Complete,

0 Errors, 0 Warnings, and 0 Remarks.

Note: Sample LED_F2812_RAM and LED_F2812_FLASH source files are attached for reference.

Please make change the hardware to load flash and do power on the TMS320F2812 DSC kit and also please make sure that TMS320F2812 is running in microcomputer mode (Jumper J7).

Debug the code once with code composer studio just run it, halt it and terminate all. Now your dedicative embedded control applications are programmed in TMS320F2812 Flash Memory. Here after your code will execute after power-up of the TMS320F2812.


Download source code here

This Post Has One Comment

  1. Muhammad Ali

    i am a beginner and i want to read code from TMS320F2812 which is installed on the PCB. Can you guide me how to do that please. Regards

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.