From c652bd5e067a966ba26702fdb1bc7cefb6ffd07a Mon Sep 17 00:00:00 2001 From: maxgerhardt Date: Tue, 27 Dec 2022 16:01:58 +0100 Subject: [PATCH 01/16] Add PlatformIO builder --- package.json | 16 ++++ tools/platformio-build.py | 161 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 177 insertions(+) create mode 100644 package.json create mode 100644 tools/platformio-build.py diff --git a/package.json b/package.json new file mode 100644 index 0000000..356cc1a --- /dev/null +++ b/package.json @@ -0,0 +1,16 @@ +{ + "name": "framework-arduinoststm32wb", + "version": "5.000104.221227", + "description": "Arduino Core for STM32WB", + "keywords": [ + "framework", + "arduino", + "stmicroelectronics", + "stm32", + "stm32wb" + ], + "repository": { + "type": "git", + "url": "https://github.com/GrumpyOldPizza/ArduinoCore-stm32wb" + } +} \ No newline at end of file diff --git a/tools/platformio-build.py b/tools/platformio-build.py new file mode 100644 index 0000000..a42ba23 --- /dev/null +++ b/tools/platformio-build.py @@ -0,0 +1,161 @@ +# Copyright 2022-present Maximilian Gerhardt +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import os +from SCons.Script import DefaultEnvironment + +env = DefaultEnvironment() +platform = env.PioPlatform() +board = env.BoardConfig() + +framework_package = "framework-arduinoststm32wb" +FRAMEWORK_DIR = platform.get_package_dir(framework_package) +BUILD_CORE = "arduino" + +assert os.path.isdir(FRAMEWORK_DIR) + +variants_dir = os.path.join( + "$PROJECT_DIR", board.get("build.variants_dir")) if board.get( + "build.variants_dir", "") else os.path.join(FRAMEWORK_DIR, "variants") + +machine_flags = [ + "-mcpu=%s" % board.get("build.cpu"), + "-march=armv7e-m", + "-mthumb", + "-mabi=aapcs", +] + +env.Append( + ASFLAGS=machine_flags, + ASPPFLAGS=[ + "-x", "assembler-with-cpp", + ], + + CFLAGS=[ + "-std=gnu11" + ], + + CCFLAGS=machine_flags + [ + "-Os", # optimize for size + "-ffunction-sections", # place each function in its own section + "-fdata-sections", + "-Wall", + "-nostdlib", + "--param", "max-inline-insns-single=500" + ], + + CXXFLAGS=[ + "-fno-threadsafe-statics", + "-fno-rtti", + "-fno-exceptions", + "-std=gnu++11", + "-fno-threadsafe-statics", + "-fsingle-precision-constant" + ], + + CPPDEFINES=[ + ("ARDUINO", 10819), + ("__SYSTEM_CORE_CLOCK__", "$BOARD_F_CPU"), # take value from board_build.f_cpu = ... + "ARDUINO_ARCH_STM32WB" + ], + + CPPPATH=[ + os.path.join(FRAMEWORK_DIR, "cores", BUILD_CORE), + os.path.join(FRAMEWORK_DIR, "system", "CMSIS", "Core", "Include"), + os.path.join(FRAMEWORK_DIR, "system", "CMSIS", "DSP" ,"Include"), + os.path.join(FRAMEWORK_DIR, "system", "CMSIS", "Device", "ST", "STM32WBxx", "Include"), + os.path.join(FRAMEWORK_DIR, "system", "STM32WBxx", "Include") + ], + + LIBSOURCE_DIRS=[ + os.path.join(FRAMEWORK_DIR, "libraries") + ], + + LIBPATH=[ + os.path.join(FRAMEWORK_DIR, "system", "STM32WBxx", "Lib"), + os.path.join(FRAMEWORK_DIR, "system", "CMSIS", "DSP", "Lib") + ], + + LINKFLAGS=machine_flags + [ + "-Os", + "--specs=nosys.specs", + "--specs=nano.specs", + "-Wl,--gc-sections", + "-Wl,--check-sections", + "-Wl,--unresolved-symbols=report-all", + "-Wl,--warn-common", + "-Wl,--warn-section-align" + ], + + LIBS=["m", "stm32wb55xx"], +) + +# no custom linker script given? give it the default one. +if not board.get("build.ldscript", ""): + env.Append( + LIBPATH=[ + os.path.join(FRAMEWORK_DIR, "system", "STM32WBxx", "LinkScripts") + ] + ) + env.Replace(LDSCRIPT_PATH="STM32WB55xx_FLASH.ld") + +if "build.usb_product" in board: + env.Append( + CPPDEFINES=[ + ("USB_VID", board.get("build.hwids")[0][0]), + ("USB_PID", board.get("build.hwids")[0][1]), + ("USB_PRODUCT", '\\"%s\\"' % + board.get("build.usb_product", "").replace('"', "")), + ("USB_MANUFACTURER", '\\"%s\\"' % + board.get("vendor", "").replace('"', "")) + ] + ) + +# Flags for Cortex-M4 FPU +env.Prepend( + CCFLAGS=[ + "-mfloat-abi=hard", + "-mfpu=fpv4-sp-d16" + ], + + LINKFLAGS=[ + "-mfloat-abi=hard", + "-mfpu=fpv4-sp-d16" + ], + + LIBS=["arm_cortexM4lf_math"] +) + +# +# Target: Build Core Library +# + +libs = [] + +if "build.variant" in board: + env.Append( + CPPPATH=[os.path.join(variants_dir, board.get("build.variant"))] + ) + # explicitly build as source files so that weak functions are linked correctly + env.BuildSources( + os.path.join("$BUILD_DIR", "FrameworkArduinoVariant"), + os.path.join(variants_dir, board.get("build.variant")) + ) + +libs.append(env.BuildLibrary( + os.path.join("$BUILD_DIR", "FrameworkArduino"), + os.path.join(FRAMEWORK_DIR, "cores", BUILD_CORE) +)) + +env.Prepend(LIBS=libs) From 000e1506dcbbbe1c51b027ac8594d52a7abc89e4 Mon Sep 17 00:00:00 2001 From: maxgerhardt Date: Tue, 27 Dec 2022 16:02:16 +0100 Subject: [PATCH 02/16] Fix retirn -> return typo --- cores/arduino/HardwareSerial.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cores/arduino/HardwareSerial.cpp b/cores/arduino/HardwareSerial.cpp index 59152a7..04009b7 100644 --- a/cores/arduino/HardwareSerial.cpp +++ b/cores/arduino/HardwareSerial.cpp @@ -101,7 +101,7 @@ int wiring_stderr_write(const char *data, int nbytes) { return Serial.write((const uint8_t*)data, nbytes); } - retirn 0; + return 0; } } From 5e54325ee1f6a09e837cddaae9ef01f5b434d2df Mon Sep 17 00:00:00 2001 From: maxgerhardt Date: Tue, 27 Dec 2022 16:02:38 +0100 Subject: [PATCH 03/16] Rewrite CDC for UART macros (TEMPORARY) --- cores/arduino/Uart.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cores/arduino/Uart.cpp b/cores/arduino/Uart.cpp index c24aa3a..2e3f3a0 100644 --- a/cores/arduino/Uart.cpp +++ b/cores/arduino/Uart.cpp @@ -206,8 +206,8 @@ size_t Uart::write(const uint8_t *buffer, size_t size) { tx_count = m_tx_size - tx_read; } - if (tx_count > CDC_TX_PACKET_SIZE) { - tx_count = CDC_TX_PACKET_SIZE; + if (tx_count > UART_TX_PACKET_SIZE/*CDC_TX_PACKET_SIZE*/) { + tx_count = UART_TX_PACKET_SIZE/*CDC_TX_PACKET_SIZE*/; } if (tx_count) { @@ -270,8 +270,8 @@ size_t Uart::write(const uint8_t *buffer, size_t size) { tx_count = m_tx_size - tx_read; } - if (tx_count > CDC_TX_PACKET_SIZE) { - tx_count = CDC_TX_PACKET_SIZE; + if (tx_count > UART_TX_PACKET_SIZE/*CDC_TX_PACKET_SIZE*/) { + tx_count = UART_TX_PACKET_SIZE; } if (tx_count) { @@ -381,8 +381,8 @@ void Uart::transmitCallback(class Uart *self) { tx_count = (self->m_tx_size - tx_read); } - if (tx_count > CDC_TX_PACKET_SIZE) { - tx_count = CDC_TX_PACKET_SIZE; + if (tx_count > /*CDC_TX_PACKET_SIZE*/UART_TX_PACKET_SIZE) { + tx_count = UART_TX_PACKET_SIZE/*CDC_TX_PACKET_SIZE*/; } self->m_tx_count = tx_count; From c85fff704140fd6b039e296b9f84665696f6eac9 Mon Sep 17 00:00:00 2001 From: maxgerhardt Date: Tue, 27 Dec 2022 16:55:32 +0100 Subject: [PATCH 04/16] Update README --- README.md | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 16578de..1d50bf3 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,30 @@ ArduinoCore-stm32wb is targeted at ultra low power scenarios, sensor hubs, with ### STMicroelectronics * [NUCLEO-WB55RG](https://www.st.com/content/st_com/en/products/evaluation-tools/product-evaluation-tools/stm32-nucleo-expansion-boards/p-nucleo-wb55.html) - -## Installing +## Installing in PlatformIO (WIP) + +You can use this Arduino core in PlatformIO. + +To do so, create any new project in the PIO Home screen (e.g., "Board: Arduino Uno" + "Framework: Arduino), then overwrite the `platformio.ini` of the generated project with: + +```ini +[env:nucleo_wb55rg_p] +; use forked platform +platform = https://github.com/maxgerhardt/platform-ststm32.git#stm32wb +board = grumpypizza_nucleo_wb55rg_p +board_build.core = stm32wb +framework = arduino +build_flags = + -DSTORAGE_TYPE=0 +; if you need to source the core from a different repo +;platform_packages = framework-arduinoststm32wb@https://github.com/maxgerhardt/ArduinoCore-stm32wb.git +; if you need to source the core from the local filesystem +;platform_packages = framework-arduinoststm32wb@symlink://C:\Users\User\Desktop\dev\ArduinoCore-stm32wb +``` + +Available boards, configuration options etc. are still subject to change at this point. + +## Installing in the Arduino IDE ### Board Manager From 7484e050086670412d0dfc1605d18490dbdc2baa Mon Sep 17 00:00:00 2001 From: maxgerhardt Date: Tue, 27 Dec 2022 17:17:59 +0100 Subject: [PATCH 05/16] Add RTC in linker commands --- tools/platformio-build.py | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/tools/platformio-build.py b/tools/platformio-build.py index a42ba23..e0d8f7b 100644 --- a/tools/platformio-build.py +++ b/tools/platformio-build.py @@ -13,6 +13,7 @@ # limitations under the License. import os +import time from SCons.Script import DefaultEnvironment env = DefaultEnvironment() @@ -25,6 +26,21 @@ assert os.path.isdir(FRAMEWORK_DIR) +# make RTC infos available +# see https://github.com/arduino/arduino-cli/blob/63f1e1855aa4c91415480be40fc49fd50d597e35/legacy/builder/setup_build_properties.go#L121-L125 +# in this core +# -Wl,--defsym=__RTC_EPOCH__={extra.time.utc} +# -Wl,--defsym=__RTC_ZONE__={extra.time.zone} +# -Wl,--defsym=__RTC_DST__={extra.time.dst} +# -Wl,--defsym=__RTC_LEAP_SECONDS=18 +# extra.time.utc +time_utc = int(time.time()) +# extra.time.zone +time_zone = -time.timezone +is_dst = time.daylight and time.localtime().tm_isdst > 0 +# extra.time.dst +time_dst = - (time.altzone if is_dst else 0) + variants_dir = os.path.join( "$PROJECT_DIR", board.get("build.variants_dir")) if board.get( "build.variants_dir", "") else os.path.join(FRAMEWORK_DIR, "variants") @@ -73,7 +89,7 @@ CPPPATH=[ os.path.join(FRAMEWORK_DIR, "cores", BUILD_CORE), os.path.join(FRAMEWORK_DIR, "system", "CMSIS", "Core", "Include"), - os.path.join(FRAMEWORK_DIR, "system", "CMSIS", "DSP" ,"Include"), + os.path.join(FRAMEWORK_DIR, "system", "CMSIS", "DSP", "Include"), os.path.join(FRAMEWORK_DIR, "system", "CMSIS", "Device", "ST", "STM32WBxx", "Include"), os.path.join(FRAMEWORK_DIR, "system", "STM32WBxx", "Include") ], @@ -95,7 +111,11 @@ "-Wl,--check-sections", "-Wl,--unresolved-symbols=report-all", "-Wl,--warn-common", - "-Wl,--warn-section-align" + "-Wl,--warn-section-align", + "-Wl,--defsym=__RTC_EPOCH__=%d" % time_utc, + "-Wl,--defsym=__RTC_ZONE__=%d" % time_zone, + "-Wl,--defsym=__RTC_DST__=%d" % time_dst, + "-Wl,--defsym=__RTC_LEAP_SECONDS=18" # constant ], LIBS=["m", "stm32wb55xx"], From 96c1fbaaaef9aaba8ec9478f62203dfdb1074c45 Mon Sep 17 00:00:00 2001 From: maxgerhardt Date: Tue, 27 Dec 2022 18:05:05 +0100 Subject: [PATCH 06/16] Implement USB and storage flags properly --- tools/platformio-build.py | 41 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/tools/platformio-build.py b/tools/platformio-build.py index e0d8f7b..c57def4 100644 --- a/tools/platformio-build.py +++ b/tools/platformio-build.py @@ -28,6 +28,7 @@ # make RTC infos available # see https://github.com/arduino/arduino-cli/blob/63f1e1855aa4c91415480be40fc49fd50d597e35/legacy/builder/setup_build_properties.go#L121-L125 +# https://arduino.github.io/arduino-cli/0.29/platform-specification/#global-predefined-properties # in this core # -Wl,--defsym=__RTC_EPOCH__={extra.time.utc} # -Wl,--defsym=__RTC_ZONE__={extra.time.zone} @@ -130,11 +131,47 @@ ) env.Replace(LDSCRIPT_PATH="STM32WB55xx_FLASH.ld") -if "build.usb_product" in board: +# process USB flags +cpp_defines = env.Flatten(env.get("CPPDEFINES", [])) +board_is_usb_capable = "build.usb_product" in board +# if not already set externally and board is USB capable +if board_is_usb_capable and "USB_TYPE" not in cpp_defines: + # default value: "Serial" + usb_type = 1 + # "Serial" + if "PIO_FRAMEWORK_ARDUINO_ENABLE_CDC" in cpp_defines: + usb_type = 1 + # "Serial + Mass Storage" + elif "PIO_FRAMEWORK_ARDUINO_ENABLE_CDC_WITH_MSC" in cpp_defines: + usb_type = 2 + # "No USB" + elif "PIO_FRAMEWORK_ARDUINO_NO_USB" in cpp_defines: + usb_type = 0 + env.Append(CPPDEFINES=[("USB_TYPE", usb_type)]) + +# process storage type if not given externally: +if "STORAGE_TYPE" not in cpp_defines: + # default value: "None" + storage_type = 0 + # "None" + if "PIO_FRAMEWORK_ARDUINO_STORAGE_TYPE_NONE" in cpp_defines: + storage_type = 0 + # "SFLASH" + elif "PIO_FRAMEWORK_ARDUINO_STORAGE_TYPE_SFLASH" in cpp_defines: + storage_type = 1 + # "SDCARD" + elif "PIO_FRAMEWORK_ARDUINO_STORAGE_TYPE_SDCARD" in cpp_defines: + storage_type = 2 + env.Append(CPPDEFINES=[("STORAGE_TYPE", storage_type)]) + +if board_is_usb_capable: env.Append( CPPDEFINES=[ ("USB_VID", board.get("build.hwids")[0][0]), ("USB_PID", board.get("build.hwids")[0][1]), + # default DID is 0x0100 unless given in board + # right now every board has the same DID + ("USB_DID", board.get("build.usb_did", "0x0100")), ("USB_PRODUCT", '\\"%s\\"' % board.get("build.usb_product", "").replace('"', "")), ("USB_MANUFACTURER", '\\"%s\\"' % @@ -167,7 +204,7 @@ env.Append( CPPPATH=[os.path.join(variants_dir, board.get("build.variant"))] ) - # explicitly build as source files so that weak functions are linked correctly + # explicitly use BuildSources so that weak functions are linked correctly with object files instead of archives env.BuildSources( os.path.join("$BUILD_DIR", "FrameworkArduinoVariant"), os.path.join(variants_dir, board.get("build.variant")) From 465914a17288c685253076dbfa3fec9be82f2765 Mon Sep 17 00:00:00 2001 From: maxgerhardt Date: Tue, 27 Dec 2022 18:35:49 +0100 Subject: [PATCH 07/16] Update README --- README.md | 47 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 44 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1d50bf3..b7fa63c 100644 --- a/README.md +++ b/README.md @@ -24,8 +24,7 @@ To do so, create any new project in the PIO Home screen (e.g., "Board: Arduino U [env:nucleo_wb55rg_p] ; use forked platform platform = https://github.com/maxgerhardt/platform-ststm32.git#stm32wb -board = grumpypizza_nucleo_wb55rg_p -board_build.core = stm32wb +board = grumpyoldpizza_nucleo_wb55rg framework = arduino build_flags = -DSTORAGE_TYPE=0 @@ -35,7 +34,49 @@ build_flags = ;platform_packages = framework-arduinoststm32wb@symlink://C:\Users\User\Desktop\dev\ArduinoCore-stm32wb ``` -Available boards, configuration options etc. are still subject to change at this point. +Available `board` selection values: +* grumpyoldpizza_firefly_wb55cg +* grumpyoldpizza_katydid_wb55cg +* grumpyoldpizza_mothra_wb5mmg +* grumpyoldpizza_nucleo_wb55rg +* grumpyoldpizza_snoopy6_wb5mmg + +CPU frequency selection example: +```ini +; 16 MHz (No USB) +board_build.f_cpu = 16000000L +``` + +The default USB type is "Serial" if the board supports USB (currently all except Nucleo WB55RG). +This can be changed by activating one of these macros through the `build_flags` of the `platformoi.ini`. +Remember that to combine multiple flags into one `build_flags` expression if you want to activate multiple flags. + +```ini +; USB: "Serial" (default if USB available) +build_flags = -D PIO_FRAMEWORK_ARDUINO_ENABLE_CDC +; USB: "Serial + Mass Storage" +build_flags = -D PIO_FRAMEWORK_ARDUINO_ENABLE_CDC_WITH_MSC +; USB: "No USB" +build_flags = -D PIO_FRAMEWORK_ARDUINO_NO_USB +``` + +Configuration for "External Storage": + +```ini +; Ext. Storage: None (default) +build_flags = -D PIO_FRAMEWORK_ARDUINO_STORAGE_TYPE_NONE +; Ext. Storage: SFLASH +build_flags = -D PIO_FRAMEWORK_ARDUINO_STORAGE_TYPE_SFLASH +; Ext. Storage: SDCARD +build_flags = -D PIO_FRAMEWORK_ARDUINO_STORAGE_TYPE_SDCARD +``` + +Example for combined values: +```ini +build_flags = + -D PIO_FRAMEWORK_ARDUINO_STORAGE_TYPE_SDCARD + -D PIO_FRAMEWORK_ARDUINO_ENABLE_CDC_WITH_MSC +``` ## Installing in the Arduino IDE From c8f4bcf7bba22d13efcabd22efa8c2b49f22448c Mon Sep 17 00:00:00 2001 From: maxgerhardt Date: Tue, 27 Dec 2022 18:38:44 +0100 Subject: [PATCH 08/16] Add instructions on updating --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index b7fa63c..054d623 100644 --- a/README.md +++ b/README.md @@ -78,6 +78,14 @@ build_flags = -D PIO_FRAMEWORK_ARDUINO_ENABLE_CDC_WITH_MSC ``` +In case of platform or package updates, use +``` +pio pkg update -g -p "https://github.com/maxgerhardt/platform-ststm32.git#stm32wb" +pio pkg update -g -t "https://github.com/maxgerhardt/ArduinoCore-stm32wb.git" +``` + +on [the CLI](https://docs.platformio.org/en/stable/integration/ide/vscode.html#platformio-core-cli). + ## Installing in the Arduino IDE ### Board Manager From 85c8623786476b0ee10a8b9e520ad997da7bf8da Mon Sep 17 00:00:00 2001 From: maxgerhardt Date: Tue, 27 Dec 2022 18:39:04 +0100 Subject: [PATCH 09/16] Update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 054d623..7673c3a 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ You can use this Arduino core in PlatformIO. To do so, create any new project in the PIO Home screen (e.g., "Board: Arduino Uno" + "Framework: Arduino), then overwrite the `platformio.ini` of the generated project with: ```ini -[env:nucleo_wb55rg_p] +[env:nucleo_wb55rg] ; use forked platform platform = https://github.com/maxgerhardt/platform-ststm32.git#stm32wb board = grumpyoldpizza_nucleo_wb55rg From 26fefc557ad426fcc63773d9b6975b961774c69c Mon Sep 17 00:00:00 2001 From: maxgerhardt Date: Tue, 27 Dec 2022 18:41:24 +0100 Subject: [PATCH 10/16] Update readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 7673c3a..d08efc4 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,8 @@ build_flags = ;platform_packages = framework-arduinoststm32wb@symlink://C:\Users\User\Desktop\dev\ArduinoCore-stm32wb ``` +Also see example at https://github.com/maxgerhardt/pio-grumpyoldpizza-stm32wb-test. + Available `board` selection values: * grumpyoldpizza_firefly_wb55cg * grumpyoldpizza_katydid_wb55cg From 35dcc40234a28a0a7835e5f0d51b617e8ae910d8 Mon Sep 17 00:00:00 2001 From: maxgerhardt Date: Tue, 27 Dec 2022 18:46:53 +0100 Subject: [PATCH 11/16] Update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d08efc4..c04959b 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ ArduinoCore-stm32wb is targeted at ultra low power scenarios, sensor hubs, with You can use this Arduino core in PlatformIO. -To do so, create any new project in the PIO Home screen (e.g., "Board: Arduino Uno" + "Framework: Arduino), then overwrite the `platformio.ini` of the generated project with: +To do so, create any new project in the PIO Home screen (e.g., "Board: Arduino Uno" + "Framework: Arduino"), then overwrite the `platformio.ini` of the generated project with: ```ini [env:nucleo_wb55rg] From 3771aa41167023293e7234ad3f087e424c2840e1 Mon Sep 17 00:00:00 2001 From: maxgerhardt Date: Tue, 27 Dec 2022 18:47:27 +0100 Subject: [PATCH 12/16] Update readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c04959b..a76c3d6 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ platform = https://github.com/maxgerhardt/platform-ststm32.git#stm32wb board = grumpyoldpizza_nucleo_wb55rg framework = arduino build_flags = - -DSTORAGE_TYPE=0 + -DPIO_FRAMEWORK_ARDUINO_STORAGE_TYPE_NONE ; if you need to source the core from a different repo ;platform_packages = framework-arduinoststm32wb@https://github.com/maxgerhardt/ArduinoCore-stm32wb.git ; if you need to source the core from the local filesystem From 992d02f69460f3d478387e5d2f2fa82e5f67c1dc Mon Sep 17 00:00:00 2001 From: maxgerhardt Date: Tue, 27 Dec 2022 19:20:06 +0100 Subject: [PATCH 13/16] Use next x.y.z-dev version in package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 356cc1a..cf48bad 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "framework-arduinoststm32wb", - "version": "5.000104.221227", + "version": "0.1.5-dev", "description": "Arduino Core for STM32WB", "keywords": [ "framework", From cb01ed39b3dcb5f58e4af0985a871bce49e9d961 Mon Sep 17 00:00:00 2001 From: maxgerhardt Date: Wed, 28 Dec 2022 12:47:37 +0100 Subject: [PATCH 14/16] Remove WIP status from README headline --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a76c3d6..d4ff272 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ ArduinoCore-stm32wb is targeted at ultra low power scenarios, sensor hubs, with ### STMicroelectronics * [NUCLEO-WB55RG](https://www.st.com/content/st_com/en/products/evaluation-tools/product-evaluation-tools/stm32-nucleo-expansion-boards/p-nucleo-wb55.html) -## Installing in PlatformIO (WIP) +## Installing in PlatformIO You can use this Arduino core in PlatformIO. From 52443ce0bc029b2ffe816bdae4c568e8be457b6f Mon Sep 17 00:00:00 2001 From: maxgerhardt Date: Wed, 4 Jan 2023 16:08:09 +0100 Subject: [PATCH 15/16] Make STM32WBxx/Source explorable for better IntelliSense --- tools/platformio-build.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/platformio-build.py b/tools/platformio-build.py index c57def4..89ae5ef 100644 --- a/tools/platformio-build.py +++ b/tools/platformio-build.py @@ -92,7 +92,9 @@ os.path.join(FRAMEWORK_DIR, "system", "CMSIS", "Core", "Include"), os.path.join(FRAMEWORK_DIR, "system", "CMSIS", "DSP", "Include"), os.path.join(FRAMEWORK_DIR, "system", "CMSIS", "Device", "ST", "STM32WBxx", "Include"), - os.path.join(FRAMEWORK_DIR, "system", "STM32WBxx", "Include") + os.path.join(FRAMEWORK_DIR, "system", "STM32WBxx", "Include"), + # make it possible to follow function implementation in IDE by making source explorable + os.path.join(FRAMEWORK_DIR, "system", "STM32WBxx", "Source") ], LIBSOURCE_DIRS=[ From 5a65bcdb0b9adb3a9f435a52a464efab54cca0b3 Mon Sep 17 00:00:00 2001 From: Maximilian Gerhardt Date: Wed, 18 Jan 2023 17:54:57 +0100 Subject: [PATCH 16/16] Update linkerscript folder --- tools/platformio-build.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/platformio-build.py b/tools/platformio-build.py index 89ae5ef..8e61c8b 100644 --- a/tools/platformio-build.py +++ b/tools/platformio-build.py @@ -128,7 +128,7 @@ if not board.get("build.ldscript", ""): env.Append( LIBPATH=[ - os.path.join(FRAMEWORK_DIR, "system", "STM32WBxx", "LinkScripts") + os.path.join(FRAMEWORK_DIR, "system", "STM32WBxx", "LdScripts") ] ) env.Replace(LDSCRIPT_PATH="STM32WB55xx_FLASH.ld")