Page 1 of 1

I can use STM32l432kc as HID with arduino Ide?

Posted: Thu Sep 29, 2022 3:08 pm
by Iraton
I don't know if is the right category but for now i post here. I searched online if is possible to use this board like HID, I have not seen anything that denies it,but not even the opposite. I have tried with the arduino ide with no results, i have researched online and i found some project that use this board as an HID device, but i can't understand how. So now i have a doubt, i can use this board as HID device?

Re: I can use STM32l432kc as HID with arduino Ide?

Posted: Thu Sep 29, 2022 4:45 pm
by GonzoG
In Arduino IDE -> menu -> tools -> USB support -> HID (keyboard and mouse)
You use default keyboard.h and mouse.h libraries.

Re: I can use STM32l432kc as HID with arduino Ide?

Posted: Thu Sep 29, 2022 5:44 pm
by fpiSTM
Yes you can use it as it has USB capabilities:
https://github.com/stm32duino/Arduino_C ... #L258-L263

Anyway you should ensure to have an USB port connected to PA11/PA12 and also check the system core clock config provide a 48MHz clock.

Re: I can use STM32l432kc as HID with arduino Ide?

Posted: Thu Sep 29, 2022 6:33 pm
by Iraton
GonzoG wrote: Thu Sep 29, 2022 4:45 pm In Arduino IDE -> menu -> tools -> USB support -> HID (keyboard and mouse)
You use default keyboard.h and mouse.h libraries.
I did it, but it doesen't work, now i will try with the usb attached to the pin pa11-12

Re: I can use STM32l432kc as HID with arduino Ide?

Posted: Thu Sep 29, 2022 6:33 pm
by Iraton
fpiSTM wrote: Thu Sep 29, 2022 5:44 pm Yes you can use it as it has USB capabilities:
https://github.com/stm32duino/Arduino_C ... #L258-L263

Anyway you should ensure to have an USB port connected to PA11/PA12 and also check the system core clock config provide a 48MHz clock.
I saw that i can set this on the CubeMX, but ihow can do it in arduino ide?

Re: I can use STM32l432kc as HID with arduino Ide?

Posted: Thu Sep 29, 2022 8:20 pm
by GonzoG
Iraton wrote: Thu Sep 29, 2022 6:33 pm I saw that i can set this on the CubeMX, but ihow can do it in arduino ide?
USB port = usb physical port (socket) where you put cable in.
Arduino will use only USB on PA11/PA12 as HID/Serial.

Re: I can use STM32l432kc as HID with arduino Ide?

Posted: Thu Sep 29, 2022 8:33 pm
by Iraton
GonzoG wrote: Thu Sep 29, 2022 8:20 pm
Iraton wrote: Thu Sep 29, 2022 6:33 pm I saw that i can set this on the CubeMX, but ihow can do it in arduino ide?
USB port = usb physical port (socket) where you put cable in.
Arduino will use only USB on PA11/PA12 as HID/Serial.
Sorry I expressed myself badly, the question was about how to change the system core clock from 80Mhz (default) to 48Mhz

Re: I can use STM32l432kc as HID with arduino Ide?

Posted: Thu Sep 29, 2022 8:45 pm
by GonzoG
Iraton wrote: Thu Sep 29, 2022 8:33 pm Sorry I expressed myself badly, the question was about how to change the system core clock from 80Mhz (default) to 48Mhz
It's not main MCU speed.
Just check if standard Serial output over USB works (USB support -> CDC (generic Serial supersede USART)). It this work, there is proper clock config.

Re: I can use STM32l432kc as HID with arduino Ide?

Posted: Thu Sep 29, 2022 9:04 pm
by Iraton
Thanks u all, now it works perfectly, you saved me :)