(I changed Leonardo's VID, PID to VID = 0x2342, PID = 0x003E in "Makefile", "Descriptors.c" file.)
지금 레오나르도의 VID, PID를
"bootloaders/ caterina/ Makefile"
Makefile
CDEFS += -DDEVICE_VID=0x2342
CDEFS += -DDEVICE_PID=0x003E
, "bootloaders/ caterina/ Descriptors.c "
Descriptors.c
const USB_Descriptor_Device_t DeviceDescriptor =
{
.Header = {.Size = sizeof(USB_Descriptor_Device_t), .Type = DTYPE_Device},
.USBSpecification = VERSION_BCD(01.10),
.Class = CDC_CSCP_CDCClass,
.SubClass = CDC_CSCP_NoSpecificSubclass,
.Protocol = CDC_CSCP_NoSpecificProtocol,
.Endpoint0Size = FIXED_CONTROL_ENDPOINT_SIZE,
.VendorID = 0x2342,/* <---here*/
.ProductID = 0x003E,/* <---here*/
.ReleaseNumber = VERSION_BCD(00.01),
.ManufacturerStrIndex = 0x02,
.ProductStrIndex = 0x01,
.SerialNumStrIndex = USE_INTERNAL_SERIAL,
.NumberOfConfigurations = FIXED_NUM_CONFIGURATIONS
};
파일에서 VID = 0x2342, PID = 0x003E로 변경하고,
.
.
.
레오나르도의 이름을 "Descriptors.c"에서
Descriptors.c
const USB_Descriptor_String_t ProductString =
{
.Header = {.Size = USB_STRING_LEN(12)/* <---here*/, .Type = DTYPE_String},
.UnicodeString = L"NAMENAMENAME"/* <---here*/
/* #if DEVICE_PID == 0x0036
.UnicodeString = L"Arduino Leonardo"
#elif DEVICE_PID == 0x0037
.UnicodeString = L"Arduino Micro "
#elif DEVICE_PID == 0x003C
.UnicodeString = L"Arduino Esplora "
#elif DEVICE_PID == 0x003D
.UnicodeString = L"NAMENAMENAME "
#else
.UnicodeString = L"NAMENAMENAME "
#endif*/
};
const USB_Descriptor_String_t ManufNameString =
{
.Header = {.Size = USB_STRING_LEN(6)/* <---here*/, .Type = DTYPE_String},
.UnicodeString = L"NAME "/* <---here*/
/* #if DEVICE_VID == 0x2341
.UnicodeString = L"Arduino LLC"
#elif DEVICE_VID == 0x2342
.UnicodeString = L"NAME "
#else
.UnicodeString = L"NAME "
#endif*/
};
"NAMENAMENAME"으로 변경하고 또한 이게 무엇인지 정확히 모르겠지만 "cores/ arduino/ USBCore.cpp" 에서 USB_PRODUCT 와 USB_MANUFACTURER을 각각 "NAMENAMENAME"과 "NAME " 으로 변경 했습니다.
(I changed Leonardo's name to "NAMENAMENAME" in "Descriptors.c" and also in "cores/arduino/USBCore.cpp" I changed USB_PRODUCT and USB_MANUFACTURER to "NAMENAMENAME" and "NAME " respectively, although I'm not exactly sure what these are.)
USBCore.cpp
#ifndef USB_PRODUCT
// If no product is provided, use NAMENAMENAME
#define USB_PRODUCT "NAMENAMENAME"/* <---here*/
#endif
const u8 STRING_PRODUCT[] PROGMEM = USB_PRODUCT;
#ifndef USB_MANUFACTURER
#define USB_MANUFACTURER "NAME "/* <---here*/
#endif
/*#if USB_VID == 0x2341
# if defined(USB_MANUFACTURER)
# undef USB_MANUFACTURER
# endif
# define USB_MANUFACTURER "Arduino LLC"
#elif USB_VID == 0x1b4f
# if defined(USB_MANUFACTURER)
# undef USB_MANUFACTURER
# endif
# define USB_MANUFACTURER "SparkFun"
#elif !defined(USB_MANUFACTURER)
// Fall through to "NAME " if no manufacturer name was provided in a macro
# define USB_MANUFACTURER "NAME "
#endif*/
하지만 여전히 USB 직렬 장치으로 표시됩니다.
(But it still shows up as a USB-Serial device.)
보이는 C언어 소스는 다 열어봤는데 뭐가 문제인지 잘 모르겠습니다. 도와주세요.
(I opened all the visible C language sources, but I don't know what the problem is. Please help me.)
.
.
.
.
-----추가 정보-----
arduino IDE 에서는 "boards.txt"를 수정해서 원하는 이름이 잘 표시됩니다.
(Caterina.hex 파일을 업로드 하게 변경함)
부트로더 컴파일은 WSL (Ubuntu)에 미리 Appdata/ local/ Arduino15에 있는 파일 전체를 Ubuntu로 옮겨서
"packages/ arduino/ hardware/ avr/ 1.8.6/ bootloaders/ caterina"에 있는 Makefile을 make하고(make clean --> make all)
만들어진 Caterina.hex 파일을 "Appdata/ local/ Arduino15/ packages/ arduino/ hardware/ avr/ 1.8.6/ bootloaders/ caterina"에 옮겨서 boards.txt에 적은 보드를 선택해서 "부트로더 굽기"를 눌러 부트로더를 변경 했습니다.
.
.
.
.
-----Additional information-----
In Arduino IDE, edit "boards.txt" so that the desired name is displayed well.
(Changed to upload Caterina.hex file)
For bootloader compilation, move all files in Appdata/local/Arduino15 to Ubuntu in advance on WSL (Ubuntu)
Make Makefile in "packages/arduino/hardware/avr/1.8.6/bootloaders/caterina" (make clean --> make all)
Move the created Caterina.hex file to "Appdata/local/Arduino15/packages/arduino/hardware/avr/1.8.6/bootloaders/caterina" and select the board written in boards.txt and press "Burn bootloader" to change the bootloader.
