Closed
Description
I found issue where UART1 is not working on pin PA10 & PA9 on Nucleo-G071RB but UART1 works fine on pin PB7 & PB6.
I verified with following code in Arduino IDE and PlatformIO
HardwareSerial rfUart(PA10, PA9); // do not work
//HardwareSerial rfUart(PB7, PB6); // work successfully
void setup()
{
Serial.begin(115200);
delay(100);
rfUart.begin(115200);
pinMode(LED_BUILTIN, OUTPUT);
Serial.println("\nSG0 Begin....");
rfUart.println("\nSG0 RF Begin....");
}
int count = 0;
void loop()
{
delay(2000);
Serial.printf("\nSG0 Count: %02d", count);
rfUart.print("\nRF Count:"); rfUart.println(count++);
digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN));
}
Note: I tried using Stm32Cube Framework, UART1 on pin PA10 & PA9 works fine.
Activity
fpistm commentedon Sep 22, 2020
Hi @harji2130
Thanks for reporting this issue. Error comes from the REMAP of those pins. When adding the Disco G031 we introduced the remap by default but this is not correct.
Arduino_Core_STM32/libraries/SrcWrapper/src/stm32/pinmap.c
Lines 75 to 96 in 95e58e6
So in your case PA9 is remap to PA11. If you wire the Tx pin on PA11 you will see the output.
I will fix that soon.
Khelicon commentedon Sep 22, 2020
Thank you @fpistm, now as a workaround, I comment the defines in "stm32g0xx_ll_system.h" at line 87 & 88
Arduino_Core_STM32/system/Drivers/STM32G0xx_HAL_Driver/Inc/stm32g0xx_ll_system.h
Lines 87 to 88 in 95e58e6
Khelicon commentedon Sep 24, 2020
Hello @fpistm , I was further exploring more uart for my project and found that UART4 on pin PA1 & PA0 also do not work under Arduino framework.
I have tested the UART1, UART2 & UART4 using STM32Cube Framework and everything works fine.
fpistm commentedon Sep 24, 2020
Hi @harji2130
I found the issue.
After fixing this issue #1141
I forgot to update the IRQ handler function then for USART4 the
HAL_UART_IRQHandler
is not called.I will fix it too...
Remap pin management
Remap pin management
Remap pin management
Remap pin management
Remap pin management
Remap pin management
15 remaining items