Skip to content

STM32F405 and UART4 compiling problem #1556

Closed Answered by fpistm
luca-stm32 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @luca-stm32
in fact the generic define the SERIAL_UART_INSTANCE to be the default Serial instance.
In that case Serial4 is instantiate by default and mapped to Serial4 and using default pins: PA1/PA0.
So you don't need to instantiate Serial4 but as you need PC11/PC10 simply change it using the setRx() and setTx() before the begin():

    Serial.setRx(PC11);
    Serial.setTx(PC10);
    Serial.begin(9600);

ref: https://github.com/stm32duino/wiki/wiki/API#hardwareserial

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by fpistm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1555 on November 23, 2021 13:04.