-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
USB host stack sizes need to be large. #21
Comments
Max, Thread size is provided here
USBx stack size is passed in this function call : And I would be surprised if USBx stack works with 8K. |
I'm referring to the thread stack sizes inside of usbx. They can be
configured in ux_user or ux_port.h
Like here: https://github.com/azure-rtos/usbx/blob/master/ports/cortex_m7/gnu/inc/ux_port.h#L121
I'm not talking about the RAM given to ux in initialization. I already give USBX > 100k of memory to play with.
…On Thu, Jun 24, 2021, 10:09 PM parth pandya ***@***.***> wrote:
Max,
Is this stack size for threads or is it stack size for USBx ?
Thread size is provided here
tx_thread_create(&tx_mass_storage_thread, "tx demo",
mass_storage_thread_entry, 0,
stack_pointer, DEMO_STACK_SIZE,
30, 30, 1, TX_AUTO_START);
USBx stack size is passed in this function call :
ux_system_initialize(memory_pointer, USBX_MEMORY_SIZE, UX_NULL, 0);
And I would be surprised if this works with 8K stack.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#21 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACZP7FFOEOPKGQQXGWYCIHLTUQFRNANCNFSM47I7QB2Q>
.
|
I am able to get usbx working in 20KB in host mode stack |
@maxkunes The intention is to allow developers to specify a suitable stack size in ux_port.h. Given different architectures we support, and the individual use case, its hard to set a default that is big enough but not too big to waste RAM space. |
Hi,
It seems the default stack size for UsbX in the gnu port file is too small for even my basic application of USB mouse and keyboard. I believe it is set to 2048 by default. 8192 seems to do the trick for me. However, I can probably get away with something in the middle.
When the stack size is too small I always get a hard fault in the UX function that searches for a free memory block called by the ux allocate function. This occurs when I plug in a device for a second time. IE: plug in a device, unplug the device, and plug it back in. 100% hardfault using that scenario with the default stack size on USBx v6.1.7. I know it is a stack corruption as the local variables get corrupted and simply upping the stack size fixes the issue. This issues happens nomatter how many devices are used. It happens constantly with just a basic mouse after the second plug in.
It's not really a bug, but it seems something has changed recently, from the older versions, that are requiring a larger stack size. This is more so a note to others that might run into a similar issue.
I'm on the ARM platform using an MXRT1064
The text was updated successfully, but these errors were encountered: