Skip to content

Add new board for Arduino IDE

Leon Kiefer edited this page Jan 14, 2020 · 3 revisions

This wiki explains how to add new boards to Arduino IDE to upload a sketch with the correct USB VID and PID. When using Visual Studio with the Visual Micro extension these IDs can be set in the board.txt files. Unfortunately, this file is not supported by Arduino IDE. Custom boards definitions must be used in order to change the USB VID and PID. The Corsair Lighting Protocol Boards project contains definitions for common boards. But not all boards are provided by that project, therefore we have to manually configure our boards that are not supported.

  1. First check your board is not supported by Corsair Lighting Protocol Boards project
  2. Open Arduino IDE->File->Preferences, click on the ...preferences.txt link at the bottom of the window (the explorer should open the directory)
  3. Navigate from that directory to packages/{vendor}/hardware/{architecture}/{version}/ of the board you want to upload to.
  4. Open the boards.txt file located in this directory and find the definition of your board. You can find your board by the display name.
  5. Copy the whole definition of the board (with all configuration options). For example the whole definition of a "SparkFun Pro Micro" looks like this:
################################################################################
################################## Pro Micro ###################################
################################################################################
promicro.name=SparkFun Pro Micro

promicro.upload.tool=avrdude
promicro.upload.protocol=avr109
promicro.upload.maximum_size=28672
promicro.upload.maximum_data_size=2560
promicro.upload.speed=57600
promicro.upload.disable_flushing=true
promicro.upload.use_1200bps_touch=true
promicro.upload.wait_for_upload_port=true

promicro.bootloader.tool=avrdude
promicro.bootloader.unlock_bits=0x3F
promicro.bootloader.lock_bits=0x2F
promicro.bootloader.low_fuses=0xFF
promicro.bootloader.high_fuses=0xD8

promicro.build.board=AVR_PROMICRO
promicro.build.core=arduino:arduino
promicro.build.variant=promicro
promicro.build.mcu=atmega32u4
promicro.build.usb_product="SparkFun Pro Micro"
promicro.build.vid=0x1b4f
promicro.build.extra_flags={build.usb_flags}


######################### Pro Micro 3.3V / 8MHz ################################
promicro.menu.cpu.8MHzatmega32U4=ATmega32U4 (3.3V, 8 MHz)

promicro.menu.cpu.8MHzatmega32U4.build.pid.0=0x9203
promicro.menu.cpu.8MHzatmega32U4.build.pid.1=0x9204
promicro.menu.cpu.8MHzatmega32U4.build.pid=0x9204
promicro.menu.cpu.8MHzatmega32U4.build.f_cpu=8000000L

promicro.menu.cpu.8MHzatmega32U4.bootloader.extended_fuses=0xFE
promicro.menu.cpu.8MHzatmega32U4.bootloader.file=caterina/Caterina-promicro8.hex


############################# Pro Micro 5V / 16MHz #############################
promicro.menu.cpu.16MHzatmega32U4=ATmega32U4 (5V, 16 MHz)

promicro.menu.cpu.16MHzatmega32U4.build.pid.0=0x9205
promicro.menu.cpu.16MHzatmega32U4.build.pid.1=0x9206
promicro.menu.cpu.16MHzatmega32U4.build.pid=0x9206
promicro.menu.cpu.16MHzatmega32U4.build.f_cpu=16000000L

promicro.menu.cpu.16MHzatmega32U4.bootloader.extended_fuses=0xCB
promicro.menu.cpu.16MHzatmega32U4.bootloader.file=caterina/Caterina-promicro16.hex
  1. Create a new file named boards.local.txt in the same directory and paste in the definition you just copied.
  2. Now edit this file and change the board ID of the definition. The board ID is the prefix in every property name. For example in promicro.name=SparkFun Pro Micro, promicro is the board ID and you have to change it in every line by adding clp at the end. So promicro become promicroclp.
  3. Change the display name, so you can later find your definition in Arduino IDE. Use CLP as a prefix, e.g.
promicroclp.name=CLP SparkFun Pro Micro
  1. Search for the properties build.vid, build.pid, build.usb_product, build.usb_manufacturer and replace the values with the values found in the RGB Controller Table. If they don't exist add them, like the build.usb_manufacturer was added in the example below. Result:
################################################################################
################################## Pro Micro ###################################
################################################################################
promicroclp.name=CLP SparkFun Pro Micro

promicroclp.upload.tool=avrdude
promicroclp.upload.protocol=avr109
promicroclp.upload.maximum_size=28672
promicroclp.upload.maximum_data_size=2560
promicroclp.upload.speed=57600
promicroclp.upload.disable_flushing=true
promicroclp.upload.use_1200bps_touch=true
promicroclp.upload.wait_for_upload_port=true

promicroclp.bootloader.tool=avrdude
promicroclp.bootloader.unlock_bits=0x3F
promicroclp.bootloader.lock_bits=0x2F
promicroclp.bootloader.low_fuses=0xFF
promicroclp.bootloader.high_fuses=0xD8

promicroclp.build.board=AVR_PROMICRO
promicroclp.build.core=arduino:arduino
promicroclp.build.variant=promicro
promicroclp.build.mcu=atmega32u4
promicroclp.build.usb_product="Lighting Node PRO"
promicroclp.build.usb_manufacturer="Corsair"
promicroclp.build.vid=0x1b1c
promicroclp.build.extra_flags={build.usb_flags}


######################### Pro Micro 3.3V / 8MHz ################################
promicroclp.menu.cpu.8MHzatmega32U4=ATmega32U4 (3.3V, 8 MHz)

promicroclp.menu.cpu.8MHzatmega32U4.build.pid.0=0x0c0b
promicroclp.menu.cpu.8MHzatmega32U4.build.pid.1=0x0c0b
promicroclp.menu.cpu.8MHzatmega32U4.build.pid=0x0c0b
promicroclp.menu.cpu.8MHzatmega32U4.build.f_cpu=8000000L

promicroclp.menu.cpu.8MHzatmega32U4.bootloader.extended_fuses=0xFE
promicroclp.menu.cpu.8MHzatmega32U4.bootloader.file=caterina/Caterina-promicro8.hex


############################# Pro Micro 5V / 16MHz #############################
promicroclp.menu.cpu.16MHzatmega32U4=ATmega32U4 (5V, 16 MHz)

promicroclp.menu.cpu.16MHzatmega32U4.build.pid.0=0x0c0b
promicroclp.menu.cpu.16MHzatmega32U4.build.pid.1=0x0c0b
promicroclp.menu.cpu.16MHzatmega32U4.build.pid=0x0c0b
promicroclp.menu.cpu.16MHzatmega32U4.build.f_cpu=16000000L

promicroclp.menu.cpu.16MHzatmega32U4.bootloader.extended_fuses=0xCB
promicroclp.menu.cpu.16MHzatmega32U4.bootloader.file=caterina/Caterina-promicro16.hex
  1. Close all open Arduino IDE windows (it is important that the Arduino IDE is restarted after the boards definition file changed)
  2. Now open your sketch with the Arduino IDE
  3. Select the the board we just created (that with the prefix "CLP")
  4. Configure the board and select the Port for uploading
  5. Upload the sketch
  6. Open the Windows settings->devices->connected devices. Somewhere in the list of devices there should be a device called "Lighting Node PRO". If not, you can open a support-Issue. Now the board should show up in iCUE as Lighting Node PRO.