cancel
Showing results for 
Search instead for 
Did you mean: 

STM32G0 bought with level 2 protection

FranzCreva
Senior

Hi all, I'm new to this STM32 community.

I have a small problem: I bought some STM32G0P0.. for my project, also making the PCB and the rest. But after soldering the various components, I try to program one and see that the level 2 protection is active, I try to program another and there is the same thing.

What I see from the STM32 St-LINK program is that only some memory pages have protection, while others don't, but then going to view the memory areas I see that they have all been set to FFFFFFFF.

Below I can see that the memory on the address 0x08001400 is free, but..

0693W00000WIxGqQAL.png 

..here I see that is protected! How can I program it?

0693W00000WIxHFQA1.png 

My question now is: what the hell do I do? Do I ask for a return? Is this a normal thing of STM32G0...? Trying to write a bootloader that makes me jump from one address to another when the memory to read is full?

Thank you for your availability and attention

63 REPLIES 63
AScha.3
Chief II

i am not shure...but try:

set nboot0 , checked.

and then... ?

If you feel a post has answered your question, please click "Accept as Solution".

I tried but nothing to do

FranzCreva
Senior

Hi @Community member​  and @AScha.3​.

Now I was trying to debug with another board I have, still with the same MCU, and something went on and I don't know what.

Debugging has started, but always hangs at this point:

0693W00000WJgNSQA1.png 

The messages I see in the console are these:

