mimxrt: Fix USB CDC handling so it works reliably.#6881
mimxrt: Fix USB CDC handling so it works reliably.#6881dpgeorge merged 1 commit intomicropython:masterfrom
Conversation
dpgeorge
commented
Feb 12, 2021
On i.MX the SysTick IRQ cannot wake the CPU from a WFI so the CPU was blocked on WFI waiting for USB data in mp_hal_stdin_rx_chr() even though it had already arrived (because it may arrive just after calling the check tud_cdc_available()). This commit fixes this problem by using SEV/WFE to indicate that there has been a USB event. The mp_hal_stdout_tx_strn() function is also fixed so that it doesn't overflow the USB buffers. Signed-off-by: Damien George <damien@micropython.org>
|
@hathach FYI this fixes our i.MX port to make it 100% reliable with USB CDC transfers (as far as my tests show). It still calls |
|
Thanks @dpgeorge for the update, to be honest I don’t know MP enough to comment on the changes. But I am glad you figured it out. PS: feel free to tag me in the future if there is issue related to tinyusb 😃 |
Yes, we do use that pattern in some places in the stm32 port. But IMO using SEV/WFE is a better way to handle atomic events. |
|
Glad you fixed it all. I just create an issue as reminder to implement an isr safe version where several osal calls such as mutex can be bypassed and better testing. Will update the development there, and let you know when its PR is ready. |
…tron-maker-feather-aiot-s3-pin Modified the pins assignment for Cytron Maker Feather AIoT S3.