UP | HOME

Setting device name in Teensyduino

Original: https://forum.pjrc.com/threads/23796-How-to-change-Teensy-3-0-PRODUCT_NAME

By default, when you use Teensyduino, the device name will be appeared as USB Serial or something.

To change this to your own product name, create a new tab in Arduino IDE, name it something ending with .c, for example, metadata.c. Then put the following code:

#include "usb_names.h"

#define MANUFACTURER_NAME     {'S','n','a','c','k','y'}
#define MANUFACTURER_NAME_LEN 6
#define PRODUCT_NAME          {'S','n','a','c','k','y','M','i','n','i'}
#define PRODUCT_NAME_LEN      10

struct usb_string_descriptor_struct usb_string_manufacturer_name = {
  2 + MANUFACTURER_NAME_LEN * 2,
  3,
  MANUFACTURER_NAME
};

struct usb_string_descriptor_struct usb_string_product_name = {
  2 + PRODUCT_NAME_LEN * 2,
  3,
  PRODUCT_NAME
};

Don't forget to set MANUFACTURER_NAME_LEN and PRODUCT_NAME_LEN to the actual length of your manufacturer/product name.

Date: 2019-02-07 Thu 00:00

Author: Huy Tran

Created: 2019-04-22 Mon 14:40