Other Parts Discussed in Thread: MOTORWARE
Hello,
I'm trying to add DLOG module into an instaSPIN project but it seems that there is an overlap on the memory.
e.g. : the gMotorVars stucture is filled in with strange values. After that, I restarted the MCU, I tried again and I received the message :
C28xx: Trouble Reading PC Register: (Error -1142 @ 0x0) Device blocked debug access because it is currently executing non-debuggable code. Choose 'Rude Retry' to disable polite mode and force the operation. (Emulation package 5.1.73.0)
Here is what I made:
1) I added in my project dlog4ch.c from MotorWare_1_01_00_09
2) I added in my project dlog4ch.asm from MotorWare_1_01_00_09
3) I added in the global vars DLOG_4CH dlog1;
4) I initialized it DLOG_4CH dlog1 = DLOG_4CH_DEFAULTS;
5) In the main for loop, I filled in the dlog structure like this
dlog1.iptr1 = &DlogCh1;
dlog1.iptr2 = &DlogCh2;
dlog1.iptr3 = &DlogCh3;
dlog1.iptr4 = &DlogCh4;
dlog1.trig_value = 0x0;
dlog1.size = 0x400;
dlog1.prescalar = 1;
dlog1.init(dlog1);
6) In the main ISR, I updated DLOG with the variables I wanted to log
DlogCh1 = _IQtoQ15(gMotorVars.SpeedRef_krpm);
DlogCh2 = _IQtoQ15(gMotorVars.Is_A);
DlogCh3 = _IQtoQ15(gMotorVars.Torque_Nm);
DlogCh4 = HallPosition;
dlog1.update(&dlog1);
7) I modified my RAM linker command file like this :
MEMORY
{
PAGE 0 :
RAML0_L3 : origin = 0x008000, length = 0x001800 /* length 0x001800 instead of 0x002000 */
PAGE 1 :
dataRAM : origin = 0x009800, length = 0x000800 /* dataRAM is in RAML3 for DLOG */
SECTIONS
{
.ebss : > dataRAM, PAGE = 1
.econst : > dataRAM, PAGE = 1
SECTIONS
{
DLOG: > dataRAM,PAGE=1
}
8) When I built the project, 0 error and 0 warning
9) I entered in debug mode and clicked on the Resume icon to start the debug.
What did I make wrong?