Git Product home page Git Product logo

elmot / h7-trace-probe Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 3.0 1.81 MB

**Obsolete** Example project for STM32H745 Nucleo-144 board. Supports two kernels, specially for CLion

Home Page: https://www.jetbrains.com/clion/

License: Creative Commons Zero v1.0 Universal

CMake 0.13% C 96.49% Assembly 0.93% C++ 2.45%
arm stm32 stm32h7 stm32h745 embedded clion clion-embedded cmake clion-cmake gcc-arm gcc-cross-compiler gcc gdb

h7-trace-probe's Introduction

CLion example project for STM32H745 MCU and NUCLEO-H745ZI-Q board

Example project for STM32H745 Nucleo-144 board. Supports two kernels, both compile and debug. This is temporary solution, until full support is implemented in CLion.

This example is specially made for multi-core MCUs, like some of STM32H7xx chips

Single-core STM32 MCUs are supported out-of-the-box

Tools required

Functionality

Two LEDs are blinking. One is controlled by CM4 kernel, another obe by CM7 kernel

Project structure

The project contains two separate sub-projects, and each one is a complete CLion+CMake project with some shared code at the top level. Obviously CM7 is for Cortex-M7 kernel, CM4 forCortex-M4

Each of the projects is open in it's own CLion instance, and then builds, flashes, and debugs independently.

Steps to make a similar project

  1. Install and configure all the required tools. See CLion Quick start guide
  2. Start STM32CubeMX and make a new project.
    • Note I. On the Project Manager tab, Toolchain/IDE field must be set to STM32CubeIDE
    • Note II. Do not use space, international, or special characters for project name or path
  3. Generate the project code. STM32CubeMX will create a project folder with two separate subprojects
  4. Open each of them in different CLion windows. Do not open the root project!
  5. Add CMakeLists.txt to each of the subprojects using a template
  6. Now check all the TODO comments in those CMakeLists.txt files and put actual values instead. TODO tool window is a great feature for that. It's recommended to set subproject name to a form of <project name>_<kernel name>
  7. Right-click CMakeLists.txtin the Project tool window and then click Load CMake Project
  8. Your CMake project will be parsed. If there are errors, correct them and select Tools -> CMake -> Reset Cache and Reload Prpject from the main menu. Repeat until everything is fixed and the CMakeLists is successfully parsed.
  9. Create Run Configurations for both projects
    1. Select create new Embedded GDB Server run configuration.
    2. Select Target. There shall be the only one.
    3. Select Executable. There shall be the only one.
    4. Set tcp::<port number> to 'target remote' args field. The port number may be virtually any in range 1024..65535 but it must nt clash with the conterpart project port number. Use the same number below
    5. Locate ST-LINK_gdbserver executable and select for as GDB server The executable resides in the in STM32CubeIDE installation folder, plugins/com.st.stm32cube.ide.mcu.externaltools.stlink-gdb-server.????/tools/bin/ subfolder. Actual name varies from version too version, and exact name can't be provided
    6. Locate STM32_Programmer_CLI executable similar way, but the folder expected to be plugins/com.st.stm32cube.ide.mcu.externaltools.cubeprogrammer.???/tools/bin/ then add path to the folder as a -cp key value to GDB Server args field
    7. Add -t -d -p <port number> -m <core num> keys to GDB Server args field.
      • The <core num> parameter is 0 for Cortex-M7 or 3 for Cortex-M4 kernels. Other MCU models may support other numbers.
      • Final arguments form is -cp <STM32_Programmer_CLI bin folder path> -t -d -p <port number> -m <core num>
  10. Try to build both projects. If something goes wrong, fix your CMakeLists.txt and sources.
  11. Click Debug in both projects. The firmware for both kernels should be flashed and started.
  12. Enjoy your newly-created project.

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.