boards: st: st25dv_mb1283_disco: add mb1283 board

ST25DV discovery kit, including an LCD color screen.
ST25 support not included.

Signed-off-by: Eve Redero <eve.redero@gmail.com>
This commit is contained in:
Eve Redero 2024-03-10 18:19:58 +01:00 committed by Maureen Helm
parent 08aa504e66
commit 4809491b26
14 changed files with 441 additions and 0 deletions

View file

@ -0,0 +1,12 @@
# ST25DV DISCOVERY board configuration
# Copyright (c) 2024 Eve Redero
# SPDX-License-Identifier: Apache-2.0
if BOARD_ST25DV_MB1283_DISCO
config SPI_STM32_INTERRUPT
default y
depends on SPI
endif # BOARD_ST25DV_MB1283_DISCO

View file

@ -0,0 +1,7 @@
# ST25DV DISCOVERY board configuration
# Copyright (c) 2024 Eve Redero
# SPDX-License-Identifier: Apache-2.0
config BOARD_ST25DV_MB1283_DISCO
select SOC_STM32F405XX

View file

@ -0,0 +1,6 @@
# SPDX-License-Identifier: Apache-2.0
board_runner_args(jlink "--device=STM32F405RG" "--speed=4000")
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
include(${ZEPHYR_BASE}/boards/common/jlink.board.cmake)

View file

@ -0,0 +1,5 @@
board:
name: st25dv_mb1283_disco
vendor: st
socs:
- name: stm32f405xx

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

View file

@ -0,0 +1,142 @@
.. _st25dv_mb1283_disco_board:
ST ST25DV Discovery, MB1283 version
###################################
Overview
********
The ST25DV04K device is a dynamic NFC/RFID tag IC with a dual interface. It embeds a
4 Kbits EEPROM memory. It can be operated from an I2C interface, or by a 13.56 MHz
RFID reader, or by a NFC phone. The ST25DV04K Class 5 antenna daughter card, included
in the kit, can be replaced by Class 1 or Class 6 antennas.
The ST25DV-DISCOVERY is a demonstration kit to evaluate the features and capabilities
of the ST25DV series.
It is based on the NFC ST25DV04K device embedded on a daughter card using a Class 5 antenna
and a STM32 processor driving a mother board.
.. image:: img/st25dv_mb1283_disco.jpg
:align: center
:alt: ST25DV_MB1283_DISCO
.. note::
The ST25DV itself is not implemented yet.
Hardware
********
The ST25DV Discovery kit provides the following hardware components:
- Main board: ST25DV_Discovery_Mboard:
- STM32F405VGT6 LQFP100 32-bit microcontroller, with 1 Mbyte Flash memory, 192 + 4 Kbytes SRAM.
- LCD color screen (320 x 200 pixels)
- Touch screen driver
- Different color LEDs (power, user, ST link)
- User push button
- Joystick for menu selection
- Reset button
- On board ST link for microcontroller firmware upgrade and debug
- ST link mini USB
- User micro USB
- USB micro or mini connector for board powering
- Demonstration edition (optional add-on module) with Bluetooth Low Energy module,
Wi-Fi ® module and JTAG 20 pin connector
It exists in two variants, MB1283 and MB1285.
- Antenna daughter board: ST25DV_Discovery_ANT_C5:
- 40 mm x 24 mm, 13.56 MHz inductive antenna etched on the PCB
- ST25DV04K Dynamic NFC / RFID tag
- I 2 C interface connector
- Energy harvesting output (VOUT) with a 10nF capacitance filtering circuit
- GPO configurable as RF WIP/BUSY output, to indicate that an RF operation is ongoing
The antenna board can be removed, and its 14-pin 0.254mm header connector used as an eval kit header.
Connections and IOs
===================
Default Zephyr Peripheral Mapping
---------------------------------
- UART_6 TX/RX : PC6/PC7 (ST-Link Virtual Port Com)
- UART_2 TX/RX : PA2/PA3 (Available on J6 connector)
- I2C1 SCL/SDA : PB6/PB7 (Touchscreen STMPE811, interrupt pin PB5)
- SPI2 SCK/MOSI/CS : PB13/PC3/PB12 (LCD display FRD24048TP, reset pin PC1, DC pin PC0)
- SPI1 SCK/MISO/MOSI/CS : PA5/PA6/PA7/PA4 (External ST25DV connector J6)
- GPIO : PE8/PE9/PE10/PE11/PE12 (Joystick)
- LD1 : PC13 (Orange led)
- LD2 : PC4 (Yellow led)
- GPIO : PE15/PE7 (Available on external ST25DV connector J6)
- GPIO : PE14 (Available on J5 connector)
Serial Port
===========
The Zephyr console output and shell are assigned to UART6, which is connected to the
onboard ST-LINK/V2 Virtual COM port interface.
Default communication settings are 115200 8N1.
Programming and Debugging
*************************
Applications for the ``st25dv_mb1283_disco`` board configuration can be built and
flashed in the usual way (see :ref:`build_an_application` and
:ref:`application_run` for more details).
If programming fails, press the reset button (black) and release it while "west flash" is running.
Flashing
========
ST25DV Discovery kit includes an ST-LINK/V2 embedded debug tool interface.
This interface is supported by the openocd version included in the Zephyr SDK.
Flashing an application to ST25DV Discovery
--------------------------------------------
First, connect the ST25DV Discovery kit to your host computer using
the USB port to prepare it for flashing. Then build and flash your application.
Here is an example for the :ref:`hello_world` application.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: st25dv_mb1283_disco
:goals: build flash
Run a serial host program to connect with your board:
.. code-block:: console
$ minicom -D /dev/ttyACM0
You should see the following message on the console:
.. code-block:: console
Hello World! st25dv_mb1283_disco
Debugging
=========
You can debug an application in the usual way. Here is an example for the
:ref:`hello_world` application.
.. zephyr-app-commands::
:zephyr-app: samples/hello_world
:board: st25dv_mb1283_disco
:goals: debug
.. _ST25DV-DISCO website:
https://www.st.com/en/nfc/st25dv-i2c-series-dynamic-nfc-tags.html
.. _ST25DV datasheet:
https://www.st.com/resource/en/datasheet/st25dv04k.pdf
.. _STM32F40xxx reference manual:
https://www.st.com/resource/en/reference_manual/rm0090-stm32f405415-stm32f407417-stm32f427437-and-stm32f429439-advanced-armbased-32bit-mcus-stmicroelectronics.pdf