Open On-Chip Debugger 0.11.0+dev-00449-g53fa0f7 (2022-06-09-09:42) [https://github.com/STMicroelectronics/OpenOCD]
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : STLINK V2J40S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.255118
Info : clock speed 950 kHz
Info : stlink_dap_op_connect(connect)
Info : SWD DPIDR 0x0bc11477
Info : STM32G050F6Px.cpu: Cortex-M0+ r0p1 processor detected
Info : STM32G050F6Px.cpu: target has 4 breakpoints, 2 watchpoints
Info : starting gdb server for STM32G050F6Px.cpu on 3333
Info : Listening on port 3333 for gdb connections
Info : accepting 'gdb' connection on tcp/3333
Info : device idcode = 0x10006456 (STM32G05/G06xx - Rev A : 0x1000)
Info : RDP level 0 (0xAA)
Info : flash size = 32kbytes
Info : flash mode : single-bank
Warn : GDB connection 1 on target STM32G050F6Px.cpu not halted
undefined debug reason 8 - target needs reset
Info : accepting 'gdb' connection on tcp/3333
Warn : GDB connection 2 on target STM32G050F6Px.cpu not halted
undefined debug reason 8 - target needs reset
target halted due to debug-request, current mode: Thread 
xPSR: 0xf1000000 pc: 0x1fff1654 msp: 0x20000e48
Info : Padding image section 0 at 0x0800184c with 4 bytes (bank write end alignment)
target halted due to debug-request, current mode: Thread 
xPSR: 0xf1000000 pc: 0x1fff1654 msp: 0x20000e48
Info : STM32G050F6Px.cpu: external reset detected

What can I do?

Connects at a lower speed (watch CM0+ devices)

Subsequently starts listening on port 3333 that the other component want to connect with.

Set connection speed LOWER, not 4 MHz or 8 MHz

Is NRST connected between TARGET and ST-LINK ??

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

Be conscious when you tightly crop everything that ancillary data is lost.

I can't confirm the mode and speed of connectivity the GUI STM32 Cube Programmer used when it connected successfully.

Or if they were talking to the same Serial Number ST-LINK

I don't know how any of this is wired up.

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

The erased value of FLASH memory is 0xFFFFFFFF. If your processor was locked, RDP would have a value of 0xCC, in that case you've got a bunch of useless chips.

From what we're all seeing, you've got a bunch of chips that haven't been used yet.

Load some code into them and report back.

The NRST is connected between my MCU and the ST-LINK.

I'm using 950khz as connection speed, because I can connect to my device with that speed on STM32Programmer.

I'll try to set the port 3333

I can program it only via STM32Programmer, with STM32CubeIDE I can't

AScha.3
Chief II

good ! so (on this board) all ok, cpu working and connection ok. -> can work with ST...programmer.

+

Ide: something you still wrong/bad adjusted.

try: in debug settings: SWD , 4MHz (or lower) ; resetmode: software system reset , + enablew low power ,+ stop watchdog.

If you feel a post has answered your question, please click "Accept as Solution".

@AScha.3​  and @Community member​ nothing changes!! I've been here for now 2-3 weeks and nothing is working.

The scheduling and degubbing configurations are:

Run configuration

0693W00000WKNyRQAX.png 

Debug configuration:

0693W00000WKNz0QAH.png0693W00000WKNzAQAX.png 

If someone could figure out what's wrong with the messages I get on the console it would be a huge favor:

Run messages console

Open On-Chip Debugger 0.11.0+dev-00449-g53fa0f7 (2022-06-09-09:42) [https://github.com/STMicroelectronics/OpenOCD]
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : STLINK V2J40S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.244561
Info : clock speed 950 kHz
Info : stlink_dap_op_connect(connect)
Info : SWD DPIDR 0x0bc11477
Info : STM32G050F6Px.cpu: Cortex-M0+ r0p1 processor detected
Info : STM32G050F6Px.cpu: target has 4 breakpoints, 2 watchpoints
Info : starting gdb server for STM32G050F6Px.cpu on 3333
Info : Listening on port 3333 for gdb connections
Info : accepting 'gdb' connection on tcp/3333
Info : device idcode = 0x10006456 (STM32G05/G06xx - Rev A : 0x1000)
Info : RDP level 0 (0xAA)
Info : flash size = 32kbytes
Info : flash mode : single-bank
undefined debug reason 8 - target needs reset
Info : accepting 'gdb' connection on tcp/3333
undefined debug reason 8 - target needs reset
target halted due to debug-request, current mode: Thread 
xPSR: 0xf1000000 pc: 0x1fff1654 msp: 0x20000e48
target halted due to debug-request, current mode: Thread 
xPSR: 0xf1000000 pc: 0x1fff1654 msp: 0x20000e48
Info : STM32G050F6Px.cpu: external reset detected
Info : dropped 'gdb' connection
target halted due to debug-request, current mode: Thread 
xPSR: 0x41000000 pc: 0x1fff1274 msp: 0x20000e28
shutdown command invoked
Info : dropped 'gdb' connection

and this message

0693W00000WKNzPQAX.png 

The DEBUG console

Open On-Chip Debugger 0.11.0+dev-00449-g53fa0f7 (2022-06-09-09:42) [https://github.com/STMicroelectronics/OpenOCD]
Licensed under GNU GPL v2
For bug reports, read
	http://openocd.org/doc/doxygen/bugs.html
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : STLINK V2J40S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.242988
Info : clock speed 950 kHz
Info : stlink_dap_op_connect(connect)
Info : SWD DPIDR 0x0bc11477
Info : STM32G050F6Px.cpu: Cortex-M0+ r0p1 processor detected
Info : STM32G050F6Px.cpu: target has 4 breakpoints, 2 watchpoints
Info : starting gdb server for STM32G050F6Px.cpu on 3333
Info : Listening on port 3333 for gdb connections
Info : accepting 'gdb' connection on tcp/3333
Info : device idcode = 0x10006456 (STM32G05/G06xx - Rev A : 0x1000)
Info : RDP level 0 (0xAA)
Info : flash size = 32kbytes
Info : flash mode : single-bank
undefined debug reason 8 - target needs reset
Info : accepting 'gdb' connection on tcp/3333
undefined debug reason 8 - target needs reset
target halted due to debug-request, current mode: Thread 
xPSR: 0xf1000000 pc: 0x1fff1654 msp: 0x20000e48
target halted due to debug-request, current mode: Thread 
xPSR: 0xf1000000 pc: 0x1fff1654 msp: 0x20000e48

and this message:

0693W00000WKO03QAH.png 

Thanks for your availability.