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?
Dump variables to PC
Dump variables to PC
Last edited by steve64 on Tue Oct 23, 2018 3:50 pm, edited 1 time in total.
-
- Site Admin
- Posts: 525
- Joined: Fri Dec 31, 2010 12:30 pm
- Contact:
Re: Dump variables to PC
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.
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
The array is defined at module-level. Tomorrow I will check with the GUI utility instead of the CLI.
Re: Dump variables to PC
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.
st-link_cli -c HOTPLUG -r8 2007F5C8 12
Thanks for previous feedback.