ARMmbed / ARMmbed/DAPLink

MSC driver assertion failure. IN and OUT endpoints callback ordering issue

Open
#963 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
2.8k
Forks
1.1k
Avg merge
3d 12h
Merged PRs (30d)
1

Description

Sometimes the MSC driver would hit the `util_assert()` here:
https://github.com/ARMmbed/DAPLink/blob/main/source/usb/msc/usbd_msc.c#L1087

The MSC driver expects its `ReadEP()` and `WriteEP()` sequence has the same order as the `BULKOUT_Event` and `BULKIN_Event` sequence. But dependent on how the usb driver implements the handler, even if MSC driver does `ReadEP()` before `WriteEP()`, the usb driver may handle`BULKIN_Event` and triggers the `util_assert`

What do you think about this issue ? Should this ordering issue be handled in the USB driver or the MSC driver ?

Contributor guide

Open the contributing guide

Research direction

Start at source/usb/msc/usbd_msc.c:1087 and trace the MSC ReadEP() and WriteEP() calls alongside BULKOUT_Event and BULKIN_Event handling. Compare the ordering guarantees provided by the USB driver and MSC driver; done means deciding which layer owns the ordering and preventing the util_assert() failure under the affected callback sequence.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.