STMicroelectronics / STM32CubeH7

STM32Cube MCU Full Package for the STM32H7 series - (HAL + LL Drivers, CMSIS Core, CMSIS Device, MW libraries plus a set of Projects running on all boards provided by ST (Nucleo, Evaluation and Discovery Kits))
https://www.st.com/en/embedded-software/stm32cubeh7.html
Other
498 stars 305 forks source link

STM32H735G-DK: Device in lock up state, possibly "read and debug" protected. Use monitor commands to remove the protection // Failed to execute MI command: load #245

Closed code-by closed 1 year ago

code-by commented 1 year ago

Hello

I have:

  1. STM32CubeIDE (Version: 1.10.1, Build: 12716_20220707_0928)
  2. STM32H735G-DK board

I have tried running a demo from TouchGFX app (4.20) and it flashes and run well, but I have a problem with running 'FreeRTOS' example created in 'Example Selector' in STM32CubeIDE. When I click Run button, I got the following error in the console:

STMicroelectronics ST-LINK GDB server. Version 7.0.0
Copyright (c) 2022, STMicroelectronics. All rights reserved.

Starting server with the following options:
        Persistent Mode            : Disabled
        LogFile Name               : C:\Users\user\STM32CubeIDE\workspace_1.10.0\FreeRTOS\STM32CubeIDE\BootROM_ExternalRAM_InternalSRAM_Debug\st-link_gdbserver_log.txt
        Logging Level              : 31
        Listen Port Number         : 61234
        Status Refresh Delay       : 15s
        Verbose Mode               : Enabled
        SWD Debug                  : Enabled

COM frequency = 24000 kHz
Target connection mode: Attach
Reading ROM table for AP 0 @0xe00fefd0
Hardware watchpoint supported by the target 
ST-LINK Firmware version : V3J10M3
Device ID: 0x483
PC: 0x79fb0c
ST-LINK device status: LOCKUP
Enter STM32_SystemReset() function 
ST-LINK detects target voltage = 3.29 V
Device in lock up state, possibly "read and debug" protected. Use monitor commands to remove the protection
ST-LINK device initialization OK
Stm32Device, pollAndNotify running...
ST-LINK device status: HALT_MODE
SwvSrv state change: 0 -> 1
Waiting for debugger connection...
Waiting for connection on port 61234...
Waiting for connection on port 61235...
Accepted connection on port 61234...
Debugger connected
Waiting for debugger connection...
Waiting for connection on port 61234...
GDB session thread running
GdbSessionManager, session started: 1
Enter STM32_SystemReset() function 
Enter STM32_InitAfterReset() function 
NVIC_DFSR_REG = 0x00000008
NVIC_CFGFSR_REG = 0x00000000
GDB session terminated: Client connection lost
GdbSessionManager, session terminated: 1
GdbSrv, last session terminated, signal dispose
Stopping port 61234
Received stop for port 61234, not accepting new connections.
GdbSrv, deInit entry.
Shutting down...
Cleanup session: 1
GdbSessionManager, deInit entry.
GDB session disposed: 1
Stopping port 61234
GdbSessionManager, deInit exit
SwvSrv deInit entry
Stopping port 61235
Received stop for port 61235, not accepting new connections.
SwvSrv deInit exit
Stm32Device, closeDevice() entry
Stm32Device, pollAndNotify stopped
Stm32Device, closeDevice() exit
Stm32Device, deInit success
GdbSrv, deInit exit.
Exit.

An error popup appeared with the following content:

Error in final launch sequence:

Failed to execute MI command:
load C:\\Users\\user\\STM32CubeIDE\\workspace_1.10.0\\FreeRTOS\\STM32CubeIDE\\BootROM_ExternalRAM_InternalSRAM_Debug\\Project.elf 

Error message from debugger back end:
Load failed
Failed to execute MI command:
load C:\\Users\\user\\STM32CubeIDE\\workspace_1.10.0\\FreeRTOS\\STM32CubeIDE\\BootROM_ExternalRAM_InternalSRAM_Debug\\Project.elf 

Error message from debugger back end:
Load failed
Failed to execute MI command:
load C:\\Users\\user\\STM32CubeIDE\\workspace_1.10.0\\FreeRTOS\\STM32CubeIDE\\BootROM_ExternalRAM_InternalSRAM_Debug\\Project.elf 

Error message from debugger back end:
Load failed
Load failed

In the readme.txt of example I'm found the following:

In order to make the program work, you must do the following:

  1. Select required configuration in memory.h in ExtMem_CodeExecution\ExtMem_Boot\Inc. The default configuration is:
    • DATA_AREA set to USE_INTERNAL_SRAM
    • CODE_AREA set to USE_OSPI
  2. Program the internal Flash with the ExtMem_Boot (see below).
  3. Program the external memory with this application (see below).
  4. Start debugging this application or reset for free running.

But I'm unable to find any memory.h in the project and can't understand if anything I need to attach to my project to find this memory.h, edit it, and successfully run the example.

Will appreciate your help

Thank you

HBOSTM commented 1 year ago

Hello @code-by

To load the ExtMem_Boot to internal Flash Could you please erase the full chip using STM32CubeProgrammer and select required configuration in memory.h before loading the project image.

With external memory please use the STM32CubeProgrammer as shown in the readme.txt file. And load the binary application file into the external OSPI flash at the address 0x90000000.

With Regards