Configure UART0 (PB_2,PB_3) on mbed
MCU & Boards
No replies yet. Be the first to reply.
Join the discussion.
MCU & Boards
No replies yet. Be the first to reply.
Join the discussion.
Share projects and connect with makers.
Joined before the site update? first.
New to WIZnet Makers?
We sent a verification link to your address. Open it to activate your account, then log in.
Accounts from this email provider are reviewed by an administrator after verification. Approval usually takes one business day.
Already have an account?
Enter your email address. If it belongs to an account, we'll send a link to set a new password. Members who joined before the site update use this to set their password.
If an account uses that address, we sent a link to set a new password. The link works once and expires in 30 minutes.
Know your password?
Need an account?
RE: Configure UART0 (PB_2,PB_3) on mbed
by lawrence WIZnet ·
Hello, joaopaulob
I think you do not need to use HAL_PAD_AFConfig()
Only you need to declare Serial Class : Serial serial(PB_2, PB_3);
But if even you success the compile, it does not work.
You must change D0(U0_RX), D1(U0_TX) alternative function to GPIO.
Because the D0, D1 order is stronger then PB_2, PB_3 ( I think… )
Thank you,
lawrence
RE: Configure UART0 (PB_2,PB_3) on mbed
by lawrence WIZnet ·
like this…
Digital Output(D0);
Digital Output(D1);
Serial serial(PB_2, PB_3);
Change the D0, D1 function and declare PB_2, PB_3 as UART0.
RE: RE: Configure UART0 (PB_2,PB_3) on mbed
by joaopaulob ·
Lawrence,
I did:
DigitalOut dummy1(PA_13); //D1
DigitalOut dummy2(PA_14); //D0
When I call the function ( Serial serial(PB_2, PB_3) ) I got the error “pinmap not found for peripheral”.
It looks like the mbed do not allow to use these pins for UART0.
Any idea?
Best regards,
RE: Configure UART0 (PB_2,PB_3) on mbed
by lawrence WIZnet ·
hello, joaopaulob
This is what I captured on my web compiler.
Could check your compiler with below lists?
→ refer the right side and up in that capture.
Thank you
lawrence
RE: RE: Configure UART0 (PB_2,PB_3) on mbed
by joaopaulob ·
Hi Lawrence,
The program compile successfully, but it freezes on running.
Try to run the following code:
Best regards
RE: Configure UART0 (PB_2,PB_3) on mbed
by lawrence WIZnet ·
hello, joaopaulob
Thank you so much!
You are Right!..
It is my fault… I never thought about mbed library.
WIZnet missed add PB_2 and PB_3 in Serial pin map.
Refer below capture.
So… Now you have two solutions.
Thank you
lawrence
RE: Configure UART0 (PB_2,PB_3) on mbed
by joaopaulob ·
Found a way to “hack” the mbed: