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

Suggestion : add support for esp32-devkit-v1 board #20

Merged
merged 2 commits into from
Feb 7, 2024

Conversation

leokeba
Copy link
Contributor

@leokeba leokeba commented Feb 7, 2024

Hi, although it might not be the best choice to run this project, the "doit" devkit-v1 board and its numerous clones are one of the most common, cheap and available esp32 boards so I thought it might be useful to add it to the template.

@theelims
Copy link
Owner

theelims commented Feb 7, 2024

Likely the doit devkit had the same schematic as the regular devkit from Espressif. Likely the board type "esp32dev" will work for it as well. If so, I would prefer the more generic board.

@leokeba
Copy link
Contributor Author

leokeba commented Feb 7, 2024

Makes sense, shoud I just edit the PR then ?

@leokeba
Copy link
Contributor Author

leokeba commented Feb 7, 2024

I just tried compiling with the template for it but it's missing the LED_BUILTIN define. It can be fixed by adding the "-D LED_BUILTIN=2" build flag, but it makes me wonder, maybe the regular devkit doesn't have a builtin led in the first place ? I went looking for the schematics on espressif's website, but not sure which devkit this refers to, maybe it was discontinued ?

@theelims
Copy link
Owner

theelims commented Feb 7, 2024

It should be as generic as possible. Could be that "esp32dev" just refers to the bare module. There is a complete overview on the platformio website. Maybe it's a good idea to reduce the platformio.ini just to the official devboard for each chip.

On the one hand the default should be as accessible as possible and on the other hand I want to avoid a pull request for each single board or there.

@leokeba
Copy link
Contributor Author

leokeba commented Feb 7, 2024

Yep totally understand your point. For my own purposes, using the more generic esp32dev with added build flag for the LED seems to be pretty much equivalent to the bare "doit" board, so either works for me.

I would say the first option, being more generic, offers more power to the user as they can just edit the LED_BUILTIN flag to adapt it for their own board. But it can also trick users into believing that their board will work when it will not, either because there is not builtin LED, or because it's on another pin.

On the other hand, my experience tells me that the "doit" style devkit-v1 boards are the most common and available by a huge margin (not the "doit" brand itself but all the "clones"). Usually, the "devkit-v1" reference is clearly written on the back of the PCB, so for not-so-experienced users who own this board it would be the most frictionless way of getting started, just select the name that's written on your board and hit upload.

Each has its merit, and of course there's also the option of not adding another board and keeping the list short, this was just a suggestion in the first place. Anyway, just tell me if you have a final recommandation for this, or just close the PR if you wanna go the third route.

Have a good day, and thanks for your work, it's a great project. I was trying to build something very similar myself, but I would never have made it so slick and streamlined, so I'm happy I ran into this :)

@leokeba
Copy link
Contributor Author

leokeba commented Feb 7, 2024

Just for good measure, I dug into espressif's arduino framework to have a look at the differences between board definitions. The devkit-v1 is exactly the same as the esp32dev but adds the LED_BUILTIN define, but I also discovered that the nodemcu-32s is the same as devkit-v1 but also adds a KEY_BUILTIN define. Fortunately, this key also works on the devkit-v1 variants as it is used as a boot strapping pin.

So if the goal is to be as generic as possible, we might replace the nodemcu-32s by the following, and it would work for both boards, and probably others :

[env:esp32dev]
; Works for nodemcu-32s, devkit-v1 boards and probably others. You can change the pin defines below if needed.
board = esp32dev
board_build.partitions = min_spiffs.csv
build_flags =
    ${env.build_flags}
    -D LED_BUILTIN=2
    -D KEY_BUILTIN=0

What do you think about this option ?

@theelims
Copy link
Owner

theelims commented Feb 7, 2024

I find it hard to map the board definitions from the Arduino framework with the platformio boards. But I like your suggestion. Should make it more universal. With the next feature branch I'll clean up the platformio.ini and get a Espressif devboard for each major chip for testing.

@theelims theelims merged commit f16cabd into theelims:main Feb 7, 2024
@leokeba leokeba deleted the devkit-v1 branch February 7, 2024 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants