Board listall with more detail

I have a problem and I fear for the answer.

My OS tells me this:
afbeelding

Arduino-cli board list tells me this:
afbeelding

When it is just one, it is not a problem. But this is:
afbeelding
afbeelding

Now the question I dare not to ask.

Is there a way to let Arduino-cli also tell me these details? adding -v didn't do the trick :see_no_evil:

Backup question which isn't really arduino related. What native windows command could I run which can gimme the details?

Kind regards :tumbler_glass:

Bas

Hi @bask185. If the ports produced by these boards each have unique USB VID/PID pairs or serial numbers then you could create a custom boards platform that associates a board definition with those properties. The board name would then be shown under the "Board Name" column of the arduino-cli board list output.

The port identification properties system is documented here:

https://arduino.github.io/arduino-cli/dev/platform-specification/#:~:text=If%20the%20platform%20supports%20pluggable%20discovery%20it%20may%20also%20declare%20a%20set%20of%20upload_port.*%20properties

The idea of creating your own boards platform might seem quite daunting (and indeed is in the case where you are creating support for a new microcontroller from scratch), but in this case where there an existing platform already provides support for your boards, it is only a matter of adding a single text file containing a dozen lines of configuration to the right subfolder under your sketchbook. You can reference all the resources from the existing platform using the system documented here:

https://arduino.github.io/arduino-cli/latest/platform-specification/#referencing-another-core-variant-or-tool

You can see an example of the system in use to associate the "Arduino Uno" board definition with the unique VID/PID pairs of the ports produced by official and faithful clone Arduino Uno boards here in the "Arduino AVR Boards" platform's boards.txt configuration file:

The reason why there are four sets of VID/PID pairs in that code is because the Arduino Uno board has been manufactured with various VID/PID pairs over time and so associations must be set up for all of them. In your case you would only need to define a single set of identification properties.

Thank you for your elaborate answer.

Boards carrying ch340s should be named: Chinese knockoff :rofl:

But for real. I was looking at.. well see screenshots. And I realized I could also JSON parse the VID and PID values and at the very least determen that the found COM port object is a CH340. However reading a few pages and add a dozen lines to a text file shouldn't be that hard.

afbeelding
afbeelding

So I am giving it a try. In this path
C:\Program Files (x86)\Arduino\hardware\arduino\avr
I found a boards.txt. And I copied the one of an UNO for testing and replace it's content. I changed name and PID/VID values.

##############################################################

ch340.name=CH340

ch340.vid.0=0x1A86
ch340.pid.0=0x7523

ch340.upload.tool=avrdude
ch340.upload.protocol=arduino
ch340.upload.maximum_size=32256
ch340.upload.maximum_data_size=2048
ch340.upload.speed=115200

ch340.bootloader.tool=avrdude
ch340.bootloader.low_fuses=0xFF
ch340.bootloader.high_fuses=0xDE
ch340.bootloader.extended_fuses=0xFD
ch340.bootloader.unlock_bits=0x3F
ch340.bootloader.lock_bits=0x0F
ch340.bootloader.file=optiboot/optiboot_atmega328.hex

ch340.build.mcu=atmega328p
ch340.build.f_cpu=16000000L
ch340.build.board=AVR_UNO
ch340.build.core=arduino
ch340.build.variant=standard

But so far no luck. My output does not change. I'll go dig a little further. Not so long ago I was toying around with the location of settings. For all I know I am editting the wrong boards.txt. The result is consistent in both IDE and CLI.

Regards,

Bas

I'm glad you decided to dig in further. I think this stuff is pretty interesting.

There are two different systems for identifying ports:

  • the legacy system
  • the "pluggable discovery" system

The syntax you used here is the legacy system:

The legacy syntax is still supported even by the modern versions of the Arduino development tools like Arduino CLI in order to provide backwards compatibility for all the boards platforms that were created before the pluggable discovery system was introduced. However, if a platform has already been migrated to the pluggable discovery system then the legacy syntax is no longer recognized. This is the reason why the board was not identified as "CH340" in the arduino-cli board list output.

The "Arduino AVR Boards" platform has been migrated to the pluggable discovery system so you must use the new syntax when working in that platform. The new syntax looks like this:

ch340.upload_port.0.vid=0x1A86
ch340.upload_port.0.pid=0x7523

If you replace the old syntax in your boards.txt file with those lines you will find that the arduino-cli board list output is as you expected.

You might notice that the "Arduino AVR Boards" platform still has the old syntax in addition to the new syntax:

Although these lines are ignored by the modern versions of Arduino CLI and Arduino IDE, they are necessary to provide compatibility with older versions of the Arduino development tools from before the implementation of the new pluggable discovery system.

1 Like

I seem to have succes. I had problems at first.. it did not work but that was because I editted the wrong boards.txt. There was one in the program files directory buttt...

This little succes over here
afbeelding

Told me it was the one in the appdata folder.
Clever learning monkey that I am I used arduino-cli.exe config dump to find it.

I do want to change a few things like to use the nano bootloader. I usually use SMD atmega chips with the A6 and A7 pins.

board listall with a slightly modified name..
afbeelding

So thnx for the assist

Kind regards,

Bas

You are welcome. I'm glad it is working now.

Regards,
Per

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