cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 USB FS and PA8 as output not working

Kuikui
Associate III
Posted on May 17, 2017 at 15:52

Hi,

I'm using the STM32F446ZE.

I'm using PA11 and PA12 for USB FS DM and DP, but I don't need PA8 as SOF, I need it as a simple output.

USB is runing fine only if PA8 = 0 !

If I set PA8 output to 1, the USB disconnects.

It looks like the PA8 is in Alternate function mode, but after double-check, the PA8 mode is in Output mode ( MODER8 = 1, AFR8 = 0 ).

Did someone already faced this issue ?

Thanks and best regards,

Vincent.

#usb-fs #stm32f4
27 REPLIES 27
Posted on May 17, 2017 at 21:36

Is this some know board such as a Nucleo or DIscovery? And the software is some of the examples?

JW

Kuikui
Associate III
Posted on May 18, 2017 at 09:19

Hi,

No I'm not running a known board.

But I think the problem is within the silicon of the STM32. I checked the erratasheet, but they never mention anything about USB (which is quite surprising !).

Software example :

Just setup the STM32 as USB FS device with PA11 and PA12.

Setup PA8 as output

Set PA8 output to 1, and your USB will disconnect.

Posted on May 18, 2017 at 09:43

Okay, and the USB portion of the software? Isn't it a port of some example or some 'library', which observes pin PA8 for any reason?

JW

Kuikui
Associate III
Posted on May 18, 2017 at 11:58

I'm using the USB library from ST ( en.stm32_f105-07_f2_f4_usb-host-device_lib )

Initially, the library setups PA8 as OTG_FS_SOF. I removed this part.

But maybe somewhere the 'OTG_FS_SOF' feature is used, but I couldn't find anything related to SOF.

Searching for 'GPIO_Pin_8' didn't give anything.

Khouloud GARSI
Lead II
Posted on May 18, 2017 at 17:34

Hi

Del_Medico.Vincent

‌,

We have never encountered this strange behavior on the PA8 pin previously.

For further debug, could you please share your project or at least describe the steps leading to reproduce the issue.

Khouloud.

Kuikui
Associate III
Posted on May 19, 2017 at 14:02

Hi,

You will find the project here : 

https://wetransfer.com/downloads/1685d8590f0c6bbd9b484f756adcd9af20170519115436/81bab7d71e8bb8098b4846e94c52aa5020170519115436/a9b710

 

I was able to reproduce the issue, starting from scratch from ST's USB library.

I just removed from ST's library all the platform-related code ( LED, LCD, buttons ), and simplified the port A setup by just PA11 and PA12 as USB DP DM, and PA8 as output after USB init function.

Your feedback is welcome.

Posted on May 19, 2017 at 14:03

Hi,

You will find the project here : 

https://wetransfer.com/downloads/1685d8590f0c6bbd9b484f756adcd9af20170519115436/81bab7d71e8bb8098b4846e94c52aa5020170519115436/a9b710

 

I was able to reproduce the issue, starting from scratch from ST's USB library.

I just removed from ST's library all the platform-related code ( LED, LCD, buttons ), and simplified the port A setup by just PA11 and PA12 as USB DP DM, and PA8 as output after USB init function.

Your feedback is welcome.

Posted on May 23, 2017 at 10:21

Hi

garsi.khouloud

Did you give a try to my project ?

BR,

Vincent.

Posted on May 23, 2017 at 10:31

Hi @VDM,

Your project is under review. I will be back to you with an answer as soon as possible.

Thanks for your understanding.

Regards,

Khouloud.