Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@vanwinkeljan
Last active December 30, 2019 21:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vanwinkeljan/d260d464d7393afa8772bd7c084d00f0 to your computer and use it in GitHub Desktop.
Save vanwinkeljan/d260d464d7393afa8772bd7c084d00f0 to your computer and use it in GitHub Desktop.
Zephyr nrf52840_pca10056 SPI1 as Arduino SPI
diff --git a/boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts b/boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts
index 1ca951ae58..950a1f935e 100644
--- a/boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts
+++ b/boards/arm/nrf52840_pca10056/nrf52840_pca10056.dts
@@ -176,12 +176,12 @@ arduino_i2c: &i2c0 {
miso-pin = <29>;
};
-&spi1 {
+arduino_spi: &spi1 {
compatible = "nordic,nrf-spi";
status = "okay";
- sck-pin = <31>;
- mosi-pin = <30>;
- miso-pin = <40>;
+ sck-pin = <47>;
+ miso-pin = <46>;
+ mosi-pin = <45>;
};
&spi2 {
@@ -207,11 +207,11 @@ arduino_i2c: &i2c0 {
};
};
-arduino_spi: &spi3 {
+&spi3 {
status = "okay";
- sck-pin = <47>;
- miso-pin = <46>;
- mosi-pin = <45>;
+ sck-pin = <31>;
+ mosi-pin = <30>;
+ miso-pin = <40>;
};
&flash0 {
@vanwinkeljan
Copy link
Author

The nrf52840 preview development kits used AAAA engineering version of the nrf52840 where SPI 3 is not working.
The patch in these gist remaps the arduino_spi to SPI 1.

@nwsetec
Copy link

nwsetec commented Nov 23, 2019

Thanks @vanwinkeljan!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment