Giter Site home page Giter Site logo

mohalsa / stm32_bluepill_semihosting Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 1.0 26 KB

Enabling Semihosting for STM32 Bluepill in PlatformIO + Vscode

Home Page: https://github.com/mohalsa/0-SemiHosting_Configurations

Python 5.37% C 94.63%
semihosting platformio stm32f103 stm32 bluepill bluepill-board stm32f103c8t6 openocd printf visual-studio-code platformio-ide

stm32_bluepill_semihosting's Introduction

Enabling Semihosting Printf() debugging in Vscode + PlatformIO for ARM CORTEX STM32 BLUEPILL board

ARM Cortex M3 STM32 Bluepill Semihosting-Enabled PlatformIO Project by Mohammed Alsada Please first read all instructions, then follow them carefully!

Connection:

bluepill_connections_stlink credits:https://www.onetransistor.eu/2020/01/stm32-bluepill-arduino-support.html

Ignore the optional "Enable Hardware rest mode" Line and don't connect it, and connect the rest of the wires as shown in the image.

0- Connect Your STlink debugger to USB and to the bluepill board (Drivers must be installed before, if needed.).

1- Open Command Palette by holding "CMD + SHIFT + P" in Mac OS machines and "CTRL + SHIFT + P" or just click on "View" then "Command Palette...".

2- Type "Tasks: Run Task" without the double qoutation marks and select it by pressing Enter.

3- Select "OpenOCD (Allow semihosting output)".

4- This Task Should run once when loading the project. If you try to run it again you'll get "The task 'OpenOCD (Allow semihosting output) (0-SemiHosting_Configurations)' is already active." message

5- A terminal view will indicate a successfull connection with a final message of "Info : Listening on port 3333 for gdb connections".

6- Put a breakpoint on "int main(void" in the "main.c" file.

7- Click on the "Run and Debug" Icon (Left Side) or SHIFT+CMD+D (Mac OS) or SHIFT+CTRL+D (Windows OS)

8- Click "Start Debugging" the green arrow (Top left), next to PIO Debug.

9- Debugging session will start and will halt on the reset handler file, click on "continue" or press "F5" to move to the breakpoint in the main.c file

10- Failing to placing a breakpoint in the main.c file will lead the debugging session to hang!

11- In Terminal window, press any key to show the debugging info + the printf messages.

Enjoy a Painless debugging session ;)

Please let me know if there are any issues. Thank you!

stm32_bluepill_semihosting's People

Contributors

mohalsa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

dzid26

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.