2023-05-04 03:26 PM
Have STM32H7B3 Discovery Kit.
Used CubeMX to create IAR project.
Integrated USB_Host_Library.
Have USB mouse connected to OTG HS port.
Find that USB initialization eventually triggers a configASSERT(pxUnblockedTCB) in source tasks.c function xTaskRemoveFromEventList.
Observe the following sequence:
It would appear the "if" at step #11 is contradicting the configASSERT at step #14.
Suggestions?
Edit: what is happening is the queue structure is becoming corrupted, not with random garbage, but with USBH related pointers.
Specifically, when HAL_HCD_HC_Init is called, which itself calls USB_HC_Init, field ucQueueNumber in the queue structure mysteriously is overwritten with 0x20004878, which coincidentally is the contents of field pData in structure hUsbHostHS, pointing just beyond the end of hUsbHostHS.
If I single step through HAL_HCD_HC_Init, the corruption does not occur.
But if I let it rip through HAL_HCD_HC_Init, the corruption does occur, which I infer is interrupt related.
Further execution results in more corruption, including xTasksWaitingToReceive field uxNumberOfItems, and it is that corrupted count that causes the configASSERT mentioned above.
But I have not yet been able to identify who is doing the corruption.
Please note, this is 100% STM code, from CubeMX and FreeRTOS.
No code of mine is in the project.
2023-06-12 09:55 AM
The isuue is not reproduced.
No configASSERT is triggered!
Note: The user should be aware that the GPIO for the VBus should be configured and the API for the Enable USB Voltage Detector should be added manually.
Could you please upload your code or at least give more info ( are you working with cmsis os1 or 2 / lib version...)
Thank you