Skip to content
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

Add support for the Arduino Nano ESP32 on 3.x branch #8909

Merged
merged 12 commits into from
Nov 29, 2023

Conversation

pillo79
Copy link
Contributor

@pillo79 pillo79 commented Nov 22, 2023

This adds pin remapping and support for the Arduino Nano ESP32 board to the master (3.x) branch.

Copy link
Member

@P-R-O-C-H-Y P-R-O-C-H-Y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pillo79 PTAL on my comments, I have review the board addition part for now.

platform.txt Outdated Show resolved Hide resolved
variants/arduino_nano_nora/pins_arduino.h Outdated Show resolved Hide resolved
variants/arduino_nano_nora/pins_arduino.h Outdated Show resolved Hide resolved
@pillo79 pillo79 force-pushed the nano_esp32_support branch 3 times, most recently from 63b57d1 to d1c378b Compare November 22, 2023 15:14
@pillo79
Copy link
Contributor Author

pillo79 commented Nov 22, 2023

@P-R-O-C-H-Y thanks for the review notes, I updated the PR accordingly.

"touch" would create the file if not present, but not delete its
contents if a previous run left the file in the build dir.
"debug.toolchain.prefix" must end with a dash, since only the tool name is
appended to this string.

The reason this is not a major issue is that the "debug_custom.json" file
(copied in the sketch directory when debugging is enabled) forces its own
prefix. And to make things more interesting, the "toolchainPrefix" entry
in that file should _not_ end with a dash.
@pillo79
Copy link
Contributor Author

pillo79 commented Nov 23, 2023

Added a few missing debug related one-liners that had been already merged in 2.x as part of #8567 and rebased to current main.

@pillo79
Copy link
Contributor Author

pillo79 commented Nov 27, 2023

I see the latest commits in master added a few more perimap-related calls - I will shortly provide an appropriate update to the io_pin_remap.h.

Previously all libraries invoked either high-level APIs (transparently
remapped, like the user sketch) or low-level ESP-IDF calls (where the
remap to GPIO numbers had to be added manually).

Since 3.x, some of these are mixed (for example, periman* APIs are
remapped, while soc* are not). This must be handled by disabling the
automatic API remapping and making sure all calls use GPIO numbers.
@pillo79
Copy link
Contributor Author

pillo79 commented Nov 28, 2023

  • aba2f2e adds #pragma once to esp32-hal-periman.h and includes it from esp-hal.h as all other similar include files
  • 61890e2 adds the missing periman APIs
  • 2dce29f fixes an issue with libraries using mixed APIs (some remapped, some not) so that they all use non-remapped calls and manually handle pin numbers.

@P-R-O-C-H-Y
Copy link
Member

P-R-O-C-H-Y commented Nov 28, 2023

@pillo79 Can you please take a look at the function printPerimanInfo in the chip-debug-report.cpp -> LINK. This will be printed after setup and it is going to print all pins that are used for some peripheral.
For your case with the pin remapping enabled, it may be confusing for the users. As it's going to print the GPIO number not the remapped one.
Can you please do changes here to print the remapped pin if remapping enabled? Thanks

@pillo79
Copy link
Contributor Author

pillo79 commented Nov 28, 2023

@P-R-O-C-H-Y thanks for pointing that out, very useful feature! When pin remapping is active, I have added a separate column with digital pin numbers and tested it formats nicely:

GPIO Info:
------------------------------------------
  DPIN|GPIO : BUS_TYPE[bus/unit][chan]
  --------------------------------------  
  D15 |   0 : LEDC[0][1]
  D1  |  43 : UART_TX[0]
  D0  |  44 : UART_RX[0]
  D16 |  45 : LEDC[0][2]
  D14 |  46 : LEDC[0][0]
  D13 |  48 : GPIO

[edit] Force-push made the double column active if the selected board has pin remapping, regardless of the user's choice of numbering, as it's useful in both cases.

Copy link
Member

@P-R-O-C-H-Y P-R-O-C-H-Y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding that :)

@P-R-O-C-H-Y P-R-O-C-H-Y added Status: Pending Merge Pull Request is ready to be merged and removed Status: Review needed Issue or PR is awaiting review labels Nov 28, 2023
@VojtechBartoska VojtechBartoska added this to the 3.0.0-Aplha3 milestone Nov 28, 2023
@me-no-dev me-no-dev merged commit 7d26b07 into espressif:master Nov 29, 2023
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Pending Merge Pull Request is ready to be merged Type: 3rd party Boards
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants