Skip to content

Commit 9317b95

Browse files
author
Felipe Neves
committed
boards: xtensa: esp32s2_franzininho: add support
to the ESP32 S2 Franzininho educational development board. Signed-off-by: Felipe Neves <[email protected]> boards: xtensa: esp32s2_franzininho: remove docs section for debugging since this board does not have any on board debug or connection for that. Signed-off-by: Felipe Neves <[email protected]>
1 parent 53af1ba commit 9317b95

File tree

10 files changed

+388
-0
lines changed

10 files changed

+388
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# ESP32S2 Franzininho board configuration
2+
3+
# Copyright (c) 2022 Felipe Neves
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
config BOARD_ESP32S2_FRANZININHO
7+
bool "ESP32S2 Franzininho Board"
8+
depends on SOC_ESP32S2
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# ESP32S2 Franzininho board configuration
2+
3+
# Copyright (c) 2022 Felipe Neves
4+
# SPDX-License-Identifier: Apache-2.0
5+
6+
config BOARD
7+
default "esp32s2_franzininho"
8+
depends on BOARD_ESP32S2_FRANZININHO
9+
10+
config ENTROPY_GENERATOR
11+
default y
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
if(NOT "${OPENOCD}" MATCHES "^${ESPRESSIF_TOOLCHAIN_PATH}/.*")
4+
set(OPENOCD OPENOCD-NOTFOUND)
5+
endif()
6+
find_program(OPENOCD openocd PATHS ${ESPRESSIF_TOOLCHAIN_PATH}/openocd-esp32/bin NO_DEFAULT_PATH)
7+
8+
include(${ZEPHYR_BASE}/boards/common/esp32.board.cmake)
9+
include(${ZEPHYR_BASE}/boards/common/openocd.board.cmake)
39.9 KB
Loading
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
.. _esp32s2_franzininho:
2+
3+
ESP32-S2 Franzininho
4+
####################
5+
6+
Overview
7+
********
8+
9+
Franzininho is an educational development board based on ESP32-S2 which is a highly integrated, low-power, single-core Wi-Fi Microcontroller SoC,
10+
designed to be secure and cost-effective, with a high performance and a rich set of IO capabilities. [1]_
11+
12+
The features include the following:
13+
14+
- RSA-3072-based secure boot
15+
- AES-XTS-256-based flash encryption
16+
- Protected private key and device secrets from software access
17+
- Cryptographic accelerators for enhanced performance
18+
- Protection against physical fault injection attacks
19+
- Various peripherals:
20+
21+
- 43x programmable GPIOs
22+
- 14x configurable capacitive touch GPIOs
23+
- USB OTG
24+
- LCD interface
25+
- camera interface
26+
- SPI
27+
- I2S
28+
- UART
29+
- ADC
30+
- DAC
31+
- LED PWM with up to 8 channels
32+
33+
.. figure:: img/esp32_s2_franzininho.jpg
34+
:align: center
35+
:alt: ESP32-S2 FRANZININHO
36+
37+
System requirements
38+
*******************
39+
40+
Prerequisites
41+
-------------
42+
43+
Espressif HAL requires WiFi and Bluetooth binary blobs in order work. Run the command
44+
below to retrieve those files.
45+
46+
.. code-block:: console
47+
48+
west blobs fetch hal_espressif
49+
50+
.. note::
51+
52+
It is recommended running the command above after :file:`west update`.
53+
54+
Building & Flashing
55+
-------------------
56+
57+
Build and flash applications as usual (see :ref:`build_an_application` and
58+
:ref:`application_run` for more details).
59+
60+
.. zephyr-app-commands::
61+
:zephyr-app: samples/hello_world
62+
:board: esp32s2_franzininho
63+
:goals: build
64+
65+
The usual ``flash`` target will work with the ``esp32s2_franzininho`` board
66+
configuration. Here is an example for the :ref:`hello_world`
67+
application.
68+
69+
.. zephyr-app-commands::
70+
:zephyr-app: samples/hello_world
71+
:board: esp32s2_franzininho
72+
:goals: flash
73+
74+
Open the serial monitor using the following command:
75+
76+
.. code-block:: shell
77+
78+
west espressif monitor
79+
80+
After the board has automatically reset and booted, you should see the following
81+
message in the monitor:
82+
83+
.. code-block:: console
84+
85+
***** Booting Zephyr OS vx.x.x-xxx-gxxxxxxxxxxxx *****
86+
Hello World! esp32s2_franzininho
87+
88+
References
89+
**********
90+
91+
.. [1] https://www.espressif.com/en/products/socs/esp32-s2
92+
.. _`ESP32S2 Technical Reference Manual`: https://espressif.com/sites/default/files/documentation/esp32-s2_technical_reference_manual_en.pdf
93+
.. _`ESP32S2 Datasheet`: https://www.espressif.com/sites/default/files/documentation/esp32-s2_datasheet_en.pdf
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
/*
2+
* Copyright (c) 2022 Felipe Neves.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
#include <zephyr/dt-bindings/pinctrl/esp-pinctrl-common.h>
8+
#include <dt-bindings/pinctrl/esp32s2-pinctrl.h>
9+
#include <zephyr/dt-bindings/pinctrl/esp32s2-gpio-sigmap.h>
10+
11+
&pinctrl {
12+
13+
uart0_default: uart0_default {
14+
group1 {
15+
pinmux = <UART0_TX_GPIO43>;
16+
};
17+
group2 {
18+
pinmux = <UART0_RX_GPIO44>;
19+
bias-pull-up;
20+
};
21+
};
22+
23+
spim2_default: spim2_default {
24+
group1 {
25+
pinmux = <SPIM2_MISO_GPIO13>,
26+
<SPIM2_SCLK_GPIO12>,
27+
<SPIM2_CSEL_GPIO10>;
28+
};
29+
group2 {
30+
pinmux = <SPIM2_MOSI_GPIO11>;
31+
output-low;
32+
};
33+
};
34+
35+
spim3_default: spim3_default {
36+
group1 {
37+
pinmux = <SPIM3_MISO_GPIO37>,
38+
<SPIM3_SCLK_GPIO36>,
39+
<SPIM3_CSEL_GPIO34>;
40+
};
41+
group2 {
42+
pinmux = <SPIM3_MOSI_GPIO35>;
43+
output-low;
44+
};
45+
};
46+
47+
i2c0_default: i2c0_default {
48+
group1 {
49+
pinmux = <I2C0_SDA_GPIO8>,
50+
<I2C0_SCL_GPIO9>;
51+
bias-pull-up;
52+
drive-open-drain;
53+
output-high;
54+
};
55+
};
56+
57+
i2c1_default: i2c1_default {
58+
group1 {
59+
pinmux = <I2C1_SDA_GPIO3>,
60+
<I2C1_SCL_GPIO4>;
61+
bias-pull-up;
62+
drive-open-drain;
63+
output-high;
64+
};
65+
};
66+
67+
};
Lines changed: 154 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,154 @@
1+
/*
2+
* Copyright (c) 2022 Felipe Neves.
3+
*
4+
* SPDX-License-Identifier: Apache-2.0
5+
*/
6+
7+
/dts-v1/;
8+
9+
#include <espressif/esp32s2.dtsi>
10+
#include "esp32s2_franzininho-pinctrl.dtsi"
11+
12+
/ {
13+
model = "esp32s2_franzininho";
14+
compatible = "espressif,esp32s2";
15+
16+
aliases {
17+
led0 = &user_led_0;
18+
led1 = &user_led_1;
19+
i2c-0 = &i2c0;
20+
watchdog0 = &wdt0;
21+
};
22+
23+
chosen {
24+
zephyr,sram = &sram0;
25+
zephyr,console = &uart0;
26+
zephyr,shell-uart = &uart0;
27+
zephyr,flash = &flash0;
28+
};
29+
30+
leds {
31+
compatible = "gpio-leds";
32+
33+
user_led_0: led_0 {
34+
gpios = <&gpio0 21 GPIO_ACTIVE_HIGH>;
35+
label = "User - LED0";
36+
};
37+
38+
user_led_1: led_1 {
39+
gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>;
40+
label = "User - LED1";
41+
};
42+
};
43+
};
44+
45+
&cpu0 {
46+
clock-frequency = <ESP32_CLK_CPU_240M>;
47+
};
48+
49+
&uart0 {
50+
status = "okay";
51+
current-speed = <115200>;
52+
pinctrl-0 = <&uart0_default>;
53+
pinctrl-names = "default";
54+
};
55+
56+
&gpio0 {
57+
status = "okay";
58+
};
59+
60+
&gpio1 {
61+
status = "okay";
62+
};
63+
64+
&timer0 {
65+
status = "okay";
66+
};
67+
68+
&timer1 {
69+
status = "okay";
70+
};
71+
72+
&timer2 {
73+
status = "okay";
74+
};
75+
76+
&timer3 {
77+
status = "okay";
78+
};
79+
80+
&i2c0 {
81+
status = "okay";
82+
clock-frequency = <I2C_BITRATE_STANDARD>;
83+
pinctrl-0 = <&i2c0_default>;
84+
pinctrl-names = "default";
85+
};
86+
87+
&i2c1 {
88+
clock-frequency = <I2C_BITRATE_STANDARD>;
89+
pinctrl-0 = <&i2c1_default>;
90+
pinctrl-names = "default";
91+
};
92+
93+
&trng0 {
94+
status = "okay";
95+
};
96+
97+
&spi2 {
98+
#address-cells = <1>;
99+
#size-cells = <0>;
100+
status = "okay";
101+
pinctrl-0 = <&spim2_default>;
102+
pinctrl-names = "default";
103+
};
104+
105+
&spi3 {
106+
#address-cells = <1>;
107+
#size-cells = <0>;
108+
status = "okay";
109+
pinctrl-0 = <&spim3_default>;
110+
pinctrl-names = "default";
111+
};
112+
113+
&flash0 {
114+
status = "okay";
115+
partitions {
116+
compatible = "fixed-partitions";
117+
#address-cells = <1>;
118+
#size-cells = <1>;
119+
120+
/* Reserve 60kB for the bootloader */
121+
boot_partition: partition@1000 {
122+
label = "mcuboot";
123+
reg = <0x00001000 0x0000F000>;
124+
read-only;
125+
};
126+
127+
/* Reserve 1024kB for the application in slot 0 */
128+
slot0_partition: partition@10000 {
129+
label = "image-0";
130+
reg = <0x00010000 0x00100000>;
131+
};
132+
133+
/* Reserve 1024kB for the application in slot 1 */
134+
slot1_partition: partition@110000 {
135+
label = "image-1";
136+
reg = <0x00110000 0x00100000>;
137+
};
138+
139+
/* Reserve 256kB for the scratch partition */
140+
scratch_partition: partition@210000 {
141+
label = "image-scratch";
142+
reg = <0x00210000 0x00040000>;
143+
};
144+
145+
storage_partition: partition@250000 {
146+
label = "storage";
147+
reg = <0x00250000 0x00006000>;
148+
};
149+
};
150+
};
151+
152+
&wdt0 {
153+
status = "okay";
154+
};
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
identifier: esp32s2_franzininho
2+
name: ESP32-S2
3+
type: mcu
4+
arch: xtensa
5+
toolchain:
6+
- zephyr
7+
supported:
8+
- gpio
9+
- i2c
10+
- watchdog
11+
- uart
12+
- pinmux
13+
- nvs
14+
testing:
15+
ignore_tags:
16+
- heap
17+
- net
18+
- bluetooth
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# SPDX-License-Identifier: Apache-2.0
2+
3+
CONFIG_XTENSA_RESET_VECTOR=n
4+
5+
CONFIG_BOARD_ESP32S2_FRANZININHO=y
6+
CONFIG_SOC_ESP32S2=y
7+
CONFIG_MAIN_STACK_SIZE=2048
8+
9+
CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC=240000000
10+
11+
CONFIG_CONSOLE=y
12+
CONFIG_SERIAL=y
13+
CONFIG_UART_CONSOLE=y
14+
15+
CONFIG_XTENSA_USE_CORE_CRT1=n
16+
17+
CONFIG_GPIO=y
18+
19+
CONFIG_GEN_ISR_TABLES=y
20+
CONFIG_GEN_IRQ_VECTOR_TABLE=n
21+
22+
CONFIG_CLOCK_CONTROL=y
23+
24+
CONFIG_BOOTLOADER_ESP_IDF=y
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
set ESP_RTOS none
2+
3+
source [find interface/ftdi/esp32s2_kaluga_v1.cfg]
4+
source [find target/esp32s2.cfg]

0 commit comments

Comments
 (0)