I'm using Arduino IDE on linux with STM32G030 programmed via ST-LINK v2, here is working blinking example (everything works fine, the led is blinking):
void setup() {
pinMode(PB11, OUTPUT);
}
int n = 0;
void loop() {
n++;
digitalWrite(PB11, n % 3 == 0 ? HIGH : LOW);
delay(100);
}
I would like the read the value of "n". I don't want to use UART as I'm trying to find out if I can ommit UART and use just ST-LINK for debugging. How to do it using ST-LINK v2? How to read variable value?
I'm not sure if it helps but here is what arduino prints during compilation:
Sketch uses 13688 bytes (20%) of program storage space. Maximum is 65536 bytes.
Global variables use 900 bytes (10%) of dynamic memory, leaving 7292 bytes for local variables. Maximum is 8192 bytes.
-------------------------------------------------------------------
STM32CubeProgrammer v2.11.0
-------------------------------------------------------------------
ST-LINK SN : 39002100050000343251524E
ST-LINK FW : V2J29S7
Board : --
Voltage : 3.23V
SWD freq : 4000 KHz
Connect mode: Under Reset
Reset mode : Hardware reset
Device ID : 0x466
Revision ID : Rev 1.1
Device name : STM32G03x/STM32G04x
Flash size : 64 KBytes
Device type : MCU
Device CPU : Cortex-M0+
BL Version : --
Memory Programming ...
Opening and parsing file: example1.ino.bin
File : example1.ino.bin
Size : 13.57 KB
Address : 0x08000000
Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 6]
Download in Progress:
File download complete
Time elapsed during download operation: 00:00:00.464
RUNNING Program ...
Address: : 0x8000000
Application is running, Please Hold on...
Start operation achieved successfully