Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
7 years, 5 months ago.
Can I use USBDevice Library?
I'd like to use USBSerial using PA13, PA14, but it seems that L073 is not registered in the USBDevice library, but can somehow be used?
Question relating to:
1 Answer
7 years, 5 months ago.
I am just a beginner, so my answer must be taken with caution. For me, yes you can use the usb serial as shown below (example running on NUCLEO-L073RZ board) but may be not with pins PA13 and PA14. On the NUCLEO-L073RZ board these pins are not useable. It also seems not possible to use them as USB wires with other boards. The section "pin descriptions" of the data sheet (pages 42 and next) does not mention usb function for these pins.
Serial pc(SERIAL_TX, SERIAL_RX); DigitalOut myLed(LED2);
int main() { int i = 1 ; myLed = 0 ; pc.printf("Hello World!\n"); while(1) { char c = pc.getc(); Read hyperterminal wait (1) ; pc.printf("This program runs since %d seconds.\n", i++) ; if ( (i % 2) == 0){ myLed = 1 ; } else { myLed = 0 ; } } }
Thank you Hervé DELACOURT. However, since it is planned to finally use the ST-LINK part separately, I do not want to use SERIAL_TX / SERIAL_RX and I would like to try using pure USB. Signal lines are out on the connector, and since USB pin was mentioned in PinNames.h, I am happy if it can be used. L4xx is registered in the library but there is a reason why L0xx is not registered · · ·
posted by 19 Jul 2017