cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4xx SPI2 and USB-HS conflict

dejan
Associate II
Posted on June 12, 2015 at 01:26

I have been hit with an odd issue - we have a very complex board, using practically all of STM32F429 device's peripherals (Ethernet, USB HS device, SDCARD, I2C , SDRAM interface, 3 SPI channels...).

When USB HS (with external PHY - so DP and DM lines are not used) is attached to the PC, SPI2 MOSI line drops dead. It happens when the driver enables USB HS device on the chip. It looks like MOSI line gets disconnected from the SPI controller (it's driver operates in the background, clock output is toggling etc.). As soon as USB is disconnected and disabled, MOSI jumps to live again. I managed to create bare-bone example with only USB and SPI2 activated and checked various pin configurations for SPI2  - it only affectes MOSI when it's routed to PB15 (when routed to PC3 and PI3 it works).

I checked GPIOB configuration registers during USB operation and all seems to be OK

and not changed from original settings, so I have no idea how can PB15 be disabled.

According to datasheet, PB14 and PB15 are used for USBHS DP and DM lines, when internal PHY is selected, so I guess there must be some hardware bug that erroneously attahces PB15 to it (PB14 outputs SPI clock all the time) even when external PHY is enabled...

I also tested this on Keil's MCBSTM32F400 board with STM32F407 device - same thing. If anybody wants to try it out, I can post complete Keil project of that bare-bone example...

Any ideas?

4 REPLIES 4
dejan
Associate II
Posted on June 12, 2015 at 08:41

Thanks for this hint, Jan. It works -USB driver erroneously enables internal HS PHY even when it is not used... I should notify Keil to update their Middleware USB driver.

Posted on June 12, 2015 at 08:54

I'd still call it a silicon bug asking for at least an erratum - a peripheral is not supposed to override the GPIO AF setting unless carefully documented.

Could you please submit this as a bug also to ST?

JW

nesrine
Senior
Posted on June 12, 2015 at 17:01

Curious to reproduce this case, could you please share your project?

Thanks you

Syrine