Been trying to get my Nextion screen to talk to my ST board. This is the multi-serial example and works fine.
import streams s0=streams.serial(SERIAL0,set_default=True) # s1=streams.serial(SERIAL1,baud=9600) ## define second serial port while True: print("Write some chars on the serial port and terminate with \\n (new line)") line=s0.readline() # read and return any single character available on the serial port until a \n is found print("You wrote:", line) print() sleep (300)
However if I uncomment the line that defines stream “s1” (on serial1) then the program no longer works. It compiles and runs, but the first print command is never executed. The program just hangs. What do I have to do to talk to multiple serial ports?
I’m a bit confused with the documentation too. According to the STM documentation for the board there are two serial ports on the STM32F401RE; USART2 on pins PA2 (D0) and PA3 (D1), (the default ones for connecting to the PC via USB) and USART3 on pins PC10 (D41) and PC11 (D42). The Zerynth pinmap shows three serial ports: on D0 and D1, D24 and D25, and D8 and D2. Who is right?