diff --git a/.github/workflows/githubci.yml b/.github/workflows/githubci.yml index 430342d..1a9cd1c 100644 --- a/.github/workflows/githubci.yml +++ b/.github/workflows/githubci.yml @@ -43,3 +43,6 @@ jobs: - name: Build blink for ${{ matrix.board }} run: pio run -d tests/blink -e ${{ matrix.board }} + + - name: Build the bundled libraries for ${{ matrix.board }} + run: pio run -d tests/libraries -e ${{ matrix.board }} diff --git a/tests/libraries/platformio.ini b/tests/libraries/platformio.ini new file mode 100644 index 0000000..16ba20a --- /dev/null +++ b/tests/libraries/platformio.ini @@ -0,0 +1,10 @@ +; Compile test for the libraries bundled with the framework. Blink only pulls +; in the core, so without this CI never builds them. +; +; Boards, platform and the framework symlink come from tests/blink, so the two +; tests can't drift apart: +; +; pio run -d tests/libraries -e xiao_nrf54l15 + +[platformio] +extra_configs = ../blink/platformio.ini diff --git a/tests/libraries/src/main.cpp b/tests/libraries/src/main.cpp new file mode 100644 index 0000000..c601a9c --- /dev/null +++ b/tests/libraries/src/main.cpp @@ -0,0 +1,57 @@ +#include + +// Compile test for the libraries bundled with the framework: every library is +// included and used, so CI builds and links each of them for every board. +// Nothing here is meant to run on hardware; the pins are just valid numbers. +// +// Left out: +// - BLEAdafruitService needs Adafruit sensor libraries from the registry. +// - PDM and Servo stop with #error on anything but nRF52, and BLEHomekit +// doesn't compile here: none of the three has been ported to the nRF54L. + +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace Adafruit_LittleFS_Namespace; + +BLEUart bleuart; +SoftwareSerial swSerial(PIN_SERIAL1_RX, PIN_SERIAL1_TX); + +void setup() { + Serial.begin(115200); + Serial.println("libraries"); + Serial.flush(); + Serial.end(); + + uint8_t buf[16]; + nRF54Crypto.begin(); + nRF54Crypto.random(buf, sizeof(buf)); + nRF54Crypto.end(); + + InternalFS.begin(); + File file = InternalFS.open("/test", FILE_O_WRITE); + if (file) { + file.write(buf, sizeof(buf)); + file.close(); + } + + Bluefruit.begin(); + bleuart.begin(); + Bluefruit.Advertising.addService(bleuart); + Bluefruit.Advertising.start(0); + + Wire.begin(); + SPI.begin(); + swSerial.begin(9600); + RotaryEncoder.begin(PIN_SERIAL1_RX, PIN_SERIAL1_TX); +} + +void loop() { + delay(1000); +} diff --git a/variants/nrf54l05dk/variant.h b/variants/nrf54l05dk/variant.h index dac9570..319e327 100644 --- a/variants/nrf54l05dk/variant.h +++ b/variants/nrf54l05dk/variant.h @@ -139,12 +139,21 @@ static const uint8_t SCK = PIN_SPI_SCK; /* * Wire Interfaces + * + * TWIM22, as on the nRF54L15 boards. The default NRF_TWIM0 alias is TWIM20, + * which shares SERIAL20 with UARTE20 (Serial2): both would define + * SERIAL20_IRQHandler, and a sketch using Wire wouldn't link. */ #define WIRE_INTERFACES_COUNT 1 #define PIN_WIRE_SDA (37) // P1.05 (or adjust per DK routing) #define PIN_WIRE_SCL (38) // P1.06 +#define WIRE_TWIM NRF_TWIM22 +#define WIRE_TWIS NRF_TWIS22 +#define WIRE_IRQN SERIAL22_IRQn +#define WIRE_IRQ_HANDLER SERIAL22_IRQHandler + #ifdef __cplusplus } #endif diff --git a/variants/nrf54l10dk/variant.h b/variants/nrf54l10dk/variant.h index 63b985c..b013996 100644 --- a/variants/nrf54l10dk/variant.h +++ b/variants/nrf54l10dk/variant.h @@ -139,12 +139,21 @@ static const uint8_t SCK = PIN_SPI_SCK; /* * Wire Interfaces + * + * TWIM22, as on the nRF54L15 boards. The default NRF_TWIM0 alias is TWIM20, + * which shares SERIAL20 with UARTE20 (Serial2): both would define + * SERIAL20_IRQHandler, and a sketch using Wire wouldn't link. */ #define WIRE_INTERFACES_COUNT 1 #define PIN_WIRE_SDA (37) // P1.05 (or adjust per DK routing) #define PIN_WIRE_SCL (38) // P1.06 +#define WIRE_TWIM NRF_TWIM22 +#define WIRE_TWIS NRF_TWIS22 +#define WIRE_IRQN SERIAL22_IRQn +#define WIRE_IRQ_HANDLER SERIAL22_IRQHandler + #ifdef __cplusplus } #endif