Page 1 of 1

Dump variables to PC

Posted: Tue Oct 23, 2018 11:02 am
by steve64
I'm trying to fill an Oberon-07 array variable inside a program and, after program termination,
dumping back the array from the PC.

The array is defined as:

VAR
shared: ARRAY 32 OF BYTE;

and filled in the init body as:

FOR i := 0 TO 15 DO
shared := i
END;

where I also print the physical addresses as follows;

Out.Hex(SYSTEM.ADR(shared[0]),0); Out.Ln;
Out.Hex(SYSTEM.ADR(shared[1]),0); Out.Ln;
Out.Hex(SYSTEM.ADR(shared[2]),0); Out.Ln;

getting the following addresses:

2007F5C8H
2007F5C9H
2007F5CAH

Then on PC side I dump that memory area with ST-Link CLI tool:

st-link_cli -r8 2007F5C8 16
...
0x2007F5C8 : 63 69 81 26 6C 81 07 DE 54 EF 0A 9B DC F5 07 20
0x2007F5D8 : 3D 25 00 08 00 00

where dumped values are completely different. Am I missing something?

Re: Dump variables to PC

Posted: Tue Oct 23, 2018 12:06 pm
by cfbsoftware
I ran a similar test using the View > Device memory feature of the GUI STM32 ST-LINK Utility and it worked fine.

Make sure that the array shared is a global array and not local to a procedure. If it is local then the variables are stored on the stack and the storage space could subsequently be reused after the procedure terminates.

Re: Dump variables to PC

Posted: Tue Oct 23, 2018 3:48 pm
by steve64
The array is defined at module-level. Tomorrow I will check with the GUI utility instead of the CLI.

Re: Dump variables to PC

Posted: Wed Oct 24, 2018 12:24 pm
by steve64
I have now found the solution. The CLI command must connect in "hotplug" mode:

st-link_cli -c HOTPLUG -r8 2007F5C8 12

Thanks for previous feedback.