8 years, 10 months ago.

To which pin UART1_IRQn should redirect ?

Hello, I'm pretty new with MCUs... I'm still learning, and today, I'm trying to compile this demo code for a Nucleo F401RE board but I get an error saying that the UART1_IRQn variable is not defined. So I think I'm missing something...

Should I define it myself ? If so, what's the correct pin ? Is there a trick to easily find it for every board ?

Thanks !

Question relating to:

1 Answer

8 years, 10 months ago.

That page was written by a user when only the LPC1768 mbed existed, and has a few things which are specific for this board.

At the bottom of this page is an example which should work fine on your board: https://developer.mbed.org/handbook/Serial

Small note to take into account: All programs, including example programs, include a version of the mbed lib. When you import the program it asks you if you want to update all libs or not. In principle if it asks you this, let it update it. Otherwise your board might not yet be supported. (There are some cases where you rather don't have it updating it).

Accepted Answer

Thank you for your answer Erik, the example you gave me works fine ! Actually, I'd already seen it, but I thought what was explained about the "Critical Sections using Enable and Disable Interrupts" section, and the use of sprintf and scanf was "preferred". Will I be OK basing me on the serial communication example code you mentionned if I want ton transfer a lot of data between two boards ?

posted by Ausy AER 29 Dec 2015

If you need to worry about it depends on how you implement it. Do you just want to add a software buffer and use interrupts to transmit the buffer(s)? Have a look at BufferedSerial: https://developer.mbed.org/users/sam_grove/code/BufferedSerial/. It does this for you.

posted by Erik - 29 Dec 2015

Ok, I'll look more into this class... Thanks a lot for your help !

posted by Ausy AER 29 Dec 2015