correct stepping for STM32F405 OTG ?

Report here problems in any of ChibiOS components. This forum is NOT for support.
tridge
Posts: 141
Joined: Mon Sep 25, 2017 8:27 am
Location: Canberra, Australia
Has thanked: 10 times
Been thanked: 20 times
Contact:

correct stepping for STM32F405 OTG ?

Postby tridge » Mon Feb 12, 2018 5:15 am

We just hit a really bizarre problem with ArduPilot on a STM32F405RGT6. It is an open hardware autopilot board called a "OpenPilot Revolution", widely used by several autopilot projects.
It has USART1 on PA9/PA10 and USB on PA11/PA12. When we ported it to ChibiOS (based on 17.6.0 with a few patches) I found that both USART1 and USB did startup, but the USB would disconnect and reconnect from a Linux host whenever a byte was written to USART1_TX.
I then experimented some more and found that even if I didn't setup USART1 as a USART, and instead set it up as a GPIO output, that if I pulled it low then the USB would disconnect. It would reconnect when PA9 was pulled high. Yes, I did check that RTS and CTS were disabled on the UART.
This had been driving me nuts till I discovered today that if I changed the stepping for the ChibiOS OTG driver that it all worked fine. I made the following change:
https://github.com/ArduPilot/ChibiOS/co ... d41420298b
I guess that means one of two things:
    the stepping of the STM32F405 really is 2
    the stepping is 1, but there is some weird interaction between the code for stepping 1 and the PA9 pin
How do we determine what the real stepping is supposed to be on a F405? I can't see anything about the OTG stepping in the reference manual for the 40x, nor anything in the errata that seems to match the code in OTGV1/hal_usb_lld.c. Where does that info come from?
Cheers, Tridge

User avatar
Giovanni
Site Admin
Posts: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: correct stepping for STM32F405 OTG ?

Postby Giovanni » Mon Feb 12, 2018 8:23 am

Hi,

It is a problem, that stepping is not described anywhere clearly, it is something we discovered experimentally but, of course, we cannot test all devices.

I am not sure if it is really a stepping 2 (F4s are old) or you are just experimenting some weird interaction with those signals. It looks like USART1 is messing with USB DP/DM signals regardless RTS/CTS signals. Is it possible there is something wired at board level?

Giovanni

tridge
Posts: 141
Joined: Mon Sep 25, 2017 8:27 am
Location: Canberra, Australia
Has thanked: 10 times
Been thanked: 20 times
Contact:

Re: correct stepping for STM32F405 OTG ?

Postby tridge » Mon Feb 12, 2018 11:38 am

> Is it possible there is something wired at board level?

At first I was sure it was a weird UART property with CTS/RTS, but when I found the problem happened with the UART disabled and the pin just pulled low (either by setting as a GPIO low output or with external pulldown) I had to discount it being a UART thing.
The weird thing is this is a very widely used board, its supported by lots of code bases. I do think it may be something electrical, but I don't know what.
Maybe we should have a #ifndef override for the stepping to override it and leave it at that? It seems to work perfectly as stepping2.
Cheers, Tridge

User avatar
Giovanni
Site Admin
Posts: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: correct stepping for STM32F405 OTG ?

Postby Giovanni » Mon Feb 12, 2018 12:07 pm

I will review those "stepping 2" code paths, just in case.

Giovanni

User avatar
Giovanni
Site Admin
Posts: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: correct stepping for STM32F405 OTG ?

Postby Giovanni » Fri Jul 27, 2018 2:56 pm

Hi,

Is BOARD_OTG_NOVBUSSENS defined in your board.h?

Giovanni

User avatar
Giovanni
Site Admin
Posts: 14457
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: correct stepping for STM32F405 OTG ?

Postby Giovanni » Sun Nov 10, 2019 10:32 am

bump


Last bumped by Giovanni on Sun Nov 10, 2019 10:32 am.


Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 65 guests