cancel
Showing results for 
Search instead for 
Did you mean: 

How to debug X-Cube-AWS in STM32CubeIDE

The objective of this article is to instruct a user to be able to debug aws_demos of X-Cube-AWS project in STM32CubeIDE. Debugging helps the user understand the program flow and figure out which line of code could be causing any sort of deviance from normalcy.  

1. Pre-requisites 

1471.jpg 

Micro USB Cable used to power and debug.  

1.1 Software Tools 

  • STM32CubeIDE 

  • Download the X-CUBE-AWS package. You may need to create an account on st.com for the same.  

2. Steps 

  1. Open STM32CubeIDE. Click on File->Open Projects from File System. Import the following projects into the workspace from the following paths: 

  • C:\STM32CubeExpansion_Cloud_AWS_V2.0.0\Projects\B-L4S5I-IOT01A\Applications\BootLoader_STSAFE\2_Images_SECoreBin\STM32CubeIDE\B-L4S5I-IOT01_2_Images_SECoreBin 

  • C:\STM32CubeExpansion_Cloud_AWS_V2.0.0\Projects\B-L4S5I-IOT01A\Applications\BootLoader_STSAFE\2_Images_SBSFU\STM32CubeIDE 

  • C:\STM32CubeExpansion_Cloud_AWS_V2.0.0\Projects\B-L4S5I-IOT01A\Applications\BootLoader_STSAFE\STSAFE_Provisioning 

  • C:\STM32CubeExpansion_Cloud_AWS_V2.0.0\Projects\B-L4S5I-IOT01A\Applications\Cloud\aws_demos\STM32CubeIDE 

  1. Click on Finish to import the STM32CubeIDE project as shown below:1472.png 

  1. This is what the projects imported into the workspace looks like: 

1473.png 

  1. Build B-L4S5I-IOT01_2_Images_SECoreBin, B-L4S5I-IOT01_2_Images_SBSFU, B-L4S5I-IOT01_STSAFE_Provisioning and B-L4S5I-IOT01_aws_demos projects  by clicking the following icon: 

1474.png 

Make sure that you build in the order that is mentioned otherwise build errors will be generated.  

  1. Go to the project explorer and drag and drop the binary to the board(eg: DIS_L4S5VI) from the following path (C:\STM32CubeExpansion_Cloud_AWS_V2.0.0\Projects\B-L4S5I-IOT01A\Applications\Cloud\aws_demos\STM32CubeIDE\Debug) as shown below: 

1475.png 1476.png  

  1. Go back to the IDE and click on the drop-down arrow next to the bug button and click on Debug configurations.  

1477.png 

7.The following debug window will open: 

1478.png 

Click on Startup. 

8.Double click on true under download 

1479.png 

 The following tab will pop up: 

1480.png 

9.Uncheck download as shown above and click OK. Under Name, give it a different name for example, B-L4S5I-IOT01_aws_demos Debugnodownload and Close.  

10.Place a breakpoint at a line of your choice in main() by double clicking on the line. I have placed the breakpoint here in line 213: 

 

11. In the dropdown next to the bug, click on B-L4S5I-IOT01_aws_demos Debugnodownload. Make sure that the board is connected to your laptop. 

 

12. Following prompt will appear. Click on Switch.  

 

 13. Once launched, the debugger will stop at the first line of main(). 

 

14. Click on resume. The debugger will stop at the breakpoint.  

 

15. You can Step over the function. Stepping over will go into the next line of execution of the code as shown below. 

 

You can also step into the function by clicking the following icon:  

 

It will take you into the function. Additionally, you can also press and hold control (CRTL on the keyboard) and click on the function to be taken into the function.  

If you wish to relaunch the debugger, click on Terminate and Relaunch as shown below: 

 

3. Additional Material  

Comments
Jenni
Associate II

The images aren't loading for some of this page.

Laurids_PETERSEN
Community manager
Community manager

Hi @Jenni, thanks for your feedback.

Unfortunately we are not able to recover these images, so we will provide fresh ones ASAP. 

Best regards, 
Laurids

Version history
Last update:
‎2021-11-16 01:48 AM