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.

Using sine look-up table using code written to flash memory

Other Parts Discussed in Thread: TMS320F28035

I have written code for a single-phase inverter. A goal is to write to flash (i.e. so that when the device is powered off and not connected to the PC, it will continue to boot and execute correctly). Currently, the sine-look up table is not being accessed properly when power is removed, though it seems the rest of the code is fine. Note that I am using TMS320F28035 and CCSv5.

I understand that the sine table is already available in ROM, so there is no need to write anything from Flash to RAM (as you see I tried to do using ramfuncs). I also understand that in the .cmd file, IQmathTables is set to "no load" (done by the example I started from). SINTBL is something I found written in the signal library documentation, but I don't really understand what I have programmed it to do (I just know that it works as long as I program the flash and don't power off the chip).

Any advice welcome.

BR, -Brian

Code snippet from F28035modified.cmd

   /* Allocate Look Up Table */
    SINTBL               : > RAML1,       PAGE = 0
//    SINTBL               : > FLASHE,       PAGE = 0
   /* Allocate IQ math areas: */
   IQmath              : > FLASHA      PAGE = 0            /* Math Code */
   IQmathTables        : > IQTABLES,   PAGE = 0, TYPE = NOLOAD

 

Code Snippet from Main.c

#include <sgen.h>               

#pragma CODE_SECTION(adc_isr, "ramfuncs");
#pragma CODE_SECTION(ePWM_TZ_isr, "ramfuncs");
//#pragma CODE_SECTION(InitLookupTable, "ramfuncs");

// These are defined by the linker
extern Uint16 RamfuncsLoadStart;
extern Uint16 RamfuncsLoadEnd;
extern Uint16 RamfuncsRunStart;

/* Look-up Table using DSP library
Create an instance of Signal generator module    */
SGENT_1 sgen = SGENT_1_DEFAULTS;

MemCopy(&RamfuncsLoadStart, &RamfuncsLoadEnd, &RamfuncsRunStart);

InitFlash();