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

Custom board options menu items not in order specified by boards.txt #801

Closed
3 tasks done
mjs513 opened this issue Feb 2, 2022 · 4 comments
Closed
3 tasks done
Assignees
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@mjs513
Copy link

mjs513 commented Feb 2, 2022

Describe the problem

In the boards.txt file for the Teensy we have specified a list of menu items for USB Type, e.g.,

teensyMM.menu.usb.serial=Serial
teensyMM.menu.usb.serial.build.usbtype=USB_SERIAL
teensyMM.menu.usb.serial2=Dual Serial
teensyMM.menu.usb.serial2.build.usbtype=USB_DUAL_SERIAL
teensyMM.menu.usb.serial3=Triple Serial
teensyMM.menu.usb.serial3.build.usbtype=USB_TRIPLE_SERIAL
teensyMM.menu.usb.keyboard=Keyboard
teensyMM.menu.usb.keyboard.build.usbtype=USB_KEYBOARDONLY
teensyMM.menu.usb.keyboard.fake_serial=teensy_gateway
teensyMM.menu.usb.touch=Keyboard + Touch Screen
teensyMM.menu.usb.touch.build.usbtype=USB_TOUCHSCREEN
teensyMM.menu.usb.touch.fake_serial=teensy_gateway
teensyMM.menu.usb.hidtouch=Keyboard + Mouse + Touch Screen
teensyMM.menu.usb.hidtouch.build.usbtype=USB_HID_TOUCHSCREEN
teensyMM.menu.usb.hidtouch.fake_serial=teensy_gateway
teensyMM.menu.usb.hid=Keyboard + Mouse + Joystick
teensyMM.menu.usb.hid.build.usbtype=USB_HID
teensyMM.menu.usb.hid.fake_serial=teensy_gateway
teensyMM.menu.usb.serialhid=Serial + Keyboard + Mouse + Joystick
teensyMM.menu.usb.serialhid.build.usbtype=USB_SERIAL_HID
teensyMM.menu.usb.midi=MIDI
teensyMM.menu.usb.midi.build.usbtype=USB_MIDI
teensyMM.menu.usb.midi.fake_serial=teensy_gateway
teensyMM.menu.usb.midi4=MIDIx4
teensyMM.menu.usb.midi4.build.usbtype=USB_MIDI4
teensyMM.menu.usb.midi4.fake_serial=teensy_gateway
teensyMM.menu.usb.midi16=MIDIx16
teensyMM.menu.usb.midi16.build.usbtype=USB_MIDI16
teensyMM.menu.usb.midi16.fake_serial=teensy_gateway
teensyMM.menu.usb.serialmidi=Serial + MIDI
teensyMM.menu.usb.serialmidi.build.usbtype=USB_MIDI_SERIAL
teensyMM.menu.usb.serialmidi4=Serial + MIDIx4
teensyMM.menu.usb.serialmidi4.build.usbtype=USB_MIDI4_SERIAL
teensyMM.menu.usb.serialmidi16=Serial + MIDIx16
teensyMM.menu.usb.serialmidi16.build.usbtype=USB_MIDI16_SERIAL
teensyMM.menu.usb.audio=Audio
teensyMM.menu.usb.audio.build.usbtype=USB_AUDIO
teensyMM.menu.usb.audio.fake_serial=teensy_gateway
teensyMM.menu.usb.serialmidiaudio=Serial + MIDI + Audio
teensyMM.menu.usb.serialmidiaudio.build.usbtype=USB_MIDI_AUDIO_SERIAL
teensyMM.menu.usb.serialmidi16audio=Serial + MIDIx16 + Audio
teensyMM.menu.usb.serialmidi16audio.build.usbtype=USB_MIDI16_AUDIO_SERIAL
teensyMM.menu.usb.mtp=MTP Disk (Experimental)
teensyMM.menu.usb.mtp.build.usbtype=USB_MTPDISK
teensyMM.menu.usb.mtp.fake_serial=teensy_gateway
teensyMM.menu.usb.rawhid=Raw HID
teensyMM.menu.usb.rawhid.build.usbtype=USB_RAWHID
teensyMM.menu.usb.rawhid.fake_serial=teensy_gateway
teensyMM.menu.usb.flightsim=Flight Sim Controls
teensyMM.menu.usb.flightsim.build.usbtype=USB_FLIGHTSIM
teensyMM.menu.usb.flightsim.fake_serial=teensy_gateway
teensyMM.menu.usb.flightsimjoystick=Flight Sim Controls + Joystick
teensyMM.menu.usb.flightsimjoystick.build.usbtype=USB_FLIGHTSIM_JOYSTICK
teensyMM.menu.usb.flightsimjoystick.fake_serial=teensy_gateway
#teensyMM.menu.usb.disable=No USB
#teensyMM.menu.usb..disable.build.usbtype=USB_DISABLED

