From 68749d4f91d18424239a0f44a7f9a31309d263dc Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Thu, 3 Apr 2025 13:18:26 -0600 Subject: [PATCH 1/6] quick fix for the toolkit UART compile/builds issues on some platforms --- library.properties | 2 +- src/sfTkArdUART.cpp | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/library.properties b/library.properties index e52c88b..ccfba8b 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=SparkFun Toolkit -version=1.1.0 +version=1.1.1 author=SparkFun Electronics maintainer=SparkFun Electronics sentence=A utility library that other SparkFun libraries can take advantage of. diff --git a/src/sfTkArdUART.cpp b/src/sfTkArdUART.cpp index 7e63721..7188f58 100644 --- a/src/sfTkArdUART.cpp +++ b/src/sfTkArdUART.cpp @@ -48,16 +48,21 @@ sfTkError_t sfTkArdUART::init(HardwareSerial &hwSerial, uint32_t baudRate, bool sfTkError_t sfTkArdUART::init(uint32_t baudRate, bool bInit) { +#ifdef _THIS__NOT_IS_BROKEN // if we don't have a port already, use the default Arduino Serial. if (!_hwSerial) return init(Serial, baudRate, bInit); // We already have a UART setup, so it's already initialized. Change the baud rate. return setBaudRate(baudRate); // set the baud rate +#else + return ksfTkErrFail; +#endif } sfTkError_t sfTkArdUART::init(sfTkIUART::UARTConfig_t config, bool bInit) { +#ifdef _THIS__NOT_IS_BROKEN // if we don't have a port already, use the default Arduino Serial. if (!_hwSerial) return init(Serial, config, bInit); @@ -67,6 +72,9 @@ sfTkError_t sfTkArdUART::init(sfTkIUART::UARTConfig_t config, bool bInit) // We already have a UART setup, so it's already initialized. return ksfTkErrOk; +#else + return ksfTkErrFail; +#endif } sfTkError_t sfTkArdUART::init() @@ -103,11 +111,11 @@ sfTkError_t sfTkArdUART::read(uint8_t *data, size_t length, size_t &bytesRead) bytesRead = 0; // zero out value -// #ifdef ARDUINO_ARCH_AVR + // #ifdef ARDUINO_ARCH_AVR bytesRead = _hwSerial->readBytes(data, length); -// #else -// bytesRead = readBytes(data, length); -// #endif + // #else + // bytesRead = readBytes(data, length); + // #endif if (bytesRead == 0) return ksfTkErrFail; @@ -187,7 +195,8 @@ sfTkError_t sfTkArdUART::_start(void) // ESP8266 does not support setting stop bits, parity, and data bits in a stanard manner. _hwSerial->begin(_config.baudRate); #else - _hwSerial->begin(_config.baudRate, _config.stopBits | _config.parity | _config.dataBits); + _hwSerial->begin(_config.baudRate, + (uint32_t)_config.stopBits | (uint32_t)_config.parity | (uint32_t)_config.dataBits); #endif if (!availableForWrite()) return ksfTkErrSerialNotInit; // check if the port is available From cc2aa7d0ca05b4d5e804397ae9001cc86be224c5 Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Fri, 4 Apr 2025 12:57:41 -0600 Subject: [PATCH 2/6] add c6 compile test - testing --- .github/workflows/compile-sketch.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/compile-sketch.yml b/.github/workflows/compile-sketch.yml index eee9338..33c5e24 100644 --- a/.github/workflows/compile-sketch.yml +++ b/.github/workflows/compile-sketch.yml @@ -47,6 +47,13 @@ jobs: - name: esp32:esp32 source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json + # ESP32-C6 + # https://github.com/espressif/arduino-esp32/blob/master/boards.txt + - fqbn: esp32:esp32:esp32c6 + platforms: | + - name: esp32:esp32 + source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json + # Artemis / Apollo3 Feb 25 - there some issue here -- will need to look at # https://github.com/sparkfun/Arduino_Apollo3/blob/main/boards.txt # - fqbn: SparkFun:apollo3:sfe_artemis_atp From 514bed95688503c2a176c6520a6b9aaa391736a0 Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Fri, 4 Apr 2025 13:17:11 -0600 Subject: [PATCH 3/6] use actual boards, added more boards, added board name output --- .github/workflows/compile-sketch.yml | 55 +++++++++++++++++++++------- 1 file changed, 42 insertions(+), 13 deletions(-) diff --git a/.github/workflows/compile-sketch.yml b/.github/workflows/compile-sketch.yml index 33c5e24..88f9023 100644 --- a/.github/workflows/compile-sketch.yml +++ b/.github/workflows/compile-sketch.yml @@ -22,48 +22,63 @@ jobs: # Uno # https://github.com/arduino/ArduinoCore-avr/blob/master/boards.txt - fqbn: arduino:avr:mega + name: Arduino AVR platforms: | - name: arduino:avr source-url: https://downloads.arduino.cc/packages/package_index.json # ESP32 # https://github.com/espressif/arduino-esp32/blob/master/boards.txt - - fqbn: esp32:esp32:esp32 + - fqbn: esp32:esp32:esp32thing_plus_c + name: ESP32 Thing Plus C platforms: | - name: esp32:esp32 source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json # ESP32-S2 # https://github.com/espressif/arduino-esp32/blob/master/boards.txt - - fqbn: esp32:esp32:esp32s2 + - fqbn: esp32:esp32:sparkfun_esp32s2_thing_plus + name: ESP32-S2 Thing Plus platforms: | - - name: esp32:esp32 + - name: esp32:esp32s2 + source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json + + # ESP32-S3 + # https://github.com/espressif/arduino-esp32/blob/master/boards.txt + - fqbn: esp32:esp32:sparkfun_esp32s3_thing_plus + name: ESP32-S3 Thing Plus + platforms: | + - name: esp32:esp32s3 source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json # ESP32-C3 # https://github.com/espressif/arduino-esp32/blob/master/boards.txt - - fqbn: esp32:esp32:esp32c3 + - fqbn: esp32:esp32:sparkfun_pro_micro_esp32c3 + name: ESP32-C3 Pro Micro platforms: | - - name: esp32:esp32 + - name: esp32:esp32c3 source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json # ESP32-C6 # https://github.com/espressif/arduino-esp32/blob/master/boards.txt - - fqbn: esp32:esp32:esp32c6 + - fqbn: esp32:esp32:sparkfun_esp32c6_thing_plus + name: ESP32-C6 Thing Plus platforms: | - - name: esp32:esp32 + - name: esp32:esp32c6 source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json # Artemis / Apollo3 Feb 25 - there some issue here -- will need to look at # https://github.com/sparkfun/Arduino_Apollo3/blob/main/boards.txt - # - fqbn: SparkFun:apollo3:sfe_artemis_atp - # platforms: | - # - name: SparkFun:apollo3 - # source-url: https://raw.githubusercontent.com/sparkfun/Arduino_Apollo3/master/package_sparkfun_apollo3_index.json + - fqbn: SparkFun:apollo3:sfe_artemis_atp + name: SparkFun Artemis ATP + platforms: | + - name: SparkFun:apollo3 + source-url: https://raw.githubusercontent.com/sparkfun/Arduino_Apollo3/master/package_sparkfun_apollo3_index.json # ESP8266 # https://github.com/esp8266/Arduino/blob/master/boards.txt - fqbn: esp8266:esp8266:thingdev + name: ESP8266 Thing Dev platforms: | - name: esp8266:esp8266 source-url: https://arduino.esp8266.com/stable/package_esp8266com_index.json @@ -71,6 +86,7 @@ jobs: # SAMD21 # https://github.com/arduino/ArduinoCore-samd/blob/master/boards.txt - fqbn: arduino:samd:mkr1000 + name: SAMD21 MKR1000 platforms: | - name: arduino:samd # source-url: https://downloads.arduino.cc/packages/package_index.json @@ -78,6 +94,7 @@ jobs: # Nano BLE 33 / nRF52840 # https://github.com/arduino/ArduinoCore-mbed/blob/master/boards.txt - fqbn: arduino:mbed:nano33ble + name: Nano BLE 33 platforms: | - name: arduino:mbed # source-url: https://downloads.arduino.cc/packages/package_index.json @@ -85,13 +102,23 @@ jobs: # RP2040 # https://github.com/arduino/ArduinoCore-mbed/blob/master/boards.txt - fqbn: rp2040:rp2040:sparkfun_promicrorp2040 + name: SparkFun Pro Micro RP2040 platforms: | - name: rp2040:rp2040 source-url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json + # RP2350 + # https://github.com/arduino/ArduinoCore-mbed/blob/master/boards.txt + - fqbn: rp2040:rp2040:sparkfun_iotredboard_rp2350 + name: SparkFun IoT RedBoard RP2350 + platforms: | + - name: rp2040:rp2350 + source-url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json + # STM32 # https://github.com/arduino/ArduinoCore-mbed/blob/master/boards.txt - fqbn: STMicroelectronics:stm32:GenF4 + name: STM32 GenF4 platforms: | - name: STMicroelectronics:stm32 source-url: https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json @@ -100,8 +127,10 @@ jobs: - name: Checkout uses: actions/checkout@v3 - - name: Branch name - run: echo running on branch ${GITHUB_REF##*/} + - name: Branch name and details + run: | + echo "running on branch ${{ github.ref_name }}" + echo "Board: ${{matrix.board.name}}, fqbn: ${{ matrix.board.fqbn }}" - name: Compile Sketch uses: arduino/compile-sketches@v1.1.0 From 7a0930df2770319fa1b1c897493e136aaa832a86 Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Fri, 4 Apr 2025 13:20:18 -0600 Subject: [PATCH 4/6] fix issues b/c of AI --- .github/workflows/compile-sketch.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/compile-sketch.yml b/.github/workflows/compile-sketch.yml index 88f9023..adced18 100644 --- a/.github/workflows/compile-sketch.yml +++ b/.github/workflows/compile-sketch.yml @@ -40,7 +40,7 @@ jobs: - fqbn: esp32:esp32:sparkfun_esp32s2_thing_plus name: ESP32-S2 Thing Plus platforms: | - - name: esp32:esp32s2 + - name: esp32:esp32 source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json # ESP32-S3 @@ -48,7 +48,7 @@ jobs: - fqbn: esp32:esp32:sparkfun_esp32s3_thing_plus name: ESP32-S3 Thing Plus platforms: | - - name: esp32:esp32s3 + - name: esp32:esp32 source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json # ESP32-C3 @@ -56,7 +56,7 @@ jobs: - fqbn: esp32:esp32:sparkfun_pro_micro_esp32c3 name: ESP32-C3 Pro Micro platforms: | - - name: esp32:esp32c3 + - name: esp32:esp32 source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json # ESP32-C6 @@ -64,7 +64,7 @@ jobs: - fqbn: esp32:esp32:sparkfun_esp32c6_thing_plus name: ESP32-C6 Thing Plus platforms: | - - name: esp32:esp32c6 + - name: esp32:esp32 source-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json # Artemis / Apollo3 Feb 25 - there some issue here -- will need to look at @@ -112,7 +112,7 @@ jobs: - fqbn: rp2040:rp2040:sparkfun_iotredboard_rp2350 name: SparkFun IoT RedBoard RP2350 platforms: | - - name: rp2040:rp2350 + - name: rp2040:rp2040 source-url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json # STM32 From d77e1f74956594b13da1d2ae9da2844e5ec4e8ba Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Fri, 4 Apr 2025 13:33:54 -0600 Subject: [PATCH 5/6] HIDE uart compile issues on some esp32 platforms. This needs a perm fix --- src/sfTkArdUART.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/sfTkArdUART.cpp b/src/sfTkArdUART.cpp index 7188f58..6c82262 100644 --- a/src/sfTkArdUART.cpp +++ b/src/sfTkArdUART.cpp @@ -48,7 +48,8 @@ sfTkError_t sfTkArdUART::init(HardwareSerial &hwSerial, uint32_t baudRate, bool sfTkError_t sfTkArdUART::init(uint32_t baudRate, bool bInit) { -#ifdef _THIS__NOT_IS_BROKEN + // issues here on some devices - $defineing out for now +#ifdef _THIS_IS_BROKEN // if we don't have a port already, use the default Arduino Serial. if (!_hwSerial) return init(Serial, baudRate, bInit); @@ -62,7 +63,8 @@ sfTkError_t sfTkArdUART::init(uint32_t baudRate, bool bInit) sfTkError_t sfTkArdUART::init(sfTkIUART::UARTConfig_t config, bool bInit) { -#ifdef _THIS__NOT_IS_BROKEN +// issues here on some devices - $defineing out for now +#ifdef _THIS_IS_BROKEN // if we don't have a port already, use the default Arduino Serial. if (!_hwSerial) return init(Serial, config, bInit); From 8cbd3b1f47af1bd1d1140e0ce3878b3064485787 Mon Sep 17 00:00:00 2001 From: Kirk Benell Date: Fri, 4 Apr 2025 13:34:24 -0600 Subject: [PATCH 6/6] fix compile warning issue on some platforms --- src/sfTk/sfTkIUART.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sfTk/sfTkIUART.h b/src/sfTk/sfTkIUART.h index 9ce5c15..8d517c4 100644 --- a/src/sfTk/sfTkIUART.h +++ b/src/sfTk/sfTkIUART.h @@ -68,7 +68,7 @@ typedef enum _sfTkUARTDataBits kUARTDataBitsEight = 0x400ul, } sfTkUARTDataBits_t; -inline const uint8_t dataBitsToValue(sfTkUARTDataBits_t dataBits) +inline uint8_t dataBitsToValue(sfTkUARTDataBits_t dataBits) { static const uint8_t dataBitsArray[] = {5, 6, 7, 8};