Skip to main content
M326.1
Associate II
August 26, 2020
Question

STM32WB Debug OTA application

  • August 26, 2020
  • 15 replies
  • 8050 views

Hello,

I run STM32WB exemple : BLE_p2pServer_ota on STM32CubeIDE with the BLE_Ota exemple for bootloader. In this application we start from address 0x08007000

MEMORY

{

FLASH (rx)         : ORIGIN = 0x08007000, LENGTH = 484k

RAM1 (xrw)         : ORIGIN = 0x20000004, LENGTH = 191k

RAM_SHARED (xrw)      : ORIGIN = 0x20030000, LENGTH = 10K

}

How could i do in the STM32CUBEIDE debug configuration to run the debug on this application ?

Thanks.

15 replies

EJOHA
Associate
August 26, 2020

It should work to debug this in STM32CubeIDE directly. It should not be a problem that you have defined flash not to start from 0x8000000.

But to debug it we recommend to use the Debug version instead of Release version which normally does not contain all debug information or is built with optimization,

The problem you may experiance could be that vector base register needs to be setup to location where interrupt vectors are located.

You can try to debug both using ST-LINK GDB server and OpenOCD.

Do you experience problems with debugging?

M326.1
M326.1Author
Associate II
August 26, 2020

Thanks for your answer

I used two exemple of ST : BLE_p2pServer_ota and BLE_Ota (STM32Cube_FW_WB_V1.8.0) and i didn't modify anything.

I got this problem when i run the debug: "Break at address "0x8001042" with no debug information available, or outside of program code."

Could you please tell me how to setup the vector base in this exemple ?

Tesla DeLorean
Guru
August 26, 2020

If your application resides at 0x08007000 then whatever is at 0x08001042 is something else, that you're not debugging with source, like a boot loader

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
EJOHA
Associate
September 15, 2020

I do not know about the BLE_p2pServer_ota example. Normally if the program is located on non-default address and interrupts are used the application needs to setup the vector base register, This can be done for instance with

SCB->VTOR=my_VectorTable;

The STM32CubeIDE User manual also contains useful information. It is available here. See chapter 2.7.4

GBehe
Associate III
December 28, 2020

Hi EJOHA.

I have also faced the same issue with all my OTA projects. I also have done the required FLASH starting address for the BLE_ota example.

"But to debug it we recommend to use the Debug version instead of Release version " --> I could not get it. What is it about?

Thank you.

EJOHA
Associate
December 28, 2020

Hi GBehe,

Normally projects have two build configurations. One Release and one Debug, The Debug configuration is intended to use when debugging.

When opening project properties do you see both a Release and a Debug build configuration?

GBehe
Associate III
December 28, 2020

Hi EJOHA.

You mean, as in the screenshot right? I could not understand the release type build configuration. Do you mean the run/Start up configuration?

Thanks.

EJOHA
Associate
December 28, 2020

I was thinking of the project Properties Build settings. Debug configuration normally builds the project with Debug information.

EJOHA
Associate
December 28, 2020

0693W000006GzsPQAS.png

MRebo.2
Associate II
April 28, 2022

Hi EJOHA.

I can't debug the BLE_OTA project, I noticed that there is no build option for debug, how do I get the project to be built in the debug version?

0693W00000LzNcxQAF.png

GBehe
Associate III
December 28, 2020

Ohh. Thanks for showing it. I see both Release and a Debug build configuration as in screenshot.

What to do next?

Thanks.

EJOHA
Associate
December 28, 2020

OK! It seems fine and Debug configuration is the active one.

If it does not work to debug the application the reason could be that the application is located above 0x8000000 and it is intended to be started by a bootloader.

To see what happens when debugging if it does not break at main you can in the Debug Configuration open the Startup tab and deselect the "Resume" checkbox. This should make debugging start from the Reset_Handler in the startup file. Step through and see what happens.

I have not debugged the OTA projects and do not know the Bootloader. Maybe the Bootloader updates the vector base register when it is used. In that case you need to set vector base register instead in the application to make interrupt work correctly. I really hope there are some documentation/readme file together with the applications you are testing.

GBehe
Associate III
December 29, 2020

Yes. The application starts from 0x08007000. The OTA project loader code(BLE_Ota) resides from 0x8000000 to 0x08006000.

The code does breaks at main showing the error message as I have shared above saying :"breaks at address 0x08004454 with no information available, or outside the program code".

In the Debug Configuration --> Startup tab. I have deselected the "Resume" checkbox. But the same thing is happening.

"set vector base register instead in the application to make interrupt work correctly." --> Please tell me how to do it. I will try.

I have seen documentation/readme file with the applications I am using (STM32Cube_FW_WB_V1.8.0). But could not find anything related to this.

Thank you.