keever50 opened a new pull request, #16279:
URL: https://github.com/apache/nuttx/pull/16279

   Changed usbhost stack sizes to 2048 for affected STM32H7 boards. This was 
previously causing stack overflows when usb is inserted.
   
   ## Summary
   
   When USB host was enabled on STM32H7 boards, memory corruption happened due 
a stack overflow in the usbhost thread.
   This was because the default stacksize was set to 1024. This is now 2048, 
which should be big enough.
   
   This was discovered in issue https://github.com/apache/nuttx/issues/16256
   
   It is also discovered that the **usbhost_stacksize** configuration is not 
added to board specific Kconfig while it should be. I decided to not add these 
in this commit because I am unable to test them all. It is a safer option to 
simply change all stacksizes to something safe initially.
   
   ## Impact
   
   Impacts all STM32H7 hardware users (Except the boards were it was already 
2048). They can now use usbhost without memory corruption.
   
   _For the NuttX PR bot:
   Does not impact documentation, build process, security or compatibility._
   
   ## Testing
   
   Testing information is found in the issue mentioned before, but here is a 
screenshot of usbhost being a little bigger than 1kB after USB insertion, which 
was the previous default. Stacksize is now 4kB in this screenshot for testing. 
This proves that it was too big before. This was tested on the a 
nucleo-STM32H743zi usb configuration on custom (out of tree) STM32H753zi 
hardware. They are compatible.
   
   
![image](https://github.com/user-attachments/assets/4f5c6553-b1e8-466a-8349-503a4b783da8)
   
   _For the NuttX PR bot:
   OS: yes
   CPU: yes
   compiler: yes_
   


-- 
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