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

Gadget0 failing control loopback test #592

Conversation

h2obrain
Copy link
Contributor

@h2obrain h2obrain commented Jan 5, 2016

Contents

  • Adds test-support for gadget0 for the stm32f429i-disco board

@h2obrain
Copy link
Contributor Author

h2obrain commented Jan 5, 2016

WIKI proposal

how to test usb (linux) :

  • install openocd, pyusb, GCC ARM Embedded
  • clone libopencm3
  • cd libopencm3
  • make
  • cd tests/gadget-zero
  • edit openocd.stm32f4disco.cfg
    • adapt hla_serial to your debugger board (dmesg?) (just comment it out :))
  • edit test_gadget0.py
    • uncomment DUT_SERIAL belonging to your board
  • make -f Makefile.stm32f429i-disco all flash
  • python -m unittest test_gadget0

@h2obrain h2obrain mentioned this pull request Jan 5, 2016
@karlp
Copy link
Member

karlp commented Jan 5, 2016

Aim here is to make the loopback test behave the same way as the linux kernel gadget 0 loopback test. (Late thoughts, this is control req loopback? not data loopback?)

@h2obrain
Copy link
Contributor Author

h2obrain commented Jan 5, 2016

It's definitely a control transfer.. (loopback like..)

  • send known data to device (store in static buffer)
  • read size of known data from device (read from static buffer)
  • compare known data with read data

the device fails in the first step with the word-loss error)
looks like this

 - buf_out : '5678901234567890123456789012345678901234567'
 - buf_in  : '9012345678901234567890123456789012345676\x00\x00\xa7'

nvic_enable_irq(NVIC_OTG_HS_IRQ);

volatile int i = 1;
while (i);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"while (i)" ? Is there something else modifying "i" ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, it's just a while (1) asm(""); or maybe even while (1);
i'm never sure what the compiler is going to optimise out in the end

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the standard "while (1) {} " construct is pretty invincible, and compiles always to an endless loop.

@karlp karlp self-assigned this May 2, 2018
karlp added a commit to karlp/libopencm3 that referenced this pull request May 2, 2018
This is based on linux's gadget0 intel loopback tests, and also github
pr: libopencm3#592

Current status is passing on f3, f0, and failing on f4.
@karlp
Copy link
Member

karlp commented May 2, 2018

I've pulled an ~equivalent ctrl loopback test code locally, (and can confirm some of the other bugs) but I've based it more on the linux gadget0/intel compliance code, rather than making up our own new codes for it. Will close this once it lands.

karlp added a commit to karlp/libopencm3 that referenced this pull request Jun 7, 2018
This is based on linux's gadget0 intel loopback tests, and also github
pr: libopencm3#592

Current status is passing on f3, f0, and failing on f4.
karlp added a commit to karlp/libopencm3 that referenced this pull request Jun 7, 2018
This is based on linux's gadget0 intel loopback tests, and also github
pr: libopencm3#592

Current status is passing on f3, f0, and failing on f4.
karlp added a commit to karlp/libopencm3 that referenced this pull request Jun 7, 2018
This is based on linux's gadget0 intel loopback tests, and also github
pr: libopencm3#592

Current status is passing on f3, f0, and failing on f4.
karlp added a commit to karlp/libopencm3 that referenced this pull request Jun 27, 2018
This is based on linux's gadget0 intel loopback tests, and also github
pr: libopencm3#592

Current status is passing on f3, f0, and failing on f4.
karlp added a commit to karlp/libopencm3 that referenced this pull request Jul 6, 2018
This is based on linux's gadget0 intel loopback tests, and also github
pr: libopencm3#592

Current status is passing on f3, f0, and failing on f4.
karlp added a commit to karlp/libopencm3 that referenced this pull request Jul 7, 2018
This is based on linux's gadget0 intel loopback tests, and also github
pr: libopencm3#592

Current status is passing on f3, f0, and failing on f4.
karlp added a commit to karlp/libopencm3 that referenced this pull request Jul 24, 2018
This is based on linux's gadget0 intel loopback tests, and also github
pr: libopencm3#592

Current status is passing on f3, f0, and failing on f4.
karlp added a commit to karlp/libopencm3 that referenced this pull request Jul 25, 2018
This is based on linux's gadget0 intel loopback tests, and also github
pr: libopencm3#592

Current status is passing on f3, f0, and failing on f4.
karlp added a commit to karlp/libopencm3 that referenced this pull request Jul 29, 2018
This is based on linux's gadget0 intel loopback tests, and also github
pr: libopencm3#592

Current status is passing on f3, f0, and failing on f4.
karlp added a commit to karlp/libopencm3 that referenced this pull request Aug 19, 2018
This is based on linux's gadget0 intel loopback tests, and also github
pr: libopencm3#592

FIXME Current status is passing on f3, f0, and failing on f4.
karlp added a commit to karlp/libopencm3 that referenced this pull request Aug 21, 2018
This is based on linux's gadget0 intel loopback tests, and also github
pr: libopencm3#592

FIXME Current status is passing on f3, f0, and failing on f4.
karlp added a commit that referenced this pull request Aug 27, 2018
This is based on linux's gadget0 intel loopback tests, and also github
pr: #592

Note that this captures the currently broken control loopback issues on
dwc_otg devices.

See #873 and all linked
issues.

Current status is passing on f3, f0, and failing on f4.
@karlp
Copy link
Member

karlp commented Aug 27, 2018

These tests (or equivalent) have merged, along with the fixes for them. thanks for pushing on this.

@karlp karlp closed this Aug 27, 2018
grevaillot pushed a commit to grevaillot/libopencm3 that referenced this pull request Jan 11, 2019
This is based on linux's gadget0 intel loopback tests, and also github
pr: libopencm3#592

Note that this captures the currently broken control loopback issues on
dwc_otg devices.

See libopencm3#873 and all linked
issues.

Current status is passing on f3, f0, and failing on f4.
BOJIT pushed a commit to BOJIT/PlatformIO-libopencm3 that referenced this pull request Jan 30, 2021
This is based on linux's gadget0 intel loopback tests, and also github
pr: libopencm3#592

Note that this captures the currently broken control loopback issues on
dwc_otg devices.

See libopencm3#873 and all linked
issues.

Current status is passing on f3, f0, and failing on f4.
@h2obrain h2obrain deleted the gadget0_failing_control_loopback_test branch March 14, 2021 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants