cancel
Showing results for 
Search instead for 
Did you mean: 

stm32L452CEU6 usb doesnt work with Samsung GalaxyTab A8

anees
Associate II

I have a board design based on stm32L452 , USB gets recognized on a windows PC and I can talk to the device over any software like putty and a Test software sees the com port and can to the device. However in Android (Iam using samsung  GalaxyTab A8), usb is not even recognized. The Tab support OTG mode and I did change default USB mode in the tab (Tried all the combo, file transfer, teethering, media etc). Nothing helps. Any advice is greatly appreciated

 

32 REPLIES 32
AScha.3
Chief II

Maybe you need a CDC host driver for Android ...?

see:

https://github.com/mik3y/usb-serial-for-android

 

If you feel a post has answered your question, please click "Accept as Solution".
Andrew Neil
Evangelist III

@anees wrote:

I have a board design based on stm32L452 , USB gets recognized on a windows PC and I can talk to the device over any software like putty 


So you've implemented CDC ?

Does that tablet recognise any other CDC devices ?

Does your STM32 see any attempt from the tablet to start enumerating ?

1.So my board with stm32 is detected in windows and apple. But not in android , CDC driver is implemented on device

2. Yes the tablet sees other device,

3. When you bring up android settings, and developer options enable and usb in setting, in transferring file mode...other modes are disabled or greyed out.  So not ensure what enumeration stage it is...

4. https://github.com/mik3y/usb-serial-for-android , is this code available in c# equivalent, does this change needed in android to make it work?

anees
Associate II

typeA to MicroB connected, galaxy Tablet said "media device detected". But no communication or serial comm and no enumeration, same result in galaxy s2. Then test on ipadPro .. usbA to usbC dongle, its said usb accessory.. still have to check if comm port can communicate with ipad.

We want to user galaxy A8,

Just about :  typeA to MicroB  -- there are two types of adapter: to connect a device (usb stick, cdc..) or a host (PC) .

The micro usb has a pin for this , that is on gnd or not - depending on adapter type.

So check, you use the matching = phone-> device adapter . Try connect another usb-serial adapter to the usb-A , to test.

If you feel a post has answered your question, please click "Accept as Solution".
some more back ground regarding the issue,
I have been using STM-32 NUCLEO development boards (see below), which have been functioning as expected, detecting device and communicating with Android and able to send & receive over USB serial port:
NUCLEO-U575ZI-Q (ordered from DigiKey)
497-NUCLEO-U575ZI-Q-ND
NUCLEO-144 STM32U575ZI EVAL BRD
I have created our Android App to successfully communicate over USB serial port as desired with the STM-32 NUCLEO development board.
 
But we had to build the new hardware around stm32UL. 
 
The problem is that we can't currently detect and communicate with the new hardware and we need to know if there is a fix, such as a software workaround. We are using C# language (not JAVA), others details below.
Although we tried the JAVA example sent by ST, the following Android App also didn't detect the new hardware: https://github.com/mik3y/usb-serial-for-android
 
To be clear the new hardware based on stm32UL gets USB detected and work correctly from a terminal program or our own app in windows and macos. 
 
Our Android tablet App was previously functioning with STM-32 development board and would allow our Android App to detect and communicate over USB serial port.
However, when we switch to the new board/device and plug it into the same USB-C port in the Android tablet, our App shows no devices indicated as being available on the USB port.
Target Android Tablet: Samsung Galaxy Tab A8 10.5"
Android .apk build, environment & library details:
Environment: Windows 11Pro, Microsoft Visual Studio Editors (multiple), Unity 2019.4.x
'Android Studio' used to download and install all necessary Android Build Support modules: Android SDK, NDK, OpenJDK, JAVA drivers, any other necessary drivers.
Target Android OS Level: API level 31 (both Minimum and Target API Level)
Scripting Backend: Mono (also works with IL2CPP), code is entirely written in C# (not JAVA)
Api Compatibility Level: .NET Standard 2.0 (also works with .NET 4.x)

Ok,

so we (you) have : 

A: an U575 nucleo board, M33 core 160MHz, with USB otg , host, device ; :: working with CDC -> Tab8 .

B: an L452 board, M4 core 80MHz , with USB device (crystal less); :: not working with CDC -> Tab8 .

A + B : working with CDC -> PC -- right ?

First : what clock you use for B , USB ? 48M from HSE/PLL or 48M HSI (or HSI crystal less ) ?

Program generated with : stm-IDE , Cube/HAL , in C ?  + optimizer setting for project ?

and : software for USB : from Cube/HAL ? same for A and B ? tried already other lib ? 

If you feel a post has answered your question, please click "Accept as Solution".
jaindevasy
Associate II

Hi I'm Anees,


We are using HSI48 (crystal less) for L452 board.

Program generated with CubeMX for A and B.
There is only one library available, which is CDC ACM. Using same library for both boards

So can you try  48M for USB from HSE/PLL ?

+ wich optimizer setting for project you use?

If you feel a post has answered your question, please click "Accept as Solution".