-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
boards/esp32s2-mini: add definition for ESP32 S2 Mini #18863
Conversation
@benpicco Is this PR still WIP or ready for review? |
I still didn't get around to map the pins / peripherals, but that can be done rather quickly. |
This board seems just to be a clone of the Wemos S2 mini which in turn seems to be pin compatible with the ESP8266 LOLIN D1 mini board and its shields that we also support with (ESP-12x based boards). IMHO, we should refer the official Wemos S2 mini product and should think about to call it The pins should be defined to be compatible with the Wemos Mini Shields. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
board.h
, gpio_params.h
and periph_conf.h
still require some work.
Ok, UART, I2C (untested) and SPI are now on the same pins as the Wemos S2 mini. Not sure what do do about ADC, DAC and PWM - can they be on arbitrary pins? Doc still needs an update. |
The ESP32-S2 does not have a DAC device. It allows the use of 20 GPIOs as ADC channels (ADC1 10 channels: GPIO1 - GPIO10 and ADC2 10 channels: GPIO11 - GPIO20). ADC1 channels should be preferred as ADC2 is also used by the WiFi module and may not always be available when ESP32-S2 LEDC device has one channel group device that allows up to 8 PWM channels. PWM channels can be routed to all GPIOs with the exception of GPIO46 which is is an input-only pin. |
I must revise myself, the ESP32-C3 is missing the DAC device. The ESP32-S2 has a DAC device with 2 channels that are connected to GPIO17 and GPIO18. |
01e79b5
to
6ac2b24
Compare
6ac2b24
to
0e56a47
Compare
0e56a47
to
d9b36ed
Compare
What about the |
18752: nanocoap_sock: deprecate nanocoap_get() r=benpicco a=benpicco 19100: cpu/esp_common: allow configuration of UART0 r=benpicco a=gschorcht ### Contribution description This PR - fixes the issue for ESP32 SoCs that UART0 signals can't be routed to arbitrary GPIOs and - allows the configuration of the UART device used by the bootloader. The UART interface and its configuration used by the STDIO are defined in RIOT using the define `STDIO_UART_DEV` and the configuration of the corresponding UART device in `periph_conf.h`. However, the bootloader compiled directly in ESP-IDF uses its own definitions `CONFIG_ESP_CONSOLE_UART_*` for the UART configuration. To be able to use a consistent UART configuration in RIOT and the bootloader, e.g. to see the output of the 2nd stage bootloader, these `CONFIG_ESP_CONSOLE_UART_*` can be defined via a set of KConfig variables in RIOT (not yet implemented in Kconfig): - `CONSOLE_CONFIG_UART_NUM` defines the UART device to be used by the bootloader and by `STDIO_UART_DEV` - `CONSOLE_CONFIG_UART_RX` and `CONSOLE_CONFIG_UART_TX` define the GPIOs to be used by the bootloader and should be the GPIOs as defined in `periph_conf.h` for the corresponding UART device. ### Testing procedure Any ESP32 node should still work with `stdio_uart` and the default configuration. To test an alternative configuration, use ``` CFLAGS='-DUART1_TXD=5 -DUART1_RXD=4 -DCONFIG_CONSOLE_UART_NUM=1 -DCONFIG_CONSOLE_UART_TX=5 -DCONFIG_CONSOLE_UART_RX=4' USEMODULE=esp_log_startup BOARD=esp32-wroom-32 make -C tests/shell flash ``` The bootloader output and the STDIO should be routed to UART1 at GPIO4 and GPIO5. ### Issues/PRs references Prerequisite for PR ##18863 19104: tests/periph_uart: only exclude STDIO_UART_DEV if stdio_uart is used r=benpicco a=benpicco Co-authored-by: Benjamin Valentin <benjamin.valentin@ml-pa.com> Co-authored-by: Gunar Schorcht <gunar@schorcht.net> Co-authored-by: Benjamin Valentin <benjamin.valentin@bht-berlin.de>
Regarding the problem with USB OTG and the WiFi interface seems to be indeed a problem also for the ESP32-S3. It works, but very unstable. Unfortunatly, it is not easy to debug it because the USB interface is occupied by the USB OTG controller. I will try to have a JTAG adapter connected directly to the JTAG pins tomorrow. |
bors merge |
🕐 Waiting for PR status (GitHub check) to be set, probably by CI. Bors will automatically try to run when all required PR statuses are set. |
94b253f
to
ed5bfb7
Compare
bors merge |
Build failed: |
@@ -7,6 +7,7 @@ DISABLE_MODULE += auto_init_xtimer | |||
|
|||
# Boards that can't run only on xtimer or that always select ztimer | |||
BOARD_BLACKLIST += \ | |||
esp32s2-wemos-mini \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😕 What is different on this board than on other ESP32-S2 boards?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the USB implementations always pull in ZTimer, so these tests that rely on xtimer internals don't work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, it is using stdio_tinyusb_cdc_acm
which in turn depends on ztimer_msec
.
bors merge |
🕐 Waiting for PR status (GitHub check) to be set, probably by CI. Bors will automatically try to run when all required PR statuses are set. |
Already running a review |
Build succeeded: |
Thank you for the review! |
What exactly did you mean? Did you mean that the WiFi station interface simply can't connect to the AP and you just get the constant message |
I mean that USB would not work (nothing in |
Contribution description
This adds support for the ESP32-S2 Mini, an inexpensive board based on the ESP32S2-FN4R2.
There is no additional USB <-> Serial converter, so stdio is provided by tinyUSB.
The board comes with a serial bootloader in mask ROM and can be flashed just like any other ESP32 based board.
Testing procedure
Issues/PRs references