I can use STM32l432kc as HID with arduino Ide?

Development environment specific, Arduino, Eclipse, VS2013, Em::Blocks etc
Post Reply
Iraton
Posts: 14
Joined: Thu Sep 29, 2022 3:01 pm
Location: Italy
Contact:

I can use STM32l432kc as HID with arduino Ide?

Post 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?
by GonzoG » Thu Sep 29, 2022 8:45 pm
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.
Go to full post
GonzoG
Posts: 403
Joined: Wed Jan 15, 2020 11:30 am
Answers: 27
Location: Prudnik, Poland

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

Post by GonzoG »

In Arduino IDE -> menu -> tools -> USB support -> HID (keyboard and mouse)
You use default keyboard.h and mouse.h libraries.
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

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

Post 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.
Iraton
Posts: 14
Joined: Thu Sep 29, 2022 3:01 pm
Location: Italy
Contact:

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

Post 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
Iraton
Posts: 14
Joined: Thu Sep 29, 2022 3:01 pm
Location: Italy
Contact:

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

Post 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?
GonzoG
Posts: 403
Joined: Wed Jan 15, 2020 11:30 am
Answers: 27
Location: Prudnik, Poland

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

Post 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.
Iraton
Posts: 14
Joined: Thu Sep 29, 2022 3:01 pm
Location: Italy
Contact:

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

Post 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
GonzoG
Posts: 403
Joined: Wed Jan 15, 2020 11:30 am
Answers: 27
Location: Prudnik, Poland

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

Post 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.
Iraton
Posts: 14
Joined: Thu Sep 29, 2022 3:01 pm
Location: Italy
Contact:

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

Post by Iraton »

Thanks u all, now it works perfectly, you saved me :)
Post Reply

Return to “IDE's”