Skip to content

Custom cores in sketchbook not being found; IDE looking in wrong place #2172

@DragRedSim

Description

@DragRedSim

Describe the problem

I am attempting to add a new, local package to my IDE install in order to utilise an alternative bootloader on a 32u4-based board. However, when I place a boards.txt file in the structure given on the platform specification document, it is not shown in the IDE.

When placed in a certain other folder, the cores do show up, and are marked as being in the sketchbook; however, the folder where they have to be placed to show up is not contained within the sketchbook.

To reproduce

The following folder paths assume the use of Windows, since it's what I use. I assume the same would occur on other platforms, with the paths changed as appropriate for those systems.

  1. Prepare a suitable custom core configuration; for example, I will use a package built to allow a 32u4 board to identify itself as a specific device, required for it to be able to be used as a game controller compatible with the Nintendo Switch system. Place the contents of the following GitHub link in SKETCHBOOK/packages/nx_controller/hardware/avr/boards.txt: ArduinoTaikoController/boards.txt (substitute SKETCHBOOK for your IDE's sketchbook path)
  2. Close and re-open the IDE.
  3. Pick "Tools" -> "Board" in the menu.
    At this point, reference item 1 in Expected behavior
  4. Move the nx_controller folder to the following location: %LOCALAPPDATA%/Arduino15/packages
  5. Close and re-open the IDE.
    At this point, reference item 2 in Expected behavior
  6. Open the file %USERPROFILE%/.arduinoIDE/arduino-cli.yaml - note that this file is named such that it is suggested to apply to the CLI.
  7. Change the value of directories: data: to match that in directories: user:. Save and close.
  8. Move the nx_controller folder back to the SKETCHBOOK\packages folder.
  9. Close and re-open the IDE.
    At this point, reference item 3 in Expected behavior

Expected behavior

  1. The boards list at this point should include a new item titled "nx_controller", marked as being from the sketchbook. (Actual result: no item)
  2. The boards list should include the "nx_controller" item, but should not have the text stating that it was from the sketchbook, since it has been moved out of that location. (Actual result: item, marked as being in sketchbook)
  3. The boards list should list all boards, excepting the nx_controller, without a tag; the nx_controller item should be tagged. (Actual result: the only boards that are listed are those in the sketchbook path, tagged as being such; I assume they are being found from the directories: data: path, then being checked and found to be in the sketchbook format path (not having a version number-based folder within the folder named after the architecture), thus being tagged.)

As I understand it, the IDE is effectively referencing the CLI config path, and drawing in its sketchbook path from there, based on the value of directories: data:, in regards to any boards; however, that path is not changed when updating the sketchbook path in the IDE, rather it only changes the value of directories: user:, which is not being scanned for boards. The platform description page linked above states: (emphasis mine)

Platforms add support for new boards to the Arduino development software. They are installable either via Boards Manager or manual installation to the hardware folder of Arduino's sketchbook folder (AKA "user directory").

Arduino IDE version

2.1.0; 2.1.1-nightly-20230508

Operating system

Windows

Operating system version

11 22H2 x64

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • I verified the problem still occurs when using the latest nightly build
  • My report contains all necessary details

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions