Page 2 of 2

Re: Need some help setting up UART5

Posted: Sun May 31, 2015 10:46 pm
by dhylands
I just did a PR to add UART5 support to the stmhal port.
https://github.com/micropython/micropython/pull/1299

I tested it on my CERB40 board which has UART5 exposed (and has no sdcard).
It seems to be working fine for that.

You may want to compare your code with mine to see where you're doing things differently. I think you were missing the IRQ handler whcih would cause the board to hang as soon as an imcoming character was received.

If I connect C12 to D2 then with the PR applied I see the following:

Code: Select all

Micro Python v1.4.3-74-g286ced4-dirty on 2015-05-31; Cerb40 with STM32F405RG
Type "help()" for more information.
>>> u5 = pyb.UART(5, 115200)
>>> u5.write('This is a test')
14
>>> u5.read(7)
b'This is'
>>> u5.read(7)
b' a test'

Re: Need some help setting up UART5

Posted: Mon Jun 01, 2015 2:32 am
by gradoj
The only real difference I could find - I copied the wrong interrupt handler so it read USART5 instead of UART5. :oops:

It is working now. Thanks again for your help.

Re: Need some help setting up UART5

Posted: Mon Jun 01, 2015 3:01 am
by dhylands
It looks like my PR got merged into the codebase (just an FYI)