Hello,
I am currently facing a problem on the DSP F28335.
When my application is running in RAM, it runs correctly.
When my application is running in FLASH, the problem is as follows : the CAN communication, that is normally driven by a 10ms task, is disrupted and for example the CAN frames are sampled at 20ms (not stable, between 9ms and 20ms) instead of 10ms. In my application I have another task at 100µs.
We supposed this is a problem of CPU load, and I did the following :
- measure of CPU load with a Simulink tool that allows that when running in RAM : I got about 70µs calculation time for the 100µs task, and 105µs for the 10ms task; this is quite high but OK for a RAM execution
- in Simulink, all the tasks (100µs and 10ms) are defined to be loaded in ramfunc (stored in Flash, then copied from Flash to RAM at DSP start) --> that should decreased the CPU load, but it is not enough and I still have CPU load problem
- we saw that maths functions are not located in ramfunc, so we add the following in the .cmd file to locate these functions (sinus, cosinus, ...) in ramfunc :
ramfuncs: LOAD = FLASH,
RUN = RAML4L7,
LOAD_START(_RamfuncsLoadStart),
LOAD_END(_RamfuncsLoadEnd),
RUN_START(_RamfuncsRunStart),
PAGE = 0
{
-l rts2800_fpu32.lib <sin.obj> (.text)
-l rts2800_fpu32.lib <cos.obj> (.text)
-l rts2800_fpu32.lib <sqrt.obj> (.text)
-l rts2800_fpu32.lib <modf.obj> (.text)
-l rts2800_fpu32.lib <fmod.obj> (.text)
-l rts2800_fpu32.lib <memcpy_ff.obj> (.text)
-l rts2800_fpu32.lib <fs_div.obj> (.text)
-l rts2800_fpu32.lib <memset.obj> (.text)
}
...but we still have the problem.
Is it correct to locate all the maths functions like we did ?
What else can we do to locate the maximum of code in ramfunc to optimize the CPU load?
Thank you,
Best regards,
Julien