davids5 opened a new pull request #4589:
URL: https://github.com/apache/incubator-nuttx/pull/4589


   ## Summary
   
   The PR fixes stm32xx GPIO glitches from GPIO configuration with bad order of 
operations
   
   When I2C was initialized the SDA and SCL lines would glitch low. The Bosch 
BMM150 was locking up from this.
    
   <img width="1708" alt="Glitch on init Capture" 
src="https://user-images.githubusercontent.com/1945821/134233245-0d0ae952-8df3-4e34-8f9d-e829e6504ba3.PNG";>
   
   The root cause on a STM32F12 was that the IO PAD was connected and driven 
(by the default IP block) BEFORE the IP block (I2C) was routed to the PAD via 
the alternate selection mux.
   
   The fix is two fold: 
   
   1. On a to-ALT configuration: Configure the ALT selection MUX **before** the 
IO direction is changed. 
   2. On a from-ALT configuration (unconfigure): Configure the ALT selection 
MUX **after** the IO direction is changed. 
   <img width="519" alt="On_deinit" 
src="https://user-images.githubusercontent.com/1945821/134233296-9c09ade6-a8c5-485e-9dd1-407d4d6978e9.PNG";>
   
   On a Conner case testing HW stack checking this change exposed a timing 
related bug in the SDIO/SDMMC driver that was the result of redundant GPIO 
configurations dropping interrupts. This is fixed in 
https://github.com/apache/incubator-nuttx/commit/18d720407140d361d1d606852e5e4185d80c4935
   
   ## Impact
   
   STM32, STM32F7, STM32H7
   
   ## Testing
   
   Bench tested on 
   PX4 holybro-can-gps-v1
   
   F4, F7, H7 HW
   
   
![image](https://user-images.githubusercontent.com/1945821/134235053-73d3aee7-f66f-4c8d-8194-22cb8c583339.png)
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to