NUCLEO-L476RG firmware has only UART2 defined
Posted: Fri Feb 26, 2021 12:17 pm
Hello,
I have loaded MicroPython firmware to my NUCLEO-L476RG board, which has several UART units available. Unfortunately MicroPython firmware only defines single UART currently:
(see in ports\stm32\boards\NUCLEO_L476RG\mpconfigboard.h). Would it be OK if I add remaining UART units to mpconfigboard.h and push to github.com/micropython/micropython, are such changes welcomed?
Please also let me know if any additional code changes are necessary for remaining UART units to be accessible from Python scripts.
Thanks!
Update: I built MicroPython 1.14 for NUCLEO-L476RG with corrected mpconfigboard.h, loaded to my board and verified that additional UART units work (using MH-Z19B CO2 sensor). Now UART 1, 2 and 3 are available for Python scripts. According to the datasheet, https://www.st.com/resource/en/datashee ... l476rg.pdf, stm32l476rg microcontroller also contains UART4 and UART5, but they are labeled differently, not "USART" as the first, the second and the third, but "UART". Not sure that they may work as well if I add them to mpconfigboard.h too.
I have loaded MicroPython firmware to my NUCLEO-L476RG board, which has several UART units available. Unfortunately MicroPython firmware only defines single UART currently:
Code: Select all
// UART config
#define MICROPY_HW_UART2_TX (pin_A2)
#define MICROPY_HW_UART2_RX (pin_A3)
#define MICROPY_HW_UART_REPL PYB_UART_2
#define MICROPY_HW_UART_REPL_BAUD 115200
Please also let me know if any additional code changes are necessary for remaining UART units to be accessible from Python scripts.
Thanks!
Update: I built MicroPython 1.14 for NUCLEO-L476RG with corrected mpconfigboard.h, loaded to my board and verified that additional UART units work (using MH-Z19B CO2 sensor). Now UART 1, 2 and 3 are available for Python scripts. According to the datasheet, https://www.st.com/resource/en/datashee ... l476rg.pdf, stm32l476rg microcontroller also contains UART4 and UART5, but they are labeled differently, not "USART" as the first, the second and the third, but "UART". Not sure that they may work as well if I add them to mpconfigboard.h too.