text stringlengths 9 39.2M | dir stringlengths 25 226 | lang stringclasses 163 values | created_date timestamp[s] | updated_date timestamp[s] | repo_name stringclasses 751 values | repo_full_name stringclasses 752 values | star int64 1.01k 183k | len_tokens int64 1 18.5M |
|---|---|---|---|---|---|---|---|---|
```cmake
# This configuration allows selecting what debug adapter debugging to use
# for the SparkFun Pro Micro RP2040 by a command-line argument.
# It is mainly intended to support both the 'picoprobe' and 'raspberrypi-swd'
# adapter described in "Getting started with Raspberry Pi Pico".
# And any other SWD debug adapter might also be usable with this configuration.
# Note that the Pro Micro RP2040 SWD pins are test points on the underside
# of the board.
# Set RPI_PICO_DEBUG_ADAPTER to select debug adapter by command-line arguments.
# e.g.) west build -b rpi_pico -- -DRPI_PICO_DEBUG_ADAPTER=raspberrypi-swd
# The value is treated as a part of an interface file name that
# the debugger's configuration file.
# The value must be the 'stem' part of the name of one of the files
# in the openocd interface configuration file.
# The setting is store to CMakeCache.txt.
if ("${RPI_PICO_DEBUG_ADAPTER}" STREQUAL "")
set(RPI_PICO_DEBUG_ADAPTER "cmsis-dap")
endif()
board_runner_args(openocd --cmd-pre-init "source [find interface/${RPI_PICO_DEBUG_ADAPTER}.cfg]")
board_runner_args(openocd --cmd-pre-init "transport select swd")
board_runner_args(openocd --cmd-pre-init "source [find target/rp2040.cfg]")
# The adapter speed is expected to be set by interface configuration.
# But if not so, set 2000 to adapter speed.
board_runner_args(openocd --cmd-pre-init "set_adapter_speed_if_not_set 2000")
board_runner_args(jlink "--device=RP2040_M0_0")
board_runner_args(uf2 "--board-id=RPI-RP2")
board_runner_args(pyocd "--target=rp2040")
include(${ZEPHYR_BASE}/boards/common/uf2.board.cmake)
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
include(${ZEPHYR_BASE}/boards/common/blackmagicprobe.board.cmake)
include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)
``` | /content/code_sandbox/boards/sparkfun/pro_micro_rp2040/board.cmake | cmake | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 481 |
```unknown
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=125000000
CONFIG_RESET=y
# Enable UART driver
CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y
# Enable console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
# Enable clock control by default
CONFIG_CLOCK_CONTROL=y
# Code partition needed to target the correct flash range
CONFIG_USE_DT_CODE_PARTITION=y
# Output UF2 by default, native bootloader supports it.
CONFIG_BUILD_OUTPUT_UF2=y
``` | /content/code_sandbox/boards/sparkfun/pro_micro_rp2040/sparkfun_pro_micro_rp2040_defconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 99 |
```yaml
board:
name: sparkfun_pro_micro_rp2040
vendor: sparkfun
socs:
- name: rp2040
``` | /content/code_sandbox/boards/sparkfun/pro_micro_rp2040/board.yml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 32 |
```unknown
/*
*/
#include <dt-bindings/pinctrl/rpi-pico-rp2040-pinctrl.h>
&pinctrl {
uart0_default: uart0_default {
group1 {
pinmux = <UART0_TX_P0>;
};
group2 {
pinmux = <UART0_RX_P1>;
input-enable;
};
};
i2c1_default: i2c1_default {
group1 {
pinmux = <I2C1_SDA_P2>;
input-enable;
};
group2 {
pinmux = <I2C1_SCL_P3>;
input-enable;
};
};
spi0_default: spi0_default {
group1 {
pinmux = <SPI0_TX_P19>;
};
group2 {
pinmux = <SPI0_RX_P20>;
input-enable;
};
group3 {
pinmux = <SPI0_SCK_P18>;
};
};
adc_default: adc_default {
group1 {
pinmux = <ADC_CH0_P26>, <ADC_CH1_P27>, <ADC_CH2_P28>, <ADC_CH3_P29>;
input-enable;
};
};
clocks_default: clocks_default {
};
ws2812_pio0_default: ws2812_pio_default {
ws2812 {
pinmux = <PIO0_P25>;
};
};
};
``` | /content/code_sandbox/boards/sparkfun/pro_micro_rp2040/sparkfun_pro_micro_rp2040-pinctrl.dtsi | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 320 |
```unknown
config BOARD_SPARKFUN_PRO_MICRO_RP2040
select SOC_RP2040
``` | /content/code_sandbox/boards/sparkfun/pro_micro_rp2040/Kconfig.sparkfun_pro_micro_rp2040 | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 22 |
```unknown
if BOARD_SPARKFUN_PRO_MICRO_RP2040
config RP2_FLASH_W25Q080
default y
if I2C_DW
config I2C_DW_CLOCK_SPEED
default 125
endif # I2C_DW
config USB_SELF_POWERED
default n
endif # BOARD_SPARKFUN_PRO_MICRO_RP2040
``` | /content/code_sandbox/boards/sparkfun/pro_micro_rp2040/Kconfig.defconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 78 |
```unknown
/*
*
*/
/dts-v1/;
#include <rpi_pico/rp2040.dtsi>
#include "sparkfun_pro_micro_rp2040-pinctrl.dtsi"
#include "sparkfun_pro_micro_connector.dtsi"
#include <freq.h>
#include <zephyr/dt-bindings/led/led.h>
/ {
chosen {
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,flash-controller = &ssi;
zephyr,console = &uart0;
zephyr,code-partition = &code_partition;
};
aliases {
watchdog0 = &wdt0;
led-strip = &ws2812;
};
};
&flash0 {
/* 16MB of flash minus the 0x100 used for
* the second stage bootloader
*/
reg = <0x10000000 DT_SIZE_M(16)>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
/* Reserved memory for the second stage bootloader */
second_stage_bootloader: partition@0 {
label = "second_stage_bootloader";
reg = <0x00000000 0x100>;
read-only;
};
/*
* Usable flash. Starts at 0x100, after the bootloader. The partition
* size is 16MB minus the 0x100 bytes taken by the bootloader.
*/
code_partition: partition@100 {
label = "code-partition";
reg = <0x100 (DT_SIZE_M(16) - 0x100)>;
read-only;
};
};
};
&clocks {
pinctrl-0 = <&clocks_default>;
pinctrl-names = "default";
};
&uart0 {
current-speed = <115200>;
status = "okay";
pinctrl-0 = <&uart0_default>;
pinctrl-names = "default";
};
&i2c1 {
status = "okay";
pinctrl-0 = <&i2c1_default>;
pinctrl-names = "default";
clock-frequency = <I2C_BITRATE_FAST>;
};
&spi0 {
status = "okay";
pinctrl-0 = <&spi0_default>;
pinctrl-names = "default";
clock-frequency = <DT_FREQ_M(2)>;
};
&gpio0 {
status = "okay";
};
&wdt0 {
status = "okay";
};
&adc {
status = "okay";
pinctrl-0 = <&adc_default>;
pinctrl-names = "default";
};
&pio0 {
status = "okay";
pio-ws2812 {
compatible = "worldsemi,ws2812-rpi_pico-pio";
status = "okay";
pinctrl-0 = <&ws2812_pio0_default>;
pinctrl-names = "default";
bit-waveform = <3>, <3>, <4>;
ws2812: ws2812 {
status = "okay";
gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>;
chain-length = <1>;
color-mapping = <LED_COLOR_ID_GREEN
LED_COLOR_ID_RED
LED_COLOR_ID_BLUE>;
reset-delay = <280>;
frequency = <800000>;
};
};
};
zephyr_udc0: &usbd {
status = "okay";
};
&vreg {
regulator-always-on;
regulator-allowed-modes = <REGULATOR_RPI_PICO_MODE_NORMAL>;
};
``` | /content/code_sandbox/boards/sparkfun/pro_micro_rp2040/sparkfun_pro_micro_rp2040.dts | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 786 |
```ini
# Checking and set 'adapter speed'.
# Set the adaptor speed, if unset, and given as an argument.
proc set_adapter_speed_if_not_set { speed } {
puts "checking adapter speed..."
if { [catch {adapter speed} ret] } {
adapter speed $speed
}
}
``` | /content/code_sandbox/boards/sparkfun/pro_micro_rp2040/support/openocd.cfg | ini | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 64 |
```yaml
identifier: sparkfun_pro_micro_rp2040
name: Sparkfun Pro Micro RP2040
type: mcu
arch: arm
flash: 16384
ram: 264
toolchain:
- zephyr
- gnuarmemb
- xtools
supported:
- uart
- gpio
- adc
- i2c
- spi
- hwinfo
- watchdog
- pwm
- flash
- dma
- counter
- clock
``` | /content/code_sandbox/boards/sparkfun/pro_micro_rp2040/sparkfun_pro_micro_rp2040.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 115 |
```cmake
board_runner_args(pyocd "--target=nrf52832")
include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)
``` | /content/code_sandbox/boards/sparkfun/nrf52_sparkfun/board.cmake | cmake | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 32 |
```unknown
/*
*
*/
/dts-v1/;
#include <nordic/nrf52832_qfaa.dtsi>
#include "nrf52_sparkfun-pinctrl.dtsi"
#include <zephyr/dt-bindings/input/input-event-codes.h>
/ {
model = "Sparkfun nRF52832 Breakout";
compatible = "sparkfun,nrf52832";
chosen {
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
};
/* These aliases are provided for compatibility with samples */
aliases {
led0 = &led0;
sw0 = &button0;
watchdog0 = &wdt0;
};
leds {
compatible = "gpio-leds";
led0: led_0 {
gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
label = "LED";
};
};
buttons {
compatible = "gpio-keys";
button0: button_0 {
/* gpio flags need validation */
gpios = <&gpio0 6 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
label = "Button";
zephyr,code = <INPUT_KEY_0>;
};
};
};
&uicr {
gpio-as-nreset;
};
&gpiote {
status = "okay";
};
&gpio0 {
status = "okay";
};
&uart0 {
compatible = "nordic,nrf-uart";
current-speed = <115200>;
status = "okay";
pinctrl-0 = <&uart0_default>;
pinctrl-1 = <&uart0_sleep>;
pinctrl-names = "default", "sleep";
};
&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
boot_partition: partition@0 {
label = "mcuboot";
reg = <0x00000000 0xc000>;
};
slot0_partition: partition@c000 {
label = "image-0";
reg = <0x0000c000 0x32000>;
};
slot1_partition: partition@3e000 {
label = "image-1";
reg = <0x0003e000 0x32000>;
};
scratch_partition: partition@70000 {
label = "image-scratch";
reg = <0x00070000 0xa000>;
};
storage_partition: partition@7a000 {
label = "storage";
reg = <0x0007a000 0x00006000>;
};
};
};
``` | /content/code_sandbox/boards/sparkfun/nrf52_sparkfun/nrf52_sparkfun.dts | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 654 |
```cmake
# Suppress "unique_unit_address_if_enabled" to handle the following overlaps:
# - power@40000000 & clock@40000000 & bprot@40000000
# - acl@4001e000 & flash-controller@4001e000
list(APPEND EXTRA_DTC_FLAGS "-Wno-unique_unit_address_if_enabled")
``` | /content/code_sandbox/boards/sparkfun/nrf52_sparkfun/pre_dt_board.cmake | cmake | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 72 |
```restructuredtext
.. _sparkfun_pro_micro_rp2040:
SparkFun Pro Micro RP2040
#########################
Overview
********
The SparkFun Pro Micro RP2040 is a small, low-cost, versatile board from
SparkFun. It is equipped with an RP2040 SoC, an on-board WS2812 addressable
LED, a USB connector, and a Qwiic connector. The USB bootloader allows it
to be flashed without any adapter, in a drag-and-drop manner.
Hardware
********
- Dual core Arm Cortex-M0+ processor running up to 133MHz
- 264KB on-chip SRAM
- 16MB on-board QSPI flash with XIP capabilities
- 18 GPIO pins
- 4 Analog inputs
- 1 UART peripherals
- 1 SPI controllers
- 2 I2C controllers (one via Qwiic connector)
- 16 PWM channels
- USB 1.1 controller (host/device)
- 8 Programmable I/O (PIO) for custom peripherals
- On-board RGB LED
- 1 Watchdog timer peripheral
.. figure:: img/sparkfun_pro_micro_rp2040.jpg
:align: center
:alt: SparkFun Pro Micro RP2040
SparkFun Pro Micro RP2040 (Image courtesy of SparkFun)
Supported Features
==================
The sparkfun_pro_micro_rp2040 board configuration supports the following
hardware features:
.. list-table::
:header-rows: 1
* - Peripheral
- Kconfig option
- Devicetree compatible
* - NVIC
- N/A
- :dtcompatible:`arm,v6m-nvic`
* - UART
- :kconfig:option:`CONFIG_SERIAL`
- :dtcompatible:`raspberrypi,pico-uart`
* - GPIO
- :kconfig:option:`CONFIG_GPIO`
- :dtcompatible:`raspberrypi,pico-gpio`
* - ADC
- :kconfig:option:`CONFIG_ADC`
- :dtcompatible:`raspberrypi,pico-adc`
* - I2C
- :kconfig:option:`CONFIG_I2C`
- :dtcompatible:`snps,designware-i2c`
* - SPI
- :kconfig:option:`CONFIG_SPI`
- :dtcompatible:`raspberrypi,pico-spi`
* - USB Device
- :kconfig:option:`CONFIG_USB_DEVICE_STACK`
- :dtcompatible:`raspberrypi,pico-usbd`
* - HWINFO
- :kconfig:option:`CONFIG_HWINFO`
- N/A
* - Watchdog Timer (WDT)
- :kconfig:option:`CONFIG_WATCHDOG`
- :dtcompatible:`raspberrypi,pico-watchdog`
* - PWM
- :kconfig:option:`CONFIG_PWM`
- :dtcompatible:`raspberrypi,pico-pwm`
* - Flash
- :kconfig:option:`CONFIG_FLASH`
- :dtcompatible:`raspberrypi,pico-flash`
* - Clock controller
- :kconfig:option:`CONFIG_CLOCK_CONTROL`
- :dtcompatible:`raspberrypi,pico-clock-controller`
* - UART (PIO)
- :kconfig:option:`CONFIG_SERIAL`
- :dtcompatible:`raspberrypi,pico-uart-pio`
Pin Mapping
===========
The peripherals of the RP2040 SoC can be routed to various pins on the board.
The configuration of these routes can be modified through DTS. Please refer to
the datasheet to see the possible routings for each peripheral.
Default Zephyr Peripheral Mapping:
----------------------------------
.. rst-class:: rst-columns
- UART0_TX : P0
- UART0_RX : P1
- I2C1_SDA : P2
- I2C1_SCL : P3
- SPI0_RX : P20
- SPI0_SCK : P18
- SPI0_TX : P19
Programming and Debugging
*************************
Flashing
========
Using UF2
---------
The Pro Micro board does make the SWD pins available on pads on the
underside of the board. You can solder to these pins, and use a JTag
debugger. You can also flash the SparkFun ProMicro RP2040 with a UF2 file.
By default, building an app for this board will generate a
`build/zephyr/zephyr.uf2` file. If the Pro Micro RP2040 is powered on with
the `BOOTSEL` button pressed, it will appear on the host as a mass storage
device. The UF2 file should be copied to the device, which will
flash the Pro Micro RP2040.
.. target-notes::
.. _Getting Started with Raspberry Pi Pico:
path_to_url
.. _Graphical Datasheet:
path_to_url
``` | /content/code_sandbox/boards/sparkfun/pro_micro_rp2040/doc/index.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,052 |
```unknown
/*
*/
&pinctrl {
uart0_default: uart0_default {
group1 {
psels = <NRF_PSEL(UART_TX, 0, 27)>,
<NRF_PSEL(UART_RX, 0, 26)>;
};
};
uart0_sleep: uart0_sleep {
group1 {
psels = <NRF_PSEL(UART_TX, 0, 27)>,
<NRF_PSEL(UART_RX, 0, 26)>;
low-power-enable;
};
};
};
``` | /content/code_sandbox/boards/sparkfun/nrf52_sparkfun/nrf52_sparkfun-pinctrl.dtsi | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 124 |
```yaml
board:
name: nrf52_sparkfun
vendor: sparkfun
socs:
- name: nrf52832
``` | /content/code_sandbox/boards/sparkfun/nrf52_sparkfun/board.yml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 32 |
```yaml
identifier: nrf52_sparkfun
name: Sparkfun nRF52832 breakout
type: mcu
arch: arm
toolchain:
- zephyr
- gnuarmemb
- xtools
ram: 64
flash: 512
vendor: sparkfun
``` | /content/code_sandbox/boards/sparkfun/nrf52_sparkfun/nrf52_sparkfun.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 65 |
```unknown
# Sparkfun nRF52832 breakout board configuration
config BOARD_NRF52_SPARKFUN
select SOC_NRF52832_QFAA
``` | /content/code_sandbox/boards/sparkfun/nrf52_sparkfun/Kconfig.nrf52_sparkfun | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 31 |
```unknown
# Enable MPU
CONFIG_ARM_MPU=y
# enable GPIO
CONFIG_GPIO=y
# enable uart driver
CONFIG_SERIAL=y
# enable console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
``` | /content/code_sandbox/boards/sparkfun/nrf52_sparkfun/nrf52_sparkfun_defconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 42 |
```unknown
# Sparkfun nRF52832 breakout board configuration
if BOARD_NRF52_SPARKFUN
config BT_CTLR
default BT
endif # BOARD_NRF52_SPARKFUN
``` | /content/code_sandbox/boards/sparkfun/nrf52_sparkfun/Kconfig.defconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 40 |
```unknown
# Sparkfun nRF9160 Thing Plus configuration
config BOARD_SPARKFUN_THING_PLUS
select SOC_NRF9160_SICA
``` | /content/code_sandbox/boards/sparkfun/thing_plus/Kconfig.sparkfun_thing_plus | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 30 |
```cmake
board_runner_args(nrfjprog "--nrf-family=NRF91")
board_runner_args(jlink "--device=nRF9160_xxAA" "--speed=4000")
include(${ZEPHYR_BASE}/boards/common/nrfjprog.board.cmake)
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
``` | /content/code_sandbox/boards/sparkfun/thing_plus/board.cmake | cmake | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 71 |
```yaml
identifier: sparkfun_thing_plus/nrf9160
name: Sparkfun-Thing-Plus-nRF9160
type: mcu
arch: arm
toolchain:
- gnuarmemb
- xtools
- zephyr
ram: 64
flash: 256
supported:
- i2c
- pwm
- watchdog
- counter
vendor: sparkfun
``` | /content/code_sandbox/boards/sparkfun/thing_plus/sparkfun_thing_plus_nrf9160.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 91 |
```unknown
/*
*
*/
/dts-v1/;
#include <nordic/nrf9160ns_sica.dtsi>
#include "sparkfun_thing_plus_nrf9160_common.dtsi"
/ {
chosen {
zephyr,flash = &flash0;
zephyr,sram = &sram0_ns;
zephyr,code-partition = &slot0_ns_partition;
};
aliases {
watchdog0 = &wdt0;
};
};
``` | /content/code_sandbox/boards/sparkfun/thing_plus/sparkfun_thing_plus_nrf9160_ns.dts | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 104 |
```yaml
identifier: sparkfun_thing_plus/nrf9160/ns
name: Sparkfun-Thing-Plus-nRF9160-Non-Secure
type: mcu
arch: arm
toolchain:
- gnuarmemb
- xtools
- zephyr
ram: 128
flash: 192
supported:
- i2c
- pwm
- watchdog
vendor: sparkfun
``` | /content/code_sandbox/boards/sparkfun/thing_plus/sparkfun_thing_plus_nrf9160_ns.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 92 |
```unknown
# Enable MPU
CONFIG_ARM_MPU=y
# Enable TrustZone-M
CONFIG_ARM_TRUSTZONE_M=y
# Hardware stack protection
CONFIG_HW_STACK_PROTECTION=y
# Enable UART driver
CONFIG_SERIAL=y
# Enable console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_REGULATOR=y
``` | /content/code_sandbox/boards/sparkfun/thing_plus/sparkfun_thing_plus_nrf9160_defconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 65 |
```unknown
/*
*
*/
/dts-v1/;
#include <nordic/nrf9160_sica.dtsi>
#include "sparkfun_thing_plus_nrf9160_common.dtsi"
/ {
chosen {
zephyr,sram = &sram0_s;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
zephyr,sram-secure-partition = &sram0_s;
zephyr,sram-non-secure-partition = &sram0_ns;
};
aliases {
watchdog0 = &wdt0;
};
};
&uart0 {
status = "okay";
current-speed = <1000000>;
};
``` | /content/code_sandbox/boards/sparkfun/thing_plus/sparkfun_thing_plus_nrf9160.dts | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 155 |
```unknown
/*
*/
&pinctrl {
uart0_default: uart0_default {
group1 {
psels = <NRF_PSEL(UART_TX, 0, 6)>,
<NRF_PSEL(UART_RX, 0, 5)>;
};
};
uart0_sleep: uart0_sleep {
group1 {
psels = <NRF_PSEL(UART_TX, 0, 6)>,
<NRF_PSEL(UART_RX, 0, 5)>;
low-power-enable;
};
};
uart1_default: uart1_default {
group1 {
psels = <NRF_PSEL(UART_TX, 0, 0)>,
<NRF_PSEL(UART_RX, 0, 1)>;
};
};
uart1_sleep: uart1_sleep {
group1 {
psels = <NRF_PSEL(UART_TX, 0, 0)>,
<NRF_PSEL(UART_RX, 0, 1)>;
low-power-enable;
};
};
uart2_default: uart2_default {
group1 {
psels = <NRF_PSEL(UART_TX, 0, 24)>,
<NRF_PSEL(UART_RX, 0, 23)>;
};
};
uart2_sleep: uart2_sleep {
group1 {
psels = <NRF_PSEL(UART_TX, 0, 24)>,
<NRF_PSEL(UART_RX, 0, 23)>;
low-power-enable;
};
};
i2c1_default: i2c1_default {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 26)>,
<NRF_PSEL(TWIM_SCL, 0, 27)>;
};
};
i2c1_sleep: i2c1_sleep {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 26)>,
<NRF_PSEL(TWIM_SCL, 0, 27)>;
low-power-enable;
};
};
pwm0_default: pwm0_default {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 0, 3)>;
nordic,invert;
};
};
pwm0_sleep: pwm0_sleep {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 0, 3)>;
low-power-enable;
};
};
spi3_default: spi3_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 11)>,
<NRF_PSEL(SPIM_MOSI, 0, 9)>,
<NRF_PSEL(SPIM_MISO, 0, 28)>;
};
};
spi3_sleep: spi3_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 11)>,
<NRF_PSEL(SPIM_MOSI, 0, 9)>,
<NRF_PSEL(SPIM_MISO, 0, 28)>;
low-power-enable;
};
};
};
``` | /content/code_sandbox/boards/sparkfun/thing_plus/sparkfun_thing_plus_nrf9160_common-pinctrl.dtsi | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 733 |
```yaml
board:
name: sparkfun_thing_plus
vendor: sparkfun
socs:
- name: nrf9160
variants:
- name: 'ns'
``` | /content/code_sandbox/boards/sparkfun/thing_plus/board.yml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 41 |
```unknown
/*
*
*/
/*
* Default Flash planning for sparkfun_thing_plus_nrf9160.
*
* Zephyr build for nRF9160 with ARM TrustZone-M support,
* implies building Secure and Non-Secure Zephyr images.
*
* Secure image will be placed, by default, in flash0
* (or in slot0, if MCUboot is present).
* Secure image will use sram0 for system memory.
*
* Non-Secure image will be placed in slot0_ns, and use
* sram0_ns for system memory.
*
* Note that the Secure image only requires knowledge of
* the beginning of the Non-Secure image (not its size).
*/
&slot0_partition {
reg = <0x00010000 0x40000>;
};
&slot0_ns_partition {
reg = <0x00050000 0x30000>;
};
&slot1_partition {
reg = <0x00080000 0x40000>;
};
&slot1_ns_partition {
reg = <0x000c0000 0x30000>;
};
/* Default SRAM planning when building for nRF9160 with
* ARM TrustZone-M support
* - Lowest 64 kB SRAM allocated to Secure image (sram0_s).
* - 64 kB SRAM reserved for and used by the BSD socket
* library (sram0_bsd).
* - Upper 128 kB allocated to Non-Secure image (sram0_ns).
*/
&sram0_s {
reg = <0x20000000 DT_SIZE_K(64)>;
};
&sram0_bsd {
reg = <0x20010000 DT_SIZE_K(64)>;
};
&sram0_ns {
reg = <0x20020000 DT_SIZE_K(128)>;
};
``` | /content/code_sandbox/boards/sparkfun/thing_plus/sparkfun_thing_plus_nrf9160_partition_conf.dtsi | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 375 |
```unknown
# Circuit Dojo nRF9160 Feather configuration
if BOARD_SPARKFUN_THING_PLUS
# For the secure version of the board the firmware is linked at the beginning
# of the flash, or into the code-partition defined in DT if it is intended to
# be loaded by MCUboot. If the secure firmware is to be combined with a non-
# secure image (TRUSTED_EXECUTION_SECURE=y), the secure FW image shall always
# be restricted to the size of its code partition.
# For the non-secure version of the board, the firmware
# must be linked into the code-partition (non-secure) defined in DT, regardless.
# Apply this configuration below by setting the Kconfig symbols used by
# the linker according to the information extracted from DT partitions.
# Workaround for not being able to have commas in macro arguments
DT_CHOSEN_Z_CODE_PARTITION := zephyr,code-partition
config FLASH_LOAD_SIZE
default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
depends on BOARD_SPARKFUN_THING_PLUS_NRF9160 && TRUSTED_EXECUTION_SECURE
if BOARD_SPARKFUN_THING_PLUS_NRF9160_NS
config FLASH_LOAD_OFFSET
default $(dt_chosen_reg_addr_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
config FLASH_LOAD_SIZE
default $(dt_chosen_reg_size_hex,$(DT_CHOSEN_Z_CODE_PARTITION))
endif # BOARD_SPARKFUN_THING_PLUS_NRF9160
endif # BOARD_SPARKFUN_THING_PLUS
``` | /content/code_sandbox/boards/sparkfun/thing_plus/Kconfig.defconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 321 |
```unknown
# Sparkfun nRF9160 Thing Plus configuration
config BOARD_SPARKFUN_THING_PLUS
# The GPIO driver is required by this board's initialization code
# (board.c), so it is forced here to be enabled always, not only
# enabled by default (in defconfig).
select GPIO
``` | /content/code_sandbox/boards/sparkfun/thing_plus/Kconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 67 |
```unknown
# Enable MPU
CONFIG_ARM_MPU=y
# Enable TrustZone-M
CONFIG_ARM_TRUSTZONE_M=y
# This Board implies building Non-Secure firmware
CONFIG_TRUSTED_EXECUTION_NONSECURE=y
# Hardware stack protection
CONFIG_HW_STACK_PROTECTION=y
# Enable UART driver
CONFIG_SERIAL=y
# Enable console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_REGULATOR=y
``` | /content/code_sandbox/boards/sparkfun/thing_plus/sparkfun_thing_plus_nrf9160_ns_defconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 86 |
```unknown
/*
*
*/
#include "sparkfun_thing_plus_nrf9160_common-pinctrl.dtsi"
#include <zephyr/dt-bindings/input/input-event-codes.h>
/ {
model = "Sparkfun nRF9160 Thing Plus";
compatible = "sparkfun,thing-plus-nrf9160";
chosen {
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,uart-mcumgr = &uart0;
};
leds {
compatible = "gpio-leds";
blue_led: led_0 {
gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
label = "Blue LED (D7)";
};
};
pwmleds {
compatible = "pwm-leds";
pwm_led0: pwm_led_0 {
pwms = <&pwm0 0 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
};
};
buttons {
compatible = "gpio-keys";
button0: button_0 {
gpios = <&gpio0 12 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
label = "Switch 1";
zephyr,code = <INPUT_KEY_0>;
};
};
/* TPS63031 Buck/Boost converter (provides 3.3V) */
pwr-3v3 {
compatible = "regulator-fixed";
regulator-name = "pwr-3v3";
enable-gpios = <&gpio0 31 GPIO_ACTIVE_HIGH>;
regulator-always-on;
};
/* These aliases are provided for compatibility with samples */
aliases {
led0 = &blue_led;
bootloader-led0 = &blue_led;
pwm-led0 = &pwm_led0;
sw0 = &button0;
mcuboot-button0 = &button0;
mcuboot-led0 = &blue_led;
watchdog0 = &wdt0;
accel0 = &lis2dh;
};
/* Used for accessing other pins */
feather_header: feather_connector {
compatible = "adafruit-feather-header";
#gpio-cells = <2>;
gpio-map-mask = <0xffffffff 0xffffffc0>;
gpio-map-pass-thru = <0 0x3f>;
gpio-map = <12 0 &gpio0 26 0>, /* SDA */
<13 0 &gpio0 27 0>, /* SCL */
<14 0 &gpio0 29 0>, /* PWM3 */
<15 0 &gpio0 30 0>, /* PWM3 */
<16 0 &gpio0 0 0>, /* PWM1 */
<17 0 &gpio0 1 0>, /* PWM1 */
<18 0 &gpio0 2 0>, /* PWM1 */
<19 0 &gpio0 3 0>, /* PWM0 */
<20 0 &gpio0 4 0>, /* PWM1 */
/* 11 not connected */
<10 0 &gpio0 24 0>, /* TX */
<9 0 &gpio0 23 0>, /* RX */
<8 0 &gpio0 22 0>, /* MISO */
<7 0 &gpio0 21 0>, /* MOSI */
<6 0 &gpio0 19 0>, /* SCK */
<5 0 &gpio0 18 0>, /* SS */
<4 0 &gpio0 17 0>, /* ADC4 = AIN6 */
<3 0 &gpio0 16 0>, /* ADC3 = AIN5 */
<2 0 &gpio0 15 0>, /* ADC2 = AIN4 */
<1 0 &gpio0 14 0>, /* ADC1 = AIN2 */
<0 0 &gpio0 13 0>; /* ADC0 = AIN1 */
};
};
&adc {
status = "okay";
};
&gpiote {
status = "okay";
};
&gpio0 {
status = "okay";
};
&uart0 {
status = "okay";
current-speed = <115200>;
pinctrl-0 = <&uart0_default>;
pinctrl-1 = <&uart0_sleep>;
pinctrl-names = "default", "sleep";
};
&uart1 {
current-speed = <115200>;
pinctrl-0 = <&uart1_default>;
pinctrl-1 = <&uart1_sleep>;
pinctrl-names = "default", "sleep";
};
&uart2 {
pinctrl-0 = <&uart2_default>;
pinctrl-1 = <&uart2_sleep>;
pinctrl-names = "default", "sleep";
};
&i2c1 {
compatible = "nordic,nrf-twim";
status = "okay";
pinctrl-0 = <&i2c1_default>;
pinctrl-1 = <&i2c1_sleep>;
pinctrl-names = "default", "sleep";
pcf85063a@51 {
compatible = "nxp,pcf85063a";
reg = <0x51>;
};
lis2dh: lis2dh@18 {
compatible = "st,lis2dh";
reg = <0x18>;
irq-gpios = <&gpio0 29 0>;
};
};
&pwm0 {
status = "okay";
pinctrl-0 = <&pwm0_default>;
pinctrl-1 = <&pwm0_sleep>;
pinctrl-names = "default", "sleep";
};
&spi3 {
compatible = "nordic,nrf-spim";
status = "okay";
cs-gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
pinctrl-0 = <&spi3_default>;
pinctrl-1 = <&spi3_sleep>;
pinctrl-names = "default", "sleep";
w25q32jv: w25q32jv@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <40000000>;
wp-gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
hold-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
size = <0x2000000>;
has-dpd;
t-enter-dpd = <3000>;
t-exit-dpd = <30000>;
jedec-id = [ ef 40 16 ];
};
};
&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
boot_partition: partition@0 {
label = "mcuboot";
reg = <0x00000000 0x10000>;
};
slot0_partition: partition@10000 {
label = "image-0";
};
slot0_ns_partition: partition@50000 {
label = "image-0-nonsecure";
};
slot1_partition: partition@80000 {
label = "image-1";
};
slot1_ns_partition: partition@c0000 {
label = "image-1-nonsecure";
};
/* 0xf0000 to 0xf7fff reserved for TF-M partitions */
storage_partition: partition@f8000 {
label = "storage";
reg = <0x000f8000 0x00008000>;
};
};
};
/ {
reserved-memory {
#address-cells = <1>;
#size-cells = <1>;
ranges;
sram0_s: image_s@20000000 {
/* Secure image memory */
};
sram0_bsd: image_bsd@20010000 {
/* BSD (shared) memory */
};
sram0_ns: image_ns@20020000 {
/* Non-Secure image memory */
};
};
};
/ {
vbatt {
compatible = "voltage-divider";
io-channels = <&adc 7>;
output-ohms = <100000>;
full-ohms = <(100000 + 100000)>;
power-gpios = <&gpio0 25 0>;
};
};
/* Include partition configuration file */
#include "sparkfun_thing_plus_nrf9160_partition_conf.dtsi"
``` | /content/code_sandbox/boards/sparkfun/thing_plus/sparkfun_thing_plus_nrf9160_common.dtsi | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,907 |
```restructuredtext
.. _boards-arduino:
Arduino
#######
.. toctree::
:maxdepth: 1
:glob:
**/*
``` | /content/code_sandbox/boards/arduino/index.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 31 |
```cmake
include(${ZEPHYR_BASE}/boards/common/bossac.board.cmake)
``` | /content/code_sandbox/boards/arduino/mkrzero/board.cmake | cmake | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 19 |
```unknown
/*
*/
/ {
arduino_mkr_header: connector {
compatible = "arduino-mkr-header";
#gpio-cells = <2>;
gpio-map-mask = <0xffffffff 0xffffffc0>;
gpio-map-pass-thru = <0 0x3f>;
gpio-map = <0 0 &porta 22 0>, /* D0 */
<1 0 &porta 23 0>, /* D1 */
<2 0 &porta 10 0>, /* D2 */
<3 0 &porta 11 0>, /* D3 */
<4 0 &portb 10 0>, /* D4 */
<5 0 &portb 11 0>, /* D5 */
<6 0 &porta 20 0>, /* D6 */
<7 0 &porta 21 0>, /* D7 */
<8 0 &porta 16 0>, /* D8 / SPI-COPI */
<9 0 &porta 17 0>, /* D9 / SPI-SCK */
<10 0 &porta 19 0>, /* D10 / SPI-CIPO */
<11 0 &porta 8 0>, /* D11 / I2C-SDA */
<12 0 &porta 9 0>, /* D12 / I2C-SCL */
<13 0 &portb 23 0>, /* D13 / UART-RX */
<14 0 &portb 22 0>, /* D14 / UART-TX */
<15 0 &porta 2 0>, /* D15 / A0 */
<16 0 &portb 2 0>, /* D16 / A1 */
<17 0 &portb 3 0>, /* D17 / A2 */
<18 0 &porta 4 0>, /* D18 / A3 */
<19 0 &porta 5 0>, /* D19 / A4 */
<20 0 &porta 6 0>, /* D20 / A5 */
<21 0 &porta 7 0>; /* D21 / A6 */
};
};
arduino_mkr_i2c: &sercom0 {};
arduino_mkr_spi: &sercom1 {};
arduino_mkr_serial: &sercom5 {};
``` | /content/code_sandbox/boards/arduino/mkrzero/arduino_mkr_connector.dtsi | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 578 |
```unknown
CONFIG_SOC_ATMEL_SAMD_XOSC32K=y
CONFIG_SOC_ATMEL_SAMD_XOSC32K_AS_MAIN=y
CONFIG_BOOTLOADER_BOSSA=y
CONFIG_BOOTLOADER_BOSSA_ARDUINO=y
CONFIG_CONSOLE=y
CONFIG_SERIAL=y
CONFIG_UART_CONSOLE=y
CONFIG_UART_INTERRUPT_DRIVEN=y
``` | /content/code_sandbox/boards/arduino/mkrzero/arduino_mkrzero_defconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 72 |
```restructuredtext
.. _sparkfun_thing_plus_nrf9160:
nRF9160 Thing Plus
##################
.. figure:: img/sparkfun_thing_plus_nrf9160.jpg
:align: center
:alt: Sparkfun nRF9160 Thing Plus
nRF9160 Thing Plus (Credit: Sparkfun)
Overview
********
The nRF9160 Thing Plus designed by Circuit Dojo is a single-board development
for bringing your LTE-M and NB-IoT applications to life. The sparkfun_thing_plus_nrf9160
board configuration leverages the pre-existing support for the Nordic Semiconductor
nRF9160. Supported nRF9160 peripherals include:
* :abbr:`ADC (Analog to Digital Converter)`
* CLOCK
* FLASH
* :abbr:`GPIO (General Purpose Input Output)`
* :abbr:`I2C (Inter-Integrated Circuit)`
* :abbr:`MPU (Memory Protection Unit)`
* :abbr:`NVIC (Nested Vectored Interrupt Controller)`
* :abbr:`PWM (Pulse Width Modulation)`
* :abbr:`RTC (nRF RTC System Clock)`
* Segger RTT (RTT Console)
* :abbr:`SPI (Serial Peripheral Interface)`
* :abbr:`UARTE (Universal asynchronous receiver-transmitter with EasyDMA)`
* :abbr:`WDT (Watchdog Timer)`
* :abbr:`IDAU (Implementation Defined Attribution Unit)`
More information about the board can be found at the
`nRF9160 Thing Plus Documentation`_.
Hardware
********
Connections and IOs
===================
The nRF9160 Thing Plus has everything you know and love about
the Feather platform. Here are some of the highlights:
LED
---
* D7 (blue) = P0.03
Push buttons and Switches
-------------------------
* MODE = P0.12
* RESET
USB
---
Contains a USB/UART connection for both debugging and loading new
code using a UART Enabled MCUBoot.
Standard Battery Connection
----------------------------
The nRF9160 Thing Plus has a 2 pin battery connector on board. Lithium Polymer batteries >
300mA required.
Nano SIM Holder
---------------
The nRF9160 Thing Plus has a built-in nano SIM (4FF) holder located
on the bottom side.
Programming and Debugging
*************************
sparkfun_thing_plus_nrf9160 can be used with most programmers like:
* J-Link (the nRF53-DK is recommended)
* CMSIS-DAP based programmers
Check out `Getting Started`_ for more info.
Building an application
=======================
In most cases you'll want to use the ``ns`` target with any of the Zephyr
or Nordic based examples.
Some of the examples do not use secure mode, so they do not required the ``ns`` suffix.
A great example of this is the `hello_world` below.
Flashing
========
Follow the instructions in the :ref:`nordic_segger` page to install
and configure all the necessary software. Further information can be
found in :ref:`nordic_segger_flashing`. Then build and flash
applications as usual (see :ref:`build_an_application` and
:ref:`application_run` for more details).
Here is an example for the :ref:`hello_world` application.
First, run your favorite terminal program to listen for output.
.. code-block:: console
$ screen /dev/<tty_device> 115200
Replace :code:`<tty_device>` with the port where the nRF9160 Thing Plus
can be found. In most cases (On Linux/Mac) it will be: :code:`/dev/tty.SLAB_USBtoUART`.
Then build and flash the application in the usual way.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: sparkfun_thing_plus_nrf9160
:goals: build flash
Debugging
=========
Refer to the :ref:`nordic_segger` page to learn about debugging Nordic boards with a
Segger IC.
Testing the LEDs and buttons on the nRF9160 Thing Plus
******************************************************
There are 2 samples that allow you to test that the buttons (switches) and LEDs on
the board are working properly with Zephyr:
* :zephyr:code-sample:`blinky`
* :zephyr:code-sample:`button`
You can build and flash the examples to make sure Zephyr is running correctly on
your board. The button and LED definitions can be found in
:zephyr_file:`boards/sparkfun/thing_plus/sparkfun_thing_plus_nrf9160_common.dtsi`.
References
**********
.. target-notes::
**Side note** This page was based on the documentation for the nRF9160 DK. Thanks to Nordic for
developing a great platform!
.. _nRF9160 Thing Plus Documentation: path_to_url
.. _Getting Started: path_to_url
``` | /content/code_sandbox/boards/sparkfun/thing_plus/doc/index.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,043 |
```cmake
# SPI is implemented via sercom so node name isn't spi@...
list(APPEND EXTRA_DTC_FLAGS "-Wno-spi_bus_bridge")
# Suppress "unique_unit_address_if_enabled" to handle the following overlaps:
# - /soc/pinmux@41004400 & /soc/gpio@41004400
# - /soc/pinmux@41004480 & /soc/gpio@41004480
list(APPEND EXTRA_DTC_FLAGS "-Wno-unique_unit_address_if_enabled")
``` | /content/code_sandbox/boards/arduino/mkrzero/pre_dt_board.cmake | cmake | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 104 |
```yaml
board:
name: arduino_mkrzero
vendor: arduino
socs:
- name: samd21g18a
``` | /content/code_sandbox/boards/arduino/mkrzero/board.yml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 33 |
```yaml
identifier: arduino_mkrzero
name: Arduino MKRZERO
type: mcu
arch: arm
ram: 32
flash: 256
toolchain:
- zephyr
- gnuarmemb
- xtools
supported:
- adc
- counter
- dac
- dma
- gpio
- hwinfo
- pwm
- spi
- uart
- usb_device
- watchdog
vendor: arduino
``` | /content/code_sandbox/boards/arduino/mkrzero/arduino_mkrzero.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 109 |
```unknown
config BOARD_ARDUINO_MKRZERO
select SOC_SAMD21G18A
``` | /content/code_sandbox/boards/arduino/mkrzero/Kconfig.arduino_mkrzero | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 21 |
```unknown
# Arduino MKR Zero board configuration
if DISK_DRIVERS
config DISK_DRIVER_SDMMC
default y
config SPI
default y
config GPIO
default y
endif # DISK_DRIVERS
``` | /content/code_sandbox/boards/arduino/mkrzero/Kconfig.defconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 44 |
```unknown
/*
*/
#include <dt-bindings/pinctrl/samd21-da1gXabcd-pinctrl.h>
&pinctrl {
dac_default: dac_default {
group1 {
pinmux = <PA2B_DAC_VOUT>;
};
};
sercom0_i2c_default: sercom0_i2c_default {
group1 {
pinmux = <PA8C_SERCOM0_PAD0>,
<PA9C_SERCOM0_PAD1>;
};
};
sercom1_spi_default: sercom1_spi_default {
group1 {
pinmux = <PA16C_SERCOM1_PAD0>,
<PA17C_SERCOM1_PAD1>,
<PA19C_SERCOM1_PAD3>;
};
};
sercom2_spi_default: sercom2_spi_default {
group1 {
pinmux = <PA12C_SERCOM2_PAD0>,
<PA13C_SERCOM2_PAD1>,
<PA15C_SERCOM2_PAD3>;
};
};
sercom3_uart_default: sercom3_uart_default {
group1 {
pinmux = <PA23C_SERCOM3_PAD1>,
<PA22C_SERCOM3_PAD0>;
};
};
sercom5_uart_default: sercom5_uart_default {
group1 {
pinmux = <PB23D_SERCOM5_PAD3>,
<PB22D_SERCOM5_PAD2>;
};
};
usb_dc_default: usb_dc_default {
group1 {
pinmux = <PA25G_USB_DP>,
<PA24G_USB_DM>;
};
};
};
``` | /content/code_sandbox/boards/arduino/mkrzero/arduino_mkrzero-pinctrl.dtsi | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 362 |
```unknown
/*
*
*/
/dts-v1/;
#include <atmel/samd21.dtsi>
#include <atmel/samx2xx18.dtsi>
#include "arduino_mkrzero-pinctrl.dtsi"
#include "arduino_mkr_connector.dtsi"
/ {
model = "Arduino MKR Zero";
compatible = "arduino,mkrzero";
chosen {
zephyr,console = &sercom5;
zephyr,shell-uart = &sercom5;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &code_partition;
};
leds {
compatible = "gpio-leds";
led0: led_0 {
gpios = <&portb 8 0>;
label = "LED";
};
};
aliases {
led0 = &led0;
sdhc0 = &sdhc0;
};
};
&cpu0 {
clock-frequency = <48000000>;
};
&sercom0 {
status = "okay";
compatible = "atmel,sam0-i2c";
clock-frequency = <I2C_BITRATE_FAST>;
#address-cells = <1>;
#size-cells = <0>;
pinctrl-0 = <&sercom0_i2c_default>;
pinctrl-names = "default";
atecc508a@c0 {
compatible = "atmel,atecc508";
reg = <0xc0>;
};
};
&sercom1 {
status = "okay";
compatible = "atmel,sam0-spi";
dipo = <3>;
dopo = <0>;
#address-cells = <1>;
#size-cells = <0>;
pinctrl-0 = <&sercom1_spi_default>;
pinctrl-names = "default";
};
&sercom2 {
status = "okay";
compatible = "atmel,sam0-spi";
dipo = <3>;
dopo = <0>;
#address-cells = <1>;
#size-cells = <0>;
pinctrl-0 = <&sercom2_spi_default>;
pinctrl-names = "default";
cs-gpios = <&porta 14 GPIO_ACTIVE_LOW>;
sdhc0: sdhc@0 {
compatible = "zephyr,sdhc-spi-slot";
reg = <0>;
status = "okay";
spi-max-frequency = <1000000>;
mmc {
compatible = "zephyr,sdmmc-disk";
status = "okay";
};
};
};
&sercom5 {
status = "okay";
compatible = "atmel,sam0-uart";
current-speed = <115200>;
rxpo = <3>;
txpo = <1>;
pinctrl-0 = <&sercom5_uart_default>;
pinctrl-names = "default";
};
&dac0 {
status = "okay";
pinctrl-0 = <&dac_default>;
pinctrl-names = "default";
};
&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
boot_partition: partition@0 {
label = "bootloader";
reg = <0x00000000 0x2000>;
read-only;
};
code_partition: partition@2000 {
label = "code";
reg = <0x2000 0x3A000>;
read-only;
};
/*
* The final 16 KiB is reserved for the application.
* Storage partition will be used by FCB/LittleFS/NVS
* if enabled.
*/
storage_partition: partition@3c000 {
label = "storage";
reg = <0x0003c000 0x00004000>;
};
};
};
zephyr_udc0: &usb0 {
status = "okay";
pinctrl-0 = <&usb_dc_default>;
pinctrl-names = "default";
};
``` | /content/code_sandbox/boards/arduino/mkrzero/arduino_mkrzero.dts | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 898 |
```unknown
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=48000000
CONFIG_BUILD_OUTPUT_HEX=y
# Enable UART driver
CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y
# Enable console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
# Enable GPIO
CONFIG_GPIO=y
CONFIG_PINCTRL=y
CONFIG_CLOCK_CONTROL=y
CONFIG_USE_DT_CODE_PARTITION=y
``` | /content/code_sandbox/boards/arduino/uno_r4/arduino_uno_r4_wifi_defconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 76 |
```unknown
/*
*
*/
/dts-v1/;
#include "arduino_uno_r4_common.dtsi"
#include "arduino_uno_r4_minima-pinctrl.dtsi"
/ {
model = "Arduino Uno R4 Minima";
leds {
compatible = "gpio-leds";
led: led {
gpios = <&ioport1 11 GPIO_ACTIVE_HIGH>;
};
};
aliases {
led0 = &led;
};
arduino_header: connector {
compatible = "arduino-header-r3";
#gpio-cells = <2>;
gpio-map-mask = <0xffffffff 0xffffffc0>;
gpio-map-pass-thru = <0 0x3f>;
gpio-map = <0 0 &ioport0 14 0>, /* A0 */
<1 0 &ioport0 0 0>, /* A1 */
<2 0 &ioport0 1 0>, /* A2 */
<3 0 &ioport0 2 0>, /* A3 */
<4 0 &ioport1 1 0>, /* A4 */
<5 0 &ioport1 0 0>, /* A5 */
<6 0 &ioport3 1 0>, /* D0 */
<7 0 &ioport3 2 0>, /* D1 */
<8 0 &ioport1 5 0>, /* D2 */
<9 0 &ioport1 4 0>, /* D3 */
<10 0 &ioport1 3 0>, /* D4 */
<11 0 &ioport1 2 0>, /* D5 */
<12 0 &ioport1 6 0>, /* D6 */
<13 0 &ioport1 7 0>, /* D7 */
<14 0 &ioport3 4 0>, /* D8 */
<15 0 &ioport3 3 0>, /* D9 */
<16 0 &ioport1 12 0>, /* D10 */
<17 0 &ioport1 9 0>, /* D11 */
<18 0 &ioport1 10 0>, /* D12 */
<19 0 &ioport1 11 0>, /* D13 */
<20 0 &ioport1 1 0>, /* D14 */
<21 0 &ioport1 0 0>; /* D15 */
};
};
``` | /content/code_sandbox/boards/arduino/uno_r4/arduino_uno_r4_minima.dts | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 580 |
```cmake
board_runner_args(pyocd "--target=r7fa4m1ab")
include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)
``` | /content/code_sandbox/boards/arduino/uno_r4/board.cmake | cmake | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 35 |
```restructuredtext
.. _arduino_mkrzero:
Arduino MKR Zero
####################
Overview
********
The Arduino MKR Zero built with smaller MKR form factor and powered by Atmel's SAMD21 MCU.
This board come with microSD card holder that allows you to play with music files with no extra hardware.
.. image:: img/arduino_mkrzero.jpg
:align: center
:alt: Arduino MKR Zero
Hardware
********
- ATSAMD21G18A ARM Cortex-M0+ processor at 48 MHz
- 32.768 kHz crystal oscillator
- 256 KiB flash memory and 32 KiB of RAM
- One user LEDs
- One reset button
- microSD card slot
- ATECC508A secure element
Supported Features
==================
The arduino_mkrzero board configuration supports the following hardware
features:
+-----------+------------+------------------------------------------+
| Interface | Controller | Driver/Component |
+===========+============+==========================================+
| ADC | on-chip | Analog to digital converter |
+-----------+------------+------------------------------------------+
| COUNTER | on-chip | Pulse counter |
+-----------+------------+------------------------------------------+
| DMA | on-chip | Direct memory access unit |
+-----------+------------+------------------------------------------+
| Flash | on-chip | Can be used with LittleFS to store files |
+-----------+------------+------------------------------------------+
| GPIO | on-chip | I/O ports |
+-----------+------------+------------------------------------------+
| HWINFO | on-chip | Hardware info and serial number |
+-----------+------------+------------------------------------------+
| NVIC | on-chip | nested vector interrupt controller |
+-----------+------------+------------------------------------------+
| PWM | on-chip | Pulse Width Modulation |
+-----------+------------+------------------------------------------+
| SPI | on-chip | Serial Peripheral Interface ports |
+-----------+------------+------------------------------------------+
| I2C | on-chip | Inter-Integrated Circuit ports |
+-----------+------------+------------------------------------------+
| SYSTICK | on-chip | systick |
+-----------+------------+------------------------------------------+
| USART | on-chip | Serial ports |
+-----------+------------+------------------------------------------+
| USB | on-chip | USB device |
+-----------+------------+------------------------------------------+
| WDT | on-chip | Watchdog |
+-----------+------------+------------------------------------------+
Other hardware features are not currently supported by Zephyr.
The default configuration can be found in the Kconfig
:zephyr_file:`boards/arduino/mkrzero/arduino_mkrzero_defconfig`.
Connections and IOs
===================
The `Arduino store`_ has detailed information about board
connections. Download the `Arduino MKR Zero Schematic`_ for more detail.
System Clock
============
The SAMD21 MCU is configured to use the 32.768 kHz external oscillator
with the on-chip PLL generating the 48 MHz system clock. The internal
APB and GCLK unit are set up in the same way as the upstream Arduino
libraries.
Serial Port
===========
The SAMD21 MCU has 6 SERCOM based USARTs. SERCOM5 is available on pins 13(PA23) and 14(PA22).
PWM
===
The SAMD21 MCU has 3 TCC based PWM units with up to 4 outputs each and a period
of 24 bits or 16 bits.
SPI Port
========
The SAMD21 MCU has 6 SERCOM based SPIs. On the Arduino MKR Zero, SERCOM1
is available on pin 8, 9, and 10.
SERCOM2 connect to microSD card slot as SPI interface.
I2C Port
========
The SAMD21 MCU has 6 SERCOM based I2Cs. SERCOM0 is available on pin 11(PA08) and 12(PA09).
This I2C bus also available as ESLOV(JST SH 5pin) socket.
ATECC508A secure element is connect to this I2C bus.
USB Device Port
===============
The SAMD21 MCU has a USB device port that can be used to communicate
with a host PC. See the :ref:`usb-samples` sample applications for
more, such as the :zephyr:code-sample:`usb-cdc-acm` sample which sets up a virtual
serial port that echos characters back to the host PC.
DAC
===
The SAMD21 MCU has a single channel DAC with 10 bits of resolution. On the
Arduino MKR Zero, the DAC is available on pin A0.
Programming and Debugging
*************************
The Arduino MKR Zero ships the BOSSA compatible bootloader. The
bootloader can be entered by quickly tapping the reset button twice.
Flashing
========
#. Build the Zephyr kernel and the :ref:`hello_world` sample application:
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: arduino_mkrzero
:goals: build
:compact:
#. Connect the MKR Zero to your host computer using USB
#. Connect a 3.3 V USB to serial adapter to the board and to the
host. See the `Serial Port`_ section above for the board's pin
connections.
#. Run your favorite terminal program to listen for output. Under Linux the
terminal should be :code:`/dev/ttyACM0`. For example:
.. code-block:: console
$ minicom -D /dev/ttyACM0 -o
The -o option tells minicom not to send the modem initialization
string. Connection should be configured as follows:
- Speed: 115200
- Data: 8 bits
- Parity: None
- Stop bits: 1
#. Tap the reset button twice quickly to enter bootloader mode
#. Flash the image:
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: arduino_mkrzero
:goals: flash
:compact:
You should see "Hello World! arduino_mkrzero" in your terminal.
References
**********
.. target-notes::
.. _Arduino Store:
path_to_url
.. _Arduino MKR Zero Schematic:
path_to_url
``` | /content/code_sandbox/boards/arduino/mkrzero/doc/index.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,375 |
```unknown
/*
*
*/
#include <zephyr/dt-bindings/pinctrl/renesas/pinctrl-r7fa4m1xxxxxx.h>
&pinctrl {
sci2_default: sci2_default {
group1 {
pinmux = <P301_RXD2>, <P302_TXD2>;
};
};
};
``` | /content/code_sandbox/boards/arduino/uno_r4/arduino_uno_r4_wifi-pinctrl.dtsi | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 75 |
```unknown
config BOARD_ARDUINO_UNO_R4_MINIMA
select SOC_R7FA4M1AB3CFM
``` | /content/code_sandbox/boards/arduino/uno_r4/Kconfig.arduino_uno_r4_minima | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 28 |
```yaml
identifier: arduino_uno_r4_wifi
name: Arduino Uno R4 WiFi
type: mcu
arch: arm
toolchain:
- zephyr
- gnuarmemb
- xtools
ram: 32
supported:
- gpio
- uart
``` | /content/code_sandbox/boards/arduino/uno_r4/arduino_uno_r4_wifi.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 64 |
```unknown
/*
*
*/
#include <zephyr/dt-bindings/pinctrl/renesas/pinctrl-r7fa4m1xxxxxx.h>
&pinctrl {
sci2_default: sci2_default {
group1 {
pinmux = <P301_RXD2>, <P302_TXD2>;
};
};
};
``` | /content/code_sandbox/boards/arduino/uno_r4/arduino_uno_r4_minima-pinctrl.dtsi | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 75 |
```unknown
/*
*
*/
/dts-v1/;
#include <renesas/ra/r7fa4m1ab3cfm.dtsi>
#include <zephyr/dt-bindings/gpio/gpio.h>
/ {
model = "Arduino Uno R4 Board";
compatible = "renesas,r7fa4m1ab3cfm";
chosen {
zephyr,console = &uart2;
zephyr,shell-uart = &uart2;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &code_partition;
};
};
&sci2 {
status = "okay";
pinctrl-0 = <&sci2_default>;
pinctrl-names = "default";
uart2: uart {
current-speed = <115200>;
status = "okay";
};
};
&ioport1 {
status = "okay";
};
&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
boot_partition: partition@0 {
label = "bootloader";
reg = <0x00000000 0x4000>;
read-only;
};
code_partition: partition@4000 {
label = "code";
reg = <0x4000 0x3C000>;
read-only;
};
};
};
&fcu {
status = "okay";
};
&hoco {
status = "okay";
clock-frequency = <48000000>;
};
&cgc {
clock-source = <&hoco>;
iclk-div = <1>;
pclka-div = <1>;
pclkb-div = <2>;
pclkc-div = <1>;
pclkd-div = <1>;
fclk-div = <2>;
};
``` | /content/code_sandbox/boards/arduino/uno_r4/arduino_uno_r4_common.dtsi | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 403 |
```yaml
boards:
- name: arduino_uno_r4_minima
vendor: arduino
socs:
- name: r7fa4m1ab3cfm
- name: arduino_uno_r4_wifi
vendor: arduino
socs:
- name: r7fa4m1ab3cfm
``` | /content/code_sandbox/boards/arduino/uno_r4/board.yml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 78 |
```unknown
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=48000000
CONFIG_BUILD_OUTPUT_HEX=y
# Enable UART driver
CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y
# Enable console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
# Enable GPIO
CONFIG_GPIO=y
CONFIG_PINCTRL=y
CONFIG_CLOCK_CONTROL=y
CONFIG_USE_DT_CODE_PARTITION=y
``` | /content/code_sandbox/boards/arduino/uno_r4/arduino_uno_r4_minima_defconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 76 |
```unknown
config BOARD_ARDUINO_UNO_R4_WIFI
select SOC_R7FA4M1AB3CFM
``` | /content/code_sandbox/boards/arduino/uno_r4/Kconfig.arduino_uno_r4_wifi | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 27 |
```yaml
identifier: arduino_uno_r4_minima
name: Arduino Uno R4 Minima
type: mcu
arch: arm
toolchain:
- zephyr
- gnuarmemb
- xtools
ram: 32
supported:
- gpio
- uart
``` | /content/code_sandbox/boards/arduino/uno_r4/arduino_uno_r4_minima.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 66 |
```unknown
/*
*
*/
/dts-v1/;
#include "arduino_uno_r4_common.dtsi"
#include "arduino_uno_r4_wifi-pinctrl.dtsi"
/ {
model = "Arduino Uno R4 WiFi";
leds {
compatible = "gpio-leds";
led: led {
gpios = <&ioport1 2 GPIO_ACTIVE_HIGH>;
};
};
aliases {
led0 = &led;
};
arduino_header: connector {
compatible = "arduino-header-r3";
#gpio-cells = <2>;
gpio-map-mask = <0xffffffff 0xffffffc0>;
gpio-map-pass-thru = <0 0x3f>;
gpio-map = <0 0 &ioport0 14 0>, /* A0 */
<1 0 &ioport0 0 0>, /* A1 */
<2 0 &ioport0 1 0>, /* A2 */
<3 0 &ioport0 2 0>, /* A3 */
<4 0 &ioport1 1 0>, /* A4 */
<5 0 &ioport1 0 0>, /* A5 */
<6 0 &ioport3 1 0>, /* D0 */
<7 0 &ioport3 2 0>, /* D1 */
<8 0 &ioport1 4 0>, /* D2 */
<9 0 &ioport1 5 0>, /* D3 */
<10 0 &ioport1 6 0>, /* D4 */
<11 0 &ioport1 7 0>, /* D5 */
<12 0 &ioport1 11 0>, /* D6 */
<13 0 &ioport1 12 0>, /* D7 */
<14 0 &ioport3 4 0>, /* D8 */
<15 0 &ioport3 3 0>, /* D9 */
<16 0 &ioport1 3 0>, /* D10 */
<17 0 &ioport4 11 0>, /* D11 */
<18 0 &ioport4 10 0>, /* D12 */
<19 0 &ioport1 2 0>, /* D13 */
<20 0 &ioport1 1 0>, /* D14 */
<21 0 &ioport1 0 0>; /* D15 */
};
};
``` | /content/code_sandbox/boards/arduino/uno_r4/arduino_uno_r4_wifi.dts | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 578 |
```restructuredtext
.. _arduino_uno_r4:
Arduino UNO R4
##############
Overview
********
The Arduino UNO R4 Minima/WiFi is a development board featuring the Renesas RA4M1 SoC
in the Arduino form factor and is compatible with traditional Arduino.
Hardware
********
- Renesas RA4MA1 Processor (ARM Cortex-M4 at 48 MHz)
- 256 KiB flash memory and 32 KiB of RAM
- One user LEDs
- One reset button
- One WiFi Transceiver (Arduino UNO R4 WiFi only)
- One 12x8 LED Matrix (Arduino UNO R4 WiFi only)
- Built-in CMSIS-DAP debug adapter (Arduino UNO R4 WiFi only)
Supported Features
==================
The Arduino UNO R4 Minima/Wifi board configuration supports the following
hardware features:
+-----------+------------+------------------------------------------+
| Interface | Controller | Driver/Component |
+===========+============+==========================================+
| GPIO | on-chip | I/O ports |
+-----------+------------+------------------------------------------+
| UART | on-chip | Serial ports |
+-----------+------------+------------------------------------------+
Programming and debugging
*************************
Debug adapter
=============
A debug adapter is required to flash and debug programs.
Arduino UNO R4 WiFi has a built-in debug adapter that
you can use for flashing and debugging.
In the Arduino UNO R4 Minima case, You need to prepare
debug adapter separately. A 5V-compatible CMSIS-DAP adapter
adapts to this board.
Building & Flashing
===================
You can build and flash with ``west flash`` command (See
:ref:`build_an_application` and
:ref:`application_run` for more details).
Here is an example for building and flashing the :zephyr:code-sample:`blinky` application.
.. zephyr-app-commands::
:zephyr-app: samples/basic/blinky
:board: arduino_uno_r4_minima
:goals: build flash
.. zephyr-app-commands::
:zephyr-app: samples/basic/blinky
:board: arduino_uno_r4_wifi
:goals: build flash
Debugging
=========
Debugging can be done with ``west debug`` command.
The following command is debugging the :zephyr:code-sample:`blinky` application.
Also, see the instructions specific to the debug server that you use.
.. zephyr-app-commands::
:zephyr-app: samples/basic/blinky
:board: arduino_uno_r4_minima
:maybe-skip-config:
:goals: debug
.. zephyr-app-commands::
:zephyr-app: samples/basic/blinky
:board: arduino_uno_r4_wifi
:maybe-skip-config:
:goals: debug
Using pyOCD
-----------
Various debug adapters, including cmsis-dap probes, can debug the Arduino UNO R4 with pyOCD.
The default configuration uses the pyOCD for debugging.
You must install CMSIS-Pack when flashing or debugging Arduino UNO R4 Minima with pyOCD.
If not installed yet, execute the following command to install CMSIS-Pack for Arduino UNO R4.
.. code-block:: console
pyocd pack install r7fa4m1ab
Restoring Arduino Bootloader
============================
If you corrupt the Arduino bootloader, you can restore it with the following command.
.. code-block:: console
wget path_to_url
pyocd flash -e sector -a 0x0 -t r7fa4m1ab dfu_minima.hex
.. code-block:: console
wget path_to_url
pyocd flash -e sector -a 0x0 -t r7fa4m1ab dfu_wifi.hex
``` | /content/code_sandbox/boards/arduino/uno_r4/doc/index.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 827 |
```cmake
include(${ZEPHYR_BASE}/boards/common/bossac.board.cmake)
board_runner_args(jlink "--device=atsam3x8e" "--speed=4000" "--reset-after-load")
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
``` | /content/code_sandbox/boards/arduino/due/board.cmake | cmake | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 61 |
```unknown
config BOARD_ARDUINO_DUE
select SOC_SAM3X8E
``` | /content/code_sandbox/boards/arduino/due/Kconfig.arduino_due | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 20 |
```unknown
/dts-v1/;
#include <atmel/sam3x.dtsi>
#include "arduino_due-pinctrl.dtsi"
/ {
model = "Arduino Due with an Atmel SAM3X8E SoC";
compatible = "arduino,due", "atmel,sam3x8e", "atmel,sam3x";
aliases {
uart-0 = &uart;
i2c-0 = &twi0;
i2c-1 = &twi1;
pwm-0 = &pwm0;
led0 = &yellow_led;
watchdog0 = &wdt;
};
chosen {
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,console = &uart;
zephyr,shell-uart = &uart;
};
leds {
compatible = "gpio-leds";
yellow_led: led_0 {
gpios = <&piob 27 0>;
label = "User LED";
};
};
};
&cpu0 {
clock-frequency = <84000000>;
};
&wdt {
status = "okay";
};
&twi0 {
status = "okay";
pinctrl-0 = <&twi0_default>;
pinctrl-names = "default";
};
&twi1 {
status = "okay";
pinctrl-0 = <&twi1_default>;
pinctrl-names = "default";
};
&uart {
status = "okay";
current-speed = <115200>;
pinctrl-0 = <&uart_default>;
pinctrl-names = "default";
};
&pwm0 {
status = "okay";
pinctrl-0 = <&pwm0_default>;
pinctrl-names = "default";
};
arduino_i2c: &twi1 { };
``` | /content/code_sandbox/boards/arduino/due/arduino_due.dts | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 406 |
```unknown
CONFIG_ARM_MPU=y
CONFIG_HW_STACK_PROTECTION=y
CONFIG_WDT_DISABLE_AT_BOOT=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_SERIAL=y
``` | /content/code_sandbox/boards/arduino/due/arduino_due_defconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 36 |
```yaml
board:
name: arduino_due
vendor: arduino
socs:
- name: sam3x8e
``` | /content/code_sandbox/boards/arduino/due/board.yml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 30 |
```unknown
/*
*/
#include <dt-bindings/pinctrl/sam3XXh-pinctrl.h>
&pinctrl {
twi0_default: twi0_default {
group1 {
pinmux = <PA18A_TWI0_TWCK>,
<PA17A_TWI0_TWD>;
};
};
twi1_default: twi1_default {
group1 {
pinmux = <PB13A_TWI1_TWCK>,
<PB12A_TWI1_TWD>;
};
};
uart_default: uart_default {
group1 {
pinmux = <PA8A_UART_RXD>;
bias-pull-up;
};
group2 {
pinmux = <PA9A_UART_TXD>;
};
};
usart0_default: usart0_default {
group1 {
pinmux = <PA10A_USART0_RXD>,
<PA11A_USART0_TXD>;
};
};
usart1_default: usart1_default {
group1 {
pinmux = <PA12A_USART1_RXD>,
<PA13A_USART1_TXD>;
};
};
usart2_default: usart2_default {
group1 {
pinmux = <PB21A_USART2_RXD>,
<PB20A_USART2_TXD>;
};
};
usart3_default: usart3_default {
group1 {
pinmux = <PD5B_USART3_RXD>,
<PD4B_USART3_TXD>;
};
};
pwm0_default: pwm0_default {
group1 {
pinmux = <PC4B_PWM_PWML1>,
<PC5B_PWM_PWMH1>;
};
};
};
``` | /content/code_sandbox/boards/arduino/due/arduino_due-pinctrl.dtsi | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 386 |
```yaml
identifier: arduino_due
name: Arduino Due
type: mcu
arch: arm
toolchain:
- zephyr
- gnuarmemb
- xtools
flash: 512
ram: 96
supported:
- arduino_i2c
- gpio
- watchdog
vendor: arduino
``` | /content/code_sandbox/boards/arduino/due/arduino_due.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 75 |
```unknown
# Enable MPU
CONFIG_ARM_MPU=y
CONFIG_HW_STACK_PROTECTION=y
# enable peripherals
CONFIG_GPIO=y
CONFIG_SERIAL=y
# enable console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
# enable sam-ba bootloader on legacy mode
CONFIG_BOOTLOADER_BOSSA=y
CONFIG_BOOTLOADER_BOSSA_LEGACY=y
``` | /content/code_sandbox/boards/arduino/nano_33_ble/arduino_nano_33_ble_defconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 74 |
```cmake
board_runner_args(pyocd "--target=nrf52840" "--frequency=4000000")
board_runner_args(trace32
"--startup-args"
"elfFile=${PROJECT_BINARY_DIR}/${KERNEL_ELF_NAME}"
)
include(${ZEPHYR_BASE}/boards/common/bossac.board.cmake)
include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)
include(${ZEPHYR_BASE}/boards/common/blackmagicprobe.board.cmake)
include(${ZEPHYR_BASE}/boards/common/trace32.board.cmake)
``` | /content/code_sandbox/boards/arduino/nano_33_ble/board.cmake | cmake | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 117 |
```restructuredtext
.. _arduino_due:
Arduino Due
###########
Overview
********
The arduino_due board configuration is used by Zephyr applications
that run on the Arduino Due board. It provides support for the Atmel
SAM3X8E ARM Cortex-M3 CPU and the following devices:
* Nested Vectored Interrupt Controller (NVIC)
* System Tick System Clock (SYSTICK)
* Serial Port over USB (ATMEL_SAM3)
More information about the board can be found at the `Arduino Due website`_.
The `Atmel SAM3X8E Datasheet`_ has the information and the datasheet about
the processor.
.. note::
This configuration is not supported by Arduino.
.. image:: img/arduino_due.jpg
:align: center
:alt: Arduino Due
Hardware
********
Supported Features
==================
The arduino_due board configuration supports the following hardware features:
+-----------+------------+----------------------+
| Interface | Controller | Driver/Component |
+===========+============+======================+
| NVIC | on-chip | nested vectored |
| | | interrupt controller |
+-----------+------------+----------------------+
| SYSTICK | on-chip | system clock |
+-----------+------------+----------------------+
| UART | on-chip | serial port |
+-----------+------------+----------------------+
| GPIO | on-chip | gpio |
+-----------+------------+----------------------+
| I2C | on-chip | i2c |
+-----------+------------+----------------------+
| Watchdog | on-chip | watchdog |
+-----------+------------+----------------------+
Other hardware features are not currently supported by the Zephyr kernel.
See `Arduino Due website`_ and `Atmel SAM3X8E Datasheet`_ for a complete
list of Arduino Due board hardware features.
The default configuration can be found in the Kconfig
:zephyr_file:`boards/arduino/due/arduino_due_defconfig`.
.. note::
For I2C, pull-up resistors are required for using SCL1 and SDA1 (near IO13).
Interrupt Controller
====================
There are 15 fixed exceptions including exceptions 12 (debug monitor) and 15
(SYSTICK) that behave more as interrupts than exceptions. In addition, there can
be a variable number of IRQs. Exceptions 7-10 and 13 are reserved. They don't
need handlers.
A Cortex-M3/4-based board uses vectored exceptions. This means each exception
calls a handler directly from the vector table.
Handlers are provided for exceptions 1-6, 11-12, and 14-15. The table here
identifies the handlers used for each exception.
+------+------------+----------------+-----------------------+
| Exc# | Name | Remarks | Used by Zephyr Kernel |
+======+============+================+=======================+
| 1 | Reset | | system initialization |
+------+------------+----------------+-----------------------+
| 2 | NMI | | system fatal error |
+------+------------+----------------+-----------------------+
| 3 | Hard fault | | system fatal error |
+------+------------+----------------+-----------------------+
| 4 | MemManage | MPU fault | system fatal error |
+------+------------+----------------+-----------------------+
| 5 | Bus | | system fatal error |
+------+------------+----------------+-----------------------+
| 6 | Usage | undefined | system fatal error |
| | fault | instruction, | |
| | | or switch | |
| | | attempt to ARM | |
| | | mode | |
+------+------------+----------------+-----------------------+
| 11 | SVC | | system calls, kernel |
| | | | run-time exceptions, |
| | | | and IRQ offloading |
+------+------------+----------------+-----------------------+
| 12 | Debug | | system fatal error |
| | monitor | | |
+------+------------+----------------+-----------------------+
| 14 | PendSV | | context switch |
+------+------------+----------------+-----------------------+
| 15 | SYSTICK | | system clock |
+------+------------+----------------+-----------------------+
.. note::
After a reset, all exceptions have a priority of 0. Interrupts cannot run
at priority 0 for the interrupt locking mechanism and exception handling
to function properly.
System Clock
============
Arduino Due has two external oscillators/resonators. The slow clock is
32.768 kHz, and the main clock is 12 MHz. The processor can set up PLL to drive
the master clock, which can be set as high as 84 MHz.
Serial Port
===========
The Atmel SAM3X8E processor has a single UART that is used by the SAM-BA
bootloader. This UART has only two wires for RX/TX and does not have flow
control (CTS/RTS) or FIFO. The RX/TX pins are connected to the ATmega16U2,
which provides USB-to-TTL serial function. The Zephyr console output, by
default, is utilizing this controller.
Programming and Debugging
*************************
Flashing
========
BOSSA Tool
----------
Flashing the Zephyr kernel onto Arduino Due requires the `bossa tool`_.
There are GUI and command line versions of the bossa tool. The following
section provides the steps to build the command line version. Please
refer to the bossa tool's README file on how to build the GUI version.
To build the bossa tool, follow these steps:
#. Checkout the bossa tool's code from the repository.
.. code-block:: console
$ git clone path_to_url
$ cd BOSSA
#. Checkout the arduino branch. The code on the master branch does not
work with Arduino Due.
.. code-block:: console
$ git checkout arduino
#. Build the command line version of the bossa tool.
.. code-block:: console
$ make bin/bossac
#. The resulting binary is available at :file:`bin/bossac`.
Flashing an Application to Arduino Due
--------------------------------------
Applications for the ``arduino_due`` board configuration can be built
and flashed in the usual way (see :ref:`build_an_application` and
:ref:`application_run` for more details).
Here is an example for the :ref:`hello_world` application. After
building the application, press the Reset button before running the
flash command, so the board will boot into the SAM-BA bootloader and
be prepared to receive the new program.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: arduino_due
:goals: build flash
After flashing the application, run your favorite terminal program to
listen for output. For example, under Linux, the terminal should be
:code:`/dev/ttyACM0`. For example:
.. code-block:: console
$ sudo minicom -D /dev/ttyACM0 -o
The -o option tells minicom not to send the modem initialization
string.
Now press the Reset button and you should see "Hello World! arduino_due" in your terminal.
.. note::
Make sure your terminal program is closed before flashing the binary image,
or it will interfere with the flashing process.
References
**********
.. _Arduino Due website: path_to_url
.. _Atmel SAM3X8E Datasheet: path_to_url
.. _bossa tool: path_to_url
.. _bossa arduino branch: path_to_url
``` | /content/code_sandbox/boards/arduino/due/doc/index.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,670 |
```unknown
/*
*
*/
/ {
chosen {
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,uart-mcumgr = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &code_partition;
zephyr,ieee802154 = &ieee802154;
};
leds {
compatible = "gpio-leds";
led0: led_0 {
gpios = <&gpio0 24 GPIO_ACTIVE_LOW>;
label = "Red LED";
};
led1: led_1 {
gpios = <&gpio0 16 GPIO_ACTIVE_LOW>;
label = "Green LED";
};
led2: led_2 {
gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
label = "Blue LED";
};
led3: led_3 {
/* Cannot be used together with spi2. */
gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
label = "Yellow LED";
};
led4: led_4 {
gpios = <&gpio1 9 GPIO_ACTIVE_HIGH>;
label = "User LED";
};
};
pwmleds {
compatible = "pwm-leds";
red_pwm_led: led_pwm_0 {
pwms = <&pwm0 0 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
label = "Red PWM LED";
};
green_pwm_led: led_pwm_1 {
pwms = <&pwm0 1 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
label = "Green PWM LED";
};
blue_pwm_led: led_pwm_2 {
pwms = <&pwm0 2 PWM_MSEC(20) PWM_POLARITY_INVERTED>;
label = "Blue PWM LED";
};
user_pwm_led: led_pwm_4 {
pwms = <&pwm1 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
label = "User PWM LED";
};
};
pwmleds2 {
compatible = "pwm-leds";
/* Cannot be used together with spi2. */
status = "disabled";
yellow_pwm_led: led_pwm_3 {
pwms = <&pwm2 0 PWM_MSEC(20) PWM_POLARITY_NORMAL>;
label = "Yellow PWM LED";
};
};
vdd_env: vdd-env {
compatible = "regulator-fixed";
regulator-name = "vdd_env";
enable-gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>;
regulator-boot-on;
startup-delay-us = <5000>;
};
zephyr,user {
/* I2C pull-ups are connected to VDD via pin voltage level */
pull-up-gpios = <&gpio1 0 GPIO_ACTIVE_HIGH>;
};
/* These aliases are provided for compatibility with samples */
aliases {
led0 = &led0;
led1 = &led1;
led2 = &led2;
led3 = &led3;
led4 = &led4;
pwm-led0 = &red_pwm_led;
pwm-led1 = &green_pwm_led;
pwm-led2 = &blue_pwm_led;
pwm-led3 = &yellow_pwm_led;
pwm-led4 = &user_pwm_led;
red-pwm-led = &red_pwm_led;
green-pwm-led = &green_pwm_led;
blue-pwm-led = &blue_pwm_led;
spi = &spi2;
watchdog0 = &wdt0;
accel0 = &lsm9ds1;
};
};
&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
boot_partition: partition@0 {
label = "sam-ba";
reg = <0x00000000 0x00010000>;
read-only;
};
code_partition: partition@10000 {
label = "code";
reg = <0x00010000 0x000e8000>;
read-only;
};
/*
* The flash starting at 0x000f8000 and ending at
* 0x000fffff is reserved for use by the application.
*
* Storage partition will be used by FCB/LittleFS/NVS
* if enabled.
*/
storage_partition: partition@f8000 {
label = "storage";
reg = <0x000f8000 0x00008000>;
};
};
};
&adc {
status = "okay";
};
&uart0 {
compatible = "nordic,nrf-uart";
current-speed = <115200>;
status = "okay";
pinctrl-0 = <&uart0_default>;
pinctrl-1 = <&uart0_sleep>;
pinctrl-names = "default", "sleep";
};
arduino_i2c: &i2c0 {
compatible = "nordic,nrf-twim";
status = "okay";
pinctrl-0 = <&i2c0_default>;
pinctrl-1 = <&i2c0_sleep>;
pinctrl-names = "default", "sleep";
};
&i2c1 {
compatible = "nordic,nrf-twim";
status = "okay";
pinctrl-0 = <&i2c1_default>;
pinctrl-1 = <&i2c1_sleep>;
pinctrl-names = "default", "sleep";
lsm9ds1: lsm9ds1@6b {
compatible = "st,lsm9ds1";
reg = <0x6b>;
};
};
/* SPI2 is used because SPI1/0 shares conflicts with I2C1/0 */
arduino_spi: &spi2 {
compatible = "nordic,nrf-spim";
status = "okay";
pinctrl-0 = <&spi2_default>;
pinctrl-1 = <&spi2_sleep>;
pinctrl-names = "default", "sleep";
};
&uicr {
gpio-as-nreset;
};
&gpio0 {
status = "okay";
};
&gpio1 {
status = "okay";
};
&gpiote {
status = "okay";
};
&pwm0 {
status = "okay";
pinctrl-0 = <&pwm0_default>;
pinctrl-1 = <&pwm0_sleep>;
pinctrl-names = "default", "sleep";
};
&pwm1 {
status = "okay";
pinctrl-0 = <&pwm1_default>;
pinctrl-1 = <&pwm1_sleep>;
pinctrl-names = "default", "sleep";
};
&pwm2 {
/* Cannot be used together with spi2 because of conflict on P0.13. */
status = "disabled";
pinctrl-0 = <&pwm2_default>;
pinctrl-1 = <&pwm2_sleep>;
pinctrl-names = "default", "sleep";
};
zephyr_udc0: &usbd {
compatible = "nordic,nrf-usbd";
status = "okay";
};
&ieee802154 {
status = "okay";
};
``` | /content/code_sandbox/boards/arduino/nano_33_ble/arduino_nano_33_ble-common.dtsi | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,671 |
```unknown
config BOARD_ARDUINO_NANO_33_BLE
select SOC_NRF52840_QIAA
``` | /content/code_sandbox/boards/arduino/nano_33_ble/Kconfig.arduino_nano_33_ble | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 24 |
```cmake
# Suppress "unique_unit_address_if_enabled" to handle the following overlaps:
# - power@40000000 & clock@40000000 & bprot@40000000
# - acl@4001e000 & flash-controller@4001e000
list(APPEND EXTRA_DTC_FLAGS "-Wno-unique_unit_address_if_enabled")
``` | /content/code_sandbox/boards/arduino/nano_33_ble/pre_dt_board.cmake | cmake | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 72 |
```unknown
/*
*/
&pinctrl {
uart0_default: uart0_default {
group1 {
psels = <NRF_PSEL(UART_TX, 1, 3)>,
<NRF_PSEL(UART_RX, 1, 10)>;
};
};
uart0_sleep: uart0_sleep {
group1 {
psels = <NRF_PSEL(UART_TX, 1, 3)>,
<NRF_PSEL(UART_RX, 1, 10)>;
low-power-enable;
};
};
i2c0_default: i2c0_default {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 31)>,
<NRF_PSEL(TWIM_SCL, 0, 2)>;
};
};
i2c0_sleep: i2c0_sleep {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 31)>,
<NRF_PSEL(TWIM_SCL, 0, 2)>;
low-power-enable;
};
};
i2c1_default: i2c1_default {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 14)>,
<NRF_PSEL(TWIM_SCL, 0, 15)>;
};
};
i2c1_sleep: i2c1_sleep {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 14)>,
<NRF_PSEL(TWIM_SCL, 0, 15)>;
low-power-enable;
};
};
spi2_default: spi2_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 13)>,
<NRF_PSEL(SPIM_MOSI, 1, 1)>,
<NRF_PSEL(SPIM_MISO, 1, 8)>;
};
};
spi2_sleep: spi2_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 13)>,
<NRF_PSEL(SPIM_MOSI, 1, 1)>,
<NRF_PSEL(SPIM_MISO, 1, 8)>;
low-power-enable;
};
};
pwm0_default: pwm0_default {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 0, 24)>,
<NRF_PSEL(PWM_OUT1, 0, 16)>,
<NRF_PSEL(PWM_OUT2, 0, 6)>;
nordic,invert;
};
};
pwm0_sleep: pwm0_sleep {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 0, 24)>,
<NRF_PSEL(PWM_OUT1, 0, 16)>,
<NRF_PSEL(PWM_OUT2, 0, 6)>;
low-power-enable;
};
};
pwm1_default: pwm1_default {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 1, 9)>;
};
};
pwm1_sleep: pwm1_sleep {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 1, 9)>;
};
};
pdm0_default: pdm0_default {
group1 {
psels = <NRF_PSEL(PDM_CLK, 0, 26)>,
<NRF_PSEL(PDM_DIN, 0, 25)>;
};
};
pdm0_sleep: pdm0_sleep {
group1 {
psels = <NRF_PSEL(PDM_CLK, 0, 26)>,
<NRF_PSEL(PDM_DIN, 0, 25)>;
low-power-enable;
};
};
pwm2_default: pwm2_default {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 0, 13)>;
};
};
pwm2_sleep: pwm2_sleep {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 0, 13)>;
low-power-enable;
};
};
};
``` | /content/code_sandbox/boards/arduino/nano_33_ble/arduino_nano_33_ble-pinctrl.dtsi | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 983 |
```c
/*
*
*/
#include <zephyr/init.h>
#include <zephyr/drivers/gpio.h>
static int board_init(void)
{
int res;
static const struct gpio_dt_spec pull_up =
GPIO_DT_SPEC_GET(DT_PATH(zephyr_user), pull_up_gpios);
static const struct gpio_dt_spec user_led =
GPIO_DT_SPEC_GET(DT_ALIAS(led4), gpios);
if (!gpio_is_ready_dt(&pull_up)) {
return -ENODEV;
}
if (!gpio_is_ready_dt(&user_led)) {
return -ENODEV;
}
res = gpio_pin_configure_dt(&pull_up, GPIO_OUTPUT_HIGH);
if (res) {
return res;
}
return gpio_pin_configure_dt(&user_led, GPIO_OUTPUT_INACTIVE);
}
SYS_INIT(board_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
``` | /content/code_sandbox/boards/arduino/nano_33_ble/board.c | c | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 174 |
```unknown
/*
*/
/ {
arduino_nano_header: connector {
compatible = "arduino-nano-header-r3";
#gpio-cells = <2>;
gpio-map-mask = <0xffffffff 0xffffffc0>;
gpio-map-pass-thru = <0 0x3f>;
gpio-map = <0 0 &gpio1 3 0>, /* D0 / UART-TX */
<1 0 &gpio1 10 0>, /* D1 / UART-RX */
<2 0 &gpio1 11 0>, /* D2 */
<3 0 &gpio1 12 0>, /* D3 */
<4 0 &gpio1 15 0>, /* D4 */
<5 0 &gpio1 13 0>, /* D5 */
<6 0 &gpio1 14 0>, /* D6 */
<7 0 &gpio0 9 0>, /* D7 */
<8 0 &gpio0 10 0>, /* D8 */
<9 0 &gpio0 27 0>, /* D9 */
<10 0 &gpio1 2 0>, /* D10 */
<11 0 &gpio1 1 0>, /* D11 / SPI-MOSI */
<12 0 &gpio1 8 0>, /* D12 / SPI-MISO */
<13 0 &gpio0 13 0>, /* D13 / SPI-SCK */
<14 0 &gpio0 4 0>, /* D14 / A0 */
<15 0 &gpio0 5 0>, /* D15 / A1 */
<16 0 &gpio0 30 0>, /* D16 / A2 */
<17 0 &gpio0 29 0>, /* D17 / A3 */
<18 0 &gpio0 14 0>, /* D18 / A4 / I2C-SDA */
<19 0 &gpio0 15 0>, /* D19 / A5 / I2C-SCL */
<20 0 &gpio0 28 0>, /* D20 / A6 */
<21 0 &gpio1 3 0>; /* D21 / A7 */
};
};
arduino_nano_i2c: &i2c0 {};
arduino_nano_spi: &spi2 {};
arduino_nano_serial: &uart0 {};
``` | /content/code_sandbox/boards/arduino/nano_33_ble/arduino_nano_r3_connector.dtsi | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 549 |
```unknown
# Enable MPU
CONFIG_ARM_MPU=y
CONFIG_HW_STACK_PROTECTION=y
# enable peripherals
CONFIG_GPIO=y
CONFIG_SERIAL=y
# enable console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
# enable sam-ba bootloader on legacy mode
CONFIG_BOOTLOADER_BOSSA=y
CONFIG_BOOTLOADER_BOSSA_LEGACY=y
``` | /content/code_sandbox/boards/arduino/nano_33_ble/arduino_nano_33_ble_nrf52840_sense_defconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 74 |
```yaml
board:
name: arduino_nano_33_ble
vendor: arduino
socs:
- name: nrf52840
variants:
- name: 'sense'
``` | /content/code_sandbox/boards/arduino/nano_33_ble/board.yml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 43 |
```yaml
identifier: arduino_nano_33_ble
name: Arduino Nano 33 BLE
type: mcu
arch: arm
toolchain:
- zephyr
- gnuarmemb
- xtools
supported:
- adc
- ble
- i2c
- pwm
- serial
- spi
- uart
- usb_device
- watchdog
vendor: arduino
``` | /content/code_sandbox/boards/arduino/nano_33_ble/arduino_nano_33_ble.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 95 |
```unknown
/*
*
*/
/dts-v1/;
#include <nordic/nrf52840_qiaa.dtsi>
#include "arduino_nano_33_ble-common.dtsi"
#include "arduino_nano_33_ble-pinctrl.dtsi"
#include "arduino_nano_r3_connector.dtsi"
/ {
model = "Arduino Nano 33 BLE";
compatible = "arduino,arduino_nano_33_ble";
};
``` | /content/code_sandbox/boards/arduino/nano_33_ble/arduino_nano_33_ble.dts | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 90 |
```unknown
if BOARD_ARDUINO_NANO_33_BLE
config BT_CTLR
default BT
config REGULATOR
default y if SENSOR
endif # BOARD_ARDUINO_NANO_33_BLE
``` | /content/code_sandbox/boards/arduino/nano_33_ble/Kconfig.defconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 44 |
```yaml
identifier: arduino_nano_33_ble//sense
name: Arduino Nano 33 BLE Sense
type: mcu
arch: arm
toolchain:
- zephyr
- gnuarmemb
- xtools
supported:
- adc
- ble
- i2c
- pwm
- serial
- spi
- uart
- usb_device
- watchdog
vendor: arduino
``` | /content/code_sandbox/boards/arduino/nano_33_ble/arduino_nano_33_ble_nrf52840_sense.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 98 |
```unknown
/*
*
*/
/dts-v1/;
#include <nordic/nrf52840_qiaa.dtsi>
#include "arduino_nano_33_ble-common.dtsi"
#include "arduino_nano_33_ble-pinctrl.dtsi"
#include "arduino_nano_r3_connector.dtsi"
/ {
model = "Arduino Nano 33 BLE Sense";
compatible = "arduino,arduino_nano_33_ble_sense";
mic_pwr: mic_pwr {
compatible = "regulator-fixed";
regulator-name = "mic_pwr";
enable-gpios = <&gpio0 17 GPIO_ACTIVE_HIGH>;
regulator-boot-on;
};
};
&i2c1 {
hts221: hts221@5f {
compatible = "st,hts221";
status = "okay";
reg = <0x5f>;
};
lps22hb: lps22hb-press@5c {
compatible = "st,lps22hb-press";
status = "okay";
reg = <0x5c>;
};
apds9960: apds9960@39 {
compatible = "avago,apds9960";
status = "okay";
reg = <0x39>;
int-gpios = <&gpio0 19 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
};
};
dmic_dev: &pdm0 {
status = "okay";
pinctrl-0 = <&pdm0_default>;
pinctrl-1 = <&pdm0_sleep>;
pinctrl-names = "default", "sleep";
clock-source = "PCLK32M_HFXO";
};
``` | /content/code_sandbox/boards/arduino/nano_33_ble/arduino_nano_33_ble_nrf52840_sense.dts | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 363 |
```unknown
ENTRY %LINE &args
DO ~~~~/startup.cmm command=debug &args
ENDDO
``` | /content/code_sandbox/boards/arduino/nano_33_ble/support/debug.cmm | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 25 |
```unknown
GLOBAL &GDBPORT
GLOBAL &TERMPORT
;
; parse arguments
;
ENTRY %LINE &args
&command=STRing.SCANAndExtract("&args","command=","debug")
&elfFile=STRing.SCANAndExtract("&args","elfFile=","")
&gdbRemote=STRing.SCANAndExtract("&args","gdbRemote=","")
&termComPort=STRing.SCANAndExtract("&args","terminal=","")
&userScript=STRing.SCANAndExtract("&args","userScript=","")
IF "&command"=="flash"
(
; Execute the application and quit
QUIT -1
)
IF "&elfFile"==""
(
PRINT %ERROR "Missing ELF file path"
PLIST
STOP
ENDDO
)
;
; process system-wide settings
;
IF OS.FILE("~~/system-settings.cmm")
DO "~~/system-settings.cmm"
;
; CPU setup
;
SYStem.Down
IF PRACTICE.CoMmanD.AVAILable(SYStem.CPU.NANO33BLE)
SYStem.CPU NANO33BLE
ELSE
SYStem.CPU NRF52840QI
;
; RTOS setup
;
IF OS.FILE("~~/demo/arm/kernel/zephyr/v2-x/zephyr.t32")&&OS.FILE("~~/demo/arm/kernel/zephyr/v2-x/zephyr.men")
(
TASK.CONFIG ~~/demo/arm/kernel/zephyr/v2-x/zephyr.t32
MENU.ReProgram ~~/demo/arm/kernel/zephyr/v2-x/zephyr.men
)
;
; connect to the target
;
IF INTERFACE.GDB()
(
IF ("&gdbRemote"=="")&&("&GDBPORT"!="")
&gdbRemote="&GDBPORT"
IF "&gdbRemote"!=""
(
PRINT "Use gdb remote: &gdbRemote"
)
ELSE
(
PRINT %ERROR "GDB Port not defined."
PLIST
STOP
ENDDO
)
TITLE "TRACE32 PowerView front-end debugger for Nano 33 BLE (remote=&gdbRemote)"
IF !SYStem.Up()
(
SYStem.PORT &gdbRemote
Break.CONFIG.METHOD.Program Onchip
SYStem.Option MMUSPACES ON
ON ERROR CONTinue
ERROR.RESet
SYStem.Mode Attach
ON ERROR nothing
IF ERROR.OCCURRED()
(
PRINT %ERROR "Error while connecting to the target."
PLIST
STOP
ENDDO
)
)
)
ELSE
(
SYStem.CONFIG.DEBUGPORTTYPE SWD
SYStem.UP
)
;
; load ELF
;
Data.LOAD.Elf "&elfFile"
;
; Window initialization
;
IF ("&userScript"!="")&&FILE.EXIST("&userScript")
(
DO "&userScript"
)
ELSE
(
; Setup minimal debug environment
WinCLEAR
SETUP.Var.%SpotLight
WinPOS 0. 0. 120. 30.
List.auto
WinPOS 125. 0. 80. 10.
Frame.view
WinPOS 125. 18.
Register.view /SpotLight
IF "&termComPort"!=""
(
SUBTITLE " &termComPort"
TERM.RESet
TERM.METHOD COM &termComPort 115200 8 NONE 1STOP NONE
TERM.Mode VT100
WinPOS 104.88 35.286 91. 24. 0. 0. W001
TERM.view
SUBTITLE ""
)
)
ENDDO
``` | /content/code_sandbox/boards/arduino/nano_33_ble/support/startup.cmm | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 805 |
```unknown
/*
*
*/
/dts-v1/;
#include <nordic/nrf52832_qfaa.dtsi>
#include "arduino_nicla_sense_me-pinctrl.dtsi"
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include <zephyr/dt-bindings/led/led.h>
/ {
model = "Arduino Nicla Sense ME";
compatible = "arduino,arduino_nicla_sense_me";
gpio_keys {
compatible = "gpio-keys";
user_button: button {
label = "user button";
gpios = <&gpio0 21 GPIO_ACTIVE_LOW>;
status = "okay";
zephyr,code = <INPUT_KEY_0>;
};
};
chosen {
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,uart-mcumgr = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
};
aliases {
sw0 = &user_button;
watchdog0 = &wdt0;
};
};
&adc {
status = "okay";
};
&uicr {
gpio-as-nreset;
};
&gpiote {
status = "okay";
};
&gpio0 {
status = "okay";
};
&uart0 {
compatible = "nordic,nrf-uarte";
status = "okay";
current-speed = <115200>;
pinctrl-0 = <&uart0_default>;
pinctrl-1 = <&uart0_sleep>;
pinctrl-names = "default", "sleep";
};
/* I2C0 in datasheet */
&i2c0 {
compatible = "nordic,nrf-twim";
status = "okay";
pinctrl-0 = <&i2c0_default>;
pinctrl-1 = <&i2c0_sleep>;
pinctrl-names = "default", "sleep";
is31fl3194@53 {
compatible = "issi,is31fl3194";
reg = <0x53>;
led_rgb {
label = "RGB LED";
color-mapping = <LED_COLOR_ID_BLUE>,
<LED_COLOR_ID_GREEN>,
<LED_COLOR_ID_RED>;
current-limit = <10>;
};
};
};
/* I2C1 in datasheet */
&i2c1 {
compatible = "nordic,nrf-twim";
/* Cannot be used together with spi1. */
status = "okay";
pinctrl-0 = <&i2c1_default>;
pinctrl-1 = <&i2c1_sleep>;
pinctrl-names = "default", "sleep";
};
/* SPI1 in datasheet */
&spi1 {
compatible = "nordic,nrf-spim";
/* Cannot be used together with i2c1. */
/* status = "okay"; */
pinctrl-0 = <&spi1_default>;
pinctrl-1 = <&spi1_sleep>;
pinctrl-names = "default", "sleep";
};
/* SPI0 in datasheet */
&spi2 {
compatible = "nordic,nrf-spi";
status = "okay";
pinctrl-0 = <&spi2_default>;
pinctrl-1 = <&spi2_sleep>;
pinctrl-names = "default", "sleep";
cs-gpios = <&gpio0 26 GPIO_ACTIVE_LOW>;
mx25r1635f: mx25r1635f@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <80000000>;
jedec-id = [c2 28 15];
size = <DT_SIZE_M(16)>;
has-dpd;
t-enter-dpd = <10000>;
t-exit-dpd = <35000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
logging_partition: partition@0 {
label = "logging";
reg = <0x00000000 DT_SIZE_M(16)>;
};
};
};
};
&flash0 {
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
boot_partition: partition@0 {
label = "sam-ba";
reg = <0x00000000 0x00010000>;
read-only;
};
slot0_partition: partition@10000 {
label = "image-0";
reg = <0x00010000 0x30000>;
};
slot1_partition: partition@40000 {
label = "image-1";
reg = <0x00040000 0x30000>;
};
scratch_partition: partition@70000 {
label = "image-scratch";
reg = <0x00070000 0xa000>;
};
storage_partition: partition@7a000 {
label = "storage";
reg = <0x0007a000 0x00006000>;
};
};
};
``` | /content/code_sandbox/boards/arduino/nicla_sense_me/arduino_nicla_sense_me.dts | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,183 |
```cmake
board_runner_args(pyocd "--target=nrf52832" "--frequency=400000")
include(${ZEPHYR_BASE}/boards/common/pyocd.board.cmake)
``` | /content/code_sandbox/boards/arduino/nicla_sense_me/board.cmake | cmake | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 38 |
```unknown
# Arduino Nicla Sense ME board configuration
config BOARD_ARDUINO_NICLA_SENSE_ME
select SOC_NRF52832_QFAA
``` | /content/code_sandbox/boards/arduino/nicla_sense_me/Kconfig.arduino_nicla_sense_me | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 33 |
```unknown
# Enable MPU
CONFIG_ARM_MPU=y
CONFIG_HW_STACK_PROTECTION=y
# enable GPIO
CONFIG_GPIO=y
# enable uart driver
CONFIG_SERIAL=y
# enable console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
# enable pin controller
CONFIG_PINCTRL=y
``` | /content/code_sandbox/boards/arduino/nicla_sense_me/arduino_nicla_sense_me_defconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 59 |
```restructuredtext
.. _arduino_nano_33_ble:
Arduino Nano 33 BLE (Sense)
#################################
Overview
********
The Arduino Nano 33 BLE is designed around Nordic Semiconductor's
nRF52840 ARM Cortex-M4F CPU. Arduino sells 2 variants of the board, the
plain `BLE`_ type and the `BLE Sense`_ type. The "Sense" variant is distinguished by
the inclusion of more sensors, but otherwise both variants are the same.
.. image:: img/arduino_nano_33_ble_sense.jpg
:align: center
:alt: Arduino Nano 33 BLE (Sense variant)
The Sense variant of the board
Hardware
********
Supported Features
==================
The package is configured to support the following hardware:
+-----------+------------+----------------------+
| Interface | Controller | Driver/Component |
+===========+============+======================+
| ADC | on-chip | adc |
+-----------+------------+----------------------+
| CLOCK | on-chip | clock_control |
+-----------+------------+----------------------+
| FLASH | on-chip | flash |
+-----------+------------+----------------------+
| GPIO | on-chip | gpio |
+-----------+------------+----------------------+
| I2C0 | on-chip | i2c |
+-----------+------------+----------------------+
| I2C1 | on-chip | i2c |
+-----------+------------+----------------------+
| MPU | on-chip | arch/arm |
+-----------+------------+----------------------+
| NVIC | on-chip | arch/arm |
+-----------+------------+----------------------+
| PWM | on-chip | pwm |
+-----------+------------+----------------------+
| RADIO | on-chip | Bluetooth, |
| | | ieee802154 |
+-----------+------------+----------------------+
| RTC | on-chip | system clock |
+-----------+------------+----------------------+
| SPI | on-chip | spi |
+-----------+------------+----------------------+
| UART | on-chip | serial |
+-----------+------------+----------------------+
| USB | on-chip | usb |
+-----------+------------+----------------------+
| WDT | on-chip | watchdog |
+-----------+------------+----------------------+
Other hardware features have not been enabled yet for this board.
Notably, this includes the PDM (microphone) interface.
Connections and IOs
===================
The `schematic`_ will tell you everything
you need to know about the pins.
The I2C pull-ups are enabled by setting pin P1.00 high. This is automatically
done at system init. The pin is specified in the ``zephyr,user`` Devicetree node
as ``pull-up-gpios``.
Programming and Debugging
*************************
This board requires the Arduino variant of bossac. You will not
be able to flash with the bossac included with the zephyr-sdk, or
using shumatech's mainline build.
You can get this variant of bossac with one of two ways:
#. Building the binary from the `Arduino source tree <path_to_url`_
#. Downloading the Arduino IDE
#. Install the board support package within the IDE
#. Change your IDE preferences to provide verbose logging
#. Build and flash a sample application, and read the logs to figure out where Arduino stored bossac.
#. In most Linux based systems the path is ``$HOME/.arduino15/packages/arduino/tools/bossac/1.9.1-arduino2/bossac``.
Once you have a path to bossac, you can pass it as an argument to west:
.. code-block:: bash
west flash --bossac="<path to the arduino version of bossac>"
For example
.. code-block:: bash
west flash --bossac=$HOME/.arduino15/packages/arduino/tools/bossac/1.9.1-arduino2/bossac
On Windows you need to use the :file:`bossac.exe` from the `Arduino IDE`_
You will also need to specify the COM port using the --bossac-port argument:
.. code-block:: bash
west flash --bossac=%USERPROFILE%\AppData\Local\Arduino15\packages\arduino\tools\bossac\1.9.1-arduino2\bossac.exe --bossac-port="COMx"
Flashing
========
Attach the board to your computer using the USB cable, and then
.. zephyr-app-commands::
:zephyr-app: samples/basic/blinky
:board: arduino_nano_33_ble
:goals: build
:compact:
Double-tap the RESET button on your board. Your board should disconnect, reconnect,
and there should be a pulsing orange LED near the USB port.
Then, you can flash the image using the above script.
You should see the red LED blink.
Debugging
=========
You can debug an application on the board with a debug adapter that supports
CMSIS-DAP. This board has the SWD connector for debugging but exposes it as
a test pad pattern (not a connector) on the back side of the PCB. So, It needs
bit of difficult soldering. At a minimum, SWDIO and SWCLK need soldering (As
shown in the picture). GND, 3.3V, and RESET are also available in the DIP
connector, therefore it may be easier to connect using the DIP connector
instead of soldering to them.
.. image:: img/nano_33_ble_swd.jpg
:align: center
:alt: Nano 33 BLE SWD connecting
After connecting the debug adapter, you can debug it the usual way.
Type the following command will start debugging.
.. zephyr-app-commands::
:zephyr-app: samples/basic/blinky
:board: arduino_nano_33_ble
:maybe-skip-config:
:goals: debug
Debugging with TRACE32 (GDB Front-End)
======================================
Lauterbach provides `GDB Debug version TRACE32 for Arduino Nano 33 BLE`_.
That license ties to Arduino Nano 33 BLE hardware serial number,
it also works with the ZephyrRTOS.
Follow the instruction of the tutorial for Arduino
`Lauterbach TRACE32 GDB Front-End Debugger for Nano 33 BLE`
to install the TRACE32.
After installing the TRACE32, You should set the environmental variable ``T32_DIR``.
If you installed TRACE32 into the home directory, run the following command.
(It is a good idea to put in the login script.)
.. code-block:: bash
export T32_DIR="~/T32Arduino"
The TRACE32 is `TRACE32 as GDB Front-End`_ version.
Required to run the GDB server before launching TRACE32 with the following command.
.. zephyr-app-commands::
:zephyr-app: samples/basic/blinky
:board: arduino_nano_33_ble
:goals: debugserver
:compact:
Execute the following command after launching the GDB server to run the TRACE32
and connect the GDB server.
.. code-block:: bash
west debug --runner=trace32 -- gdbRemote=:3333
The TRACE32 script handles arguments after the ``--`` sign.
You can set the following options.
========== ========== ==================================================================
Name Required? Description
---------- ---------- your_sha256_hash--
gdbRemote Required | Set the GDB server address or device file of the serial port.
| It can take <hostname>:<port> or <devicename>.
| e.g.) ``gdbRemote=localhost:3333``, ``gdbRemote=/dev/ttyACM0``
terminal Optional | Set the device file of the serial port connected to the target console.
| e.g.) ``terminal=/dev/ttyACM1``
userScript Optional | Set user script that runs after system script execute done.
| e.g.) ``userScript="./user.cmm"``
========== ========== ==================================================================
References
**********
.. target-notes::
.. _BLE:
path_to_url
.. _BLE SENSE:
path_to_url
.. _pinouts:
path_to_url
.. _schematic:
path_to_url
.. _GDB Debug version TRACE32 for Arduino Nano 33 BLE:
path_to_url
.. _Lauterbach TRACE32 GDB Front-End Debugger for Nano 33 BLE:
path_to_url
.. _TRACE32 as GDB Front-End:
path_to_url
.. _Arduino IDE:
path_to_url
``` | /content/code_sandbox/boards/arduino/nano_33_ble/doc/index.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 1,862 |
```cmake
# Suppress "unique_unit_address_if_enabled" to handle the following overlaps:
# - power@40000000 & clock@40000000 & bprot@40000000
# - acl@4001e000 & flash-controller@4001e000
list(APPEND EXTRA_DTC_FLAGS "-Wno-unique_unit_address_if_enabled")
``` | /content/code_sandbox/boards/arduino/nicla_sense_me/pre_dt_board.cmake | cmake | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 72 |
```yaml
board:
name: arduino_nicla_sense_me
vendor: arduino
socs:
- name: nrf52832
``` | /content/code_sandbox/boards/arduino/nicla_sense_me/board.yml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 34 |
```unknown
/*
*
*/
&pinctrl {
uart0_default: uart0_default {
group1 {
psels = <NRF_PSEL(UART_TX, 0, 20)>,
<NRF_PSEL(UART_RX, 0, 9)>;
};
};
uart0_sleep: uart0_sleep {
group1 {
psels = <NRF_PSEL(UART_TX, 0, 20)>,
<NRF_PSEL(UART_RX, 0, 9)>;
low-power-enable;
};
};
i2c0_default: i2c0_default {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 15)>,
<NRF_PSEL(TWIM_SCL, 0, 16)>;
};
};
i2c0_sleep: i2c0_sleep {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 15)>,
<NRF_PSEL(TWIM_SCL, 0, 16)>;
low-power-enable;
};
};
i2c1_default: i2c1_default {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 22)>,
<NRF_PSEL(TWIM_SCL, 0, 23)>;
};
};
i2c1_sleep: i2c1_sleep {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 0, 22)>,
<NRF_PSEL(TWIM_SCL, 0, 23)>;
low-power-enable;
};
};
spi1_default: spi1_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 11)>,
<NRF_PSEL(SPIM_MOSI, 0, 27)>,
<NRF_PSEL(SPIM_MISO, 0, 28)>;
};
};
spi1_sleep: spi1_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 11)>,
<NRF_PSEL(SPIM_MOSI, 0, 27)>,
<NRF_PSEL(SPIM_MISO, 0, 28)>;
low-power-enable;
};
};
spi2_default: spi2_default {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 3)>,
<NRF_PSEL(SPIM_MOSI, 0, 4)>,
<NRF_PSEL(SPIM_MISO, 0, 5)>;
};
};
spi2_sleep: spi2_sleep {
group1 {
psels = <NRF_PSEL(SPIM_SCK, 0, 3)>,
<NRF_PSEL(SPIM_MOSI, 0, 4)>,
<NRF_PSEL(SPIM_MISO, 0, 5)>;
low-power-enable;
};
};
};
``` | /content/code_sandbox/boards/arduino/nicla_sense_me/arduino_nicla_sense_me-pinctrl.dtsi | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 697 |
```yaml
identifier: arduino_nicla_sense_me
name: Arduino Nicla Sense ME
type: mcu
arch: arm
ram: 64
flash: 512
toolchain:
- zephyr
- gnuarmemb
- xtools
supported:
- gpio
- i2c
- spi
- shell
- counter
- nvs
- pwm
- watchdog
vendor: arduino
``` | /content/code_sandbox/boards/arduino/nicla_sense_me/arduino_nicla_sense_me.yaml | yaml | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 102 |
```unknown
# Arduino Nicla Sense ME board configuration
if BOARD_ARDUINO_NICLA_SENSE_ME
config BT_CTLR
default BT
endif # BOARD_ARDUINO_NICLA_SENSE_ME
``` | /content/code_sandbox/boards/arduino/nicla_sense_me/Kconfig.defconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 45 |
```restructuredtext
.. _arduino_nicla_sense_me:
Arduino Nicla Sense ME
######################
Overview
********
The `Arduino Nicla Sense ME`_ is designed around Nordic Semiconductor's
nrf52832 ARM Cortex-M4F CPU. The board houses 4 low power industrial grade sensors
that can measure rotation, acceleration, pressure, humidity, temperature, air quality
and CO2 levels.
.. figure:: arduino_nicla_sense_me.jpg
:align: center
:alt: Arduino Nicla Sense ME
Arduino Nicla Sense ME (Credit: Arduino)
Hardware
********
- nRF52832 ARM Cortex-M4 processor at 64 MHz
- 512 kB flash memory, 64 kB SRAM
- Bluetooth Low Energy
- Micro USB (USB-B)
- JST 3-pin 1.2 mm pitch battery connector
- 10 Digital I/O pins
- 2 Analog input pins
- 12 PWM pins
- One reset button
- RGB LED (I2C)
- On board sensors:
- Accelerometer/Gyroscope: Bosch BHI260AP
- Gas/Pressure/Temperature/Humidity: Bosch BME688
- Geomagnetic: Bosch BMM150
- Digital Pressure: Bosch BMP390
Supported Features
==================
+-----------+------------+----------------------+
| Interface | Controller | Driver/Component |
+===========+============+======================+
| ADC | on-chip | adc |
+-----------+------------+----------------------+
| CLOCK | on-chip | clock_control |
+-----------+------------+----------------------+
| FLASH | on-chip | flash |
+-----------+------------+----------------------+
| GPIO | on-chip | gpio |
+-----------+------------+----------------------+
| I2C(M/S) | on-chip | i2c |
+-----------+------------+----------------------+
| MPU | on-chip | arch/arm |
+-----------+------------+----------------------+
| NVIC | on-chip | arch/arm |
+-----------+------------+----------------------+
| PWM | on-chip | pwm |
+-----------+------------+----------------------+
| RADIO | on-chip | Bluetooth Low Energy |
+-----------+------------+----------------------+
| RTC | on-chip | system clock |
+-----------+------------+----------------------+
| SPI(M/S) | on-chip | spi |
+-----------+------------+----------------------+
| UART | on-chip | serial |
+-----------+------------+----------------------+
| WDT | on-chip | watchdog |
+-----------+------------+----------------------+
Connections and IOs
===================
Available pins:
---------------
.. figure:: arduino_nicla_sense_me_pinout.jpg
:align: center
:alt: Arduino Nicla Sense ME pinout
Arduino Nicla Sense ME pinout (Credit: Arduino)
For more details please refer to the `datasheet`_, `full pinout`_ and the `schematics`_.
Programming and Debugging
*************************
Applications for the ``arduino_nicla_sense_me`` board configuration can be built and
flashed in the usual way (see :ref:`build_an_application` and
:ref:`application_run` for more details).
Flashing
========
First, connect the Arduino Nicla Sense ME board to your host computer using
the USB port to prepare it for flashing. Then build and flash your application.
Here is an example for the :ref:`hello_world` application.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: arduino_nicla_sense_me
:goals: build flash
Run a serial host program to connect with your board:
.. code-block:: console
$ minicom -D /dev/ttyACM0
You should see the following message on the console:
.. code-block:: console
Hello World! arduino_nicla_sense_me
Debugging
=========
You can debug an application in the usual way. Here is an example for the
:ref:`hello_world` application.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: arduino_nicla_sense_me
:goals: debug
References
**********
.. target-notes::
.. _Arduino Nicla Sense ME:
path_to_url
.. _datasheet:
path_to_url
.. _full pinout:
path_to_url
.. _schematics:
path_to_url
``` | /content/code_sandbox/boards/arduino/nicla_sense_me/doc/index.rst | restructuredtext | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 989 |
```cmake
if(CONFIG_BOARD_ARDUINO_GIGA_R1_STM32H747XX_M7)
board_runner_args(jlink "--device=STM32H747XI_M7" "--speed=4000")
board_runner_args(openocd "--config=${BOARD_DIR}/support/openocd_arduino_giga_r1_m7.cfg")
board_runner_args(openocd --target-handle=_CHIPNAME.cpu0)
elseif(CONFIG_BOARD_ARDUINO_GIGA_R1_STM32H747XX_M4)
board_runner_args(jlink "--device=STM32H747XI_M4" "--speed=4000")
board_runner_args(openocd "--config=${BOARD_DIR}/support/openocd_arduino_giga_r1_m4.cfg")
board_runner_args(openocd --target-handle=_CHIPNAME.cpu1)
endif()
board_runner_args(dfu-util "--pid=2341:0366" "--alt=0" "--dfuse")
board_runner_args(blackmagicprobe "--connect-rst")
include(${ZEPHYR_BASE}/boards/common/dfu-util.board.cmake)
include(${ZEPHYR_BASE}/boards/common/blackmagicprobe.board.cmake)
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
``` | /content/code_sandbox/boards/arduino/giga_r1/board.cmake | cmake | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 276 |
```unknown
# Disable the internal SMPS regulator
CONFIG_POWER_SUPPLY_DIRECT_SMPS=n
# Enable GPIO
CONFIG_GPIO=y
# Enable clocks
CONFIG_CLOCK_CONTROL=y
# Enable MPU
CONFIG_ARM_MPU=y
# Enable HW stack protection
CONFIG_HW_STACK_PROTECTION=y
# Enable uart driver
CONFIG_SERIAL=y
# Console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
# Enable pin controller
CONFIG_PINCTRL=y
# Use zephyr,code-partition as flash offset
CONFIG_USE_DT_CODE_PARTITION=y
``` | /content/code_sandbox/boards/arduino/giga_r1/arduino_giga_r1_stm32h747xx_m7_defconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 109 |
```unknown
/*
*
*/
/dts-v1/;
#include <st/h7/stm32h747Xi_m4.dtsi>
#include <st/h7/stm32h747xihx-pinctrl.dtsi>
#include "arduino_giga_r1.dtsi"
/ {
model = "Arduino GIGA R1 WiFi Board (M4)";
compatible = "arduino,giga-r1";
chosen {
zephyr,console = &usart2;
zephyr,shell-uart = &usart2;
zephyr,sram = &sram1;
zephyr,flash = &flash1;
};
aliases {
led0 = &blue_led;
};
};
&rcc {
clock-frequency = <DT_FREQ_M(240)>;
};
&usart2 {
status = "okay";
pinctrl-0 = <&usart2_tx_pd5 &usart2_rx_pd6>;
pinctrl-names = "default";
current-speed = <115200>;
};
``` | /content/code_sandbox/boards/arduino/giga_r1/arduino_giga_r1_stm32h747xx_m4.dts | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 216 |
```unknown
# Enable GPIO
CONFIG_GPIO=y
# Clock configuration
CONFIG_CLOCK_CONTROL=y
# Enable MPU
CONFIG_ARM_MPU=y
# Enable HW stack protection
CONFIG_HW_STACK_PROTECTION=y
# Enable uart driver
CONFIG_SERIAL=y
# Console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
# Enable pin controller
CONFIG_PINCTRL=y
``` | /content/code_sandbox/boards/arduino/giga_r1/arduino_giga_r1_stm32h747xx_m4_defconfig | unknown | 2016-05-26T17:54:19 | 2024-08-16T18:09:06 | zephyr | zephyrproject-rtos/zephyr | 10,307 | 73 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.