View file

@ -0,0 +1,167 @@
/*
* Copyright (c) 2024 Eve Redero
*
* SPDX-License-Identifier: Apache-2.0
*/
/dts-v1/;
#include "st/f4/stm32f405Xg.dtsi"
#include "st/f4/stm32f405vgtx-pinctrl.dtsi"
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include <zephyr/dt-bindings/display/ili9xxx.h>
/ {
model = "ST ST25DV Discovery Kit with MB1283";
compatible = "st,st25dv_mb1283_disco", "st,stm32f405", "st,stm32f4";
chosen {
zephyr,console = &usart6;
zephyr,shell-uart = &usart6;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,display = &ili9341;
};
leds {
compatible = "gpio-leds";
orange_led: led_1 {
gpios = <&gpioc 13 GPIO_ACTIVE_HIGH>;
};
yellow_led: led_2 {
gpios = <&gpioc 4 GPIO_ACTIVE_HIGH>;
};
};
buttons: gpio_keys {
compatible = "gpio-keys";
blue_button: button_1 {
gpios = <&gpioc 14 GPIO_ACTIVE_LOW>;
zephyr,code = <INPUT_KEY_0>;
};
sel_button: button_2 {
gpios = <&gpioe 8 GPIO_ACTIVE_LOW>;
zephyr,code = <INPUT_KEY_ENTER>;
};
left_button: button_3 {
gpios = <&gpioe 9 GPIO_ACTIVE_LOW>;
zephyr,code = <INPUT_KEY_LEFT>;
};
right_button: button_4 {
gpios = <&gpioe 11 GPIO_ACTIVE_LOW>;
zephyr,code = <INPUT_KEY_RIGHT>;
};
up_button: button_5 {
gpios = <&gpioe 10 GPIO_ACTIVE_LOW>;
zephyr,code = <INPUT_KEY_UP>;
};
down_button: button_6 {
gpios = <&gpioe 12 GPIO_ACTIVE_LOW>;
zephyr,code = <INPUT_KEY_DOWN>;
};
};
aliases {
led0 = &orange_led;
sw0 = &blue_button;
};
mipi_dbi {
compatible = "zephyr,mipi-dbi-spi";
reset-gpios = <&gpioc 1 GPIO_ACTIVE_HIGH>;
dc-gpios = <&gpioc 0 GPIO_ACTIVE_HIGH>;
spi-dev = <&spi2>;
#address-cells = <1>;
#size-cells = <0>;
write-only;
ili9341: ili9341@0 {
compatible = "ilitek,ili9341";
mipi-max-frequency = <DT_FREQ_M(20)>;
reg = <0>;
pixel-format = <ILI9XXX_PIXEL_FORMAT_RGB888>;
rotation = <0>;
width = <240>;
height = <320>;
duplex = <0x800>;
};
};
};
&clk_lsi {
status = "okay";
};
&clk_hse {
clock-frequency = <DT_FREQ_M(8)>;
status = "okay";
};
&pll {
div-m = <4>;
mul-n = <168>;
div-p = <2>;
div-q = <7>;
clocks = <&clk_hse>;
status = "okay";
};
&rcc {
clocks = <&pll>;
clock-frequency = <DT_FREQ_M(168)>;
ahb-prescaler = <1>;
apb1-prescaler = <4>;
apb2-prescaler = <2>;
};
&usart6 {
pinctrl-0 = <&usart6_tx_pc6 &usart6_rx_pc7>;
pinctrl-names = "default";
current-speed = <115200>;
status = "okay";
};
&rtc {
clocks = <&rcc STM32_CLOCK_BUS_APB1 0x10000000>,
<&rcc STM32_SRC_LSI RTC_SEL(2)>;
status = "okay";
};
&spi2 { /* Max 20 Mbit/s */
#address-cells = <1>;
#size-cells = <0>;
pinctrl-0 = <&spi2_mosi_pc3 &spi2_sck_pb13>;
cs-gpios = <&gpiob 12 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
pinctrl-names = "default";
status = "okay";
};
&i2c1 {
pinctrl-0 = <&i2c1_scl_pb6 &i2c1_sda_pb7>;
pinctrl-names = "default";
status = "okay";
clock-frequency = <I2C_BITRATE_FAST>;
stmpe811: stmpe811@41 {
compatible = "st,stmpe811";
status = "okay";
reg = <0x41>;
int-gpios = <&gpiob 5 GPIO_ACTIVE_LOW>;
screen-width = <240>;
screen-height = <320>;
raw-x-min = <240>;
raw-y-min = <200>;
raw-x-max = <3680>;
raw-y-max = <3800>;
panel-driver-settling-time-us = <1000>;
touch-detect-delay-us = <5000>;
touch-average-control = <8>;
tracking-index = <127>;
};
};
zephyr_udc0: &usbotg_fs {
pinctrl-0 = <&usb_otg_fs_id_pa10 &usb_otg_fs_dm_pa11 &usb_otg_fs_dp_pa12>;
pinctrl-names = "default";
status = "okay";
};

