Skip to content

STM32 support #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 30, 2024
Merged

STM32 support #6

merged 3 commits into from
Jun 30, 2024

Conversation

thijses
Copy link
Contributor

@thijses thijses commented May 30, 2024

the STM32duinoBLE library provides an ArduinoBLE compatibility layer for several STM32 microcontrollers (including the STM32WB55 that i'm using). Using this library, i've added STM32 support to phyphox BLE. (i did almost nothing, as the STM32duinoBLE library is quite good, and includes all the difficult code, i basically just copy-pasted some example code).
I tested it briefly (using only the STM32WB55 nucleo dev kit that i have on hand), so there is significant room for error, BUT assuming that the STM32duinoBLE library is relatively on-par/up-to-date with the ArduinoBLE library, all the Nano 33 BLE (or Nano IOT?) code should work.

I copied the contents of the _NanoIOT header and .cpp, only adding some minor prefixes. I would like to see this reformatted as: one general header + cpp for 'default' ArduinoBLE implementations, and an STM32 and NanoIOT header that both point to this general header. Is that something the maintainers of this repo would prefer to handle? (to make sure the code stays legible), or should i take a swing at it?

thijses added 3 commits May 30, 2024 14:41
someone else has already gone through the trouble of porting the ArduinoBLE library to STM32,
all i did was copy the NanoIOT headers and added some minor preamble.
Also, i chose to 'fix'(?) a compiler warning regarding a zero-sized char array for setting MTU size in (presumably JSON code of) experiment.cpp

NOTE: personally, i would rename the NanoIOT.h header and cpp, be the 'general/basic' ArduinoBLE implementation,
    then one could delete the copied code from the new STM32 header & cpp, and just refer to the (former) NanoIOT header.
an int64_t was initialized to NULL instead of 0, the compiler threw a warning
@Staacks
Copy link
Member

Staacks commented Jun 20, 2024

First of all sorry, for some reasons neither Dominik nor I had notifications enabled for this repo (changed that now) and I only noticed it just now when Dominik stumbled upon it.

It looks good to me and I am very happy to see STM32 support as this is certainly another rather relevant microcontroller. (And including a little fix on the side that looks a lot like we were writing to unallocated memory.)

I will merge it and make a release soon.

@thijses
Copy link
Contributor Author

thijses commented Jun 20, 2024

nice! thank you for taking it off my hands ;). Let me know if there's anything you'd like me to do

@Staacks Staacks merged commit d377ad7 into phyphox:master Jun 30, 2024
Staacks added a commit that referenced this pull request Jun 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants