Skip to content

STM32Cube support #872

@2bndy5

Description

@2bndy5

Preliminary work to get this lib working in the IDE was done by @colombojrj in an unprompted PR #863

This thread is a continuation of the discussion started from that PR. Because that PR did not follow our utility/template driver files, The PR was closed and the work was cloned to a branch here upstream: stm32cube-support

Todo

  • document how to integrate the RF24 lib into the IDE
  • create a CI workflow to test build/compile a gettingStarted.cpp example RF24 app using the STM32 framework. This may be optional since each STM32Cube project is specific to a user-defined chip/board. It may be better to have an example repo since 1 simple STM32Cube project has so many files.
  • refactor initial work to be more readable using the utility/template paradigm (while also conforming to the .clang-format style guide).

Notes

This project is predominantly CMake driven now. Any Makefiles generated for this project are geared for the armhf compiler on Linux (RPi OS 32-bit). The STM32Cube IDE defaults to using Makefiles for the arm-none-eabi-gcc/++ compilers. The new CI may benefit from a CMake driven example, but it may not be necessary if it is a project that can be imported by the STM32Cube IDE. Using PlatformIO + STM32Cube framework may help in this regard as there should be minimal setup & configuration needed in this new CI workflow.

All use of printf() in RF24 is for debugging output only. Historically, the easiest approach to debugging programs in the Arduino IDE has been using the USB Serial monitor. However, the STM32Cube IDE largely relies on using an ST-Link debugging probe. Because an app developed in the STM32Cube IDE does not automatically include enumerating a USB CDC Serial device (which is board specific), the use of printf() is redundant and should only be used if USB CDC is setup for the STM32 project. Otherwise sprintfPrettyDetails() should be more flexible in that the buffer of debugging info can be directed to any bus (possibly even through the ST-Link). Another alternative is using the encodeRadioDetails() which dumps the radio's registers' values to a uint8_t array for external interpretation.

Lastly, all documentation provided by STM is scattered (based on components or chip family) or just non-existent. Our own document on getting RF24 started with STM32 devices may require linking to community answers for additional resources 😞.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions