cancel
Showing results for 
Search instead for 
Did you mean: 

Trying to flash code to debug a STM32L562 discovery board, erases part of the flash then stops, any suggestions?

peterwadsworth9
Associate

Using a RTC example from the IDE, the STM32L562 discovery board gets to partly erasing the flash, before it stops

STMicroelectronics ST-LINK GDB server. Version 6.0.0

Copyright (c) 2021, 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.9.0-RC01          

   -------------------------------------------------------------------

ST-LINK SN : 0030003C3137511733333639

ST-LINK FW : V3J9M3

Board    : STM32L562E-DK

Voltage   : 3.27V

SWD freq  : 24000 KHz

Connect mode: Under Reset

Reset mode : Hardware reset

Device ID  : 0x472

Revision ID : Rev Z

Device name : STM32L5xx

Flash size : 512 KBytes

Device type : MCU

Device CPU : Cortex-M33

BL Version : --

Memory Programming ...

Opening and parsing file: ST-LINK_GDB_server_a13612.srec

 File     : ST-LINK_GDB_server_a13612.srec

 Size     : 16712 Bytes

 Address    : 0x08000000 

Erasing memory corresponding to segment 0:

Erasing internal memory sectors [0 8]

Download in Progress:

Error: Fail to write buffer in flash

Error: failed to erase memory

Error: failed to download Segment[0]

Error: failed to download the File

Shutting down...

Exit.

BUT, if i take the example code .hex for the discovery board and use the STCube Programmer, I can get the board back to life as the previous operation had erase some flash.

So the Programmer is able to read/write code to the discovery board, but the IDE can't get debug code to run.

Any thoughts?

1 ACCEPTED SOLUTION

Accepted Solutions
peterwadsworth9
Associate

Debug SW speed was set to auto from the start, so started off at the minimum speed of 140kHz and it now works fine, code loads, and can now run and single step the code

Thanks

View solution in original post

2 REPLIES 2
MM..1
Chief II

SWD freq  : 24000 KHz

peterwadsworth9
Associate

Debug SW speed was set to auto from the start, so started off at the minimum speed of 140kHz and it now works fine, code loads, and can now run and single step the code

Thanks