Hey,
I'm want to accomplish something similar. Basically I'm want to make the device-descriptor changeable at runtime.
The idee is to override the descriptor in usb_dev.c. But I'm not really sure if it will work. So I would like to use the hardwareserial libery code (which is already used there) so i could first figure out whats going on exactly.
But the problem is I do not get any output at the uart.
code i want to execute in usb_dev.c so I can make my research:
Code:
#if 1
serial_print("Desc found, ");
serial_phex32((uint32_t)data);
serial_print(",");
serial_phex16(datalen);
serial_print(",");
serial_phex(data[0]);
serial_phex(data[1]);
serial_phex(data[2]);
serial_phex(data[3]);
serial_phex(data[4]);
serial_phex(data[5]);
serial_print("\n");
#endif
I use a ftdi board to get the serial communication to a picocom console. And its working if I do e.g. serial1.print('hello world'); but nothing from inside the usb_dev.c
Maybe someone can tell me please what I am doing wrong?