Skip to content

TimoEngelmann/nucleo-h753zi-cpp-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

📟 STM32 NUCLEO-H753ZI C++ Demo

This repository contains a simple C++ demo with Application/application.cpp file. It is based on


📁 Folder & File Structure

nucleo-h753zi-threadx-demo/ ....... # Root folder of repository.
├─ STM32Project/ .................. # Root folder of STM32 firmware project.
│  ├─ .settings/
│  │  ├─ bundles.store.json ....... # Versions of st bundles, see System Bundle Manager in STM32CubeIDE for Visual Studio Code extension.
│  │  ├─ bundles-lock.store.json .. # Versions of st bundles, see System Bundle Manager in STM32CubeIDE for Visual Studio Code extension.
│  │  └─ ide.store.json ........... # Board information.
│  ├─ .vscode/
│  │  ├─ launch.json .............. # Debugger configuration.
│  │  └─ task.json ................ # Task to restart incl. build during debugging.
│  ├─ Application/
│  │  ├─ application.cpp .......... # Simple demo application.
│  │  └─ CMakeLists.txt ........... # Changed compiler settings, automatic include sources in 'Application' folder.
│  ├─ Core/
│  │  └─ Src/
│  │     └─ main.c ................ # Added the call of C++ functions Setup() and Loop().
│  ├─ .clangd ..................... # Clangd configuration
│  ├─ .clang-format ............... # Example of clang formatter configuration.
│  ├─ .gitignore .................. # Git ignore configuration.
│  ├─ CMakeLists.txt .............. # Link to 'Application' subdirectory added, this includes the CMakeLists.txt in Application folder.
│  ├─ README.doc .................. # GitHub readme file.
│  ├─ STM32Firmware.ioc ........... # STM32 configuration file for STM32CubeMX
│  └─ STM32Project_open_in_VSCode.code-workspace  # VSCode workspace to open the project via double click.

🛠️ Tools

Install and configure the tools:

STM32CubeMX

  1. Install STM32CubeMx 🔗STM32CubeMX

  2. Install the 🔗STM32CubeH7 MCU Package in SMT32CubeMX

STLink Upgrade Tool

  1. Install the 🔗STLink Upgrade Tool.

  2. Connect the CN1 Micro-USB of your NUCLEO-H753ZI board to your PC.

  3. Start the tool by double-clicking the STLinkUpgrade.jar file.

  4. Set MCO Output to HSE/5 (5MHz)
    This is the clock that is provided to the STM32 as the HSE clock.

    🔍 Background:
    The 5 MHz value has been selected to make it easier to reach the STM32H753ZI's maximum CPU clock of 480 MHz. For other controllers, different values may be required. Please refer to the relevant STM32 configuration page or use the STM32CubeMx tool to find the correct value.

VSCode

  1. Install 🔗Visual Studio Code

  2. Create a STM32 Dev VSCode profile for STM32 development (see: https://code.visualstudio.com/docs/configure/profiles).

  3. In this STM32 Dev profile install the extension pack 🔗 STM32CubeIDE for Visual Studio Code


💾 Open Project first Time

First Time

  1. Clone this repo.

  2. Open STM32Firmware.ioc in STM32CubeMX and generate the sources.

  3. Open VSCode and switch to the STM32 Dev profile.

  4. Select 'File' / 'Open Workspace from File...' and search the file STM32Project_open_in_VSCode.code-workspace

  5. Click yes if the message box Would you like to configure discovered CMake project(s) as STM32Cube project(s)? appears in the lower right corner.

    💡 Hint:
    If this dialog box does not appear, or if it disappears after a few seconds, try closing the project folder via 'File' / 'Close workspace' and > opening it again in VSCode. Please be patient, it may take more than 30 seconds for the dialog box to appear.

  6. Click Debug if Select a configure preset for STM32Project appears in top command bar.

    💡 Hint:
    If you miss this selection, enter the command >CMake: Select Configure Preset to show it again.

Daily usage

  1. Open the project by double clicking the STM32Project_open_in_VSCode.code-workspace file.

🚀 Build the Project in VSCode

  1. Perform the command >CMake: Delete Cache and Reconfigure.

    💡 Hint:
    This will rebuild the CMake structure. This is only needed if you change something on CMakeLists.txt or you add, rename or delete a source file.
    If you have some changes on clangd or other issues delete the complete build folder and try again.

  2. Perform a complete clean rebuild with the command >CMake: Clean Rebuild.

  3. Or build only the changes with the command >CMake: Build


🔍 Debugging

  1. Connect the CN1 Micro-USB of your NUCLEO-H753ZI board to your PC.

  2. Switch to the 'Run and Debug' view in the right sidebar.

  3. Click on the green play button.

About

This repository contains a simple C++ demo with Application/application.cpp file based on STM32CubeMX and Visual Studio Code with 'STM32CubeIDE for Visual Studio Code' Extension

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors