cancel
Showing results for 
Search instead for 
Did you mean: 

Can a variable be modified by using it's name instead of it's address?

BPere.1
Associate

Hard coding address for variables could be problematic as the linker can move them during development. Is there a way to write a variable using its name instead of its address? The variables node has this information. How can I use the name in a templet to change the value of a variable?

3 REPLIES 3

Should be in object file as a symbol.​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
S.Ma
Principal

Mayve start from what do you want to achieve rather than one method which might not be the best solution. Magling through object, map or elf file seems weird.

Georgy Moshkin
Senior II

Yes, it is possible by using little helper function node. You can try my WriteByName v1.0 node (tested in STM32CubeMonitor 1.6.0).

https://youtu.be/B6R8yJ6DEQo

Download node source code (can be imported in cube monitor): nodes10.zip - nodes for STM32CubeMonitor 

How it works: on the first run all variable names are used to build global variables with JSON messages. Those JSON messages contain variable memory address and type. When buttont/text is entered, this JSON message "value" is modified and sent to "acq out" / "probe out".

 

Disappointed with crowdfunding projects? Make a lasting, meaningful impact as a Tech Sponsor instead: Visit TechSponsor.io to Start Your Journey!