Hello,
I have a custom port for the stm32f437 MCU and I have been trying to get UART7 and UART8 working but I cannot get it working.
I have added the definitions to the mpconfigboard.h
#define MICROPY_HW_UART7_TX (pin_E8)
#define MICROPY_HW_UART7_RX (pin_E7)
#define MICROPY_HW_UART8_TX (pin_E1)
#define MICROPY_HW_UART8_RX (pin_E0)
However, I get the error that the UART(7) or UART(8) doesn't exist
I additionally sometime get the error:
ValueError: set baudrate 0 is not within 5% of desired value
What else am I not doing?
Would appreciate the help
UART issues
Re: UART issues
hi,
If you grep the codebase for where (for example) MICROPY_HW_UART6_TX gets used and you'll see the code that actually uses these macros.
What baud rate are you setting it to when you get that error?
If you grep the codebase for where (for example) MICROPY_HW_UART6_TX gets used and you'll see the code that actually uses these macros.
What baud rate are you setting it to when you get that error?
Re: UART issues
I'm setting it to 9600
And that macro only seems to be used in uart.c in the /stm32 directory
Re: UART issues
Yes, everything in the machine is implemented per-port (with some common code extractes out for things like SPI and I2C)
But yes, uart.c uses those macros to map the uart number passed to the constructor, so you'll need to add the equivalent for 7 and 8.
Re: UART issues
Thanks for responding so soon.
It seems to be even weirder now. I am getting the following error in the REPL prompt:
test = UART(8,9600)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: set baudrate 19200 is not within 5% of desired value
Not sure how this is happening happens?