I have a custom Arduino-compatible board, with its own boards.txt file for functionality in the Arduino IDE. Users can burn a bootloader to the board using the IDE, as I've defined paths and scripts to handle that within the boards.txt file. Right now the different bootloaders have to be in specific places in the user's filesystem. I was wondering if there is a way to add a file dialog to the boards.txt file? Then users would be able to define the path to a bootloader image in their filesystem and the IDE can use that path. I know for example how to create menu items inside the boards.txt file but haven't found very much documentation for it.
That seems like it would be pointless and very not user friendly. Just bundle the bootloader files with the boards.txt and any other components of the hardware package that you might have, same as how every other hardware package does it. Then you will always know exactly where the bootloader files are. The user has to install your package either way so it's no extra work for them.
If you want to make it even easier to install then set your hardware package up to support installation via Boards Manager:
Well the idea is that users are able to write FPGA code and compile it to run on our board. I want to be able to make it easy for users who have already created a useful board image to share their images with other people, then they would be able to use the IDE to point to the new board image. I already have several premade bootloaders available in my boards.txt, and I have defined my bootloader tool in package_*.json file. I know that it's not super user friendly, but it seems like the best way to me for users to be able to burn bootloader images supplied not by me but other members of the community using our boards.
I see. The only way I can see this might be possible is if you write a custom tool. Custom tools are a feature that allows you to add items to the Tools menu that run Java code. This is a bit confusing because you can also add custom tools menu via boards.txt but that is more limiting.
I haven't found much documentation on this. If you look in the tools subfolder of the Arduino IDE installation folder you will find a file, howto.txt and also two tools. The first one, Mangler, is just there as a demonstration of how to write a tool. It's not compiled so that's why you don't see a Mangler entry in the Arduino IDE Tools menu. The other is the "WiFi101 Firmware Updater" you will see in the Tools menu. This was added in Arduino IDE 1.6.10. 3rd party tools can be installed to the tools subfolder of the sketchbook folder. This is a bit confusing because hardware packages also use the term "tools" and a folder named tools for their toolchain but these are two separate things and the folders are located in different places. This tools system is also used in the Processing IDE, which actually has a selection of official and 3rd party tools available. You may find more documentation for tools as they relate to Processing:
The only 3rd party tool for the Arduino IDE I know of is the EspExceptionDecoder:
I don't know whether it's possible to use a tool to set the path that will be used for the Tools > Burn Bootloader command.
If it is possible, the issue arises of how to package the tool with your hardware package. I don't know whether it's possible to include this sort of tools with a Boards Manager installation and I haven't seen it documented anywhere. The only thing I can think of is to treat it just like the other sort of tool (toolchain) but I'm doubtful that the Arduino IDE will recognize Java files in that location. It's also a bit awkward to bundle with a manual hardware package installation because the hardware package files are installed to the hardware subfolder of the sketchbook while the tools are installed to the tools folder of the sketchbook. I suppose you could have that full folder structure and have people copy the whole thing over their sketchbook.
Sorry I'm not able to be more helpful in this. It may be a dead end but I do think it's the only hope to achieve your goal. Maybe someone else with experience in writing tools will comment.
Oh thanks a lot, I was unaware of this so it's something I can look into. Even if I can't direct information back to the IDE I can probably figure out something.
I just came across a new 3rd party tool that might provide a useful model for your project:GitHub - me-no-dev/arduino-esp32fs-plugin: Arduino plugin for uploading files to ESP32 file system
Have you had any luck so far @crakerbr?
Hey thanks for following up and sorry I never got back to you, I didn't get any notification of your reply, maybe my account settings aren't set how I expect...
I have had some success with this yes and hope to be able to release my tool soon. Your posts got me started in the right direction, and thanks for finding this tool too!