Skip to content

Instantly share code, notes, and snippets.

@elfmimi
Created February 3, 2023 14:58
Show Gist options
  • Save elfmimi/e8ffd589fc7ca3794641803700d734aa to your computer and use it in GitHub Desktop.
Save elfmimi/e8ffd589fc7ca3794641803700d734aa to your computer and use it in GitHub Desktop.
Old patch for OpenSK targeting Raytac MDBT50Q-RX dongle

Old patch for OpenSK targeting Raytac MDBT50Q-RX dongle

The revision I tried was the Initial commit (f91d2fd) .

OpenSK is using Tock as one of its submodules.

So you need to clone OpenSK and its submodules recursively.

After you have cloned it successfully, you should be able to find this directory.

OpenSK/third_party/tock/boards/nordic/nrf52840_dongle/

for reference, it is located here on GitHub.

Duplicate the directory and rename it to mdbt50q_rx.

Then apply the patch below.

Or altenatively, you may just apply the patch to nrf52840_dongle directory directly.

No further instruction is provided.

diff -cdr nrf52840_dongle/Cargo.toml mdbt50q_rx/Cargo.toml
*** nrf52840_dongle/Cargo.toml 2020-02-01 16:39:13.672443100 +0900
--- mdbt50q_rx/Cargo.toml 2020-02-01 18:55:28.513801800 +0900
***************
*** 1,5 ****
[package]
! name = "nrf52840_dongle"
version = "0.1.0"
authors = ["Tock Project Developers <tock-dev@googlegroups.com>"]
build = "build.rs"
--- 1,5 ----
[package]
! name = "mdbt50q_rx"
version = "0.1.0"
authors = ["Tock Project Developers <tock-dev@googlegroups.com>"]
build = "build.rs"
diff -cdr nrf52840_dongle/Makefile mdbt50q_rx/Makefile
*** nrf52840_dongle/Makefile 2020-02-01 16:39:13.672443100 +0900
--- mdbt50q_rx/Makefile 2020-02-01 20:06:12.820003600 +0900
***************
*** 2,8 ****
TOCK_ARCH=cortex-m4
TARGET=thumbv7em-none-eabi
! PLATFORM=nrf52840_dongle
include ../../Makefile.common
--- 2,8 ----
TOCK_ARCH=cortex-m4
TARGET=thumbv7em-none-eabi
! PLATFORM=mdbt50q_rx
include ../../Makefile.common
diff -cdr nrf52840_dongle/src/main.rs mdbt50q_rx/src/main.rs
*** nrf52840_dongle/src/main.rs 2020-02-01 16:47:02.612774800 +0900
--- mdbt50q_rx/src/main.rs 2020-02-01 19:56:05.774237300 +0900
***************
*** 14,32 ****
use nrf52dk_base::{SpiPins, UartChannel, UartPins};
// The nRF52840 Dongle LEDs
! const LED1_PIN: Pin = Pin::P0_06;
! const LED2_R_PIN: Pin = Pin::P0_08;
! const LED2_G_PIN: Pin = Pin::P1_09;
! const LED2_B_PIN: Pin = Pin::P0_12;
! // The nRF52840 Dongle button
! const BUTTON_PIN: Pin = Pin::P1_06;
const BUTTON_RST_PIN: Pin = Pin::P0_18;
! const UART_RTS: Pin = Pin::P0_13;
! const UART_TXD: Pin = Pin::P0_15;
! const UART_CTS: Pin = Pin::P0_17;
! const UART_RXD: Pin = Pin::P0_20;
const SPI_MOSI: Pin = Pin::P1_01;
const SPI_MISO: Pin = Pin::P1_02;
--- 14,39 ----
use nrf52dk_base::{SpiPins, UartChannel, UartPins};
// The nRF52840 Dongle LEDs
! const LED1_PIN: Pin = Pin::P1_13; // Pin::P0_06;
! const LED2_PIN: Pin = Pin::P1_11;
! const LED3_PIN: Pin = Pin::P1_12; // Dummy
! // const LED2_R_PIN: Pin = Pin::P0_08;
! // const LED2_G_PIN: Pin = Pin::P1_09;
! // const LED2_B_PIN: Pin = Pin::P0_12;
! // The MDBT50Q-RX Dongle button
! const BUTTON_PIN: Pin = Pin::P0_15; // Pin::P1_06;
const BUTTON_RST_PIN: Pin = Pin::P0_18;
! const UART_RTS: Pin = Pin::P0_05;
! const UART_TXD: Pin = Pin::P0_06;
! const UART_CTS: Pin = Pin::P0_07;
! const UART_RXD: Pin = Pin::P0_08;
!
! // const UART_RTS: Pin = Pin::P0_13;
! // const UART_TXD: Pin = Pin::P0_15;
! // const UART_CTS: Pin = Pin::P0_17;
! // const UART_RXD: Pin = Pin::P0_20;
const SPI_MOSI: Pin = Pin::P1_01;
const SPI_MISO: Pin = Pin::P1_02;
***************
*** 107,112 ****
--- 114,128 ----
capsules::led::ActivationMode::ActiveLow
),
(
+ &nrf52840::gpio::PORT[LED2_PIN],
+ capsules::led::ActivationMode::ActiveLow
+ ),
+ (
+ &nrf52840::gpio::PORT[LED3_PIN],
+ capsules::led::ActivationMode::ActiveLow
+ )
+ /*
+ (
&nrf52840::gpio::PORT[LED2_R_PIN],
capsules::led::ActivationMode::ActiveLow
),
***************
*** 118,123 ****
--- 134,140 ----
&nrf52840::gpio::PORT[LED2_B_PIN],
capsules::led::ActivationMode::ActiveLow
)
+ */
));
let chip = static_init!(nrf52840::chip::Chip, nrf52840::chip::new());
***************
*** 126,134 ****
BUTTON_RST_PIN,
&nrf52840::gpio::PORT,
gpio,
! LED2_R_PIN,
! LED2_G_PIN,
! LED2_B_PIN,
led,
UartChannel::Pins(UartPins::new(UART_RTS, UART_TXD, UART_CTS, UART_RXD)),
&SpiPins::new(SPI_MOSI, SPI_MISO, SPI_CLK),
--- 143,151 ----
BUTTON_RST_PIN,
&nrf52840::gpio::PORT,
gpio,
! LED1_PIN, // LED2_R_PIN,
! LED2_PIN, // LED2_G_PIN,
! LED3_PIN, // LED2_B_PIN,
led,
UartChannel::Pins(UartPins::new(UART_RTS, UART_TXD, UART_CTS, UART_RXD)),
&SpiPins::new(SPI_MOSI, SPI_MISO, SPI_CLK),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment