Skip to content
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

Upstream synchronization #43

Merged
merged 46 commits into from
Dec 11, 2024
Merged

Upstream synchronization #43

merged 46 commits into from
Dec 11, 2024

Conversation

roma-jam
Copy link
Collaborator

@roma-jam roma-jam commented Dec 10, 2024

Requirements

Keep the release/v0.17 branch in sync.

Description

Sync request. Important changes/fixes:

Limitations

N/A

Breaking change

No breaking changes

Checklist

  • Pull Request name has appropriate format (for example: "fix(dcd_dwc2): Resolved address selection when several phy are present")
  • Optional: README.md updated
  • CI passing

Related issues

No related issues

lijunru-hub and others added 30 commits May 22, 2024 20:57
…-to-bool

change dcd_dcache_*() API return type from void to bool
…h#2889)

* change TUD_EPBUF_TYPE_DEF order
* add and fix -Wmissing-prototypes warnings  for   cmake (skip  make)
Add support for the STM32C0 and the NUCLEO-C071RB
USBH: Recover from unexpected descriptor size
hathach and others added 13 commits November 28, 2024 16:23
net_lwip_webserver example fix and improvement
…buffer_name

refactor(usbd_control): Updated the buffer name for deeper debug
fix(dcd_dwc2): Fix EP IN counters assignment and usage
hcd_int_handler isn't found otherwise.
Disable DWC HCD interrupt with MAX3421
* try to run arm-iar with circleci with new token
* limit iar ci parallel build to 4 for medium+ and 6 for large
* add hil-hfp to compile and test with IAR
…me_based

feat(uvc): support format frame based
correct clock setting for h563 nucleo
@roma-jam roma-jam self-assigned this Dec 10, 2024
@roma-jam roma-jam marked this pull request as ready for review December 10, 2024 09:15
@roma-jam
Copy link
Collaborator Author

roma-jam commented Dec 10, 2024

@tore-espressif @peter-marcisovsky
I have created the upstream sync PR, via a temp branch sync/upstream.
The steps:

  1. Create a sync/upstream branch from current release/v0.17
  2. Sync master to the upstream/master
  3. Merge master to sync/upstream
  4. Create a PR from sync/upstream to release/v0.17

Why I need the step 3 when I could create a PR directly from the master -> release/v0.17?
In case of the conflicts, I need somehow resolve them and I prefer to do it in the branch (which is not master and not target release/v0.17).
Note: We didn't have any conflict on this step for this PR.

As this is a first attempt to sync it, all ideas are welcome.

I will also check the history again and try to understand, what do we might need to add in the description to make it more clear.

Feel free to review and share you ideas.

@tore-espressif
Copy link
Collaborator

@roma-jam If I understand it correctly, this PR is step 4 'Create a PR from sync/upstream to release/v0.17'

The git history is clean, so LGTM

@tore-espressif
Copy link
Collaborator

Could you please check if we need this commit too hathach@d502a0c ?

We did not get any erros without it, so I'm wondering whether it is actually correct...

@roma-jam
Copy link
Collaborator Author

roma-jam commented Dec 11, 2024

@tore-espressif

This is correct (to some extend). But could lead to error in a very rare scenario. Also interesting, that the ep_count has two different sources: ghwcfg2_bm.num_dev_ep by macro DWC2_EP_COUNT(_dwc2) and from the description of the dwc_controller[rhport]: ..., .ep_count = 7, .ep_in_count = 5, ...

In dfifo_alloc() and dcd_edpt_close_all() the second option is used. The first one in such calls as handle_bus_reset() and handle_ep_irq().

So, that means that we allocate all fifo correctly (with value 7), but handle bus reset and irq with value 6 (In our case). That means that we probably should miss the IRQ for the very last EP, as we iterate the EPs for one less.

Seems, that it could be confirmed with our 2xCDC example, as there we have exactly 7 EPs (EP0, and 3 EPs per CDC).

UPD: Which is EP IN (0x84). So that means that we are not able to send any data there should be an error during sending the data to the Host by using the second CDC interface.

@roma-jam roma-jam added this to the v0.17.1 milestone Dec 11, 2024
@roma-jam
Copy link
Collaborator Author

roma-jam commented Dec 11, 2024

@tore-espressif,

I will merge this PR and create another one with the upcoming upstream changes.
Anyway, there are still couple of open questions, such as:

So, the rest upstream changes we'll sync in the following sync PRs.

@roma-jam roma-jam merged commit b755233 into release/v0.17 Dec 11, 2024
89 checks passed
@roma-jam roma-jam deleted the sync/upstream branch December 11, 2024 18:14
@roma-jam roma-jam mentioned this pull request Dec 11, 2024
3 tasks
@roma-jam
Copy link
Collaborator Author

@tore-espressif
I checked it again and we have the test for both CDC interfaces:
image

first instance has novfs and second doesn't.

But we don't have any error, because the last EP IN (which is overall 7th) is only in the position of 4 (because we don't iterate the overall amount, but the ep_num only).
So, for our case it is 0x84 => 0x04 => 0x04 < 6. That is why it works.

Then this means, that to get this error, we need 7 EP with the same direction: OUT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants