2023-08-20 02:04 PM - last edited on 2023-08-30 09:37 AM by Amel NASRI
Greetings to all, new to the STM32Cube environment hence the baby pic profile.
I created my project, a medium-complexity scale wherein 5 HX711s are feeding my STM32, and uploaded to my target, a Nucleo-L152RE.
Software compiles without error, for what that's worth. It loads, declares victory and terminates where it should just run indefinitely. To see what is happening I loaded CubeMonitor.
At first I got [not connected ! JTAG/SWD error (f5)] so I added this to my code:
#define DEBUGGER_ON 1 //REMOVE BEFORE FLIGHT
#define LOW_POWER_DISABLE 1 //REMOVE BEFORE FLIGHT
I had to run the script in debug mode for this to take affect and, interestingly, it did not terminate, nor did it run. It paused somewhere and gave me this error in the CubeMonitor
[not connected ! Device not opened (5)]
Probe_in and Probe_out are the same and defined like this:
I can hit the 'Blink the LED' and that works.
Back to the IDE, when I hit the debug button I get these results:
STMicroelectronics ST-LINK GDB server. Version 7.4.0
Copyright (c) 2023, STMicroelectronics. All rights reserved.
Starting server with the following options:
Persistent Mode : Disabled
Logging Level : 1
Listen Port Number : 61234
Status Refresh Delay : 15s
Verbose Mode : Disabled
SWD Debug : Enabled
InitWhile : Enabled
Waiting for debugger connection...
Debugger connected
Waiting for debugger connection...
Debugger connected
Waiting for debugger connection...
-------------------------------------------------------------------
STM32CubeProgrammer v2.14.0
-------------------------------------------------------------------
Log output file: C:\Users\xxxx\AppData\Local\Temp\STM32CubeProgrammer_a07164.log
ST-LINK SN : 066DFF383834434257153214
ST-LINK FW : V2J43M28
Board : NUCLEO-L152RE
Voltage : 3.26V
SWD freq : 4000 KHz
Connect mode: Under Reset
Reset mode : Hardware reset
Device ID : 0x437
Revision ID : Rev Z
Device name : STM32L15xxE/STM32L162xE
Flash size : 512 KBytes
Device type : MCU
Device CPU : Cortex-M3
BL Version : 0x40
Debug in Low Power mode enabled
Memory Programming ...
Opening and parsing file: ST-LINK_GDB_server_a07164.srec
File : ST-LINK_GDB_server_a07164.srec
Size : 162.37 KB
Address : 0x08000000
Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 649]
Download in Progress:
File download complete
Time elapsed during download operation: 00:00:07.771
Verifying ...
Download verified successfully
I note that the IDE brings up the main.c file with the HAL_init() highlighted.
I note that the SWD freq mentioned by my IDE does not match any of the options available in the Monitor. Is that my issue? If so, how do I change it?
{{Update: I set the SWD Freq to 950 kHz and the CubeMonitor Probe to 950kHz. Nothing changed. The device is still not registering as 'opened'}}
Any hints to get me moving would be greatly, greatly appreciated.
Solved! Go to Solution.
2023-08-21 10:03 AM
Resolved! I had a conflict on pins PA13 and PA14 which are used by SWD
2023-08-20 03:19 PM - edited 2023-08-20 10:04 PM
The method for changing the SWD Frequency is
In the CubeIDE on the action ribbon the Debug is a pull-down menu.
ST-LINK SN : 066Dblahblahblah
ST-LINK FW : V2J43M28
Board : NUCLEO-L152RE
Voltage : 3.27V
SWD freq : 950 KHz
In CubeMON
Now they match. Still no joy
2023-08-21 10:03 AM
Resolved! I had a conflict on pins PA13 and PA14 which are used by SWD