boards: remove arduino 101 and related boards
This board and SoC was discontinued some time ago and is currently not maintained in the zephyr tree. Remove all associated configurations and variants from the tree. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
a597c86c30
commit
ffaba63b10
77 changed files with 12 additions and 2771 deletions
|
@ -52,7 +52,6 @@
|
||||||
/arch/xtensa/ @andrewboie @dcpleung @andyross
|
/arch/xtensa/ @andrewboie @dcpleung @andyross
|
||||||
/soc/xtensa/ @andrewboie @dcpleung @andyross
|
/soc/xtensa/ @andrewboie @dcpleung @andyross
|
||||||
/boards/arc/ @vonhust @ruuddw
|
/boards/arc/ @vonhust @ruuddw
|
||||||
/boards/arc/arduino_101_sss/ @nashif
|
|
||||||
/boards/arc/quark_se_c1000_ss_devboard/ @nashif
|
/boards/arc/quark_se_c1000_ss_devboard/ @nashif
|
||||||
/boards/arm/ @MaureenHelm @galak
|
/boards/arm/ @MaureenHelm @galak
|
||||||
/boards/arm/96b_argonkey/ @avisconti
|
/boards/arm/96b_argonkey/ @avisconti
|
||||||
|
@ -67,7 +66,6 @@
|
||||||
/boards/arm/cc1352r1_launchxl/ @bwitherspoon
|
/boards/arm/cc1352r1_launchxl/ @bwitherspoon
|
||||||
/boards/arm/cc26x2r1_launchxl/ @bwitherspoon
|
/boards/arm/cc26x2r1_launchxl/ @bwitherspoon
|
||||||
/boards/arm/cc3220sf_launchxl/ @vanti
|
/boards/arm/cc3220sf_launchxl/ @vanti
|
||||||
/boards/arm/curie_ble/ @jhedberg
|
|
||||||
/boards/arm/disco_l475_iot1/ @erwango
|
/boards/arm/disco_l475_iot1/ @erwango
|
||||||
/boards/arm/frdm*/ @MaureenHelm
|
/boards/arm/frdm*/ @MaureenHelm
|
||||||
/boards/arm/frdm*/doc/ @MaureenHelm @MeganHansen
|
/boards/arm/frdm*/doc/ @MaureenHelm @MeganHansen
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
config BOARD_ARDUINO_101_SSS
|
|
||||||
bool "Arduino 101 Sensor Sub System"
|
|
||||||
depends on SOC_QUARK_SE_C1000_SS
|
|
|
@ -1,8 +0,0 @@
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
if BOARD_ARDUINO_101_SSS
|
|
||||||
|
|
||||||
config BOARD
|
|
||||||
default "arduino_101_sss"
|
|
||||||
|
|
||||||
endif # BOARD_ARDUINO_101_SSS
|
|
|
@ -1,81 +0,0 @@
|
||||||
/* SPDX-License-Identifier: Apache-2.0 */
|
|
||||||
|
|
||||||
/dts-v1/;
|
|
||||||
|
|
||||||
#include <mem.h>
|
|
||||||
|
|
||||||
#define DT_FLASH_SIZE DT_SIZE_K(128)
|
|
||||||
#define DT_SRAM_SIZE DT_SIZE_K(24)
|
|
||||||
#define DT_DCCM_SIZE DT_SIZE_K(8)
|
|
||||||
|
|
||||||
#define DT_FLASH_ADDR 0x40034000
|
|
||||||
|
|
||||||
#include "quark_se_c1000_ss.dtsi"
|
|
||||||
|
|
||||||
/ {
|
|
||||||
model = "arduino_101_sss";
|
|
||||||
compatible = "intel,arduino_101_sss", "intel,quark_se_c1000";
|
|
||||||
|
|
||||||
aliases {
|
|
||||||
led0 = &led0;
|
|
||||||
uart-0 = &uart0;
|
|
||||||
uart-1 = &uart1;
|
|
||||||
};
|
|
||||||
|
|
||||||
chosen {
|
|
||||||
zephyr,sram = &sram0;
|
|
||||||
zephyr,flash = &flash0;
|
|
||||||
zephyr,console = &uart1;
|
|
||||||
zephyr,shell-uart = &uart1;
|
|
||||||
};
|
|
||||||
|
|
||||||
leds {
|
|
||||||
compatible = "gpio-leds";
|
|
||||||
led0: led_0 {
|
|
||||||
gpios = <&gpio0 8 0>;
|
|
||||||
label = "LED";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
&uart1 {
|
|
||||||
status = "okay";
|
|
||||||
current-speed = <115200>;
|
|
||||||
};
|
|
||||||
|
|
||||||
&i2c0 {
|
|
||||||
status = "okay";
|
|
||||||
};
|
|
||||||
|
|
||||||
&i2c1 {
|
|
||||||
status = "okay";
|
|
||||||
};
|
|
||||||
|
|
||||||
&i2c2 {
|
|
||||||
status = "okay";
|
|
||||||
};
|
|
||||||
|
|
||||||
&i2c3 {
|
|
||||||
status = "okay";
|
|
||||||
};
|
|
||||||
|
|
||||||
&adc0 {
|
|
||||||
status = "okay";
|
|
||||||
};
|
|
||||||
|
|
||||||
&spi0 {
|
|
||||||
status = "okay";
|
|
||||||
};
|
|
||||||
|
|
||||||
&spi1 {
|
|
||||||
status = "okay";
|
|
||||||
|
|
||||||
bmi160@1 {
|
|
||||||
compatible = "bosch,bmi160";
|
|
||||||
reg = <0x1>;
|
|
||||||
label = "bmi160";
|
|
||||||
spi-max-frequency = <640000>;
|
|
||||||
int-gpios = <&gpio1 4 0>;
|
|
||||||
status = "okay";
|
|
||||||
};
|
|
||||||
};
|
|
|
@ -1,19 +0,0 @@
|
||||||
identifier: arduino_101_sss
|
|
||||||
name: Arduino 101 - Sensor Subsystem
|
|
||||||
type: mcu
|
|
||||||
arch: arc
|
|
||||||
toolchain:
|
|
||||||
- zephyr
|
|
||||||
- xtools
|
|
||||||
ram: 24
|
|
||||||
supported:
|
|
||||||
- adc
|
|
||||||
- i2c
|
|
||||||
- spi
|
|
||||||
- gpio
|
|
||||||
- counter
|
|
||||||
- watchdog
|
|
||||||
testing:
|
|
||||||
ignore_tags:
|
|
||||||
- net
|
|
||||||
- bluetooth
|
|
|
@ -1,17 +0,0 @@
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
CONFIG_ARC=y
|
|
||||||
CONFIG_SOC_QUARK_SE_C1000_SS=y
|
|
||||||
CONFIG_BOARD_ARDUINO_101_SSS=y
|
|
||||||
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=32000000
|
|
||||||
CONFIG_XIP=y
|
|
||||||
CONFIG_PRINTK=y
|
|
||||||
CONFIG_CPU_ARCEM=y
|
|
||||||
CONFIG_CPU_ARCV2=y
|
|
||||||
CONFIG_ARCV2_INTERRUPT_UNIT=y
|
|
||||||
CONFIG_ARCV2_TIMER=y
|
|
||||||
CONFIG_SPI_DW_PORT_0_INTERRUPT_SINGLE_LINE=n
|
|
||||||
CONFIG_UART_QMSI=y
|
|
||||||
CONFIG_CONSOLE=y
|
|
||||||
CONFIG_UART_CONSOLE=y
|
|
||||||
CONFIG_SERIAL=y
|
|
|
@ -1,15 +0,0 @@
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
if(DEFINED ENV{ZEPHYR_FLASH_OVER_DFU})
|
|
||||||
board_set_flasher_ifnset(dfu-util)
|
|
||||||
else()
|
|
||||||
board_set_flasher_ifnset(openocd)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
board_set_debugger_ifnset(openocd)
|
|
||||||
|
|
||||||
board_runner_args(dfu-util "--pid=8087:0aba" "--alt=sensor_core")
|
|
||||||
board_runner_args(openocd --cmd-pre-load "targets 1" "--gdb-port=3334")
|
|
||||||
|
|
||||||
include(${ZEPHYR_BASE}/boards/common/dfu-util.board.cmake)
|
|
||||||
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
|
|
|
@ -1,13 +0,0 @@
|
||||||
.. _arduino_101_sss:
|
|
||||||
|
|
||||||
Arduino/Genuino 101 (Sensor Subsystem)
|
|
||||||
######################################
|
|
||||||
|
|
||||||
The Arduino 101 contains a 32 MHz Argonaut RISC Core (ARC)* EM processor as part
|
|
||||||
of the Quark SE C1000 SoC within the Curie module.
|
|
||||||
The ARC core is referenced as the digital signal processor (DSP) sensor hub or a
|
|
||||||
sensor subsystem depending on what document you're looking at.
|
|
||||||
|
|
||||||
For more information about using the sensor subsystem with Zephyr, see
|
|
||||||
:ref:`arduino_101`.
|
|
||||||
|
|
|
@ -1,12 +0,0 @@
|
||||||
source [find interface/ftdi/flyswatter2.cfg]
|
|
||||||
source [find board/quark_se.cfg]
|
|
||||||
|
|
||||||
quark_se.quark configure -event gdb-attach {
|
|
||||||
reset halt
|
|
||||||
gdb_breakpoint_override hard
|
|
||||||
}
|
|
||||||
|
|
||||||
quark_se.quark configure -event gdb-detach {
|
|
||||||
resume
|
|
||||||
shutdown
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
# Kconfig - Curie BLE (nRF51822) configuration
|
|
||||||
#
|
|
||||||
# Copyright (c) 2017 Intel Corporation
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
config BOARD_CURIE_BLE
|
|
||||||
bool "Curie BLE"
|
|
||||||
depends on SOC_NRF51822_QFAA
|
|
|
@ -1,15 +0,0 @@
|
||||||
# Kconfig - Curie BLE (nRF51822) configuration
|
|
||||||
#
|
|
||||||
# Copyright (c) 2016 Intel Corporation
|
|
||||||
#
|
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
if BOARD_CURIE_BLE
|
|
||||||
|
|
||||||
config BOARD
|
|
||||||
default "curie_ble"
|
|
||||||
|
|
||||||
config BT_CTLR
|
|
||||||
default BT
|
|
||||||
|
|
||||||
endif # BOARD_CURIE_BLE
|
|
|
@ -1,5 +0,0 @@
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
board_runner_args(dfu-util "--pid=8087:0aba" "--alt=ble_core")
|
|
||||||
|
|
||||||
include(${ZEPHYR_BASE}/boards/common/dfu-util.board.cmake)
|
|
|
@ -1,39 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2017 Linaro Limited
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
/dts-v1/;
|
|
||||||
#include <nordic/nrf51822_qfaa.dtsi>
|
|
||||||
|
|
||||||
/ {
|
|
||||||
model = "Intel Curie BLE";
|
|
||||||
compatible = "intel,curie-ble", "nordic,nrf51822-qfaa",
|
|
||||||
"nordic,nrf51822";
|
|
||||||
|
|
||||||
chosen {
|
|
||||||
zephyr,console = &uart0;
|
|
||||||
zephyr,shell-uart = &uart0;
|
|
||||||
zephyr,bt-c2h-uart = &uart0;
|
|
||||||
zephyr,sram = &sram0;
|
|
||||||
zephyr,flash = &flash0;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
&gpiote {
|
|
||||||
status = "okay";
|
|
||||||
};
|
|
||||||
|
|
||||||
&gpio0 {
|
|
||||||
status = "okay";
|
|
||||||
};
|
|
||||||
|
|
||||||
&uart0 {
|
|
||||||
current-speed = <1000000>;
|
|
||||||
status = "okay";
|
|
||||||
tx-pin = <9>;
|
|
||||||
rx-pin = <11>;
|
|
||||||
rts-pin = <12>;
|
|
||||||
cts-pin = <10>;
|
|
||||||
};
|
|
|
@ -1,14 +0,0 @@
|
||||||
identifier: curie_ble
|
|
||||||
name: Intel Curie (nRF51)
|
|
||||||
type: mcu
|
|
||||||
arch: arm
|
|
||||||
toolchain:
|
|
||||||
- zephyr
|
|
||||||
- gnuarmemb
|
|
||||||
- xtools
|
|
||||||
ram: 16
|
|
||||||
supported:
|
|
||||||
- ble
|
|
||||||
testing:
|
|
||||||
ignore_tags:
|
|
||||||
- net
|
|
|
@ -1,14 +0,0 @@
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
CONFIG_ARM=y
|
|
||||||
CONFIG_SOC_FAMILY_NRF=y
|
|
||||||
CONFIG_SOC_SERIES_NRF51X=y
|
|
||||||
CONFIG_SOC_NRF51822_QFAA=y
|
|
||||||
CONFIG_BOARD_CURIE_BLE=y
|
|
||||||
|
|
||||||
# enable GPIO
|
|
||||||
CONFIG_GPIO=y
|
|
||||||
|
|
||||||
# enable uart driver
|
|
||||||
CONFIG_SERIAL=y
|
|
||||||
CONFIG_UART_0_NRF_UART=y
|
|
|
@ -1,11 +0,0 @@
|
||||||
.. _curie_ble:
|
|
||||||
|
|
||||||
Curie (BLE)
|
|
||||||
###########
|
|
||||||
|
|
||||||
The Intel |reg| Curie* module includes Bluetooth LE to enable developers to interact with
|
|
||||||
Bluetooth enabled devices such as phones and tablets.
|
|
||||||
|
|
||||||
See :ref:`arduino_101` for information how to use the BLE module with Zephyr on the Arduino
|
|
||||||
101 and other Intel Curie module-based boards.
|
|
||||||
|
|
|
@ -1,6 +0,0 @@
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
zephyr_library()
|
|
||||||
zephyr_library_sources(pinmux.c)
|
|
||||||
zephyr_library_sources_ifdef(CONFIG_BT_H4 nrf51_pm.c)
|
|
||||||
zephyr_library_include_directories(${ZEPHYR_BASE}/drivers)
|
|
|
@ -1,5 +0,0 @@
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
config BOARD_ARDUINO_101
|
|
||||||
bool "Arduino 101 Board"
|
|
||||||
depends on SOC_SERIES_QUARK_SE
|
|
|
@ -1,66 +0,0 @@
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
if BOARD_ARDUINO_101
|
|
||||||
|
|
||||||
config BOARD
|
|
||||||
default "arduino_101"
|
|
||||||
|
|
||||||
config TEXT_SECTION_OFFSET
|
|
||||||
default 0x30
|
|
||||||
|
|
||||||
config SS_RESET_VECTOR
|
|
||||||
default 0x40034000
|
|
||||||
|
|
||||||
if FLASH && SPI
|
|
||||||
|
|
||||||
config SPI_FLASH_W25QXXDV
|
|
||||||
default y
|
|
||||||
|
|
||||||
config GPIO
|
|
||||||
default y
|
|
||||||
|
|
||||||
if SPI_FLASH_W25QXXDV
|
|
||||||
|
|
||||||
config SPI_FLASH_W25QXXDV_GPIO_SPI_CS
|
|
||||||
default y
|
|
||||||
|
|
||||||
if DISK_ACCESS_FLASH
|
|
||||||
|
|
||||||
config DISK_FLASH_DEV_NAME
|
|
||||||
default SPI_FLASH_W25QXXDV_DRV_NAME
|
|
||||||
|
|
||||||
config DISK_FLASH_START
|
|
||||||
default 0x0
|
|
||||||
|
|
||||||
config DISK_FLASH_MAX_RW_SIZE
|
|
||||||
default 256
|
|
||||||
|
|
||||||
config DISK_ERASE_BLOCK_SIZE
|
|
||||||
default 0x1000
|
|
||||||
|
|
||||||
config DISK_FLASH_ERASE_ALIGNMENT
|
|
||||||
default 0x1000
|
|
||||||
|
|
||||||
config DISK_VOLUME_SIZE
|
|
||||||
default 0x200000
|
|
||||||
|
|
||||||
endif # DISK_ACCESS_FLASH
|
|
||||||
|
|
||||||
endif # SPI_FLASH_W25QXXDV
|
|
||||||
|
|
||||||
endif # FLASH && SPI
|
|
||||||
|
|
||||||
if USB_DEVICE_STACK
|
|
||||||
|
|
||||||
config USB_VBUS_GPIO
|
|
||||||
default y
|
|
||||||
|
|
||||||
config USB_VBUS_GPIO_DEV_NAME
|
|
||||||
default "GPIO_0"
|
|
||||||
|
|
||||||
config USB_VBUS_GPIO_PIN_NUM
|
|
||||||
default 28
|
|
||||||
|
|
||||||
endif # USB_DEVICE_STACK
|
|
||||||
|
|
||||||
endif # BOARD_ARDUINO_101
|
|
|
@ -1,81 +0,0 @@
|
||||||
/* SPDX-License-Identifier: Apache-2.0 */
|
|
||||||
|
|
||||||
/dts-v1/;
|
|
||||||
|
|
||||||
#include <mem.h>
|
|
||||||
|
|
||||||
#define DT_FLASH_SIZE DT_SIZE_K(144)
|
|
||||||
#define DT_SRAM_SIZE DT_SIZE_K(52)
|
|
||||||
|
|
||||||
#include "intel_curie.dtsi"
|
|
||||||
|
|
||||||
/ {
|
|
||||||
model = "Arduino 101";
|
|
||||||
compatible = "arduino,101","intel,quark";
|
|
||||||
|
|
||||||
aliases {
|
|
||||||
led0 = &led0;
|
|
||||||
uart-0 = &uart0;
|
|
||||||
uart-1 = &uart1;
|
|
||||||
};
|
|
||||||
|
|
||||||
chosen {
|
|
||||||
zephyr,sram = &sram0;
|
|
||||||
zephyr,flash = &flash0;
|
|
||||||
zephyr,console = &uart1;
|
|
||||||
zephyr,shell-uart = &uart1;
|
|
||||||
zephyr,bt-uart = &uart0;
|
|
||||||
zephyr,uart-pipe = &uart1;
|
|
||||||
zephyr,bt-mon-uart = &uart1;
|
|
||||||
};
|
|
||||||
|
|
||||||
leds {
|
|
||||||
compatible = "gpio-leds";
|
|
||||||
led0: led_0 {
|
|
||||||
gpios = <&gpio0 8 0>;
|
|
||||||
label = "LED";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
&uart0 {
|
|
||||||
status = "okay";
|
|
||||||
current-speed = <1000000>;
|
|
||||||
};
|
|
||||||
|
|
||||||
&uart1 {
|
|
||||||
status = "okay";
|
|
||||||
current-speed = <115200>;
|
|
||||||
};
|
|
||||||
|
|
||||||
&i2c0 {
|
|
||||||
status = "okay";
|
|
||||||
clock-frequency = <I2C_BITRATE_FAST>;
|
|
||||||
};
|
|
||||||
|
|
||||||
&i2c1 {
|
|
||||||
status = "okay";
|
|
||||||
clock-frequency = <I2C_BITRATE_FAST>;
|
|
||||||
};
|
|
||||||
|
|
||||||
&spi0 {
|
|
||||||
status = "okay";
|
|
||||||
cs-gpios = <&gpio0 24 0>;
|
|
||||||
|
|
||||||
spi-flash@0 {
|
|
||||||
#address-cells = <1>;
|
|
||||||
#size-cells = <1>;
|
|
||||||
compatible = "winbond,w25q16", "jedec,spi-nor";
|
|
||||||
label = "W25Q16";
|
|
||||||
reg = <0>;
|
|
||||||
spi-max-frequency = <8000000>;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
&spi1 {
|
|
||||||
status = "okay";
|
|
||||||
};
|
|
||||||
|
|
||||||
&spi2 {
|
|
||||||
status = "okay";
|
|
||||||
};
|
|
|
@ -1,19 +0,0 @@
|
||||||
identifier: arduino_101
|
|
||||||
name: Arduino 101
|
|
||||||
type: mcu
|
|
||||||
arch: x86
|
|
||||||
toolchain:
|
|
||||||
- zephyr
|
|
||||||
- issm
|
|
||||||
- xtools
|
|
||||||
supported:
|
|
||||||
- usb_device
|
|
||||||
- ble
|
|
||||||
- aio
|
|
||||||
- spi
|
|
||||||
- i2c
|
|
||||||
- dma
|
|
||||||
- gpio
|
|
||||||
- pwm
|
|
||||||
ram: 52
|
|
||||||
flash: 144
|
|
|
@ -1,16 +0,0 @@
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
CONFIG_X86=y
|
|
||||||
CONFIG_SOC_QUARK_SE_C1000=y
|
|
||||||
CONFIG_SOC_SERIES_QUARK_SE=y
|
|
||||||
CONFIG_BOARD_ARDUINO_101=y
|
|
||||||
CONFIG_CPU_MINUTEIA=y
|
|
||||||
CONFIG_CONSOLE=y
|
|
||||||
CONFIG_UART_CONSOLE=y
|
|
||||||
CONFIG_SERIAL=y
|
|
||||||
CONFIG_UART_QMSI=y
|
|
||||||
CONFIG_UART_QMSI_0=y
|
|
||||||
CONFIG_UART_QMSI_0_HW_FC=y
|
|
||||||
CONFIG_PRINTK=y
|
|
||||||
CONFIG_PINMUX=y
|
|
||||||
CONFIG_GPIO=y
|
|
|
@ -1,16 +0,0 @@
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
CONFIG_X86=y
|
|
||||||
CONFIG_SOC_QUARK_SE_C1000=y
|
|
||||||
CONFIG_SOC_SERIES_QUARK_SE=y
|
|
||||||
CONFIG_BOARD_ARDUINO_101=y
|
|
||||||
CONFIG_CPU_MINUTEIA=y
|
|
||||||
CONFIG_CONSOLE=y
|
|
||||||
CONFIG_UART_CONSOLE=y
|
|
||||||
CONFIG_SERIAL=y
|
|
||||||
CONFIG_UART_QMSI=y
|
|
||||||
CONFIG_UART_QMSI_0_HW_FC=y
|
|
||||||
CONFIG_PRINTK=y
|
|
||||||
CONFIG_PINMUX=y
|
|
||||||
CONFIG_GPIO=y
|
|
||||||
CONFIG_TEXT_SECTION_OFFSET=0x200
|
|
|
@ -1,13 +0,0 @@
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
if(DEFINED ENV{ZEPHYR_FLASH_OVER_DFU})
|
|
||||||
board_set_flasher_ifnset(dfu-util)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
board_set_debugger_ifnset(openocd)
|
|
||||||
|
|
||||||
board_runner_args(dfu-util "--pid=8087:0aba" "--alt=x86_app")
|
|
||||||
board_runner_args(openocd --cmd-pre-load "targets 1")
|
|
||||||
|
|
||||||
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
|
|
||||||
include(${ZEPHYR_BASE}/boards/common/dfu-util.board.cmake)
|
|
Binary file not shown.
Before Width: | Height: | Size: 61 KiB |
Binary file not shown.
Before Width: | Height: | Size: 101 KiB |
|
@ -1,452 +0,0 @@
|
||||||
.. _arduino_101:
|
|
||||||
|
|
||||||
Arduino/Genuino 101
|
|
||||||
###################
|
|
||||||
|
|
||||||
Overview
|
|
||||||
********
|
|
||||||
|
|
||||||
The Arduino/Genuino 101 is a learning and development board which contains an
|
|
||||||
Intel |reg| Curie |trade| Module. This board is designed to integrate the core's low
|
|
||||||
power-consumption and high performance with the Arduino's ease-of-use. The
|
|
||||||
Arduino 101 adds Bluetooth Low Energy capabilities and has an on-board 6-axis
|
|
||||||
accelerometer/gyroscope, providing exciting opportunities for building creative
|
|
||||||
projects in the connected world.
|
|
||||||
|
|
||||||
.. figure:: img/arduino_101.jpg
|
|
||||||
:width: 442px
|
|
||||||
:align: center
|
|
||||||
:alt: Arduino/Genuino 101
|
|
||||||
|
|
||||||
Arduino/Genuino 101 (Credit: Intel)
|
|
||||||
|
|
||||||
The Intel Quark* SE SoC in the Curie module contains a single core 32 MHz x86
|
|
||||||
(Intel Quark* processor) and the 32 MHz Argonaut RISC Core (ARC)* EM processor.
|
|
||||||
The two processors operate simultaneously and share memory. The ARC processor is
|
|
||||||
also referenced as the digital signal processor (DSP) sensor hub or a sensor
|
|
||||||
subsystem depending on what document you're looking at. In theory, the DSP can
|
|
||||||
run using a minimal amount of power, gathering and processing sensor data while
|
|
||||||
the x86 processor waits in a low power mode, which would be ideal for always-on
|
|
||||||
applications.
|
|
||||||
|
|
||||||
Zephyr can be flashed to an Arduino 101 for experimentation and testing
|
|
||||||
purposes; keep in mind that running the Zephyr OS on the Arduino 101 is not
|
|
||||||
supported by Arduino LLC.
|
|
||||||
|
|
||||||
Hardware
|
|
||||||
********
|
|
||||||
|
|
||||||
Board Layout
|
|
||||||
============
|
|
||||||
|
|
||||||
General information for the board can be found at the
|
|
||||||
`Arduino 101 website <https://www.arduino.cc/en/Main/ArduinoBoard101>`_,
|
|
||||||
which also includes schematics and BRD files
|
|
||||||
for the board.
|
|
||||||
|
|
||||||
Arduino 101 Pinout
|
|
||||||
==================
|
|
||||||
|
|
||||||
When using the Zephyr kernel, the pinout mapping for the Arduino 101 becomes a
|
|
||||||
little more complicated. The table below details which pins in Zephyr map to
|
|
||||||
those on the Arduino 101 board for control. Full details of the pinmux
|
|
||||||
implementation, what valid options can be configured, and where things map can
|
|
||||||
be found in the :zephyr_file:`boards/x86/arduino_101/pinmux.c` file.
|
|
||||||
|
|
||||||
|
|
||||||
+-------------+----------+------------+
|
|
||||||
| Arduino Pin | Function | Zephyr Pin |
|
|
||||||
+=============+==========+============+
|
|
||||||
| IO-0 | UART1-RX | 17 |
|
|
||||||
+-------------+----------+------------+
|
|
||||||
| IO-1 | UART1-TX | 16 |
|
|
||||||
+-------------+----------+------------+
|
|
||||||
| IO-2 | GPIO | 52 |
|
|
||||||
+-------------+----------+------------+
|
|
||||||
| IO-3 | GPIO | 51 |
|
|
||||||
| | | 63 |
|
|
||||||
+-------------+----------+------------+
|
|
||||||
| IO-4 | GPIO | 53 |
|
|
||||||
+-------------+----------+------------+
|
|
||||||
| IO-5 | GPIO | 49 |
|
|
||||||
| | | 64 |
|
|
||||||
+-------------+----------+------------+
|
|
||||||
| IO-6 | PWM2 | 65 |
|
|
||||||
+-------------+----------+------------+
|
|
||||||
| IO-7 | GPIO | 54 |
|
|
||||||
+-------------+----------+------------+
|
|
||||||
| IO-8 | GPIO | 50 |
|
|
||||||
+-------------+----------+------------+
|
|
||||||
| IO-9 | PWM3 | 66 |
|
|
||||||
+-------------+----------+------------+
|
|
||||||
| IO-10 | AIN0 | 0 |
|
|
||||||
+-------------+----------+------------+
|
|
||||||
| IO-11 | AIN3 | 3 |
|
|
||||||
+-------------+----------+------------+
|
|
||||||
| IO-12 | AIN1 | 1 |
|
|
||||||
+-------------+----------+------------+
|
|
||||||
| IO-13 | AIN2 | 2 |
|
|
||||||
+-------------+----------+------------+
|
|
||||||
| ADC0 | GPIO SS | 10 |
|
|
||||||
+-------------+----------+------------+
|
|
||||||
| ADC1 | GPIO SS | 11 |
|
|
||||||
+-------------+----------+------------+
|
|
||||||
| ADC2 | GPIO SS | 12 |
|
|
||||||
+-------------+----------+------------+
|
|
||||||
| ADC3 | GPIO SS | 13 |
|
|
||||||
+-------------+----------+------------+
|
|
||||||
| ADC4 | AIN14 | 14 |
|
|
||||||
+-------------+----------+------------+
|
|
||||||
| ADC5 | AIN9 | 9 |
|
|
||||||
+-------------+----------+------------+
|
|
||||||
|
|
||||||
.. note::
|
|
||||||
|
|
||||||
IO-3 and IO-5 require both pins to be set for functionality changes.
|
|
||||||
|
|
||||||
Supported Features
|
|
||||||
==================
|
|
||||||
|
|
||||||
The Zephyr kernel supports multiple hardware features on the Arduino 101 through
|
|
||||||
the use of drivers. Some drivers are functional on the x86 side only, some on
|
|
||||||
the ARC side only, and a few are functional on both sides. The table below shows
|
|
||||||
which drivers and functionality can be found on which architectures:
|
|
||||||
|
|
||||||
+-----------+------------+-----+-----+-----------------------+
|
|
||||||
| Interface | Controller | ARC | x86 | Driver/Component |
|
|
||||||
+===========+============+=====+=====+=======================+
|
|
||||||
| APIC | on-chip | N | Y | interrupt_controller |
|
|
||||||
+-----------+------------+-----+-----+-----------------------+
|
|
||||||
| UART | on-chip | N | Y | serial port-polling; |
|
|
||||||
| | | | | serial port-interrupt |
|
|
||||||
+-----------+------------+-----+-----+-----------------------+
|
|
||||||
| SPI | on-chip | Y | Y | spi |
|
|
||||||
+-----------+------------+-----+-----+-----------------------+
|
|
||||||
| ADC | on-chip | Y | N | adc |
|
|
||||||
+-----------+------------+-----+-----+-----------------------+
|
|
||||||
| I2C | on-chip | Y | Y | i2c |
|
|
||||||
+-----------+------------+-----+-----+-----------------------+
|
|
||||||
| GPIO | on-chip | Y | Y | gpio |
|
|
||||||
+-----------+------------+-----+-----+-----------------------+
|
|
||||||
| PWM | on-chip | Y | Y | pwm |
|
|
||||||
+-----------+------------+-----+-----+-----------------------+
|
|
||||||
| mailbox | on-chip | Y | Y | ipm |
|
|
||||||
+-----------+------------+-----+-----+-----------------------+
|
|
||||||
|
|
||||||
Required Hardware and Software
|
|
||||||
==============================
|
|
||||||
|
|
||||||
Before flashing the Zephyr kernel onto an Arduino 101, a few additional pieces
|
|
||||||
of hardware are required.
|
|
||||||
|
|
||||||
* The USB port for power will work; however, we recommend the 7V-12V barrel
|
|
||||||
connector be used when working with the JTAG connector.
|
|
||||||
* If you wish to grab any data off the serial port, you will need a TTL-to-USB
|
|
||||||
adapter. The following adapters require male-to-male jumper cables in order to
|
|
||||||
connect to the Arduino 101 board.
|
|
||||||
|
|
||||||
* USB to 3.3V TTL Serial Cable
|
|
||||||
* FTDI USB to TTL Serial Part #TTL-232R-3V3 http://www.ftdichip.com/Products/Cables/USBTTLSerial.htm
|
|
||||||
|
|
||||||
We recommend using the ``dfu-util`` tool to flash the Arduino 101 board.
|
|
||||||
For Linux environments, verify that ``udev`` has the proper rules for granting
|
|
||||||
you access to the Arduino 101 board in DFU mode. You can easily add the required
|
|
||||||
rules, using the ``create_dfu_udev_rule`` script provided with the
|
|
||||||
`Intel Curie Boards package`_ for the Arduino Desktop IDE. You can get and run
|
|
||||||
this script standalone with the following commands:
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ wget https://github.com/01org/intel-arduino-tools/raw/linux64/scripts/create_dfu_udev_rule
|
|
||||||
$ chmod +x create_dfu_udev_rule
|
|
||||||
$ sudo ./create_dfu_udev_rule
|
|
||||||
$ rm create_dfu_udev_rule
|
|
||||||
|
|
||||||
If you'd like to flash using JTAG, the following additional hardware is needed:
|
|
||||||
|
|
||||||
* Flyswatter2 JTAG debugger
|
|
||||||
* ARM Micro JTAG Connector, Model: ARM-JTAG-20-10
|
|
||||||
|
|
||||||
Connecting Serial Output
|
|
||||||
========================
|
|
||||||
|
|
||||||
The default configuration defined in the Zephyr kernel supports serial output
|
|
||||||
via the UART1 on the board. To read the output, you will need a USB to 3.3V TTL
|
|
||||||
serial cable. To enable serial output:
|
|
||||||
|
|
||||||
* Connect the Serial Cable RX pin to the Arduino 101's TX->1 pin.
|
|
||||||
* Connect the Serial Cable TX pin to the Arduino 101's RX<-0 pin.
|
|
||||||
* Connect the Serial Cable GND pin to the Arduino 101's GND pin.
|
|
||||||
|
|
||||||
Once connected, on your development environment, you will need to:
|
|
||||||
|
|
||||||
* Open a serial port emulator (i.e. on Linux minicom, screen, etc)
|
|
||||||
* Attach to the USB to TTL Serial cable, for example, on Linux this may be
|
|
||||||
/dev/ttyUSB0
|
|
||||||
* Set the communication details to:
|
|
||||||
|
|
||||||
* Speed: 115200
|
|
||||||
* Data: 8 bits
|
|
||||||
* Parity: None
|
|
||||||
* Stopbits: 1
|
|
||||||
|
|
||||||
Programming and Debugging
|
|
||||||
*************************
|
|
||||||
|
|
||||||
The Arduino 101 is powered by a Quark CPU and a sensor subsystem powered by an
|
|
||||||
ARC processor. When building applications, depending on the usage, two Zephyr
|
|
||||||
images need to be built and flashed.
|
|
||||||
|
|
||||||
The Arduino 101 has a bootloader that supports flashing over USB using the DFU
|
|
||||||
protocol. Additionally, the factory installed bootloader supports flashing of
|
|
||||||
the firmware for the Bluetooth device of the Curie module.
|
|
||||||
|
|
||||||
Use the ``arduino_101`` board definition to build a kernel for the Quark core. Use
|
|
||||||
the ``arduino_101_sss`` board definition when targeting the sensor subsystem.
|
|
||||||
|
|
||||||
When your application is targeting the Quark processor only, it is important to
|
|
||||||
disable the sensor subsystem processor using the ``CONFIG_ARC_INIT=n`` option,
|
|
||||||
otherwise the board will appear to hang waiting for the sensor subsystem
|
|
||||||
processor to boot.
|
|
||||||
|
|
||||||
|
|
||||||
Bootloader (Boot ROM)
|
|
||||||
=====================
|
|
||||||
|
|
||||||
Support for the `QMSI Bootloader`_ has been removed starting from Zephyr 1.4.0.
|
|
||||||
Thus, the factory boot ROM can be kept supporting the flashing of the board over
|
|
||||||
DFU and flashing the Bluetooth firmware.
|
|
||||||
|
|
||||||
If you have previously installed a different boot ROM it is recommended to
|
|
||||||
restore the factory boot ROM image using the `Flashpack Utility`_. Consult
|
|
||||||
the README available in the `Flashpack Utility`_ package and follow the
|
|
||||||
instructions for your environment.
|
|
||||||
|
|
||||||
Flashing
|
|
||||||
========
|
|
||||||
|
|
||||||
The ``dfu-util`` flashing application will only recognize the Arduino 101 as a
|
|
||||||
DFU-capable device within five seconds after the Master Reset button is pressed
|
|
||||||
on the board. You can run this application with the help of the Zephyr build
|
|
||||||
system by defining the environment variable ``ZEPHYR_FLASH_OVER_DFU=y`` before
|
|
||||||
flashing Zephyr applications (as described in :ref:`application_run`).
|
|
||||||
|
|
||||||
If you regularly use this method, you can add the following line into your
|
|
||||||
``~/.zephyrrc`` file:
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
export ZEPHYR_FLASH_OVER_DFU=y
|
|
||||||
|
|
||||||
Flashing the Sensor Subsystem Core
|
|
||||||
----------------------------------
|
|
||||||
When building for the ARC processor, the board type is listed as
|
|
||||||
``arduino_101_sss``.
|
|
||||||
|
|
||||||
The sample application :ref:`hello_world` is used for this tutorial. To build
|
|
||||||
and flash this application using ``dfu-util``, first set
|
|
||||||
``ZEPHYR_FLASH_OVER_DFU=y`` in the environment as described above, then run:
|
|
||||||
|
|
||||||
.. zephyr-app-commands::
|
|
||||||
:zephyr-app: samples/hello_world
|
|
||||||
:board: arduino_101_sss
|
|
||||||
:build-dir: arduino_101_sss
|
|
||||||
:goals: build flash
|
|
||||||
|
|
||||||
Flashing the x86 Application Core
|
|
||||||
---------------------------------
|
|
||||||
|
|
||||||
When building for the x86 processor, the board type is listed as
|
|
||||||
``arduino_101``. To build and flash the :ref:`hello_world` application to this
|
|
||||||
board using ``dfu-util``, first set ``ZEPHYR_FLASH_OVER_DFU=y`` in the
|
|
||||||
environment as described above, then run:
|
|
||||||
|
|
||||||
.. zephyr-app-commands::
|
|
||||||
:zephyr-app: samples/hello_world
|
|
||||||
:board: arduino_101
|
|
||||||
:build-dir: arduino_101
|
|
||||||
:goals: build flash
|
|
||||||
|
|
||||||
.. _bluetooth_firmware_arduino_101:
|
|
||||||
|
|
||||||
Flashing the Bluetooth Core
|
|
||||||
---------------------------
|
|
||||||
|
|
||||||
To be interoperable with the Zephyr Bluetooth stack the Bluetooth controller of
|
|
||||||
the Arduino 101 (Nordic Semiconductor nRF51) needs to be flashed with a
|
|
||||||
compatible firmware.
|
|
||||||
|
|
||||||
The Arduino 101 factory-installed firmware on this controller is not supported
|
|
||||||
by the Zephyr project, so you need to flash a new one onto it.
|
|
||||||
|
|
||||||
Luckily, starting with Zephyr 1.6, Zephyr itself is able to act as the firmware
|
|
||||||
for the controller. The application you need is ``samples/bluetooth/hci_uart`` and
|
|
||||||
the target board is called ``curie_ble``.
|
|
||||||
|
|
||||||
To build the Bluetooth controller image and flash it using ``dfu-util``, first
|
|
||||||
set ``ZEPHYR_FLASH_OVER_DFU=y`` in the environment as described above, then
|
|
||||||
run:
|
|
||||||
|
|
||||||
.. zephyr-app-commands::
|
|
||||||
:zephyr-app: samples/bluetooth/hci_uart
|
|
||||||
:board: curie_ble
|
|
||||||
:goals: build flash
|
|
||||||
|
|
||||||
After successfully completing these steps your Arduino 101 should now have a HCI
|
|
||||||
compatible BLE firmware.
|
|
||||||
|
|
||||||
|
|
||||||
Flashing using JTAG Adapter
|
|
||||||
---------------------------
|
|
||||||
|
|
||||||
We recommend using the ``dfu-util`` tool to flash the Arduino 101 board for typical
|
|
||||||
development work. JTAG is intended for advanced development and debugging.
|
|
||||||
|
|
||||||
* Connect the ARM Micro JTAG Connector to the Flyswatter2.
|
|
||||||
|
|
||||||
* Locate the micro JTAG header on the Arduino 101 board. It is adjacent to the
|
|
||||||
SCL and SDA pins in the Arduino headers, highlighted as the red square in the
|
|
||||||
figure below.
|
|
||||||
|
|
||||||
.. figure:: img/arduino_101_flat.jpg
|
|
||||||
:width: 442px
|
|
||||||
:align: center
|
|
||||||
:alt: Arduino/Genuino 101 JTAG
|
|
||||||
|
|
||||||
* Beside the micro JTAG header is a small white dot indicating the location of
|
|
||||||
pin 1 on the header. The green arrow on the figure points to the dot.
|
|
||||||
|
|
||||||
* Connect the ARM Micro JTAG Connector to the Arduino 101 micro JTAG header.
|
|
||||||
|
|
||||||
Ensure that both the cable and header pin 1 locations line up. The cable from
|
|
||||||
the ARM Micro JTAG Connector uses a red wire on the cable to denote which end on
|
|
||||||
the cable has the pin 1.
|
|
||||||
|
|
||||||
For Linux environments, to control the Flyswatter2 your Linux account needs to be
|
|
||||||
granted HAL layer interaction permissions. This is done through the group
|
|
||||||
'plugdev'. Verifying the group exists and adding your username can be
|
|
||||||
accomplished with the usermod command:
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ sudo usermod -a -G plugdev $LOGNAME
|
|
||||||
|
|
||||||
If the group does not exist, you can add it by running the following command:
|
|
||||||
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ sudo groupadd -r plugdev
|
|
||||||
|
|
||||||
For Linux environments, verify that ``udev`` has the proper rules for giving your
|
|
||||||
user control of the Flyswatter2 device. Adding the following rule to udev will
|
|
||||||
give members of the plugdev group control of the Flyswatter2.
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ sudo su
|
|
||||||
$ cat <<EOF > /etc/udev/rules.d/99-openocd.rules
|
|
||||||
# TinCanTools Flyswatter2
|
|
||||||
ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6010", MODE="664", GROUP="plugdev"
|
|
||||||
EOF
|
|
||||||
$ exit
|
|
||||||
|
|
||||||
Once your udev rules are setup, you will need to reload the rules:
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ sudo udevadm control --reload-rules
|
|
||||||
|
|
||||||
Plug the USB Type B cable into the Flyswatter2 and your computer. On Linux, you
|
|
||||||
should see something similar to the following in your dmesg:
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
usb 1-2.1.1: new high-speed USB device number 13 using xhci_hcd
|
|
||||||
usb 1-2.1.1: New USB device found, idVendor=0403, idProduct=6010
|
|
||||||
usb 1-2.1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
|
|
||||||
usb 1-2.1.1: Product: Flyswatter2
|
|
||||||
usb 1-2.1.1: Manufacturer: TinCanTools
|
|
||||||
usb 1-2.1.1: SerialNumber: FS20000
|
|
||||||
ftdi_sio 1-2.1.1:1.0: FTDI USB Serial Device converter detected
|
|
||||||
usb 1-2.1.1: Detected FT2232H
|
|
||||||
usb 1-2.1.1: FTDI USB Serial Device converter now attached to ttyUSB0
|
|
||||||
ftdi_sio 1-2.1.1:1.1: FTDI USB Serial Device converter detected
|
|
||||||
usb 1-2.1.1: Detected FT2232H
|
|
||||||
usb 1-2.1.1: FTDI USB Serial Device converter now attached to ttyUSB1
|
|
||||||
|
|
||||||
|
|
||||||
Debugging
|
|
||||||
=========
|
|
||||||
|
|
||||||
The instructions below will help you debug the Arduino 101 on the x86 core or
|
|
||||||
the ARC core, respectively.
|
|
||||||
|
|
||||||
Application Core (x86)
|
|
||||||
----------------------
|
|
||||||
|
|
||||||
Build and flash an x86 application, then launch a debugging server with the
|
|
||||||
following commands:
|
|
||||||
|
|
||||||
.. zephyr-app-commands::
|
|
||||||
:app: <my x86 app>
|
|
||||||
:board: arduino_101
|
|
||||||
:goals: build flash debugserver
|
|
||||||
|
|
||||||
Connect to the debug server at the x86 core from a second console:
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ cd <my x86 app>
|
|
||||||
$ $ZEPHYR_SDK_INSTALL_DIR/sysroots/x86_64-pokysdk-linux/usr/bin/i586-zephyr-elfiamcu/i586-zephyr-elfiamcu-gdb build/zephyr/zephyr.elf
|
|
||||||
(gdb) target remote localhost:3333
|
|
||||||
(gdb) b main
|
|
||||||
(gdb) c
|
|
||||||
|
|
||||||
Sensor Subsystem Core (ARC)
|
|
||||||
---------------------------
|
|
||||||
|
|
||||||
The sensor subsystem can be enabled from the x86 core (application processor).
|
|
||||||
This can be done by flashing an application to the x86 core that sets the
|
|
||||||
``CONFIG_ARC_INIT=y`` option.
|
|
||||||
|
|
||||||
Then build the ARC application, flash it, and launch a debug server with the
|
|
||||||
following commands:
|
|
||||||
|
|
||||||
.. zephyr-app-commands::
|
|
||||||
:app: <my arc app>
|
|
||||||
:board: arduino_101_sss
|
|
||||||
:goals: flash debugserver
|
|
||||||
|
|
||||||
Connect to the debug server at the ARC core from a second console:
|
|
||||||
|
|
||||||
.. code-block:: console
|
|
||||||
|
|
||||||
$ cd <my arc app>
|
|
||||||
$ $ZEPHYR_SDK_INSTALL_DIR/sysroots/x86_64-pokysdk-linux/usr/bin/arc-zephyr-elf/arc-zephyr-elf-gdb build/zephyr/zephyr.elf
|
|
||||||
(gdb) target remote localhost:3334
|
|
||||||
(gdb) b main
|
|
||||||
(gdb) c
|
|
||||||
|
|
||||||
|
|
||||||
Bluetooth Firmware
|
|
||||||
------------------
|
|
||||||
|
|
||||||
See :ref:`bluetooth-hci-tracing` to find out how to debug the Bluetooth
|
|
||||||
firmware.
|
|
||||||
|
|
||||||
Release Notes
|
|
||||||
*************
|
|
||||||
When debugging on ARC, it is important that the x86 core be started and running
|
|
||||||
BEFORE attempting to debug on ARC. This is because the IPM console calls will
|
|
||||||
hang waiting for the x86 core to clear the communication.
|
|
||||||
|
|
||||||
|
|
||||||
References
|
|
||||||
**********
|
|
||||||
|
|
||||||
.. _QMSI Bootloader: https://github.com/quark-mcu/qm-bootloader
|
|
||||||
|
|
||||||
.. _Flashpack Utility: https://downloadcenter.intel.com/downloads/eula/25470/Arduino-101-software-package?httpDown=https%3A%2F%2Fdownloadmirror.intel.com%2F25470%2Feng%2Farduino101-factory_recovery-flashpack.tar.bz2
|
|
||||||
|
|
||||||
.. _Intel Curie Boards package: https://www.arduino.cc/en/Guide/Arduino101#toc2
|
|
|
@ -1,80 +0,0 @@
|
||||||
/* nrf51-pm.c Power Management for nrf51 chip */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2016 Intel Corporation
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <zephyr.h>
|
|
||||||
#include <drivers/gpio.h>
|
|
||||||
#include <drivers/uart.h>
|
|
||||||
|
|
||||||
#include <errno.h>
|
|
||||||
|
|
||||||
#define NBLE_SWDIO_PIN 6
|
|
||||||
#define NBLE_RESET_PIN NBLE_SWDIO_PIN
|
|
||||||
#define NBLE_BTWAKE_PIN 5
|
|
||||||
|
|
||||||
static struct device *nrf51_gpio;
|
|
||||||
|
|
||||||
static int nrf51_wakeup(void)
|
|
||||||
{
|
|
||||||
return gpio_pin_write(nrf51_gpio, NBLE_BTWAKE_PIN, 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
int bt_hci_transport_setup(struct device *dev)
|
|
||||||
{
|
|
||||||
u8_t c;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
nrf51_gpio = device_get_binding("GPIO_0");
|
|
||||||
if (!nrf51_gpio) {
|
|
||||||
return -ENODEV;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = gpio_pin_configure(nrf51_gpio, NBLE_RESET_PIN, GPIO_DIR_OUT);
|
|
||||||
if (ret) {
|
|
||||||
return -ENODEV;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Reset hold time is 0.2us (normal) or 100us (SWD debug) */
|
|
||||||
ret = gpio_pin_write(nrf51_gpio, NBLE_RESET_PIN, 0);
|
|
||||||
if (ret) {
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Drain the fifo */
|
|
||||||
while (uart_fifo_read(dev, &c, 1)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* NBLE reset is achieved by asserting low the SWDIO pin.
|
|
||||||
* However, the BLE Core chip can be in SWD debug mode,
|
|
||||||
* and NRF_POWER->RESET = 0 due to, other constraints: therefore,
|
|
||||||
* this reset might not work everytime, especially after
|
|
||||||
* flashing or debugging.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* sleep 1ms depending on context */
|
|
||||||
k_sleep(1);
|
|
||||||
|
|
||||||
ret = gpio_pin_write(nrf51_gpio, NBLE_RESET_PIN, 1);
|
|
||||||
if (ret) {
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Set back GPIO to input to avoid interfering with external debugger */
|
|
||||||
ret = gpio_pin_configure(nrf51_gpio, NBLE_RESET_PIN, GPIO_DIR_IN);
|
|
||||||
if (ret) {
|
|
||||||
return -ENODEV;
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = gpio_pin_configure(nrf51_gpio, NBLE_BTWAKE_PIN, GPIO_DIR_OUT);
|
|
||||||
if (ret) {
|
|
||||||
return -ENODEV;
|
|
||||||
}
|
|
||||||
|
|
||||||
return nrf51_wakeup();
|
|
||||||
}
|
|
|
@ -1,170 +0,0 @@
|
||||||
/* pinmux_board_arduino_101.c - Arduino 101 board pinmux driver */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2015 Intel Corporation
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
||||||
#include <kernel.h>
|
|
||||||
#include <soc.h>
|
|
||||||
#include <device.h>
|
|
||||||
#include <init.h>
|
|
||||||
#include <drivers/pinmux.h>
|
|
||||||
#include <sys/sys_io.h>
|
|
||||||
#include "pinmux/pinmux.h"
|
|
||||||
|
|
||||||
#include <pinmux_quark_mcu.h>
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This is the full pinmap that we have available on the board for configuration
|
|
||||||
* including the ball position and the various modes that can be set. In the
|
|
||||||
* pinmux_defaults we do not spend any time setting values that are using mode
|
|
||||||
* A as the hardware brings up all devices by default in mode A.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* pin, ball, mode A, mode B, mode C */
|
|
||||||
/* 0 F02, gpio_0, ain_0, spi_s_cs */ /* IO10 */
|
|
||||||
/* 1 G04, gpio_1, ain_1, spi_s_miso */ /* IO12 */
|
|
||||||
/* 2 H05, gpio_2, ain_2, spi_s_sck */ /* IO13 */
|
|
||||||
/* 3 J06, gpio_3, ain_3, spi_s_mosi */ /* IO11 */
|
|
||||||
/* 4 K06, gpio_4, ain_4, NA */
|
|
||||||
/* 5 L06, gpio_5, ain_5, NA */
|
|
||||||
/* 6 H04, gpio_6, ain_6, NA */
|
|
||||||
/* 7 G03, gpio_7, ain_7, NA */
|
|
||||||
/* 8 L05, gpio_ss_0, ain_8, uart1_cts */
|
|
||||||
/* 9 M05, gpio_ss_1, ain_9, uart1_rts */ /* AD5 */
|
|
||||||
/* 10 K05, gpio_ss_2, ain_10 */ /* AD0 */
|
|
||||||
/* 11 G01, gpio_ss_3, ain_11 */ /* AD1 */
|
|
||||||
/* 12 J04, gpio_ss_4, ain_12 */ /* AD2 */
|
|
||||||
/* 13 G02, gpio_ss_5, ain_13 */ /* AD3 */
|
|
||||||
/* 14 F01, gpio_ss_6, ain_14 */ /* AD4 */
|
|
||||||
/* 15 J05, gpio_ss_7, ain_15 */
|
|
||||||
/* 16 L04, gpio_ss_8, ain_16, uart1_txd */ /* IO1 */
|
|
||||||
/* 17 M04, gpio_ss_9, ain_17, uart1_rxd */ /* IO0 */
|
|
||||||
/* 18 K04, uart0_rx, ain_18, NA */
|
|
||||||
/* 19 B02, uart0_tx, gpio_31, NA */
|
|
||||||
/* 20 C01, i2c0_scl, NA, NA */
|
|
||||||
/* 21 C02, i2c0_sda, NA, NA */
|
|
||||||
/* 22 D01, i2c1_scl, NA, NA */
|
|
||||||
/* 23 D02, i2c1_sda, NA, NA */
|
|
||||||
/* 24 E01, i2c0_ss_sda, NA, NA */
|
|
||||||
/* 25 E02, i2c0_ss_scl, NA, NA */
|
|
||||||
/* 26 B03, i2c1_ss_sda, NA, NA */
|
|
||||||
/* 27 A03, i2c1_ss_scl, NA, NA */
|
|
||||||
/* 28 C03, spi0_ss_miso, NA, NA */
|
|
||||||
/* 29 E03, spi0_ss_mosi, NA, NA */
|
|
||||||
/* 30 D03, spi0_ss_sck, NA, NA */
|
|
||||||
/* 31 D04, spi0_ss_cs0, NA, NA */
|
|
||||||
/* 32 C04, spi0_ss_cs1, NA, NA */
|
|
||||||
/* 33 B04, spi0_ss_cs2, gpio_29, NA */
|
|
||||||
/* 34 A04, spi0_ss_cs3, gpio_30, NA */
|
|
||||||
/* 35 B05, spi1_ss_miso, NA, NA */
|
|
||||||
/* 36 C05, spi1_ss_mosi, NA, NA */
|
|
||||||
/* 37 D05, spi1_ss_sck, NA, NA */
|
|
||||||
/* 38 E05, spi1_ss_cs0, NA, NA */
|
|
||||||
/* 39 E04, spi1_ss_cs1, NA, NA */
|
|
||||||
/* 40 A06, spi1_ss_cs2, uart0_cts, NA */
|
|
||||||
/* 41 B06, spi1_ss_cs3, uart0_rts, NA */
|
|
||||||
/* 42 C06, gpio_8, spi1_m_sck, NA */ /* IO13 */
|
|
||||||
/* 43 D06, gpio_9, spi1_m_miso, NA */ /* IO12 */
|
|
||||||
/* 44 E06, gpio_10, spi1_m_mosi, NA */ /* IO11 */
|
|
||||||
/* 45 D07, gpio_11, spi1_m_cs0, NA */
|
|
||||||
/* 46 C07, gpio_12, spi1_m_cs1, NA */
|
|
||||||
/* 47 B07, gpio_13, spi1_m_cs2, NA */
|
|
||||||
/* 48 A07, gpio_14, spi1_m_cs3, NA */
|
|
||||||
/* 49 B08, gpio_15, i2s_rxd, NA */ /* IO5 */
|
|
||||||
/* 50 A08, gpio_16, i2s_rscki, NA */ /* IO8 */
|
|
||||||
/* 51 B09, gpio_17, i2s_rws, NA */ /* IO3 */
|
|
||||||
/* 52 A09, gpio_18, i2s_tsck, NA */ /* IO2 */
|
|
||||||
/* 53 C09, gpio_19, i2s_twsi, NA */ /* IO4 */
|
|
||||||
/* 54 D09, gpio_20, i2s_txd, NA */ /* IO7 */
|
|
||||||
/* 55 D08, gpio_21, spi0_m_sck, NA */
|
|
||||||
/* 56 E07, gpio_22, spi0_m_miso, NA */
|
|
||||||
/* 57 E09, gpio_23, spi0_m_mosi, NA */
|
|
||||||
/* 58 E08, gpio_24, spi0_m_cs0, NA */
|
|
||||||
/* 59 A10, gpio_25, spi0_m_cs1, NA */
|
|
||||||
/* 60 B10, gpio_26, spi0_m_cs2, NA */
|
|
||||||
/* 61 C10, gpio_27, spi0_m_cs3, NA */
|
|
||||||
/* 62 D10, gpio_28, NA, NA */
|
|
||||||
/* 63 E10, gpio_ss_10, pwm_0, NA */ /* IO3 */
|
|
||||||
/* 64 D11, gpio_ss_11, pwm_1, NA */ /* IO5 */
|
|
||||||
/* 65 C11, gpio_ss_12, pwm_2, NA */ /* IO6 */
|
|
||||||
/* 66 B11, gpio_ss_13, pwm_3, NA */ /* IO9 */
|
|
||||||
/* 67 D12, gpio_ss_14, clkout_32khz, NA */
|
|
||||||
/* 68 C12, gpio_ss_15, clkout_16mhz, NA */
|
|
||||||
|
|
||||||
/* Note:
|
|
||||||
* 1. I2C pins on the shield are connected to i2c0_ss_sda and i2c_0_ss_scl,
|
|
||||||
* which are on the sensor subsystem. They are also tied to AD4 and AD5.
|
|
||||||
* Therefore, to use I2C, pin 9 (ain_9) and pin 14 (ain_14) both need to be set
|
|
||||||
* to PINMUX_FUNC_B, so they will not interfere with I2C operations.
|
|
||||||
* Also, there is no internal pull-up on I2c bus, and thus external
|
|
||||||
* pull-up resistors are needed.
|
|
||||||
* 2. IO3/PWM0 is connected to pin 51 and 63.
|
|
||||||
* 3. IO5/PWM1 is connected to pin 49 and 64.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* On the QUARK_SE platform there are a minimum of 69 pins that can be possibly
|
|
||||||
* set. This would be a total of 5 registers to store the configuration as per
|
|
||||||
* the bit description from above
|
|
||||||
*/
|
|
||||||
#define PINMUX_MAX_REGISTERS 5
|
|
||||||
|
|
||||||
static void pinmux_defaults(u32_t base)
|
|
||||||
{
|
|
||||||
u32_t mux_config[PINMUX_MAX_REGISTERS] = { 0, 0, 0, 0, 0 };
|
|
||||||
int i = 0;
|
|
||||||
|
|
||||||
#if !defined(CONFIG_SPI_1)
|
|
||||||
PIN_CONFIG(mux_config, 0, PINMUX_FUNC_B);
|
|
||||||
#endif
|
|
||||||
PIN_CONFIG(mux_config, 1, PINMUX_FUNC_B);
|
|
||||||
PIN_CONFIG(mux_config, 2, PINMUX_FUNC_B);
|
|
||||||
PIN_CONFIG(mux_config, 3, PINMUX_FUNC_B);
|
|
||||||
PIN_CONFIG(mux_config, 4, PINMUX_FUNC_B);
|
|
||||||
PIN_CONFIG(mux_config, 5, PINMUX_FUNC_B);
|
|
||||||
PIN_CONFIG(mux_config, 7, PINMUX_FUNC_B);
|
|
||||||
PIN_CONFIG(mux_config, 8, PINMUX_FUNC_C);
|
|
||||||
PIN_CONFIG(mux_config, 9, PINMUX_FUNC_B);
|
|
||||||
PIN_CONFIG(mux_config, 14, PINMUX_FUNC_B);
|
|
||||||
PIN_CONFIG(mux_config, 16, PINMUX_FUNC_C);
|
|
||||||
PIN_CONFIG(mux_config, 17, PINMUX_FUNC_C);
|
|
||||||
PIN_CONFIG(mux_config, 40, PINMUX_FUNC_B);
|
|
||||||
PIN_CONFIG(mux_config, 41, PINMUX_FUNC_B);
|
|
||||||
#ifdef CONFIG_SPI_1
|
|
||||||
PIN_CONFIG(mux_config, 42, PINMUX_FUNC_B);
|
|
||||||
PIN_CONFIG(mux_config, 43, PINMUX_FUNC_B);
|
|
||||||
PIN_CONFIG(mux_config, 44, PINMUX_FUNC_B);
|
|
||||||
PIN_CONFIG(mux_config, 45, PINMUX_FUNC_B);
|
|
||||||
#endif
|
|
||||||
PIN_CONFIG(mux_config, 55, PINMUX_FUNC_B);
|
|
||||||
PIN_CONFIG(mux_config, 56, PINMUX_FUNC_B);
|
|
||||||
PIN_CONFIG(mux_config, 57, PINMUX_FUNC_B);
|
|
||||||
PIN_CONFIG(mux_config, 63, PINMUX_FUNC_B);
|
|
||||||
PIN_CONFIG(mux_config, 64, PINMUX_FUNC_B);
|
|
||||||
PIN_CONFIG(mux_config, 65, PINMUX_FUNC_B);
|
|
||||||
PIN_CONFIG(mux_config, 66, PINMUX_FUNC_B);
|
|
||||||
|
|
||||||
for (i = 0; i < PINMUX_MAX_REGISTERS; i++) {
|
|
||||||
sys_write32(mux_config[i], PINMUX_SELECT_REGISTER(base, i));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void pinmux_pullups(u32_t base_address)
|
|
||||||
{
|
|
||||||
z_quark_mcu_set_mux(base_address + PINMUX_PULLUP_OFFSET, 104,
|
|
||||||
PINMUX_PULLUP_ENABLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int pinmux_initialize(struct device *port)
|
|
||||||
{
|
|
||||||
ARG_UNUSED(port);
|
|
||||||
|
|
||||||
pinmux_defaults(PINMUX_BASE_ADDR);
|
|
||||||
pinmux_pullups(PINMUX_BASE_ADDR);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
SYS_INIT(pinmux_initialize, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
|
|
@ -1,18 +0,0 @@
|
||||||
Restoring Original Bootloader RPM
|
|
||||||
=================================
|
|
||||||
|
|
||||||
If you have installed a custom bootloader on the Arduino 101 device for Zephyr
|
|
||||||
development you can restore the original bootloader using the flashpack utility
|
|
||||||
available from here:
|
|
||||||
|
|
||||||
https://downloadcenter.intel.com/downloads/eula/25470/Arduino-101-software-package?httpDown=https%3A%2F%2Fdownloadmirror.intel.com%2F25470%2Feng%2Farduino101-factory_recovery-flashpack.tar.bz2
|
|
||||||
|
|
||||||
Follow the README files in this package for instructions how to restore the
|
|
||||||
original factory settings.
|
|
||||||
|
|
||||||
The Arduino 101 board in Zephyr does support the original bootloader only now.
|
|
||||||
The advantages of the original bootloader are the following:
|
|
||||||
|
|
||||||
- Supports flashing using USB DFU
|
|
||||||
- Supports flashing the Bluetooth firmware
|
|
||||||
- Does not require JTAG
|
|
|
@ -1,12 +0,0 @@
|
||||||
source [find interface/ftdi/flyswatter2.cfg]
|
|
||||||
source [find board/quark_se.cfg]
|
|
||||||
|
|
||||||
quark_se.quark configure -event gdb-attach {
|
|
||||||
reset halt
|
|
||||||
gdb_breakpoint_override hard
|
|
||||||
}
|
|
||||||
|
|
||||||
quark_se.quark configure -event gdb-detach {
|
|
||||||
resume
|
|
||||||
shutdown
|
|
||||||
}
|
|
|
@ -1,5 +0,0 @@
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
zephyr_library()
|
|
||||||
zephyr_library_sources(pinmux.c)
|
|
||||||
zephyr_library_include_directories(${ZEPHYR_BASE}/drivers)
|
|
|
@ -1,5 +0,0 @@
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
config BOARD_TINYTILE
|
|
||||||
bool "TinyTILE"
|
|
||||||
depends on SOC_SERIES_QUARK_SE
|
|
|
@ -1,41 +0,0 @@
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
if BOARD_TINYTILE
|
|
||||||
|
|
||||||
config BOARD
|
|
||||||
default "tinytile"
|
|
||||||
|
|
||||||
config TEXT_SECTION_OFFSET
|
|
||||||
default 0x30
|
|
||||||
|
|
||||||
config SS_RESET_VECTOR
|
|
||||||
default 0x40034000
|
|
||||||
|
|
||||||
if USB
|
|
||||||
|
|
||||||
config USB_DW
|
|
||||||
default y
|
|
||||||
|
|
||||||
config USB_DEVICE_STACK
|
|
||||||
default y
|
|
||||||
|
|
||||||
config USB_VBUS_GPIO
|
|
||||||
default y
|
|
||||||
|
|
||||||
config USB_VBUS_GPIO_DEV_NAME
|
|
||||||
default "GPIO_0"
|
|
||||||
|
|
||||||
config USB_VBUS_GPIO_PIN_NUM
|
|
||||||
default 28
|
|
||||||
|
|
||||||
if USB_UART_CONSOLE
|
|
||||||
|
|
||||||
config UART_INTERRUPT_DRIVEN
|
|
||||||
default y
|
|
||||||
|
|
||||||
config UART_LINE_CTRL
|
|
||||||
default y
|
|
||||||
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
endif # BOARD_TINYTILE
|
|
|
@ -1,13 +0,0 @@
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
if(DEFINED ENV{ZEPHYR_FLASH_OVER_DFU})
|
|
||||||
board_set_flasher_ifnset(dfu-util)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
board_set_debugger_ifnset(openocd)
|
|
||||||
|
|
||||||
board_runner_args(dfu-util "--pid=8087:0aba" "--alt=x86_app")
|
|
||||||
board_runner_args(openocd --cmd-pre-load "targets 1")
|
|
||||||
|
|
||||||
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
|
|
||||||
include(${ZEPHYR_BASE}/boards/common/dfu-util.board.cmake)
|
|
|
@ -1,35 +0,0 @@
|
||||||
.. _tinytile:
|
|
||||||
|
|
||||||
tinyTILE
|
|
||||||
#########
|
|
||||||
|
|
||||||
Overview
|
|
||||||
********
|
|
||||||
|
|
||||||
tinyTILE is an Intel Curie module based board, a miniaturized adaptation of the
|
|
||||||
:ref:`Arduino/Genuino 101 <arduino_101>` board, measuring approx 35 x 26mm.
|
|
||||||
|
|
||||||
See :ref:`arduino_101` for information how to use the tinyTILE board with Zephyr.
|
|
||||||
|
|
||||||
.. figure:: ./tinytile.jpg
|
|
||||||
:width: 442px
|
|
||||||
:align: center
|
|
||||||
:alt: tinyTILE
|
|
||||||
|
|
||||||
tinyTILE
|
|
||||||
|
|
||||||
Features of the tinyTILE include:
|
|
||||||
|
|
||||||
- Intel |reg| Curie |trade| module dual-core (Intel |reg| Quark* processor core and ARC* core)
|
|
||||||
- Bluetooth |reg| low energy, 6-axis combo sensor and pattern matching engine
|
|
||||||
- 14 digital input/output pins (four can be used as PWM output pins)
|
|
||||||
- Four PWM output pins
|
|
||||||
- Six analog input pins
|
|
||||||
- Strictly 3.3 V I/Os only
|
|
||||||
- 20 mA DC current per I/O pin
|
|
||||||
- 196 kB Flash memory
|
|
||||||
- 24 kB SRAM
|
|
||||||
- 32 MHz clock speed
|
|
||||||
- USB connector for serial communication and firmware updates (DFU protocol)
|
|
||||||
- 35 mm length and 26 mm width
|
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 16 KiB |
|
@ -1,170 +0,0 @@
|
||||||
/* pinmux_board_tinytile.c - Arduino 101 board pinmux driver */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Copyright (c) 2015 Intel Corporation
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
||||||
#include <kernel.h>
|
|
||||||
#include <soc.h>
|
|
||||||
#include <device.h>
|
|
||||||
#include <init.h>
|
|
||||||
#include <drivers/pinmux.h>
|
|
||||||
#include <sys/sys_io.h>
|
|
||||||
#include "pinmux/pinmux.h"
|
|
||||||
|
|
||||||
#include "pinmux_quark_mcu.h"
|
|
||||||
|
|
||||||
/*
|
|
||||||
* This is the full pinmap that we have available on the board for configuration
|
|
||||||
* including the ball position and the various modes that can be set. In the
|
|
||||||
* pinmux_defaults we do not spend any time setting values that are using mode
|
|
||||||
* A as the hardware brings up all devices by default in mode A.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* pin, ball, mode A, mode B, mode C */
|
|
||||||
/* 0 F02, gpio_0, ain_0, spi_s_cs */ /* IO10 */
|
|
||||||
/* 1 G04, gpio_1, ain_1, spi_s_miso */ /* IO12 */
|
|
||||||
/* 2 H05, gpio_2, ain_2, spi_s_sck */ /* IO13 */
|
|
||||||
/* 3 J06, gpio_3, ain_3, spi_s_mosi */ /* IO11 */
|
|
||||||
/* 4 K06, gpio_4, ain_4, NA */
|
|
||||||
/* 5 L06, gpio_5, ain_5, NA */
|
|
||||||
/* 6 H04, gpio_6, ain_6, NA */
|
|
||||||
/* 7 G03, gpio_7, ain_7, NA */
|
|
||||||
/* 8 L05, gpio_ss_0, ain_8, uart1_cts */
|
|
||||||
/* 9 M05, gpio_ss_1, ain_9, uart1_rts */ /* AD5 */
|
|
||||||
/* 10 K05, gpio_ss_2, ain_10 */ /* AD0 */
|
|
||||||
/* 11 G01, gpio_ss_3, ain_11 */ /* AD1 */
|
|
||||||
/* 12 J04, gpio_ss_4, ain_12 */ /* AD2 */
|
|
||||||
/* 13 G02, gpio_ss_5, ain_13 */ /* AD3 */
|
|
||||||
/* 14 F01, gpio_ss_6, ain_14 */ /* AD4 */
|
|
||||||
/* 15 J05, gpio_ss_7, ain_15 */
|
|
||||||
/* 16 L04, gpio_ss_8, ain_16, uart1_txd */ /* IO1 */
|
|
||||||
/* 17 M04, gpio_ss_9, ain_17, uart1_rxd */ /* IO0 */
|
|
||||||
/* 18 K04, uart0_rx, ain_18, NA */
|
|
||||||
/* 19 B02, uart0_tx, gpio_31, NA */
|
|
||||||
/* 20 C01, i2c0_scl, NA, NA */
|
|
||||||
/* 21 C02, i2c0_sda, NA, NA */
|
|
||||||
/* 22 D01, i2c1_scl, NA, NA */
|
|
||||||
/* 23 D02, i2c1_sda, NA, NA */
|
|
||||||
/* 24 E01, i2c0_ss_sda, NA, NA */
|
|
||||||
/* 25 E02, i2c0_ss_scl, NA, NA */
|
|
||||||
/* 26 B03, i2c1_ss_sda, NA, NA */
|
|
||||||
/* 27 A03, i2c1_ss_scl, NA, NA */
|
|
||||||
/* 28 C03, spi0_ss_miso, NA, NA */
|
|
||||||
/* 29 E03, spi0_ss_mosi, NA, NA */
|
|
||||||
/* 30 D03, spi0_ss_sck, NA, NA */
|
|
||||||
/* 31 D04, spi0_ss_cs0, NA, NA */
|
|
||||||
/* 32 C04, spi0_ss_cs1, NA, NA */
|
|
||||||
/* 33 B04, spi0_ss_cs2, gpio_29, NA */
|
|
||||||
/* 34 A04, spi0_ss_cs3, gpio_30, NA */
|
|
||||||
/* 35 B05, spi1_ss_miso, NA, NA */
|
|
||||||
/* 36 C05, spi1_ss_mosi, NA, NA */
|
|
||||||
/* 37 D05, spi1_ss_sck, NA, NA */
|
|
||||||
/* 38 E05, spi1_ss_cs0, NA, NA */
|
|
||||||
/* 39 E04, spi1_ss_cs1, NA, NA */
|
|
||||||
/* 40 A06, spi1_ss_cs2, uart0_cts, NA */
|
|
||||||
/* 41 B06, spi1_ss_cs3, uart0_rts, NA */
|
|
||||||
/* 42 C06, gpio_8, spi1_m_sck, NA */ /* IO13 */
|
|
||||||
/* 43 D06, gpio_9, spi1_m_miso, NA */ /* IO12 */
|
|
||||||
/* 44 E06, gpio_10, spi1_m_mosi, NA */ /* IO11 */
|
|
||||||
/* 45 D07, gpio_11, spi1_m_cs0, NA */
|
|
||||||
/* 46 C07, gpio_12, spi1_m_cs1, NA */
|
|
||||||
/* 47 B07, gpio_13, spi1_m_cs2, NA */
|
|
||||||
/* 48 A07, gpio_14, spi1_m_cs3, NA */
|
|
||||||
/* 49 B08, gpio_15, i2s_rxd, NA */ /* IO5 */
|
|
||||||
/* 50 A08, gpio_16, i2s_rscki, NA */ /* IO8 */
|
|
||||||
/* 51 B09, gpio_17, i2s_rws, NA */ /* IO3 */
|
|
||||||
/* 52 A09, gpio_18, i2s_tsck, NA */ /* IO2 */
|
|
||||||
/* 53 C09, gpio_19, i2s_twsi, NA */ /* IO4 */
|
|
||||||
/* 54 D09, gpio_20, i2s_txd, NA */ /* IO7 */
|
|
||||||
/* 55 D08, gpio_21, spi0_m_sck, NA */
|
|
||||||
/* 56 E07, gpio_22, spi0_m_miso, NA */
|
|
||||||
/* 57 E09, gpio_23, spi0_m_mosi, NA */
|
|
||||||
/* 58 E08, gpio_24, spi0_m_cs0, NA */
|
|
||||||
/* 59 A10, gpio_25, spi0_m_cs1, NA */
|
|
||||||
/* 60 B10, gpio_26, spi0_m_cs2, NA */
|
|
||||||
/* 61 C10, gpio_27, spi0_m_cs3, NA */
|
|
||||||
/* 62 D10, gpio_28, NA, NA */
|
|
||||||
/* 63 E10, gpio_ss_10, pwm_0, NA */ /* IO3 */
|
|
||||||
/* 64 D11, gpio_ss_11, pwm_1, NA */ /* IO5 */
|
|
||||||
/* 65 C11, gpio_ss_12, pwm_2, NA */ /* IO6 */
|
|
||||||
/* 66 B11, gpio_ss_13, pwm_3, NA */ /* IO9 */
|
|
||||||
/* 67 D12, gpio_ss_14, clkout_32khz, NA */
|
|
||||||
/* 68 C12, gpio_ss_15, clkout_16mhz, NA */
|
|
||||||
|
|
||||||
/* Note:
|
|
||||||
* 1. I2C pins on the shield are connected to i2c0_ss_sda and i2c_0_ss_scl,
|
|
||||||
* which are on the sensor subsystem. They are also tied to AD4 and AD5.
|
|
||||||
* Therefore, to use I2C, pin 9 (ain_9) and pin 14 (ain_14) both need to be set
|
|
||||||
* to PINMUX_FUNC_B, so they will not interfere with I2C operations.
|
|
||||||
* Also, there is no internal pull-up on I2c bus, and thus external
|
|
||||||
* pull-up resistors are needed.
|
|
||||||
* 2. IO3/PWM0 is connected to pin 51 and 63.
|
|
||||||
* 3. IO5/PWM1 is connected to pin 49 and 64.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/*
|
|
||||||
* On the QUARK_SE platform there are a minimum of 69 pins that can be possibly
|
|
||||||
* set. This would be a total of 5 registers to store the configuration as per
|
|
||||||
* the bit description from above
|
|
||||||
*/
|
|
||||||
#define PINMUX_MAX_REGISTERS 5
|
|
||||||
|
|
||||||
static void pinmux_defaults(u32_t base)
|
|
||||||
{
|
|
||||||
u32_t mux_config[PINMUX_MAX_REGISTERS] = { 0, 0, 0, 0, 0 };
|
|
||||||
int i = 0;
|
|
||||||
|
|
||||||
#if !defined(CONFIG_SPI_1)
|
|
||||||
PIN_CONFIG(mux_config, 0, PINMUX_FUNC_B);
|
|
||||||
#endif
|
|
||||||
PIN_CONFIG(mux_config, 1, PINMUX_FUNC_B);
|
|
||||||
PIN_CONFIG(mux_config, 2, PINMUX_FUNC_B);
|
|
||||||
PIN_CONFIG(mux_config, 3, PINMUX_FUNC_B);
|
|
||||||
PIN_CONFIG(mux_config, 4, PINMUX_FUNC_B);
|
|
||||||
PIN_CONFIG(mux_config, 5, PINMUX_FUNC_B);
|
|
||||||
PIN_CONFIG(mux_config, 7, PINMUX_FUNC_B);
|
|
||||||
PIN_CONFIG(mux_config, 8, PINMUX_FUNC_C);
|
|
||||||
PIN_CONFIG(mux_config, 9, PINMUX_FUNC_B);
|
|
||||||
PIN_CONFIG(mux_config, 14, PINMUX_FUNC_B);
|
|
||||||
PIN_CONFIG(mux_config, 16, PINMUX_FUNC_C);
|
|
||||||
PIN_CONFIG(mux_config, 17, PINMUX_FUNC_C);
|
|
||||||
PIN_CONFIG(mux_config, 40, PINMUX_FUNC_B);
|
|
||||||
PIN_CONFIG(mux_config, 41, PINMUX_FUNC_B);
|
|
||||||
#ifdef CONFIG_SPI_1
|
|
||||||
PIN_CONFIG(mux_config, 42, PINMUX_FUNC_B);
|
|
||||||
PIN_CONFIG(mux_config, 43, PINMUX_FUNC_B);
|
|
||||||
PIN_CONFIG(mux_config, 44, PINMUX_FUNC_B);
|
|
||||||
PIN_CONFIG(mux_config, 45, PINMUX_FUNC_B);
|
|
||||||
#endif
|
|
||||||
PIN_CONFIG(mux_config, 55, PINMUX_FUNC_B);
|
|
||||||
PIN_CONFIG(mux_config, 56, PINMUX_FUNC_B);
|
|
||||||
PIN_CONFIG(mux_config, 57, PINMUX_FUNC_B);
|
|
||||||
PIN_CONFIG(mux_config, 63, PINMUX_FUNC_B);
|
|
||||||
PIN_CONFIG(mux_config, 64, PINMUX_FUNC_B);
|
|
||||||
PIN_CONFIG(mux_config, 65, PINMUX_FUNC_B);
|
|
||||||
PIN_CONFIG(mux_config, 66, PINMUX_FUNC_B);
|
|
||||||
|
|
||||||
for (i = 0; i < PINMUX_MAX_REGISTERS; i++) {
|
|
||||||
sys_write32(mux_config[i], PINMUX_SELECT_REGISTER(base, i));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static inline void pinmux_pullups(u32_t base_address)
|
|
||||||
{
|
|
||||||
z_quark_mcu_set_mux(base_address + PINMUX_PULLUP_OFFSET, 104,
|
|
||||||
PINMUX_PULLUP_ENABLE);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int pinmux_initialize(struct device *port)
|
|
||||||
{
|
|
||||||
ARG_UNUSED(port);
|
|
||||||
|
|
||||||
pinmux_defaults(PINMUX_BASE_ADDR);
|
|
||||||
pinmux_pullups(PINMUX_BASE_ADDR);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
SYS_INIT(pinmux_initialize, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
|
|
|
@ -1,12 +0,0 @@
|
||||||
source [find interface/ftdi/flyswatter2.cfg]
|
|
||||||
source [find board/quark_se.cfg]
|
|
||||||
|
|
||||||
quark_se.quark configure -event gdb-attach {
|
|
||||||
reset halt
|
|
||||||
gdb_breakpoint_override hard
|
|
||||||
}
|
|
||||||
|
|
||||||
quark_se.quark configure -event gdb-detach {
|
|
||||||
resume
|
|
||||||
shutdown
|
|
||||||
}
|
|
|
@ -1,59 +0,0 @@
|
||||||
/* SPDX-License-Identifier: Apache-2.0 */
|
|
||||||
|
|
||||||
/dts-v1/;
|
|
||||||
|
|
||||||
#include <mem.h>
|
|
||||||
|
|
||||||
#define DT_FLASH_SIZE DT_SIZE_K(192)
|
|
||||||
#define DT_SRAM_SIZE DT_SIZE_K(52)
|
|
||||||
|
|
||||||
#include "intel_curie.dtsi"
|
|
||||||
|
|
||||||
/ {
|
|
||||||
model = "tinytile board";
|
|
||||||
compatible = "intel,tinytile", "intel,quark_se_c100";
|
|
||||||
|
|
||||||
aliases {
|
|
||||||
led0 = &led0;
|
|
||||||
uart-0 = &uart0;
|
|
||||||
uart-1 = &uart1;
|
|
||||||
};
|
|
||||||
|
|
||||||
chosen {
|
|
||||||
zephyr,sram = &sram0;
|
|
||||||
zephyr,flash = &flash0;
|
|
||||||
zephyr,console = &uart1;
|
|
||||||
zephyr,shell-uart = &uart1;
|
|
||||||
zephyr,bt-uart = &uart0;
|
|
||||||
zephyr,uart-pipe = &uart1;
|
|
||||||
zephyr,bt-mon-uart = &uart1;
|
|
||||||
};
|
|
||||||
|
|
||||||
leds {
|
|
||||||
compatible = "gpio-leds";
|
|
||||||
led0: led_0 {
|
|
||||||
gpios = <&gpio0 8 0>;
|
|
||||||
label = "LED";
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
&uart0 {
|
|
||||||
status = "okay";
|
|
||||||
current-speed = <1000000>;
|
|
||||||
};
|
|
||||||
|
|
||||||
&uart1 {
|
|
||||||
status = "okay";
|
|
||||||
current-speed = <115200>;
|
|
||||||
};
|
|
||||||
|
|
||||||
&i2c0 {
|
|
||||||
status = "okay";
|
|
||||||
clock-frequency = <I2C_BITRATE_FAST>;
|
|
||||||
};
|
|
||||||
|
|
||||||
&i2c1 {
|
|
||||||
status = "okay";
|
|
||||||
clock-frequency = <I2C_BITRATE_FAST>;
|
|
||||||
};
|
|
|
@ -1,11 +0,0 @@
|
||||||
identifier: tinytile
|
|
||||||
name: tinyTILE
|
|
||||||
type: mcu
|
|
||||||
arch: x86
|
|
||||||
toolchain:
|
|
||||||
- zephyr
|
|
||||||
- issm
|
|
||||||
supported:
|
|
||||||
- usb_device
|
|
||||||
ram: 52
|
|
||||||
flash: 192
|
|
|
@ -1,17 +0,0 @@
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
CONFIG_X86=y
|
|
||||||
CONFIG_SOC_QUARK_SE_C1000=y
|
|
||||||
CONFIG_SOC_SERIES_QUARK_SE=y
|
|
||||||
CONFIG_BOARD_TINYTILE=y
|
|
||||||
CONFIG_CPU_MINUTEIA=y
|
|
||||||
CONFIG_CONSOLE=y
|
|
||||||
CONFIG_UART_CONSOLE=y
|
|
||||||
CONFIG_SERIAL=y
|
|
||||||
CONFIG_UART_QMSI=y
|
|
||||||
CONFIG_UART_QMSI_0_HW_FC=y
|
|
||||||
CONFIG_PRINTK=y
|
|
||||||
CONFIG_PINMUX=y
|
|
||||||
CONFIG_GPIO=y
|
|
||||||
CONFIG_USB=y
|
|
||||||
CONFIG_USB_UART_CONSOLE=y
|
|
|
@ -312,7 +312,6 @@ html_redirect_pages = [
|
||||||
('api/api', 'reference/index'),
|
('api/api', 'reference/index'),
|
||||||
('subsystems/subsystems', 'reference/index'),
|
('subsystems/subsystems', 'reference/index'),
|
||||||
('kernel/kernel', 'reference/kernel/index'),
|
('kernel/kernel', 'reference/kernel/index'),
|
||||||
('boards/arc/arduino_101_sss/doc/board', 'boards/arc/arduino_101_sss/doc/index'),
|
|
||||||
('boards/arc/em_starterkit/doc/board', 'boards/arc/em_starterkit/doc/index'),
|
('boards/arc/em_starterkit/doc/board', 'boards/arc/em_starterkit/doc/index'),
|
||||||
('boards/arc/nsim_em/doc/board', 'boards/arc/nsim_em/doc/index'),
|
('boards/arc/nsim_em/doc/board', 'boards/arc/nsim_em/doc/index'),
|
||||||
('boards/arm/96b_argonkey/doc/96b_argonkey', 'boards/arm/96b_argonkey/doc/index'),
|
('boards/arm/96b_argonkey/doc/96b_argonkey', 'boards/arm/96b_argonkey/doc/index'),
|
||||||
|
@ -329,7 +328,6 @@ html_redirect_pages = [
|
||||||
('boards/arm/cc2650_sensortag/doc/cc2650_sensortag', 'boards/arm/cc2650_sensortag/doc/index'),
|
('boards/arm/cc2650_sensortag/doc/cc2650_sensortag', 'boards/arm/cc2650_sensortag/doc/index'),
|
||||||
('boards/arm/cc3220sf_launchxl/doc/cc3220sf_launchxl', 'boards/arm/cc3220sf_launchxl/doc/index'),
|
('boards/arm/cc3220sf_launchxl/doc/cc3220sf_launchxl', 'boards/arm/cc3220sf_launchxl/doc/index'),
|
||||||
('boards/arm/colibri_imx7d_m4/doc/colibri_imx7d_m4', 'boards/arm/colibri_imx7d_m4/doc/index'),
|
('boards/arm/colibri_imx7d_m4/doc/colibri_imx7d_m4', 'boards/arm/colibri_imx7d_m4/doc/index'),
|
||||||
('boards/arm/curie_ble/doc/board', 'boards/arm/curie_ble/doc/index'),
|
|
||||||
('boards/arm/disco_l475_iot1/doc/disco_l475_iot1', 'boards/arm/disco_l475_iot1/doc/index'),
|
('boards/arm/disco_l475_iot1/doc/disco_l475_iot1', 'boards/arm/disco_l475_iot1/doc/index'),
|
||||||
('boards/arm/dragino_lsn50/doc/dragino_lsn50', 'boards/arm/dragino_lsn50/doc/index'),
|
('boards/arm/dragino_lsn50/doc/dragino_lsn50', 'boards/arm/dragino_lsn50/doc/index'),
|
||||||
('boards/arm/efm32wg_stk3800/doc/efm32wg_stk3800', 'boards/arm/efm32wg_stk3800/doc/index'),
|
('boards/arm/efm32wg_stk3800/doc/efm32wg_stk3800', 'boards/arm/efm32wg_stk3800/doc/index'),
|
||||||
|
@ -408,7 +406,6 @@ html_redirect_pages = [
|
||||||
('boards/riscv32/m2gl025_miv/doc/m2g1025_miv', 'boards/riscv32/m2gl025_miv/doc/index'),
|
('boards/riscv32/m2gl025_miv/doc/m2g1025_miv', 'boards/riscv32/m2gl025_miv/doc/index'),
|
||||||
('boards/riscv32/qemu_riscv32/doc/board', 'boards/riscv32/qemu_riscv32/doc/index'),
|
('boards/riscv32/qemu_riscv32/doc/board', 'boards/riscv32/qemu_riscv32/doc/index'),
|
||||||
('boards/riscv32/zedboard_pulpino/doc/zedboard_pulpino', 'boards/riscv32/zedboard_pulpino/doc/index'),
|
('boards/riscv32/zedboard_pulpino/doc/zedboard_pulpino', 'boards/riscv32/zedboard_pulpino/doc/index'),
|
||||||
('boards/x86/arduino_101/doc/board', 'boards/x86/arduino_101/doc/index'),
|
|
||||||
('boards/x86/minnowboard/doc/minnowboard', 'boards/x86/minnowboard/doc/index'),
|
('boards/x86/minnowboard/doc/minnowboard', 'boards/x86/minnowboard/doc/index'),
|
||||||
('boards/x86/qemu_x86/doc/board', 'boards/x86/qemu_x86/doc/index'),
|
('boards/x86/qemu_x86/doc/board', 'boards/x86/qemu_x86/doc/index'),
|
||||||
('boards/x86/tinytile/doc/board', 'boards/x86/tinytile/doc/index'),
|
('boards/x86/tinytile/doc/board', 'boards/x86/tinytile/doc/index'),
|
||||||
|
|
|
@ -292,7 +292,7 @@ explained in this document.
|
||||||
tests:
|
tests:
|
||||||
test:
|
test:
|
||||||
build_only: true
|
build_only: true
|
||||||
platform_whitelist: qemu_cortex_m3 qemu_x86 arduino_101
|
platform_whitelist: qemu_cortex_m3 qemu_x86
|
||||||
tags: bluetooth
|
tags: bluetooth
|
||||||
test_br:
|
test_br:
|
||||||
build_only: true
|
build_only: true
|
||||||
|
|
|
@ -39,13 +39,6 @@ nrf52840_pca10056
|
||||||
=================
|
=================
|
||||||
No special board setup is necessary because there is an on-board LED connected.
|
No special board setup is necessary because there is an on-board LED connected.
|
||||||
|
|
||||||
Arduino 101
|
|
||||||
===========
|
|
||||||
You will need to connect the LED to ground and PWM0 via
|
|
||||||
the shield. You may need a current limiting resistor. See
|
|
||||||
your LED datasheet.
|
|
||||||
|
|
||||||
|
|
||||||
Building and Running
|
Building and Running
|
||||||
********************
|
********************
|
||||||
|
|
||||||
|
|
|
@ -23,14 +23,6 @@ Hexiwear K64
|
||||||
No special board setup is necessary because there is an on-board RGB LED
|
No special board setup is necessary because there is an on-board RGB LED
|
||||||
connected to the K64 PWM.
|
connected to the K64 PWM.
|
||||||
|
|
||||||
Arduino 101
|
|
||||||
===========
|
|
||||||
|
|
||||||
You will need to connect the LED pins to PWM0, PWM1 and PWM2 on Arduino 101 via
|
|
||||||
the shield. Depending on what kind of RGB LED you are using, please connect the
|
|
||||||
common cathode to the ground or the common anode to Vcc. You need current
|
|
||||||
limiting resistor for each of the single color LEDs.
|
|
||||||
|
|
||||||
Building and Running
|
Building and Running
|
||||||
********************
|
********************
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,3 @@ Zephyr tree.
|
||||||
|
|
||||||
See :ref:`bluetooth samples section <bluetooth-samples>` for details.
|
See :ref:`bluetooth samples section <bluetooth-samples>` for details.
|
||||||
|
|
||||||
References
|
|
||||||
**********
|
|
||||||
|
|
||||||
* :ref:`env_sensing_sample`
|
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
.. _arduino101-samples:
|
|
||||||
|
|
||||||
Arduino 101 Samples
|
|
||||||
#####################
|
|
||||||
|
|
||||||
.. toctree::
|
|
||||||
:maxdepth: 1
|
|
||||||
:glob:
|
|
||||||
|
|
||||||
**/*
|
|
|
@ -1,162 +0,0 @@
|
||||||
.. _env_sensing_sample:
|
|
||||||
|
|
||||||
Environmental Sensing Sample
|
|
||||||
############################
|
|
||||||
|
|
||||||
Overview
|
|
||||||
********
|
|
||||||
|
|
||||||
This sample implements a simple environmental sensing service using the Arduino
|
|
||||||
101 board.
|
|
||||||
|
|
||||||
The sensor subsystem application collects temperature, humidity and pressure
|
|
||||||
data from a set of sensors connected to the Arduino 101 and sends it to the SoC
|
|
||||||
through IPM. The collected sensor data is also displayed by the sensor subsystem
|
|
||||||
on a Grove LCD.
|
|
||||||
|
|
||||||
The application processor exposes the received sensor data as a simple Bluetooth
|
|
||||||
Environmental Sensing Service.
|
|
||||||
|
|
||||||
Requirements
|
|
||||||
************
|
|
||||||
|
|
||||||
To use this sample, the following hardware is required:
|
|
||||||
|
|
||||||
* Arduino 101
|
|
||||||
* `Grove LCD module`_
|
|
||||||
* `Grove Base Shield`_ [Optional]
|
|
||||||
* `HDC1008 Sensor`_
|
|
||||||
* `BME280 Sensor`_
|
|
||||||
|
|
||||||
|
|
||||||
Wiring
|
|
||||||
******
|
|
||||||
|
|
||||||
External Wiring
|
|
||||||
===============
|
|
||||||
|
|
||||||
The sample uses the HDC1008 sensor for temperature and humidity measurement, and
|
|
||||||
the BMP280 sensor for pressure measurement. This section describes how to wire
|
|
||||||
these sensors to the Arduino 101 board.
|
|
||||||
|
|
||||||
Both sensors operate at 3.3V and use I2C to communicate with the Arduino. On the
|
|
||||||
Arduino 101, the I2C data pin (SDA) is exposed as pin A4 (on the ANALOG IN
|
|
||||||
header) and the I2C clock pin (SCL) as pin A5 (also on the ANALOG IN header).
|
|
||||||
Since the Arduino 101 doesn't have internal pull-up resistors, these need to be
|
|
||||||
added externally when connecting SCL and SDA to the sensors.
|
|
||||||
|
|
||||||
In addition to connecting the ground (GND), 3.3V power (VDD and VDDIO) and I2C
|
|
||||||
pins, both HDC1008 and BMP280 require some extra wiring.
|
|
||||||
|
|
||||||
For HDC1008, connect the address pins (A0 and A1) to GND (this sets the device
|
|
||||||
address to the default used by the app). Also connect the RDY pin of the sensor
|
|
||||||
to the A1 pin (on ANALOG IN header) of the Arduino board. This is needed as the
|
|
||||||
application configures data-ready interrupt on that pin (GPIO pin 3).
|
|
||||||
|
|
||||||
For BMP280, connect the SDO pin to GND and the CSB pin to VDDIO, since the
|
|
||||||
sensor needs to be setup to use I2C, and not SPI.
|
|
||||||
|
|
||||||
.. image:: figures/wiring.png
|
|
||||||
:width: 600px
|
|
||||||
:align: center
|
|
||||||
:alt: Wiring with Arduino 101
|
|
||||||
|
|
||||||
Using board sensors
|
|
||||||
===================
|
|
||||||
|
|
||||||
If you do not want to use any external sensors, you can use the Arduino 101's
|
|
||||||
internal BMI160 sensor to do just temperature readings. To do this, you need to
|
|
||||||
modify the channel_info array from the sensor subsystem application to contain
|
|
||||||
only BMI160's temperature channel, and also remove the humidity and pressure
|
|
||||||
characteristic from the control application (running on the application
|
|
||||||
processor).
|
|
||||||
|
|
||||||
If you choose this approach and you also want to use the Grove LCD, then you
|
|
||||||
also need to modify the sensor subsystem application to only display temperature
|
|
||||||
on the LCD, as humidity and pressure values will not be available.
|
|
||||||
|
|
||||||
Grove LCD
|
|
||||||
=========
|
|
||||||
|
|
||||||
Using the Grove LCD is optional and it can be disabled by removing the Grove
|
|
||||||
configuration options from the arc/proj.conf file.
|
|
||||||
|
|
||||||
The Grove LCD communicates with the sensor subsystem through the I2C bus. When
|
|
||||||
connecting the Grove LCD to the Arduino 101, either directly (similar to sensor
|
|
||||||
wiring) or through a Grove Base Shield, you need to make sure that the I2C SDA
|
|
||||||
and SCL lines have pull-up resistors connected between GND and the 3.3V power
|
|
||||||
source.
|
|
||||||
|
|
||||||
Take note that even though SDA and SCL are connected to a 3.3V power source, the
|
|
||||||
Grove LCD VDD line needs to be connected to the 5V power line, otherwise
|
|
||||||
characters will not be displayed on the LCD (3.3V is enough to power just the
|
|
||||||
backlight).
|
|
||||||
|
|
||||||
Building and Running
|
|
||||||
********************
|
|
||||||
|
|
||||||
Building
|
|
||||||
========
|
|
||||||
|
|
||||||
This sample builds two applications for both the sensor subsystem (arc) and the
|
|
||||||
application processor (x86). The resulting images need to be flashed to the
|
|
||||||
device either using JTAG (openocd) or DFU util (USB).
|
|
||||||
|
|
||||||
Before using the environmental sensing sample, the Arduino 101 board needs to be
|
|
||||||
flashed with the firmware for its nRF51 Bluetooth LE controller. To do this,
|
|
||||||
follow the steps in :ref:`bluetooth_firmware_arduino_101`.
|
|
||||||
|
|
||||||
Build and flash each of the images either using JTAG or DFU (DFU is preferred):
|
|
||||||
|
|
||||||
.. zephyr-app-commands::
|
|
||||||
:zephyr-app: samples/boards/arduino_101/environmental_sensing/ap
|
|
||||||
:board: arduino_101
|
|
||||||
:goals: build flash
|
|
||||||
:compact:
|
|
||||||
|
|
||||||
.. zephyr-app-commands::
|
|
||||||
:zephyr-app: samples/boards/arduino_101/environmental_sensing/sensor
|
|
||||||
:board: arduino_101_sss
|
|
||||||
:goals: build flash
|
|
||||||
:compact:
|
|
||||||
|
|
||||||
Running
|
|
||||||
========
|
|
||||||
The ARC (Sensor Subsystem) program collects temperature, humidity and pressure
|
|
||||||
data using the sensors API and sends it to the x86 core through an outbound
|
|
||||||
IPM. The collected data is also displayed on a Grove LCD.
|
|
||||||
|
|
||||||
The x86 program reads the sensor data from an inbound IPM and exposes it as
|
|
||||||
GATT characteristics (temperature, humidity and pressure) through a simple
|
|
||||||
Bluetooth Environmental Sensing Service. The values of these characteristics
|
|
||||||
are updated every time a new message containing sensor data is received.
|
|
||||||
|
|
||||||
An example of sensor data values that can be seen on the Grove LCD is
|
|
||||||
illustrated in the image below.
|
|
||||||
|
|
||||||
.. image:: figures/temp_sensing_4.png
|
|
||||||
:width: 400px
|
|
||||||
:align: center
|
|
||||||
:alt: LCD Display
|
|
||||||
|
|
||||||
|
|
||||||
The data exposed over Bluetooth using an Environmental Sensing Service can be
|
|
||||||
tested with a BLE Scanner app. The image below is a screenshot of such an application.
|
|
||||||
|
|
||||||
.. image:: figures/temp_sensing_5.png
|
|
||||||
:width: 400px
|
|
||||||
:align: center
|
|
||||||
:alt: BLE Scanner Application
|
|
||||||
|
|
||||||
The temperature value is 0xBA09 (little-endian) which is equal to 2490 in
|
|
||||||
decimal. Since the Bluetooth specification states that temperature values are
|
|
||||||
expressed with a resolution of 0.01 degrees Celsius, the value exposed over
|
|
||||||
Bluetooth is the same as the one displayed on the Grove LCD (24.9 degrees
|
|
||||||
Celsius).
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.. _HDC1008 Sensor: https://www.adafruit.com/product/2635
|
|
||||||
.. _BME280 Sensor: https://www.adafruit.com/products/2652
|
|
||||||
.. _Grove Base Shield: http://wiki.seeedstudio.com/wiki/Grove_-_Base_Shield
|
|
||||||
.. _Grove LCD module: http://wiki.seeed.cc/Grove-LCD_RGB_Backlight/
|
|
|
@ -1,8 +0,0 @@
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.13.1)
|
|
||||||
include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
|
|
||||||
project(environmental_sensing_ap)
|
|
||||||
|
|
||||||
target_include_directories(app PRIVATE $ENV{ZEPHYR_BASE}/drivers)
|
|
||||||
target_sources(app PRIVATE src/main.c)
|
|
|
@ -1,11 +0,0 @@
|
||||||
CONFIG_PRINTK=y
|
|
||||||
CONFIG_ARC_INIT=y
|
|
||||||
CONFIG_IPM=y
|
|
||||||
CONFIG_IPM_QUARK_SE=y
|
|
||||||
CONFIG_IPM_QUARK_SE_MASTER=y
|
|
||||||
CONFIG_IPM_CONSOLE_SENDER=y
|
|
||||||
CONFIG_TIMESLICE_SIZE=1
|
|
||||||
CONFIG_BT=y
|
|
||||||
CONFIG_BT_PERIPHERAL=y
|
|
||||||
CONFIG_GPIO=y
|
|
||||||
CONFIG_BT_WAIT_NOP=y
|
|
|
@ -1,9 +0,0 @@
|
||||||
sample:
|
|
||||||
description: Environmental Sensing sample using BLE
|
|
||||||
and sensor features on Arduino 101.
|
|
||||||
name: Environmental Sensing (Application Processor Part)
|
|
||||||
tests:
|
|
||||||
sample.board.arduino_101.env_sensing:
|
|
||||||
platform_whitelist: arduino_101
|
|
||||||
tags: sensors
|
|
||||||
harness: sensor
|
|
|
@ -1,123 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016 Intel Corporation
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <bluetooth/bluetooth.h>
|
|
||||||
#include <bluetooth/hci.h>
|
|
||||||
#include <bluetooth/uuid.h>
|
|
||||||
#include <bluetooth/gatt.h>
|
|
||||||
#include <device.h>
|
|
||||||
#include <drivers/ipm.h>
|
|
||||||
#include <ipm/ipm_quark_se.h>
|
|
||||||
#include <sys/byteorder.h>
|
|
||||||
#include <sys/printk.h>
|
|
||||||
#include <drivers/sensor.h>
|
|
||||||
#include <zephyr.h>
|
|
||||||
|
|
||||||
#define TEMPERATURE_CUD "Temperature"
|
|
||||||
#define HUMIDITY_CUD "Humidity"
|
|
||||||
#define PRESSURE_CUD "Pressure"
|
|
||||||
|
|
||||||
QUARK_SE_IPM_DEFINE(ess_ipm, 0, QUARK_SE_IPM_INBOUND);
|
|
||||||
|
|
||||||
static s16_t temp_value;
|
|
||||||
static u16_t humidity_value;
|
|
||||||
static u32_t pressure_value;
|
|
||||||
|
|
||||||
static ssize_t read_u16(struct bt_conn *conn, const struct bt_gatt_attr *attr,
|
|
||||||
void *buf, u16_t len, u16_t offset)
|
|
||||||
{
|
|
||||||
const u16_t *u16 = attr->user_data;
|
|
||||||
u16_t value = sys_cpu_to_le16(*u16);
|
|
||||||
|
|
||||||
return bt_gatt_attr_read(conn, attr, buf, len, offset, &value,
|
|
||||||
sizeof(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
static ssize_t read_u32(struct bt_conn *conn, const struct bt_gatt_attr *attr,
|
|
||||||
void *buf, u16_t len, u16_t offset)
|
|
||||||
{
|
|
||||||
const u32_t *u32 = attr->user_data;
|
|
||||||
u32_t value = sys_cpu_to_le32(*u32);
|
|
||||||
|
|
||||||
return bt_gatt_attr_read(conn, attr, buf, len, offset, &value,
|
|
||||||
sizeof(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
BT_GATT_SERVICE_DEFINE(env_svc,
|
|
||||||
BT_GATT_PRIMARY_SERVICE(BT_UUID_ESS),
|
|
||||||
|
|
||||||
BT_GATT_CHARACTERISTIC(BT_UUID_TEMPERATURE, BT_GATT_CHRC_READ,
|
|
||||||
BT_GATT_PERM_READ, read_u16, NULL, &temp_value),
|
|
||||||
BT_GATT_CUD(TEMPERATURE_CUD, BT_GATT_PERM_READ),
|
|
||||||
|
|
||||||
BT_GATT_CHARACTERISTIC(BT_UUID_HUMIDITY, BT_GATT_CHRC_READ,
|
|
||||||
BT_GATT_PERM_READ, read_u16, NULL,
|
|
||||||
&humidity_value),
|
|
||||||
BT_GATT_CUD(HUMIDITY_CUD, BT_GATT_PERM_READ),
|
|
||||||
|
|
||||||
BT_GATT_CHARACTERISTIC(BT_UUID_PRESSURE, BT_GATT_CHRC_READ,
|
|
||||||
BT_GATT_PERM_READ, read_u32, NULL,
|
|
||||||
&pressure_value),
|
|
||||||
BT_GATT_CUD(PRESSURE_CUD, BT_GATT_PERM_READ),
|
|
||||||
);
|
|
||||||
|
|
||||||
static const struct bt_data ad[] = {
|
|
||||||
BT_DATA_BYTES(BT_DATA_FLAGS, (BT_LE_AD_GENERAL | BT_LE_AD_NO_BREDR)),
|
|
||||||
};
|
|
||||||
|
|
||||||
static void bt_ready(int err)
|
|
||||||
{
|
|
||||||
if (err) {
|
|
||||||
printk("Bluetooth init failed (err %d)\n", err);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
err = bt_le_adv_start(BT_LE_ADV_CONN_NAME, ad, ARRAY_SIZE(ad), NULL, 0);
|
|
||||||
if (err) {
|
|
||||||
printk("Advertising failed to start (err %d)\n", err);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void sensor_ipm_callback(void *context, u32_t id, volatile void *data)
|
|
||||||
{
|
|
||||||
volatile struct sensor_value *val = data;
|
|
||||||
|
|
||||||
switch (id) {
|
|
||||||
case SENSOR_CHAN_AMBIENT_TEMP:
|
|
||||||
/* resolution of 0.01 degrees Celsius */
|
|
||||||
temp_value = val->val1 * 100 + val->val2 / 10000;
|
|
||||||
break;
|
|
||||||
case SENSOR_CHAN_HUMIDITY:
|
|
||||||
/* resolution of 0.01 percent */
|
|
||||||
humidity_value = val->val1 * 100 + val->val2 / 10000;
|
|
||||||
break;
|
|
||||||
case SENSOR_CHAN_PRESS:
|
|
||||||
/* resolution of 0.1 Pa */
|
|
||||||
pressure_value = val->val1 * 10000 + val->val2 / 100;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void main(void)
|
|
||||||
{
|
|
||||||
struct device *ipm;
|
|
||||||
int rc;
|
|
||||||
|
|
||||||
rc = bt_enable(bt_ready);
|
|
||||||
if (rc) {
|
|
||||||
printk("Bluetooth init failed (err %d)\n", rc);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ipm = device_get_binding("ess_ipm");
|
|
||||||
ipm_register_callback(ipm, sensor_ipm_callback, NULL);
|
|
||||||
ipm_set_enabled(ipm, 1);
|
|
||||||
|
|
||||||
k_sleep(K_FOREVER);
|
|
||||||
}
|
|
Binary file not shown.
Before Width: | Height: | Size: 146 KiB |
Binary file not shown.
Before Width: | Height: | Size: 113 KiB |
Binary file not shown.
Before Width: | Height: | Size: 408 KiB |
|
@ -1,8 +0,0 @@
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.13.1)
|
|
||||||
include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
|
|
||||||
project(environmental_sensing_sensor)
|
|
||||||
|
|
||||||
target_include_directories(app PRIVATE $ENV{ZEPHYR_BASE}/drivers)
|
|
||||||
target_sources(app PRIVATE src/main.c)
|
|
|
@ -1,23 +0,0 @@
|
||||||
/*
|
|
||||||
*
|
|
||||||
* Copyright (c) 2018, NXP
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
&i2c0 {
|
|
||||||
|
|
||||||
ti_hdc: ti_hdc@40 {
|
|
||||||
compatible = "ti,hdc","ti,hdc1008";
|
|
||||||
reg = <0x40>;
|
|
||||||
label = "HDC1008";
|
|
||||||
drdy-gpios = <&gpio0 3 0>;
|
|
||||||
};
|
|
||||||
|
|
||||||
bmp280@76 {
|
|
||||||
compatible = "bosch,bme280";
|
|
||||||
reg = <0x76>;
|
|
||||||
label = "BMP280";
|
|
||||||
};
|
|
||||||
|
|
||||||
};
|
|
|
@ -1,18 +0,0 @@
|
||||||
CONFIG_STDOUT_CONSOLE=y
|
|
||||||
CONFIG_PRINTK=y
|
|
||||||
CONFIG_IPM=y
|
|
||||||
CONFIG_IPM_QUARK_SE=y
|
|
||||||
CONFIG_IPM_CONSOLE_RECEIVER=y
|
|
||||||
CONFIG_CONSOLE=y
|
|
||||||
CONFIG_SERIAL=n
|
|
||||||
CONFIG_I2C=y
|
|
||||||
CONFIG_GPIO=y
|
|
||||||
CONFIG_SENSOR=y
|
|
||||||
|
|
||||||
# remove Grove configs you don't want to use the LCD
|
|
||||||
CONFIG_DISPLAY=y
|
|
||||||
CONFIG_GROVE_LCD_RGB=y
|
|
||||||
|
|
||||||
# change these configs if you want to use different sensors
|
|
||||||
CONFIG_BME280=y
|
|
||||||
CONFIG_TI_HDC=y
|
|
|
@ -1,9 +0,0 @@
|
||||||
sample:
|
|
||||||
description: Environmental Sensing sample using BLE
|
|
||||||
and sensor features on Arduino 101.
|
|
||||||
name: Environmental Sensing (Sensor Subsystem Part)
|
|
||||||
tests:
|
|
||||||
sample.board.arduino_101_sss.env_sensing:
|
|
||||||
platform_whitelist: arduino_101_sss
|
|
||||||
tags: sensors
|
|
||||||
harness: sensor
|
|
|
@ -1,128 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016 Intel Corporation
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <device.h>
|
|
||||||
#include <drivers/ipm.h>
|
|
||||||
#include <ipm/ipm_quark_se.h>
|
|
||||||
#include <sys/printk.h>
|
|
||||||
#include <sys/util.h>
|
|
||||||
#include <drivers/sensor.h>
|
|
||||||
#include <zephyr.h>
|
|
||||||
|
|
||||||
#ifdef CONFIG_GROVE_LCD_RGB
|
|
||||||
#include <display/grove_lcd.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QUARK_SE_IPM_DEFINE(ess_ipm, 0, QUARK_SE_IPM_OUTBOUND);
|
|
||||||
|
|
||||||
struct channel_info {
|
|
||||||
int chan;
|
|
||||||
char *dev_name;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* change device names if you want to use different sensors */
|
|
||||||
static struct channel_info info[] = {
|
|
||||||
{SENSOR_CHAN_AMBIENT_TEMP, "HDC1008"},
|
|
||||||
{SENSOR_CHAN_HUMIDITY, "HDC1008"},
|
|
||||||
{SENSOR_CHAN_PRESS, "BMP280"},
|
|
||||||
};
|
|
||||||
|
|
||||||
void main(void)
|
|
||||||
{
|
|
||||||
struct device *ipm, *dev[ARRAY_SIZE(info)];
|
|
||||||
struct sensor_value val[ARRAY_SIZE(info)];
|
|
||||||
unsigned int i;
|
|
||||||
int rc;
|
|
||||||
|
|
||||||
ipm = device_get_binding("ess_ipm");
|
|
||||||
if (ipm == NULL) {
|
|
||||||
printk("Failed to get ESS IPM device\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
for (i = 0U; i < ARRAY_SIZE(info); i++) {
|
|
||||||
dev[i] = device_get_binding(info[i].dev_name);
|
|
||||||
if (dev[i] == NULL) {
|
|
||||||
printk("Failed to get \"%s\" device\n", info[i].dev_name);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef CONFIG_GROVE_LCD_RGB
|
|
||||||
struct device *glcd;
|
|
||||||
|
|
||||||
glcd = device_get_binding(GROVE_LCD_NAME);
|
|
||||||
if (glcd == NULL) {
|
|
||||||
printk("Failed to get Grove LCD\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* configure LCD */
|
|
||||||
glcd_function_set(glcd, GLCD_FS_ROWS_2 | GLCD_FS_DOT_SIZE_LITTLE |
|
|
||||||
GLCD_FS_8BIT_MODE);
|
|
||||||
glcd_display_state_set(glcd, GLCD_DS_DISPLAY_ON);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
while (1) {
|
|
||||||
/* fetch sensor samples */
|
|
||||||
for (i = 0U; i < ARRAY_SIZE(info); i++) {
|
|
||||||
rc = sensor_sample_fetch(dev[i]);
|
|
||||||
if (rc) {
|
|
||||||
printk("Failed to fetch sample for device %s (%d)\n",
|
|
||||||
info[i].dev_name, rc);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* send sensor data to x86 core via IPM */
|
|
||||||
for (i = 0U; i < ARRAY_SIZE(info); i++) {
|
|
||||||
rc = sensor_channel_get(dev[i], info[i].chan, &val[i]);
|
|
||||||
if (rc) {
|
|
||||||
printk("Failed to get data for device %s (%d)\n",
|
|
||||||
info[i].dev_name, rc);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
rc = ipm_send(ipm, 1, info[i].chan, &val[i], sizeof(val[i]));
|
|
||||||
if (rc) {
|
|
||||||
printk("Failed to send data for device %s (%d)\n",
|
|
||||||
info[i].dev_name, rc);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef CONFIG_GROVE_LCD_RGB
|
|
||||||
char row[16];
|
|
||||||
|
|
||||||
/* clear LCD */
|
|
||||||
(void)memset(row, ' ', sizeof(row));
|
|
||||||
glcd_cursor_pos_set(glcd, 0, 0);
|
|
||||||
glcd_print(glcd, row, sizeof(row));
|
|
||||||
glcd_cursor_pos_set(glcd, 0, 1);
|
|
||||||
glcd_print(glcd, row, sizeof(row));
|
|
||||||
|
|
||||||
/* display temperature on LCD */
|
|
||||||
glcd_cursor_pos_set(glcd, 0, 0);
|
|
||||||
sprintf(row, "T:%d.%d%cC", val[0].val1,
|
|
||||||
val[0].val2/100000, 223 /* degree symbol */);
|
|
||||||
glcd_print(glcd, row, strlen(row));
|
|
||||||
|
|
||||||
/* display himidity on LCD */
|
|
||||||
glcd_cursor_pos_set(glcd, 17 - strlen(row), 0);
|
|
||||||
sprintf(row, "RH:%d%%", val[1].val1);
|
|
||||||
glcd_print(glcd, row, strlen(row));
|
|
||||||
|
|
||||||
/* display pressure on LCD */
|
|
||||||
glcd_cursor_pos_set(glcd, 0, 1);
|
|
||||||
sprintf(row, "P:%d.%02dkPa", val[2].val1,
|
|
||||||
val[2].val2 / 10000);
|
|
||||||
glcd_print(glcd, row, strlen(row));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
k_sleep(K_MSEC(100));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -5,13 +5,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file Sample app to utilize APA102C LED on Arduino 101 (x86).
|
* @file Sample app to utilize APA102C LED.
|
||||||
*
|
|
||||||
* On x86 side of Arduino 101:
|
|
||||||
* 1. GPIO_16 is on IO8 (for data)
|
|
||||||
* 2. GPIO_19 is on IO4 (for clock)
|
|
||||||
*
|
|
||||||
* The gpio_dw driver is being used for bit-banging.
|
|
||||||
*
|
*
|
||||||
* The APA102/C requires 5V data and clock signals, so logic
|
* The APA102/C requires 5V data and clock signals, so logic
|
||||||
* level shifter (preferred) or pull-up resistors are needed.
|
* level shifter (preferred) or pull-up resistors are needed.
|
||||||
|
|
|
@ -23,7 +23,7 @@ Requirements
|
||||||
|
|
||||||
- screen terminal emulator or equivalent.
|
- screen terminal emulator or equivalent.
|
||||||
|
|
||||||
- For the Arduino 101 board, the ENC28J60 Ethernet module is required.
|
- For most boards without ethernet, the ENC28J60 Ethernet module is required.
|
||||||
|
|
||||||
- dnsmasq application. The dnsmasq version used in this sample is:
|
- dnsmasq application. The dnsmasq version used in this sample is:
|
||||||
|
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.13.1)
|
|
||||||
include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
|
|
||||||
project(bmi160)
|
|
||||||
|
|
||||||
FILE(GLOB app_sources src/*.c)
|
|
||||||
target_sources(app PRIVATE ${app_sources})
|
|
|
@ -1,7 +0,0 @@
|
||||||
CONFIG_PRINTK=y
|
|
||||||
CONFIG_SPI=y
|
|
||||||
CONFIG_GPIO=y
|
|
||||||
CONFIG_SENSOR=y
|
|
||||||
CONFIG_BMI160=y
|
|
||||||
CONFIG_BMI160_TRIGGER_OWN_THREAD=y
|
|
||||||
CONFIG_BMI160_TRIGGER=y
|
|
|
@ -1,8 +0,0 @@
|
||||||
sample:
|
|
||||||
name: BMI160 Sensor Sample
|
|
||||||
tests:
|
|
||||||
sample.sensor.bmi160:
|
|
||||||
harness: sensor
|
|
||||||
platform_whitelist: arduino_101_sss
|
|
||||||
tags: sensors
|
|
||||||
depends_on: spi gpio
|
|
|
@ -1,479 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2016 Intel Corporation
|
|
||||||
*
|
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <zephyr.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <device.h>
|
|
||||||
#include <drivers/sensor.h>
|
|
||||||
#include <sys/printk.h>
|
|
||||||
|
|
||||||
#define MAX_TEST_TIME 15000
|
|
||||||
#define SLEEPTIME 300
|
|
||||||
|
|
||||||
/* uncomment next line for setting offsets manually */
|
|
||||||
/* #define PERFORM_MANUAL_CALIBRATION */
|
|
||||||
|
|
||||||
/* uncomment the next line for auto calibration */
|
|
||||||
/* #define PERFORM_AUTO_CALIBRATION */
|
|
||||||
|
|
||||||
#ifdef PERFORM_MANUAL_CALIBRATION
|
|
||||||
/*
|
|
||||||
* Offset map needed for manual accelerometer calibration. These values are
|
|
||||||
* deduced by holding the device perpendicular on one axis (usually that's Z if
|
|
||||||
* the device lies flat on the table) and compute the difference so that the
|
|
||||||
* values on the 3 axis look like this: X: 0, Y: 0; Z: 9.80665. Due to
|
|
||||||
* accelerometer noise, the values will vary around these values.
|
|
||||||
*
|
|
||||||
* For example if the accelerometer output, without offset compensation, is :
|
|
||||||
*
|
|
||||||
* Acc (m/s^2): X=-2.349435, Y=-0.488070, Z=11.158620
|
|
||||||
*
|
|
||||||
* then the offsets necessary to compensate the read values are:
|
|
||||||
* X = +2.349435, Y = +0.488070. Z = -1.351970
|
|
||||||
*/
|
|
||||||
static struct sensor_value accel_offsets[] = {
|
|
||||||
{2, 349435}, /* X */
|
|
||||||
{0, 488070}, /* Y */
|
|
||||||
{-1, -351970}, /* Z */
|
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The same goes for gyro offsets but, in gyro's case, the values should
|
|
||||||
* converge to 0 (with the device standing still).
|
|
||||||
*/
|
|
||||||
static struct sensor_value gyro_offsets[] = {
|
|
||||||
{0, 3195}, /* X */
|
|
||||||
{0, 3195}, /* Y */
|
|
||||||
{0, -4260},/* Z */
|
|
||||||
};
|
|
||||||
|
|
||||||
static int manual_calibration(struct device *bmi160)
|
|
||||||
{
|
|
||||||
#if !defined(CONFIG_BMI160_ACCEL_PMU_SUSPEND)
|
|
||||||
/* set accelerometer offsets */
|
|
||||||
if (sensor_attr_set(bmi160, SENSOR_CHAN_ACCEL_XYZ,
|
|
||||||
SENSOR_ATTR_OFFSET, accel_offsets) < 0) {
|
|
||||||
return -EIO;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(CONFIG_BMI160_GYRO_PMU_SUSPEND)
|
|
||||||
/* set gyroscope offsets */
|
|
||||||
if (sensor_attr_set(bmi160, SENSOR_CHAN_GYRO_XYZ,
|
|
||||||
SENSOR_ATTR_OFFSET, gyro_offsets) < 0) {
|
|
||||||
return -EIO;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PERFORM_AUTO_CALIBRATION
|
|
||||||
/*
|
|
||||||
* The values in the following map are the expected values that the
|
|
||||||
* accelerometer needs to converge to if the device lies flat on the table. The
|
|
||||||
* device has to stay still for about 500ms = 250ms(accel) + 250ms(gyro).
|
|
||||||
*/
|
|
||||||
struct sensor_value acc_calib[] = {
|
|
||||||
{0, 0}, /* X */
|
|
||||||
{0, 0}, /* Y */
|
|
||||||
{9, 806650}, /* Z */
|
|
||||||
};
|
|
||||||
static int auto_calibration(struct device *bmi160)
|
|
||||||
{
|
|
||||||
#if !defined(CONFIG_BMI160_ACCEL_PMU_SUSPEND)
|
|
||||||
/* calibrate accelerometer */
|
|
||||||
if (sensor_attr_set(bmi160, SENSOR_CHAN_ACCEL_XYZ,
|
|
||||||
SENSOR_ATTR_CALIB_TARGET, acc_calib) < 0) {
|
|
||||||
return -EIO;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(CONFIG_BMI160_GYRO_PMU_SUSPEND)
|
|
||||||
/*
|
|
||||||
* Calibrate gyro. No calibration value needs to be passed to BMI160 as
|
|
||||||
* the target on all axis is set internally to 0. This is used just to
|
|
||||||
* trigger a gyro calibration.
|
|
||||||
*/
|
|
||||||
if (sensor_attr_set(bmi160, SENSOR_CHAN_GYRO_XYZ,
|
|
||||||
SENSOR_ATTR_CALIB_TARGET, NULL) < 0) {
|
|
||||||
return -EIO;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief Helper function for printing a sensor value to a buffer
|
|
||||||
*
|
|
||||||
* @param buf A pointer to the buffer to which the printing is done.
|
|
||||||
* @param len Size of buffer in bytes.
|
|
||||||
* @param val A pointer to a sensor_value struct holding the value
|
|
||||||
* to be printed.
|
|
||||||
*
|
|
||||||
* @return The number of characters printed to the buffer.
|
|
||||||
*/
|
|
||||||
static inline int sensor_value_snprintf(char *buf, size_t len,
|
|
||||||
const struct sensor_value *val)
|
|
||||||
{
|
|
||||||
s32_t val1, val2;
|
|
||||||
|
|
||||||
if (val->val2 == 0) {
|
|
||||||
return snprintf(buf, len, "%d", val->val1);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* normalize value */
|
|
||||||
if (val->val1 < 0 && val->val2 > 0) {
|
|
||||||
val1 = val->val1 + 1;
|
|
||||||
val2 = val->val2 - 1000000;
|
|
||||||
} else {
|
|
||||||
val1 = val->val1;
|
|
||||||
val2 = val->val2;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* print value to buffer */
|
|
||||||
if (val1 > 0 || (val1 == 0 && val2 > 0)) {
|
|
||||||
return snprintf(buf, len, "%d.%06d", val1, val2);
|
|
||||||
} else if (val1 == 0 && val2 < 0) {
|
|
||||||
return snprintf(buf, len, "-0.%06d", -val2);
|
|
||||||
} else {
|
|
||||||
return snprintf(buf, len, "%d.%06d", val1, -val2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#if !defined(CONFIG_BMI160_GYRO_PMU_SUSPEND)
|
|
||||||
static void print_gyro_data(struct device *bmi160)
|
|
||||||
{
|
|
||||||
struct sensor_value val[3];
|
|
||||||
char buf_x[18], buf_y[18], buf_z[18];
|
|
||||||
|
|
||||||
if (sensor_channel_get(bmi160, SENSOR_CHAN_GYRO_XYZ, val) < 0) {
|
|
||||||
printk("Cannot read bmi160 gyro channels.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
sensor_value_snprintf(buf_x, sizeof(buf_x), &val[0]);
|
|
||||||
sensor_value_snprintf(buf_y, sizeof(buf_y), &val[1]);
|
|
||||||
sensor_value_snprintf(buf_z, sizeof(buf_z), &val[2]);
|
|
||||||
|
|
||||||
printk("Gyro (rad/s): X=%s, Y=%s, Z=%s\n", buf_x, buf_y, buf_z);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(CONFIG_BMI160_ACCEL_PMU_SUSPEND)
|
|
||||||
static void print_accel_data(struct device *bmi160)
|
|
||||||
{
|
|
||||||
struct sensor_value val[3];
|
|
||||||
char buf_x[18], buf_y[18], buf_z[18];
|
|
||||||
|
|
||||||
if (sensor_channel_get(bmi160,
|
|
||||||
SENSOR_CHAN_ACCEL_XYZ, val) < 0) {
|
|
||||||
printk("Cannot read bmi160 accel channels.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
sensor_value_snprintf(buf_x, sizeof(buf_x), &val[0]);
|
|
||||||
sensor_value_snprintf(buf_y, sizeof(buf_y), &val[1]);
|
|
||||||
sensor_value_snprintf(buf_z, sizeof(buf_z), &val[2]);
|
|
||||||
|
|
||||||
printk("Acc (m/s^2): X=%s, Y=%s, Z=%s\n", buf_x, buf_y, buf_z);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static void print_temp_data(struct device *bmi160)
|
|
||||||
{
|
|
||||||
struct sensor_value val;
|
|
||||||
char buf[18];
|
|
||||||
|
|
||||||
if (sensor_channel_get(bmi160, SENSOR_CHAN_DIE_TEMP, &val) < 0) {
|
|
||||||
printk("Temperature channel read error.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
sensor_value_snprintf(buf, sizeof(buf), &val);
|
|
||||||
|
|
||||||
printk("Temperature (Celsius): %s\n", buf);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void test_polling_mode(struct device *bmi160)
|
|
||||||
{
|
|
||||||
s32_t remaining_test_time = MAX_TEST_TIME;
|
|
||||||
struct sensor_value attr;
|
|
||||||
|
|
||||||
#if defined(CONFIG_BMI160_ACCEL_ODR_RUNTIME)
|
|
||||||
/* set sampling frequency to 100Hz for accel */
|
|
||||||
attr.val1 = 100;
|
|
||||||
attr.val2 = 0;
|
|
||||||
|
|
||||||
if (sensor_attr_set(bmi160, SENSOR_CHAN_ACCEL_XYZ,
|
|
||||||
SENSOR_ATTR_SAMPLING_FREQUENCY, &attr) < 0) {
|
|
||||||
printk("Cannot set sampling frequency for accelerometer.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(CONFIG_BMI160_GYRO_ODR_RUNTIME)
|
|
||||||
/* set sampling frequency to 3200Hz for gyro */
|
|
||||||
attr.val1 = 3200;
|
|
||||||
attr.val2 = 0;
|
|
||||||
|
|
||||||
if (sensor_attr_set(bmi160, SENSOR_CHAN_GYRO_XYZ,
|
|
||||||
SENSOR_ATTR_SAMPLING_FREQUENCY, &attr) < 0) {
|
|
||||||
printk("Cannot set sampling frequency for gyroscope.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
/* wait for the change to take effect */
|
|
||||||
k_sleep(SLEEPTIME);
|
|
||||||
|
|
||||||
/* poll the data and print it */
|
|
||||||
do {
|
|
||||||
if (sensor_sample_fetch(bmi160) < 0) {
|
|
||||||
printk("Sample update error.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if !defined(CONFIG_BMI160_GYRO_PMU_SUSPEND)
|
|
||||||
print_gyro_data(bmi160);
|
|
||||||
#endif
|
|
||||||
#if !defined(CONFIG_BMI160_ACCEL_PMU_SUSPEND)
|
|
||||||
print_accel_data(bmi160);
|
|
||||||
#endif
|
|
||||||
print_temp_data(bmi160);
|
|
||||||
|
|
||||||
/* wait a while */
|
|
||||||
k_sleep(SLEEPTIME);
|
|
||||||
|
|
||||||
remaining_test_time -= SLEEPTIME;
|
|
||||||
} while (remaining_test_time > 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef CONFIG_BMI160_TRIGGER
|
|
||||||
static void trigger_hdlr(struct device *bmi160,
|
|
||||||
struct sensor_trigger *trigger)
|
|
||||||
{
|
|
||||||
if (trigger->type != SENSOR_TRIG_DELTA &&
|
|
||||||
trigger->type != SENSOR_TRIG_DATA_READY) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sensor_sample_fetch(bmi160) < 0) {
|
|
||||||
printk("Sample update error.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if !defined(CONFIG_BMI160_GYRO_PMU_SUSPEND)
|
|
||||||
if (trigger->chan == SENSOR_CHAN_GYRO_XYZ) {
|
|
||||||
print_gyro_data(bmi160);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if !defined(CONFIG_BMI160_ACCEL_PMU_SUSPEND)
|
|
||||||
if (trigger->chan == SENSOR_CHAN_ACCEL_XYZ) {
|
|
||||||
print_accel_data(bmi160);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
static void test_anymotion_trigger(struct device *bmi160)
|
|
||||||
{
|
|
||||||
s32_t remaining_test_time = MAX_TEST_TIME;
|
|
||||||
struct sensor_value attr;
|
|
||||||
struct sensor_trigger trig;
|
|
||||||
|
|
||||||
/* set up anymotion trigger */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Set slope threshold to 0.1G (0.1 * 9.80665 = 4.903325 m/s^2).
|
|
||||||
* This depends on the chosen range. One cannot choose a threshold
|
|
||||||
* bigger than half the range. For example, for a 16G range, the
|
|
||||||
* threshold must not exceed 8G.
|
|
||||||
*/
|
|
||||||
attr.val1 = 0;
|
|
||||||
attr.val2 = 980665;
|
|
||||||
if (sensor_attr_set(bmi160, SENSOR_CHAN_ACCEL_XYZ,
|
|
||||||
SENSOR_ATTR_SLOPE_TH, &attr) < 0) {
|
|
||||||
printk("Cannot set anymotion slope threshold.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Set slope duration to 2 consecutive samples (after which the
|
|
||||||
* anymotion interrupt will trigger.
|
|
||||||
*
|
|
||||||
* Allowed values are from 1 to 4.
|
|
||||||
*/
|
|
||||||
attr.val1 = 2;
|
|
||||||
attr.val2 = 0;
|
|
||||||
if (sensor_attr_set(bmi160, SENSOR_CHAN_ACCEL_XYZ,
|
|
||||||
SENSOR_ATTR_SLOPE_DUR, &attr) < 0) {
|
|
||||||
printk("Cannot set anymotion slope duration.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* enable anymotion trigger */
|
|
||||||
trig.type = SENSOR_TRIG_DELTA;
|
|
||||||
trig.chan = SENSOR_CHAN_ACCEL_XYZ;
|
|
||||||
|
|
||||||
if (sensor_trigger_set(bmi160, &trig, trigger_hdlr) < 0) {
|
|
||||||
printk("Cannot enable anymotion trigger.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
printk("Anymotion test: shake the device to get anymotion events.\n");
|
|
||||||
do {
|
|
||||||
/* wait a while */
|
|
||||||
k_sleep(SLEEPTIME);
|
|
||||||
remaining_test_time -= SLEEPTIME;
|
|
||||||
|
|
||||||
} while (remaining_test_time > 0);
|
|
||||||
|
|
||||||
printk("Anymotion test: finished, removing anymotion trigger...\n");
|
|
||||||
|
|
||||||
if (sensor_trigger_set(bmi160, &trig, NULL) < 0) {
|
|
||||||
printk("Cannot remove anymotion trigger.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void test_data_ready_trigger(struct device *bmi160)
|
|
||||||
{
|
|
||||||
s32_t remaining_test_time = MAX_TEST_TIME;
|
|
||||||
struct sensor_trigger trig;
|
|
||||||
|
|
||||||
/* enable data ready trigger */
|
|
||||||
trig.type = SENSOR_TRIG_DATA_READY;
|
|
||||||
trig.chan = SENSOR_CHAN_ACCEL_XYZ;
|
|
||||||
|
|
||||||
if (sensor_trigger_set(bmi160, &trig, trigger_hdlr) < 0) {
|
|
||||||
printk("Cannot enable data ready trigger.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
printk("Data ready test:\n");
|
|
||||||
do {
|
|
||||||
/* wait a while */
|
|
||||||
k_sleep(SLEEPTIME);
|
|
||||||
remaining_test_time -= SLEEPTIME;
|
|
||||||
|
|
||||||
} while (remaining_test_time > 0);
|
|
||||||
|
|
||||||
printk("Data ready test: finished, removing data ready trigger...\n");
|
|
||||||
|
|
||||||
if (sensor_trigger_set(bmi160, &trig, NULL) < 0) {
|
|
||||||
printk("Cannot remove data ready trigger.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void test_trigger_mode(struct device *bmi160)
|
|
||||||
{
|
|
||||||
struct sensor_value attr;
|
|
||||||
|
|
||||||
#if defined(CONFIG_BMI160_ACCEL_ODR_RUNTIME)
|
|
||||||
/* set sampling frequency to 100Hz for accel */
|
|
||||||
attr.val1 = 100;
|
|
||||||
attr.val2 = 0;
|
|
||||||
|
|
||||||
if (sensor_attr_set(bmi160, SENSOR_CHAN_ACCEL_XYZ,
|
|
||||||
SENSOR_ATTR_SAMPLING_FREQUENCY, &attr) < 0) {
|
|
||||||
printk("Cannot set sampling frequency for accelerometer.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(CONFIG_BMI160_GYRO_ODR_RUNTIME)
|
|
||||||
/* set sampling frequency to 100Hz for gyro */
|
|
||||||
attr.val1 = 100;
|
|
||||||
attr.val2 = 0;
|
|
||||||
|
|
||||||
if (sensor_attr_set(bmi160, SENSOR_CHAN_GYRO_XYZ,
|
|
||||||
SENSOR_ATTR_SAMPLING_FREQUENCY, &attr) < 0) {
|
|
||||||
printk("Cannot set sampling frequency for gyroscope.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
test_anymotion_trigger(bmi160);
|
|
||||||
|
|
||||||
test_data_ready_trigger(bmi160);
|
|
||||||
}
|
|
||||||
#endif /* CONFIG_BMI160_TRIGGER */
|
|
||||||
|
|
||||||
extern u8_t pbuf[1024];
|
|
||||||
extern u8_t *pos;
|
|
||||||
void main(void)
|
|
||||||
{
|
|
||||||
struct device *bmi160;
|
|
||||||
#if defined(CONFIG_BMI160_ACCEL_RANGE_RUNTIME) ||\
|
|
||||||
defined(CONFIG_BMI160_GYRO_RANGE_RUNTIME)
|
|
||||||
struct sensor_value attr;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
printk("IMU: Binding...\n");
|
|
||||||
bmi160 = device_get_binding(DT_INST_0_BOSCH_BMI160_LABEL);
|
|
||||||
if (!bmi160) {
|
|
||||||
printk("Gyro: Device not found.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined(CONFIG_BMI160_ACCEL_RANGE_RUNTIME)
|
|
||||||
/*
|
|
||||||
* Set accelerometer range to +/- 16G. Since the sensor API needs SI
|
|
||||||
* units, convert the range to m/s^2.
|
|
||||||
*/
|
|
||||||
sensor_g_to_ms2(16, &attr);
|
|
||||||
|
|
||||||
if (sensor_attr_set(bmi160, SENSOR_CHAN_ACCEL_XYZ,
|
|
||||||
SENSOR_ATTR_FULL_SCALE, &attr) < 0) {
|
|
||||||
printk("Cannot set accelerometer range.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(CONFIG_BMI160_GYRO_RANGE_RUNTIME)
|
|
||||||
/*
|
|
||||||
* Set gyro range to +/- 250 degrees/s. Since the sensor API needs SI
|
|
||||||
* units, convert the range to rad/s.
|
|
||||||
*/
|
|
||||||
sensor_degrees_to_rad(250, &attr);
|
|
||||||
|
|
||||||
if (sensor_attr_set(bmi160, SENSOR_CHAN_GYRO_XYZ,
|
|
||||||
SENSOR_ATTR_FULL_SCALE, &attr) < 0) {
|
|
||||||
printk("Cannot set gyro range.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PERFORM_MANUAL_CALIBRATION
|
|
||||||
/* manually adjust accelerometer and gyro offsets */
|
|
||||||
if (manual_calibration(bmi160) < 0) {
|
|
||||||
printk("Manual calibration failed.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PERFORM_AUTO_CALIBRATION
|
|
||||||
/* auto calibrate accelerometer and gyro */
|
|
||||||
if (auto_calibration(bmi160) < 0) {
|
|
||||||
printk("HW calibration failed.\n");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
printk("Testing the polling mode.\n");
|
|
||||||
test_polling_mode(bmi160);
|
|
||||||
printk("Testing the polling mode finished.\n");
|
|
||||||
|
|
||||||
#ifdef CONFIG_BMI160_TRIGGER
|
|
||||||
printk("Testing the trigger mode.\n");
|
|
||||||
test_trigger_mode(bmi160);
|
|
||||||
printk("Testing the trigger mode finished.\n");
|
|
||||||
#endif
|
|
||||||
}
|
|
|
@ -16,15 +16,13 @@ Zephyr project tree.
|
||||||
Requirements
|
Requirements
|
||||||
************
|
************
|
||||||
|
|
||||||
This project requires an USB device driver, which is available for Intel Quark*
|
This project requires an USB device driver, which is available for multiple
|
||||||
SE SoC based boards like :ref:`arduino_101`. For the Arduino 101 board you need
|
boards supported in Zephyr.
|
||||||
a USB to 3.3V TTL serial cable. Connect it to UART1 as described in
|
|
||||||
:ref:`Connecting Serial Output section <arduino_101>`.
|
|
||||||
|
|
||||||
Building and Running
|
Building and Running
|
||||||
********************
|
********************
|
||||||
|
|
||||||
Arduino 101
|
Reel Board
|
||||||
===========
|
===========
|
||||||
|
|
||||||
To see the console output of the app, open a serial port emulator and
|
To see the console output of the app, open a serial port emulator and
|
||||||
|
@ -32,12 +30,10 @@ attach it to the USB to TTL Serial cable. Build and flash the project:
|
||||||
|
|
||||||
.. zephyr-app-commands::
|
.. zephyr-app-commands::
|
||||||
:zephyr-app: samples/subsys/usb/cdc_acm
|
:zephyr-app: samples/subsys/usb/cdc_acm
|
||||||
:board: arduino_101
|
:board: reel_board
|
||||||
:goals: flash
|
:goals: flash
|
||||||
:compact:
|
:compact:
|
||||||
|
|
||||||
See :ref:`Flashing the x86 Application Core section <arduino_101>` for details.
|
|
||||||
|
|
||||||
Running
|
Running
|
||||||
=======
|
=======
|
||||||
|
|
||||||
|
@ -89,7 +85,7 @@ Troubleshooting
|
||||||
If the ModemManager runs on your operating system, it will try
|
If the ModemManager runs on your operating system, it will try
|
||||||
to access the CDC ACM device and maybe you can see several characters
|
to access the CDC ACM device and maybe you can see several characters
|
||||||
including "AT" on the terminal attached to the CDC ACM device.
|
including "AT" on the terminal attached to the CDC ACM device.
|
||||||
You can add or extend the udev rule for your Arduino 101 to inform
|
You can add or extend the udev rule for your board to inform
|
||||||
ModemManager to skip the CDC ACM device.
|
ModemManager to skip the CDC ACM device.
|
||||||
For this example, it would look like this:
|
For this example, it would look like this:
|
||||||
|
|
||||||
|
|
|
@ -17,9 +17,7 @@ trying to access the device in the background.
|
||||||
|
|
||||||
Building and Running Project:
|
Building and Running Project:
|
||||||
|
|
||||||
Refer to https://www.zephyrproject.org/doc/boards/x86/arduino_101/doc/board.html
|
$ west build -b reel_board
|
||||||
for details on flashing the image into an Arduno 101.
|
|
||||||
|
|
||||||
|
|
||||||
Sample Output:
|
Sample Output:
|
||||||
|
|
||||||
|
|
|
@ -21,12 +21,6 @@ based web application (web page) running in the browser at host.
|
||||||
This application is intended for testing purposes only. For running
|
This application is intended for testing purposes only. For running
|
||||||
real usecase, implement applications based on the WebUSB API.
|
real usecase, implement applications based on the WebUSB API.
|
||||||
|
|
||||||
Building and flashing
|
|
||||||
*********************
|
|
||||||
|
|
||||||
Refer to :ref:`arduino_101` for details on building and flashing the image into
|
|
||||||
an Arduino 101.
|
|
||||||
|
|
||||||
Testing with latest Google Chrome on host
|
Testing with latest Google Chrome on host
|
||||||
*****************************************
|
*****************************************
|
||||||
|
|
||||||
|
|
|
@ -1,17 +0,0 @@
|
||||||
CONFIG_TEST=y
|
|
||||||
CONFIG_BT=y
|
|
||||||
CONFIG_BT_DEBUG_LOG=y
|
|
||||||
CONFIG_BT_CENTRAL=y
|
|
||||||
CONFIG_BT_PERIPHERAL=y
|
|
||||||
CONFIG_BT_PRIVACY=y
|
|
||||||
CONFIG_BT_SMP=y
|
|
||||||
CONFIG_BT_SIGNING=y
|
|
||||||
CONFIG_BT_ATT_PREPARE_COUNT=2
|
|
||||||
CONFIG_BT_GATT_CLIENT=y
|
|
||||||
CONFIG_BT_GATT_HRS=y
|
|
||||||
CONFIG_BT_L2CAP_DYNAMIC_CHANNEL=y
|
|
||||||
CONFIG_BT_TINYCRYPT_ECC=y
|
|
||||||
CONFIG_SHELL=y
|
|
||||||
CONFIG_BT_SHELL=y
|
|
||||||
CONFIG_BT_DEVICE_NAME="test shell"
|
|
||||||
CONFIG_BT_L2CAP_TX_BUF_COUNT=6
|
|
|
@ -42,21 +42,9 @@ Note: Target board have to support enough UARTs for BTP and controller.
|
||||||
to control tester application.
|
to control tester application.
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
Building and running on Arduino 101:
|
|
||||||
|
|
||||||
Arduino 101 is equipped with Nordic nRF51 Bluetooth LE controller.
|
|
||||||
Please refer to the Zephyr Project docs [1] to see how to build and flash the
|
|
||||||
controller with the HCI Bluetooth LE firmware.
|
|
||||||
|
|
||||||
Next, build and flash tester application by employing the "flash" build
|
Next, build and flash tester application by employing the "flash" build
|
||||||
target.
|
target.
|
||||||
|
|
||||||
While running tester application on Arduino 101, serial converter, typically
|
|
||||||
UART <-> USB is required by BTP to operate. Connect Arduino 101 Tx and Rx lines
|
|
||||||
(0 and 1 ports on Arduino 101 board) through the UART converter to the host
|
|
||||||
USB port.
|
|
||||||
|
|
||||||
Use serial client, e.g. PUTTY to communicate over the serial port
|
Use serial client, e.g. PUTTY to communicate over the serial port
|
||||||
(typically /dev/ttyUSBx) with the tester using BTP.
|
(typically /dev/ttyUSBx) with the tester using BTP.
|
||||||
|
|
||||||
[1] https://www.zephyrproject.org/doc/boards/x86/arduino_101/doc/board.html#flashing-the-bluetooth-core
|
|
||||||
|
|
|
@ -4,39 +4,6 @@
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* @addtogroup t_driver_i2c
|
|
||||||
* @{
|
|
||||||
* @defgroup t_i2c_basic test_i2c_basic_operations
|
|
||||||
* @}
|
|
||||||
*
|
|
||||||
* Setup: Connect Sensor GY271 to I2C_0 on X86 and I2C_SS_0 on ARC
|
|
||||||
*
|
|
||||||
* quark_se_c1000_devboard - x86
|
|
||||||
* ----------------------
|
|
||||||
*
|
|
||||||
* 1. GY271_SCL - I2C0_SCL
|
|
||||||
* 2. GY271_SDA - I2C0_SDA
|
|
||||||
*
|
|
||||||
* quark_se_c1000_ss_devboard - arc
|
|
||||||
* ----------------------
|
|
||||||
*
|
|
||||||
* 1. GY271_SCL - I2C0_SS_SCL
|
|
||||||
* 2. GY271_SDA - I2C0_SS_SDA
|
|
||||||
*
|
|
||||||
* arduino_101 - x86
|
|
||||||
* ----------------------
|
|
||||||
*
|
|
||||||
* 1. GY271_SCL - I2C0_SCL
|
|
||||||
* 2. GY271_SDA - I2C0_SDA
|
|
||||||
*
|
|
||||||
* arduino_101_ss - arc
|
|
||||||
* ----------------------
|
|
||||||
*
|
|
||||||
* 1. GY271_SCL - I2C0_SS_SCL
|
|
||||||
* 2. GY271_SDA - I2C0_SS_SDA
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <zephyr.h>
|
#include <zephyr.h>
|
||||||
#include <ztest.h>
|
#include <ztest.h>
|
||||||
|
|
||||||
|
|
|
@ -4,38 +4,6 @@
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/**
|
|
||||||
* @addtogroup t_driver_pinmux
|
|
||||||
* @{
|
|
||||||
* @defgroup t_pinmux_basic test_pinmux_basic_operations
|
|
||||||
* @}
|
|
||||||
*
|
|
||||||
* Setup: loop PIN_OUT with PIN_IN on the target board
|
|
||||||
*
|
|
||||||
* quark_se_c1000_devboard - x86
|
|
||||||
* --------------------
|
|
||||||
*
|
|
||||||
* 1. PIN_OUT is GPIO_15
|
|
||||||
* 2. PIN_IN is GPIO_16
|
|
||||||
*
|
|
||||||
* quark_se_c1000_ss_devboard - arc
|
|
||||||
* --------------------
|
|
||||||
*
|
|
||||||
* 1. PIN_OUT is GPIO_SS_4/GPIO_SS_AIN_12
|
|
||||||
* 2. PIN_IN is GPIO_SS_5/GPIO_SS_AIN_13
|
|
||||||
*
|
|
||||||
* arduino_101 - x86
|
|
||||||
* --------------------
|
|
||||||
*
|
|
||||||
* 1. PIN_OUT is GPIO_16
|
|
||||||
* 2. PIN_IN is GPIO_19
|
|
||||||
*
|
|
||||||
* arduino_101_sss - arc
|
|
||||||
* --------------------
|
|
||||||
*
|
|
||||||
* 1. PIN_OUT is GPIO_SS_2
|
|
||||||
* 2. PIN_IN is GPIO_SS_3
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <ztest.h>
|
#include <ztest.h>
|
||||||
|
|
||||||
|
|
|
@ -16,19 +16,6 @@ Build and Run
|
||||||
cmake -DBOARD=qemu_x86 ..
|
cmake -DBOARD=qemu_x86 ..
|
||||||
make run
|
make run
|
||||||
|
|
||||||
* Arduino 101
|
|
||||||
|
|
||||||
Build:
|
|
||||||
mkdir build; cd build
|
|
||||||
cmake -DBOARD=arduino_101 ..
|
|
||||||
make run
|
|
||||||
|
|
||||||
Flashing:
|
|
||||||
sudo dfu-util -a x86_app -D outdir/arduino_101/zephyr.bin
|
|
||||||
|
|
||||||
For more information about this board, see:
|
|
||||||
https://www.zephyrproject.org/doc/boards/x86/arduino_101/doc/board.html
|
|
||||||
|
|
||||||
* NXP Freedom-K64F (frdm-k64f)
|
* NXP Freedom-K64F (frdm-k64f)
|
||||||
|
|
||||||
Build:
|
Build:
|
||||||
|
|
|
@ -7,10 +7,10 @@ Demonstrates basic file and dir operations using the Zephyr file system.
|
||||||
|
|
||||||
Building and Running Project:
|
Building and Running Project:
|
||||||
|
|
||||||
The demo will run on Arduino 101 and will use the on-board SPI flash.
|
The demo will run on native_posix and will use the on-board SPI flash.
|
||||||
|
|
||||||
mkdir build; cd build
|
mkdir build; cd build
|
||||||
cmake -DBOARD=arduino_101 ..
|
cmake -DBOARD=native_posix ..
|
||||||
make run
|
make run
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
tests:
|
tests:
|
||||||
filesystem.fat:
|
filesystem.fat:
|
||||||
platform_whitelist: arduino_101 native_posix native_posix_64
|
platform_whitelist: native_posix native_posix_64
|
||||||
tags: filesystem
|
tags: filesystem
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue