Skip to content

Commit a56e073

Browse files
committed
boards: arm: particle_boron: enable SARA-R4 modem
The Particle.io Boron is an nRF52840-based board with a connected u-blox SARA-R4 modem. The main board was previously upstreamed without modem support. Now that we have a driver to support the SARA-R4 modem, let's enable it for the Boron board. Signed-off-by: Michael Scott <[email protected]>
1 parent b606d35 commit a56e073

File tree

6 files changed

+84
-2
lines changed

6 files changed

+84
-2
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
zephyr_library()
4+
zephyr_library_sources(board.c)

boards/arm/particle_boron/Kconfig.defconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,20 @@ endif # IEEE802154
5050
config BT_CTLR
5151
default BT
5252

53+
if MODEM
54+
55+
config UART_1_NRF_UARTE
56+
default y
57+
58+
config UART_1_NRF_FLOW_CONTROL
59+
default y
60+
61+
config MODEM_UBLOX_SARA_R4
62+
default y
63+
64+
config UART_INTERRUPT_DRIVEN
65+
default y
66+
67+
endif # MODEM
68+
5369
endif # BOARD_PARTICLE_BORON

boards/arm/particle_boron/board.c

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Copyright (c) 2019 Foundries.io
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <init.h>
8+
#include "board.h"
9+
#include <gpio.h>
10+
11+
static int particle_boron_init(struct device *dev)
12+
{
13+
14+
ARG_UNUSED(dev);
15+
16+
#if defined(CONFIG_MODEM_UBLOX_SARA_R4)
17+
struct device *gpio_dev;
18+
19+
/* Enable the serial buffer for SARA-R4 modem */
20+
gpio_dev = device_get_binding(SERIAL_BUFFER_ENABLE_GPIO_NAME);
21+
if (!gpio_dev) {
22+
return -ENODEV;
23+
}
24+
25+
gpio_pin_configure(gpio_dev, V_INT_DETECT_GPIO_PIN, GPIO_DIR_IN);
26+
27+
gpio_pin_configure(gpio_dev, SERIAL_BUFFER_ENABLE_GPIO_PIN,
28+
GPIO_DIR_OUT);
29+
#endif
30+
31+
return 0;
32+
}
33+
34+
/* needs to be done after GPIO driver init */
35+
SYS_INIT(particle_boron_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);

boards/arm/particle_boron/board.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
* Copyright (c) 2019 Foundries.io
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#ifndef __INC_BOARD_H
8+
#define __INC_BOARD_H
9+
10+
/* pin used to enable the buffer power */
11+
#define SERIAL_BUFFER_ENABLE_GPIO_NAME DT_NORDIC_NRF_GPIO_0_LABEL
12+
#define SERIAL_BUFFER_ENABLE_GPIO_PIN 25
13+
14+
/* pin used to detect V_INT (buffer power) */
15+
#define V_INT_DETECT_GPIO_PIN 2
16+
17+
#endif /* __INC_BOARD_H */

boards/arm/particle_boron/particle_boron.dts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
/dts-v1/;
88
#include <nordic/nrf52840_qiaa.dtsi>
9+
#include <dt-bindings/gpio/gpio.h>
910
#include "mesh_feather.dtsi"
1011

1112
/ {
@@ -23,10 +24,20 @@
2324

2425
&uart1 { /* u-blox SARA-U2 or SARA-R4 */
2526
compatible = "nordic,nrf-uarte";
26-
current-speed = <921600>;
27+
current-speed = <115200>;
2728
status = "ok";
29+
2830
tx-pin = <37>;
2931
rx-pin = <36>;
3032
rts-pin = <39>;
3133
cts-pin = <38>;
34+
35+
sara_r4 {
36+
compatible = "ublox,sara-r4";
37+
label = "ublox-sara-r4";
38+
status = "ok";
39+
40+
mdm-power-gpios-gpio = <&gpio0 16 0>;
41+
mdm-reset-gpios-gpio = <&gpio0 12 0>;
42+
};
3243
};

boards/arm/particle_boron/particle_boron_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ CONFIG_GPIO=y
1818
# enable uart driver
1919
CONFIG_SERIAL=y
2020
CONFIG_UART_0_NRF_UARTE=y
21-
CONFIG_UART_1_NRF_UARTE=y
2221

2322
# enable power I2C interface
2423
CONFIG_I2C=y

0 commit comments

Comments
 (0)