cancel
Showing results for 
Search instead for 
Did you mean: 

USART communications act strangely with USB & Android

treyvr
Associate II

The FLASH has (what will become) a bootloader, and an application.

I can successfully jump from bootloader to application without issue.

The application communicates over USART, through a CP210x components, to a USB-A connector, and to an Android application I built for communicating over this serial connection.

I copied the .ioc file from the application to configure the bootloader.  And if I plug that USB-A connector into my desktop instead of the Android device, I can see the bootloader's messages over the USB-A connector.  But I cannot see these on the Android device.

So, the bootloader outputs over USART, through the CP210x, to the desktop (running Linux), and displays on the console.  But if I follow the same exact steps to trigger the communication, and I use the Android app instead, it won't display the bootloader's output... but after the bootloader jumps to the application, it will display the application's output (both on my desktop, and my Android device).

The firmware in both cases uses the HAL_UART_Transmit() to send the data, with the 'huart1' handle from usart.c as generated by the .ioc file.

In both cases, the firmware configures the clock and UART identically (same .ioc, same code generated).

I'm stumped about what might be going on.  I should have expected something more consistent (like nothing ever transmit on Android but works on Desktop, maybe), but this doesn't make much sense to me.

Does this look familiar to anyone?

1 REPLY 1
NEdom.1
Associate III

Are you using the CP210x USB-A TTL UART connector both on the desktop and on Android with OTG?

Maybe you need to check the USART pin setup in the bootloader and your main app. Check what's the difference between such as baud rate, IO driven type (APP, PU or PD).

There are some of the UART hardware which need the USART TX/RX to be pull-up in order to keep he proper voltage level while not driven by either side.

Also, the CP210x need to be setup correctly on Android devices before communication.