I had read about the caching and saw where just deleting the leveldb folder was enough to get the boards menus to update. That has worked great for me.
Today I discovered boards.local.txt in some searching which led to this
https://arduino.github.io/arduino-cl...boardslocaltxt
There are similar options for platform.local.txt and others. These add or override existing boards.txt items. In my simple case I only need to add 3 lines to the USB Type menu.
I created these instructions below on my SDR project github along with the usb and 48K audio patch files.
Since moving from 1.57.2 to 0.58.3 my IDE compile broke, error is it cannot find a reference to AudioConnection which I see has changed in AudioStream.h. The examples run OK. Still investigating.
I also uninstalled Arduino 1.8.19. partly due to finding my VS Code was using it still. It was looking for the Arduini IDE file called Arduino_debug.exe, which appears to not exist in Arduino 2.0. VS Code does support the CLI if you provide a path to it. The CLI files moved and today I found it in my chosen IDE 2 install target folder.
D:\ArduinoIDE\Arduino IDE\resources\app\node_modules\arduino-ide-extension\build
I am unable to compile now in VS Code for reasons I have not spotted yet. Looking for where the detailed error info is located.
At least the boards issue appears to be solved in an easy way now.
__________________________________________________ _
Updated custom USB Type for 2 serial and 1 Audio - Updated Jan 2, 2023. Used in my SDR project.
Adds a Custom USB type for the Teensy 4.1 to enable 2 Serial ports plus Audio to the Arduino 2.0 IDE.
This enables debug on Serial and the optional CAT Serial interface on USBSerial1.
a. add this section into usb_desc.h after the USB_AUDIO section.
Code:
#elif defined(USB_SERIAL_SERIAL_AUDIO)
#define VENDOR_ID 0x16C0
#define PRODUCT_ID 0x048C
#define MANUFACTURER_NAME {'T','e','e','n','s','y','d','u','i','n','o'}
#define MANUFACTURER_NAME_LEN 11
#define PRODUCT_NAME {'K','7','M','D','L',' ','S','D','R'}
#define PRODUCT_NAME_LEN 9
#define EP0_SIZE 64
#define NUM_ENDPOINTS 7 // 5 for 2 serial, + 2 for audio
#define NUM_INTERFACE 7 // 4 for 2 serial, + 3 for audio
#define CDC_IAD_DESCRIPTOR 1
#define CDC_STATUS_INTERFACE 0
#define CDC_DATA_INTERFACE 1 // Serial
#define CDC_ACM_ENDPOINT 2
#define CDC_RX_ENDPOINT 3
#define CDC_TX_ENDPOINT 3
#define CDC_ACM_SIZE 16
#define CDC_RX_SIZE_480 512
#define CDC_TX_SIZE_480 512
#define CDC_RX_SIZE_12 64
#define CDC_TX_SIZE_12 64
#define CDC2_STATUS_INTERFACE 2 // SerialUSB1
#define CDC2_DATA_INTERFACE 3
#define CDC2_ACM_ENDPOINT 4
#define CDC2_RX_ENDPOINT 5
#define CDC2_TX_ENDPOINT 5
#define AUDIO_INTERFACE 4 // Audio (uses 3 consecutive interfaces)
#define AUDIO_TX_ENDPOINT 6
#define AUDIO_RX_ENDPOINT 6
#ifdef USB_AUDIO_48KHZ
#define AUDIO_TX_SIZE 196 // longer buffer
#define AUDIO_RX_SIZE 196
#else
#define AUDIO_TX_SIZE 180
#define AUDIO_RX_SIZE 180
#endif
#define AUDIO_SYNC_ENDPOINT 7
#define ENDPOINT2_CONFIG ENDPOINT_RECEIVE_UNUSED + ENDPOINT_TRANSMIT_INTERRUPT
#define ENDPOINT3_CONFIG ENDPOINT_RECEIVE_BULK + ENDPOINT_TRANSMIT_BULK
#define ENDPOINT4_CONFIG ENDPOINT_RECEIVE_UNUSED + ENDPOINT_TRANSMIT_INTERRUPT
#define ENDPOINT5_CONFIG ENDPOINT_RECEIVE_BULK + ENDPOINT_TRANSMIT_BULK
#define ENDPOINT6_CONFIG ENDPOINT_RECEIVE_ISOCHRONOUS + ENDPOINT_TRANSMIT_ISOCHRONOUS
#define ENDPOINT7_CONFIG ENDPOINT_RECEIVE_UNUSED + ENDPOINT_TRANSMIT_ISOCHRONOUS
b. To add custom Serial + Serial + Audio USB type into the IDE Tools:USB Type menu do the following.
Create a new file called boards.local.txt with the following 3 lines. It will add to the existing Teensy Menu items. I have already created one in the Cores subfolder.
Code:
teensy41.menu.usb.serialserialaudio=Serial + Serial + Audio
teensy41.menu.usb.serialserialaudio.build.usbtype=USB_SERIAL_SERIAL_AUDIO
teensy41.menu.usb.serialserialaudio.upload_port.usbtype=USB_SERIAL_SERIAL_AUDIO
Place your boards.local.txt into %AppData%\Local\Arduino15\packages\teensy\hardware \avr\xxxxx.
xxxxx is the TeensyDuino version you have installed and are using. In my test case it is 0.58.3 (aka 1.58 beta 3)
The USB_SERIAL_SERIAL_AUDIO becomes a #define during compile. The file usb-desc.h has all the usb combo descriptions and uses similar #define to activate your chosen combo.
I have provided a modified usb_desc.h file that uses this define and supports the 48K mod.
Other files are provided to also "patch" the library and are related to the 48KHz modification only.
c. Shutdown the Arduino IDE.
d. There is a known issue in IDE that does not update its cache (a small dB) when board.txt is changed.
See https://github.com/arduino/arduino-ide/issues/1030
For Windows users, this is typically C:\Users\<user name>\AppData\Roaming\arduino-ide
Further reading I found a less drastic solution proposed just delete 1 sub folder called leveldb
In %AppData%\Roaming\arduino-ide\Local Storage folder delete the leveldb folder.
e. Start the Arduino IDE 2.0. Ignore the errors in the output window. Restart the IDE and it will clear the error.
f. Under Tools
Board: Choose Teensy 4.1
Port: Choose the port displayed under the teensy ports section.
The correct name may not show up until you do your first compile, maybe not even then but you will see 2 serial ports.
CPU: Speed choose 816MHz (recommended, but anything you like that works)
USB Type: Choose Serial + Serial + Audio. This is our new custom USB device type.