-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
Is your feature request/improvement related to a problem? Please describe.
I am trying to use the core with a custom devboard that is using a STM32L051K8 chip. I followed the documented steps for adding a new variant (mainly adding clock and linker script): https://github.com/anjomro/Arduino_Core_STM32
My main problem is that i fail to get USART2 on PA2/PA3 to work. With STM32CubeIDE it works flawlessly, with the Arduino Core I don't see any output when writing out to serial.
I have seen with other boards that files like variant_boardname.h and PeripheralPins_boardnames.h are used. As far as i could see the generic files related to the L051K(6-8)U variant should be fine (> #define SERIAL_UART_INSTANCE 2, #define PIN_SERIAL_RX PA3; #define PIN_SERIAL_TX PA2) but it doesn't work nevertheless. (Or is this an issue that the Arduino core is expecting a UART device while the STM32 chip provides an USART device?)
Describe the solution you'd like
I would be very grateful for documentation on the steps necessary to add a board, similar to the documentation on how to add a new variant. Furthermore some documentation on the variant_board.h and PeripheralPins_board.h files would be marvelous, including information when they might be useful or in which cases the pre-generated generic versions are sufficient.
Describe alternatives you've considered
I would also be happy about pointers on any errors that I have made which prevent my approach from working.
Additional context
The result of following the variant addition files: https://github.com/anjomro/Arduino_Core_STM32/tree/main/variants/STM32L0xx/L051K(6-8)U
I also tried configuring a custom PeripheralPins header file based on the code comments which can be found here: https://github.com/anjomro/Arduino_Core_STM32/blob/L051K-Test/variants/STM32L0xx/L051K(6-8)U/PeripheralPins_STM32L051K.c
I would be very happy to submit a PR for a generic board/variant once it's working :)