Tools > Board > ESP32 > new submenu

Hi, In the Arduino-ESP32 we have too many boards, which is just a very long list. We were thinking about splitting it into submenus - is this possible?
Can you please point us in the right direction to create a submenu in the board selection?
In other words - please send a link to the documentation of the language in which is written file boards.txt

yes, it possible
Dive to the boards.txt file and see how it describe existing menu structure. Catch the principle and you will able to add your own menu level.

Can you please present an example? I was not able to create it.

Hi @ViksFrumAkul

Unfortunately, this is not possible.

I see there was a request for such a feature here:

However, I think that was considered at least mitigated by the splitting of the Tools > Board menu into sub-menus for each platforms (before that, the long list of ESP32 boards would have been part of the even longer list of all the board of all the platforms the user had installed, all under a single menu!).

However, it is possible to do something else to reduce the number of items in the Tools > Board > ESP32 Arduino menu. This approach uses the "custom board options" capability of the Arduino boards platform framework:

https://arduino.github.io/arduino-cli/latest/platform-specification/#custom-board-options

This allows each platform author to create arbitrary additional menus under the Tools menu of the Arduino IDE, which will appear after the user selects the board which defines the menus. The ESP32 platform is already making extensive use of such menus to allow the user to configure settings (e.g., the Tools > CPU Frequency menu).

So what you could do is to consolidate the board definitions into smaller number of distinct types. For example:

  • ESP32
  • ESP32-S2
  • ESP32-S3
  • ESP32-C3

After selecting this high level category from the Tools > Board menu, the user would then select their board from the list of specific models of that category under a custom board option menu. For example, if I had an "Adafruit QT Py ESP32-C3" board, I would do this:

  1. Select Tools > Board > ESP32 Arduino > ESP32-C3 from the Arduino IDE menus.
  2. Select Tools > Model > Adafruit QT Py ESP32-C3 from the Arduino IDE menus.

An example of a popular boards platform already using this technique is STM32duino (or whatever they are calling it these days):

Here you can see I have selected the high level "Generic STM32F0 series" category from the Tools > Board > STM32 MCU based boards menu, which provides a "Board part number" custom board options menu with each of the more specific boards that fit under that "Generic STM32F0 series" category.

1 Like

Thank you very much, this is an excellent example, we will consider this option.

Oooo, it exactly what I meant in post#2 :slight_smile:

You are welcome. I think it really would be a good enhancement to the platform now that it is supporting multiple microcontrollers.

Is there a public discussion about this (e.g., an issue on the GitHub repository)? If so, please share a link to it. I would be interested in following along. The additional information shared there might also be very valuable to other platform authors considering doing something similar with their projects.

There is a discussion now...

Cool! I am subscribed.

1 Like

For boards that you don't own and don't ever expect to own, you can modify the boards.txt file manually with a bunch of statements like:

tinypico.hide=true
feathers2.hide=true
feathers2neo.hide=true
tinys2.hide=true
rmp.hide=true

Those don't have to be in-order with the rest of the boards description, so you can just put a whole bunch of .hide statements at the very top of boards.txt, and those boards will just disappear from your menu.

I have a python program that ALMOST does this for you here: Duino-hacks/BoardListManager at master · WestfW/Duino-hacks · GitHub
But it's not quite finished (manually edit the file with your Arduino directory!), seems to be picky about the python environment (runs under Anaconda, but not with the default MacOS python install), and I don't think it quite works with the current 3rd part boards structures.

2 Likes

Hi @ptillisch :slight_smile: We (ESP32 core devs and contributors) have long thought of possible ways to optimize the board menu. Here are a few reasons why we have not been able to do it so far (based on chip or manufacturer):

  1. Boards in the group can not have predefined properties, like flash size, PSRAM available, etc if all in the group are not defined. If one requires selection, all will have it.
  2. Boards can not have custom values for some of the menus (ex. We have boards that require custom, non-standard upload speeds or they will not work)
  3. Some boards have specific custom menus. Those also would not fit in the scheme

We also thought of splitting the chips into separate packages, while using the same core, but worry that the many ESP32 related libraries will stop working, because defines and other things would change. Will also not solve the fact that we already have many ESP32 based boards that would still end up in one of the packages. It would only temporarily "fix" the problem for some of the chips, until more boards come out with them.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.