-
Notifications
You must be signed in to change notification settings - Fork 2.1k
boards/esp32: Arduino I/O mapping completion #21484
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/esp32: Arduino I/O mapping completion #21484
Conversation
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.
Mostly very small nitpicks here and there.
What I don't understand, but my understanding of ESP32 is limited, is the change of pins. Were there so many errors in the pin definitions? Wrong GPIOs selected for the Arduino pins?
Or do these boards not have Arduino headers and the GPIOs are just chosen arbitrarily?
None of the boards have Arduino headers so that the choice of the GPIOs is arbitrary. The only ESP32 board with Arduino headers is that one in PR #21479. |
That is in-line with what the I/O mapping documentation claims: https://doc.riot-os.org/iomaps.html#iomaps-shields Only when a feature such as (I wonder why we are not having a feature declaring consistent mapping for feather compatible boards yet. I guess someone(tm) should do that :D) |
That's why the only ESP32 board with Arduino headers in PR #21479 provides the feature |
Many of the changes are either to document the pins more clearly or to complete missing mappings, e.g. for But when I went through the Arduino configuration board by board again, I noticed some misconfigurations on some boards that either hadn't been noticed before or didn't matter, e.g. for the I also realized that some of the configurations don't make sense, even in the peripheral configuration, e.g. using a pull-up button input as a PWM channel on I'm sorry that all these cleanups lead to 897 lines + and 300 lines - 🙈 If it helps, I could split this PR into seperate PRs, one for each board which would result in 12 separate PRs. |
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.
LGTM, please squash!
I went through everything yesterday reasonably thoroughly and the changes all look reasonable. Of course one could do more cleaning and whatever, but that is beyond the scope of this PR. |
The channel of PWM_DEV(0) that conflicts with the I2C SCA signal is replaced by another channel. PWM_DEV(1) is defined in addition if `periph_spi` is not used.
006c577
to
17d9200
Compare
@maribu One thing is not really clear to me from the documentation. Have the following macros to be declared only for boards with Arduino headers or for any board with some mapping, even if it doesn't have Arduino headers and is not mechanically compatible?
|
For the macros
I think it would be fair to use them also for non-Arduino compatible I/O mappings, as long as the named pins (or rather their I/O mapping names) are actually used. But we should update the doc to indicate that.
For this one, I think it is confusing to use that for non-Arudino-UNO compatible boards. |
Ok, that means you would define |
afe052e
to
fa630d3
Compare
Ok, that means you would define @maribu ? |
I think either is fine |
Ok, then I prefer the removal and leave the default definition. @crasbe Is your approval still valid with the last fixups? |
Sure :) |
Migration to the new Arduino I/O mapping, which was not fully covered in PR RIOT-OS#19759 when the new Arduino I/O mapping was introduced and the feature handling was changed.
Migration to the new Arduino I/O mapping, which was not fully covered in PR RIOT-OS#19759 when the new Arduino I/O mapping was introduced and the feature handling was changed.
Migration to the new Arduino I/O mapping, which was not fully covered in PR RIOT-OS#19759 when the new Arduino I/O mapping was introduced and the feature handling was changed.
- GPIO2 (LED1_PIN) is used as SPI signal, not only if `sdcard_spi` is enabled. herefore, it must not be defined as LED pin if `periph_spi` is used. - GIO4 (LED2_PIN) is used by the SDMMC Host Controller as SD Card DAT1 signal and must not be defined as LED pin in that case.
Migration to the new Arduino I/O mapping, which was not fully covered in PR RIOT-OS#19759 when the new Arduino I/O mapping was introduced and the feature handling was changed.
Migration to the new Arduino I/O mapping, which was not fully covered in PR RIOT-OS#19759 when the new Arduino I/O mapping was introduced and the feature handling was changed.
Migration to the new Arduino I/O mapping, which was not fully covered in PR RIOT-OS#19759 when the new Arduino I/O mapping was introduced and the feature handling was changed.
Migration to the new Arduino I/O mapping, which was not fully covered in PR RIOT-OS#19759 when the new Arduino I/O mapping was introduced and the feature handling was changed.
Migration to the new Arduino I/O mapping, which was not fully covered in PR RIOT-OS#19759 when the new Arduino I/O mapping was introduced and the feature handling was changed.
Migration to the new Arduino I/O mapping, which was not fully covered in PR RIOT-OS#19759 when the new Arduino I/O mapping was introduced and the feature handling was changed.
Migration to the new Arduino I/O mapping, which was not fully covered in PR RIOT-OS#19759 when the new Arduino I/O mapping was introduced and the feature handling was changed.
GPIO0 is connected to the BOOT button and pulled up by external resistor. Using it as PWM channel is probably not the best idea.
Migration to the new Arduino I/O mapping, which was not fully covered in PR RIOT-OS#19759 when the new Arduino I/O mapping was introduced and the feature handling was changed.
To handle different revisions of the board with same configuration, one ADC channel was added to the configuration and the last two ADC lines were reordered. It shouldn't affect existing applications.
Migration to the new Arduino I/O mapping, which was not fully covered in PR RIOT-OS#19759 when the new Arduino I/O mapping was introduced and the feature handling was changed.
Migration to the new Arduino I/O mapping, which was not fully covered in PR RIOT-OS#19759 when the new Arduino I/O mapping was introduced and the feature handling was changed.
`arduino_pinmap` and `arduino__analog_map` are not defined any longer by the board but as a common approach in `sys/arduino/include/arduino_board*.h`. Their definition in `boards/common/esp32x` were just a leftover and forgotten in PR RIOT-OS#19759.
fa630d3
to
85d65aa
Compare
Contribution description
This PR completes the migration to the new Arduino I/O mapping for ESP32x boards, which was not fully covered in PR #19759 when the new Arduino I/O mapping was introduced and the feature handling was changed. That is
arduino_io_map.h
is updated and the featuresarduino_analog
,arduino_dac
,arduino_i2c
,arduino_pwm
,arduino_spi
andarduino_uart
are enabled if supported for the following boards:esp32-heltec-lora32-v2
esp32-mh-et-live-minikit
esp32-olimex-evb
esp32-ttgo-t-beam
esp32-wemos-lolin-d32-pro
esp32-wroom-32
esp32-wrover-kit
esp32s2-devkit
esp32s2-lilygo-ttgo-t8
esp32s3-devkit
esp32s3-pros3
esp32c3-devkit
esp32c3-wemos-mini
During the migration process some small peripheral configuration fixes and changes had to be done:
esp32-heltec-lora32-v2
: GPIO0 is connected to the BOOT button and pulled up by external resistor. Using it as PWM channel is probably not the best idea.esp32-ttgo-t-beam
: To handle different revisions of the board with same configuration, one ADC channel was added to the configuration and the last two ADC lines were reordered. It shouldn't affect existing applications.esp32-wrover-kit
: GPIO2 (LED1_PIN
) is used as SPI signal, not only ifsdcard_spi
is enabled. herefore, it must not be defined as LED pin ifperiph_spi
is used. GIO4 (LED2_PIN
) is used by the SDMMC Host Controller as SD Card DAT1 signal and must not be defined as LED pin in that case.esp32c3-devkit
: The channel ofPWM_DEV(0)
that conflicts with the I2C SCA signal is replaced by another channel.PWM_DEV(1)
is defined in addition ifperiph_spi
is not used.esp32c3-wemos-mini
: Additional channel was added tot the configuration ofPWM_DEV(0)
. Documentation fixed.Testing procedure
Compilation in CI should succeed
Issues/PRs references