Other Parts Discussed in Thread: C2000WARE
Hello, i struggling with bad CLA computation on STANDALONE mode. Im using code from FLASH, everything working fine without STANDALONE, when i want test my release program with standalone booting my computation gone wrong. I've been looking for problems and so far I can see it at CLA. My MagBuf, IOBuffer2 differs when the program is turned on in FLASH on jtag, and is different on standalone.
How can this be caused? Twiddles (i have it in GSRAM) or bad memcpy ?
My linker: 3757.2837xD_FLASH_lnk_cpu1.rar
main.c (running with _STANDALONE, _FLASH predefined symbols)extern uint32_t Cla1ProgRunStart, Cla1ProgLoadStart, Cla1ProgLoadSize;
extern uint32_t Cla1ConstRunStart, Cla1ConstLoadStart, Cla1ConstLoadSize;
extern uint32_t CLA1fftTablesRunStart, CLA1fftTablesLoadStart, CLA1fftTablesLoadSize;
int main(void) {
InitSysCtrl();
GS_RAMaccessControl();
DINT;
IER = 0x0000;
IFR = 0x0000;
InitPieCtrl();
InitPieVectTable();
#ifdef _STANDALONE
#ifdef _FLASH
//
// Send boot command to allow the CPU2 application to begin execution
//
IPCBootCPU2(C1C2_BROM_BOOTMODE_BOOT_FROM_FLASH);
#else
//
// Send boot command to allow the CPU2 application to begin execution
//
IPCBootCPU2(C1C2_BROM_BOOTMODE_BOOT_FROM_RAM);
#endif
#endif
memcpy((uint32_t *)&Cla1ProgRunStart, (uint32_t *)&Cla1ProgLoadStart, (uint32_t)&Cla1ProgLoadSize );
memcpy((uint32_t *)&Cla1ConstRunStart, (uint32_t *)&Cla1ConstLoadStart, (uint32_t)&Cla1ConstLoadSize );
memcpy((uint32_t *)&CLA1fftTablesRunStart, (uint32_t *)&CLA1fftTablesLoadStart, (uint32_t)&CLA1fftTablesLoadSize);
init_ClaFFT();
init_Cla();
}
void init_ClaFFT(void)
{
//#define TWFACTORINTABLE
memset(&IOBuffer, 0, sizeof(IOBuffer));
memset(&IOBuffer2, 0, sizeof(IOBuffer2));
memset(&RFFTmagBuff, 0, sizeof(RFFTmagBuff));
//rfft.InBuf = &IOBuffer[0]; //Input buffer
//rfft.OutBuf = &IOBuffer2[0]; //Output buffer
//rfft.CosSinBuf = &RFFTF32Coef[0]; //Twiddle factor buffer
//rfft.MagBuf = &RFFTmagBuff[0]; //Magnitude buffer
RFFT_f32_setInputPtr(rfftHandleCla, IOBuffer);
RFFT_f32_setOutputPtr(rfftHandleCla, IOBuffer2);
RFFT_f32_setMagnitudePtr(rfftHandleCla, RFFTmagBuff);
RFFT_f32_setPhasePtr(rfftHandleCla, RFFTphaseBuff);
RFFT_f32_setStages(rfftHandleCla, FFT_STAGES);
RFFT_f32_setFFTSize(rfftHandleCla, FFT_SIZE);
#ifdef TWFACTORINTABLE
RFFT_f32_setTwiddlesPtr(rfftHandleCla, RFFT_f32_twiddleFactors); //pre twiddles v tabulke
#else
RFFT_f32_setTwiddlesPtr(rfftHandleCla, RFFTF32Coef);
RFFT_f32_sincostable(rfftHandleCla);
#endif
}
Thanks for help.
- Marek.