View file

@ -0,0 +1,16 @@
identifier: st25dv_mb1283_disco
name: ST ST25DV MB1283 Discovery
type: mcu
arch: arm
toolchain:
- zephyr
- gnuarmemb
- xtools
ram: 192
flash: 1024
supported:
- gpio
- i2c
- spi
- usb_device
vendor: st

View file

@ -0,0 +1,21 @@
# SPDX-License-Identifier: Apache-2.0
# Enable MPU
CONFIG_ARM_MPU=y
# Enable HW stack protection
CONFIG_HW_STACK_PROTECTION=y
CONFIG_SERIAL=y
# console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
# enable GPIO
CONFIG_GPIO=y
# Enable Clocks
CONFIG_CLOCK_CONTROL=y
# enable pin controller
CONFIG_PINCTRL=y

View file

@ -0,0 +1,20 @@
source [find interface/stlink.cfg]
transport select hla_swd
source [find target/stm32f4x.cfg]
adapter_khz 1000
reset_config srst_only
$_TARGETNAME configure -event gdb-attach {
echo "Debugger attaching: halting execution"
reset halt
gdb_breakpoint_override hard
}
$_TARGETNAME configure -event gdb-detach {
echo "Debugger detaching: resuming execution"
resume
}

View file

@ -0,0 +1,3 @@
CONFIG_LV_COLOR_DEPTH_32=y
CONFIG_GPIO=y
CONFIG_INPUT=y

View file

@ -0,0 +1,16 @@
/*
* Copyright (c) 2024, Eve Redero
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include <zephyr/dt-bindings/lvgl/lvgl.h>
/ {
pointer {
compatible = "zephyr,lvgl-pointer-input";
input = <&stmpe811>;
invert-y;
};
};

View file

@ -0,0 +1,3 @@
CONFIG_LV_COLOR_DEPTH_32=y
CONFIG_GPIO=y
CONFIG_INPUT=y

View file

@ -0,0 +1,23 @@
/*
* Copyright (c) 2024, Eve Redero
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include <zephyr/dt-bindings/lvgl/lvgl.h>
/ {
pointer {
compatible = "zephyr,lvgl-pointer-input";
input = <&stmpe811>;
invert-y;
};
keypad {
compatible = "zephyr,lvgl-keypad-input";
input = <&buttons>;
input-codes = <INPUT_KEY_RIGHT INPUT_KEY_LEFT INPUT_KEY_UP INPUT_KEY_DOWN INPUT_KEY_ENTER INPUT_KEY_0>;
lvgl-codes = <LV_KEY_RIGHT LV_KEY_LEFT LV_KEY_UP LV_KEY_DOWN LV_KEY_ENTER LV_KEY_ESC>;
};
};