However, when we go in the IDE 2.0 when we select USB Type from the Tools dropdown (after selecting the board the order of USB Types appears to be in random order:
Capture

This behavior not constrained to just this menu. The list of boards is also not in the order specified.

To reproduce

  1. Install Teensy Boards using package:
    https://www.pjrc.com/teensy/td_156/package_teensy_index.json
    
  2. Install Teensy from Boards Manager
  3. Open boards.txt file in arduino15 for Teensy
  4. Go to tools, select Teensy MircoMod
  5. Select USB Type and compare to boards.txt for TMM.menu.usb....
  6. See error

Expected behavior

Order specified in the boards.txt file should be the order shown in the menu item in the Tools drop downs for the board specified.

Arduino IDE version

Original report

2.0.0-rc3-nightly.20220201

Last verified with

9a6a457

Operating system

Windows

Operating system version

  • Windows 10
  • Windows 11

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
@mjs513 mjs513 added the type: imperfection Perceived defect in any part of project label Feb 2, 2022
@per1234 per1234 changed the title Menu Items Listed for USB Type Not in order specified by boards.txt Custom board options menu items not in order specified by boards.txt Feb 2, 2022
@per1234 per1234 added the topic: code Related to content of the project itself label Feb 2, 2022
@KurtE
Copy link

KurtE commented Feb 2, 2022

I thought I would mention, this is not specific to just this specific menu, it appears to be true with most if not all of the menus that are specified in boards.txt

For example CPU Speed: Arduino 1.8.19 follows the order in boards.txt:
image
But the daily build of IDE 2 does not:
image

Likewise the order of the boards listed under Teensy does not match the order they are defined:
image

My guess not specific to teensy.

@per1234
Copy link
Contributor

per1234 commented Feb 2, 2022

Thanks @KurtE. You make a valuable observation that this bug is universal to the sorting of all custom board option menus (except when the arbitrary sorting order of the IDE happens to match coincidentally).

I had modified the issue title to make sure the scope of this issue is clear to interested parties.

Likewise the order of the boards listed under Teensy does not match the order they are defined

Even though they are very similar, I think I will use a dedicated issue to track the Boards menu sorting since I think this might facilitate the tracking, planning, and development work: #802

@berrak
Copy link

berrak commented Jul 27, 2022

I want to confirm the behavior after using the tips in reports #591 and #1030 and removing all the Arduino user data in the folder:

~/.config/arduino-ide

With this Arduino, IDE 2.0-rc9 updates the Tools->Board part number after restarting the IDE. The pictures confirm what this issue describes but emphasize that wiping the user data does not change anything.
IDE-1 8 19-SortOrderOK
IDE-2 0-SortOrder-boards-txt-Confusing

@per1234
Copy link
Contributor

per1234 commented Aug 7, 2023

I am no longer able to reproduce this. I bisected the fix to 960a2d0. I can still reproduce the fault using the build for the previous commit (e577de4).

Note that it is only the order of the option values (e.g., Tools > USB Type > MIDIx16) that was fixed. There is still a bug in the ordering of the parent menu items (e.g., Tools > USB Type). That bug is being tracked in a dedicated issue #2036

@per1234 per1234 closed this as completed Aug 7, 2023
@per1234 per1234 added the conclusion: resolved Issue was resolved label Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: resolved Issue was resolved topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

5 participants