I am getting the following error when using c I/O commands in CCS 5.3.
Description Resource Path Location Type
#10099-D</a> program will not fit into available memory. placement with alignment/blocking fails for section ".text" size 0x2349 page 0. Available memory ranges: 28335_RAM_lnk.cmd /Wave analysis and control line 125 C/C++ Problem
Description Resource Path Location Type
#10099-D</a> program will not fit into available memory. run placement with alignment/blocking fails for section ".stack" size 0x800 page 1. Available memory ranges: 28335_RAM_lnk.cmd /Wave analysis and control line 130 C/C++ Problem
I am trying to read a text file from my computer into an array. Currently this is the only way to read data into my program as the data is output as a text file from a simulation model run in a SPICE program.
My code is the following. It seems to compile relatively fine (no errors or warnings in the workspace directly identified in the code itself).
#include "DSP2833x_Device.h"
#include <stdio.h>
// external function prototypes
extern void InitAdc(void);
extern void InitSysCtrl(void);
extern void InitPieCtrl(void);
extern void InitPieVectTable(void);
extern void InitCpuTimers(void);
extern void ConfigCpuTimer(struct CPUTIMER_VARS *, float, float);
extern void Display_ADC(unsigned int);
extern void Power_Calculation(void);
// Prototype statements for functions found within this file.
void Gpio_select(void);
interrupt void cpu_timer0_isr(void);
void USB_Read(void);
//Global Variables
float current_source[1633];
//float Voltage_Vxtl[10000];
//float time[10000];
// support options
//###########################################################################
// main code
//###########################################################################
void main(void)
{
InitSysCtrl(); // Basic Core Init from DSP2833x_SysCtrl.c
EALLOW;
SysCtrlRegs.WDCR= 0x00AF; // Re-enable the watchdog
EDIS; // 0x00AF to NOT disable the Watchdog, Prescaler = 64
DINT; // Disable all interrupts
//Gpio_select();
InitPieCtrl(); // basic setup of PIE table; from DSP2833x_PieCtrl.c
InitPieVectTable(); // default ISR's in PIE
while(1)
{
EALLOW;
PieVectTable.TINT0 = &cpu_timer0_isr;
EDIS;
ConfigCpuTimer(&CpuTimer0,150,100000);
PieCtrlRegs.PIEIER1.bit.INTx7 = 1; // CPU Timer 0
PieCtrlRegs.PIEIER1.bit.INTx6 = 1; // ADC interrupt call
IER |=1;
EINT;
ERTM;
CpuTimer0Regs.TCR.bit.TSS = 0; // start timer0
//USB_Read(); // USB data read function call
//Power_Calculation(); // Power calculation function call
while(CpuTimer0.InterruptCount <5)
{
// wait for 500 ms
EALLOW;
SysCtrlRegs.WDKEY = 0x55; // Service watchdog #1
EDIS;
}
while(CpuTimer0.InterruptCount <10)
{
// wait for 1000 ms
EALLOW;
SysCtrlRegs.WDKEY = 0x55; // Service watchdog #1
EDIS;
}
CpuTimer0.InterruptCount = 0;
}
}
/*
void Gpio_select(void)
{
EALLOW;
GpioCtrlRegs.GPAMUX1.all = 0; // GPIO15 ... GPIO0 = General Puropse I/O
GpioCtrlRegs.GPAMUX2.all = 0; // GPIO31 ... GPIO16 = General Purpose I/O
GpioCtrlRegs.GPBMUX1.all = 0; // GPIO47 ... GPIO32 = General Purpose I/O
GpioCtrlRegs.GPBMUX2.all = 0; // GPIO63 ... GPIO48 = General Purpose I/O
GpioCtrlRegs.GPCMUX1.all = 0; // GPIO79 ... GPIO64 = General Purpose I/O
GpioCtrlRegs.GPCMUX2.all = 0; // GPIO87 ... GPIO80 = General Purpose I/O
GpioCtrlRegs.GPADIR.all = 0;
GpioCtrlRegs.GPADIR.bit.GPIO9 = 1; // peripheral explorer: LED LD1 at GPIO9
GpioCtrlRegs.GPADIR.bit.GPIO11 = 1; // peripheral explorer: LED LD2 at GPIO11
GpioCtrlRegs.GPBDIR.all = 0; // GPIO63-32 as inputs
GpioCtrlRegs.GPBDIR.bit.GPIO34 = 1; // peripheral explorer: LED LD3 at GPIO34
GpioCtrlRegs.GPBDIR.bit.GPIO49 = 1; // peripheral explorer: LED LD4 at GPIO49
GpioCtrlRegs.GPCDIR.all = 0; // GPIO87-64 as inputs
EDIS;
}
*/
interrupt void cpu_timer0_isr(void)
{
CpuTimer0.InterruptCount++;
EALLOW;
SysCtrlRegs.WDKEY = 0xAA; // service WD #2
EDIS;
PieCtrlRegs.PIEACK.all = PIEACK_GROUP1;
}
void USB_Read(void)
{
FILE *fid;
fid = fopen("c:\\users\\Gerald\\workspace_v5_3\\test data\\pzt_tline_current_model_sine_2.0M_sine.txt", "r");
fscanf(fid,"%f", current_source);
fclose(fid);
}
//===========================================================================
// End of SourceCode.
//===========================================================================