Skip to content

experimental - add ST NUCLEO L073RZ USB support #11360

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

Closed

Conversation

paul-szczepanek-arm
Copy link
Member

@paul-szczepanek-arm paul-szczepanek-arm commented Aug 28, 2019

Description

Add USB device support for L073RZ.

DO NOT MERGE.

l0-usb

Pull request type

[ ] Fix
[ ] Refactor
[x] Target update
[ ] Functionality change
[ ] Docs update
[ ] Test update
[ ] Breaking change

Reviewers

@fkjagodzinski
@jamesbeyond

Release Notes

@ciarmcom ciarmcom requested review from fkjagodzinski, jamesbeyond and a team August 28, 2019 11:00
@ciarmcom
Copy link
Member

@paul-szczepanek-arm, thank you for your changes.
@jamesbeyond @fkjagodzinski @ARMmbed/mbed-os-maintainers please review.

@bulislaw
Copy link
Member

@ARMmbed/team-st-mcd please have a look

@0xc0170 0xc0170 requested a review from a team August 29, 2019 07:58
@jeromecoutant
Copy link
Collaborator

Hi
Did you check usb tests ?
Thx

@@ -1369,8 +1369,7 @@ def ep_test_abort(dev, log, verbose=False):
payload_size = (NUM_PACKETS_UNTIL_ABORT + NUM_PACKETS_AFTER_ABORT) * ep_out.wMaxPacketSize
num_bytes_written = 0
while num_bytes_written < payload_size:
payload_out = array.array('B', (num_bytes_written/ep_out.wMaxPacketSize
for _ in range(ep_out.wMaxPacketSize)))
payload_out = array.array('B', ([num_bytes_written//ep_out.wMaxPacketSize] * ep_out.wMaxPacketSize))
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would prefer to have a specific PR for this "common" test part ?
(to be tested with all other targets?)

@@ -3421,7 +3421,8 @@
"SERIAL_ASYNCH",
"TRNG",
"FLASH",
"MPU"
"MPU",
"USBDEVICE"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can't be part of PR, as board doesn't have any USB connection.
This part has to be part of mbed_app.json

@jeromecoutant
Copy link
Collaborator

For your information, I am able to run USB serial and mouse examples!
But I couldn't yet execute any tests...

@paul-szczepanek-arm
Copy link
Member Author

Only HID and basic. There are issues with a couple of basic ones - which is why this PR is here so they can be addressed.

@jeromecoutant
Copy link
Collaborator

Hi all

I have started STM32 USB "refactor".

Please have a look on master...jeromecoutant:DEV_USB_STM32

I currently tested L4 and F4.
L0 is not working very well yet (only HID)

@LMESTM

@fkjagodzinski
Copy link
Member

fkjagodzinski commented Sep 9, 2019

Please have a look on master...jeromecoutant:DEV_USB_STM32

@jeromecoutant, I checked your branch (currently at 9cac20e, compiled with GCC_ARM) with:

  1. DISCO_L475VG_IOT01A,
  2. NUCLEO_F429ZI.

Both fail tests-usb_device-basic / usb control basic test with TEST FAILED: [TESTS/host_tests/pyusb_basic.pyc]:851, VENDOR_TEST_CTRL_OUT_SIZES failed

I had to update 2 lines to compile successfully; please see fkjagodzinski@6e2467b.


Please note that the NUCLEO_F429ZI passes all tests-usb_device-basic on current master (1800632).

@jeromecoutant
Copy link
Collaborator

About your patch, I agree.. I made some last minute file renaming....

@fkjagodzinski
Copy link
Member

@paul-szczepanek-arm sorry to keep you waiting. I checked this branch locally; here are the results of tests-usb_device-basic:

  • usb control basic test -- a few different parts of this test fail (e.g. get_set_interface_test, set_clear_feature_test) with USBError: [Errno None] libusb0-dll:err [set_configuration] could not set config 1: win error: A device attached to the system is not functioning. when trying to set one of USB device configurations. Sometimes the get_set_configuration_test fails with FAILED - expected to be deconfigured Got 1, expected 0 or FAILED - set configuration, which I think exposes the same problem.

  • usb control sizes test -- fails either with VENDOR_TEST_CTRL_OUT_SIZES failed or VENDOR_TEST_CTRL_IN_SIZES failed,

  • usb control stress test -- fails with USBError: [Errno None] libusb0-dll:err [control_msg] sending control message failed, win error: A device attached to the system is not functioning.,

  • endpoint test halt -- fails this asseriton,

  • endpoint test parallel transfers ctrl -- fails in the same way the usb control stress test does (again with failed control message transfer on endpoint 0),

To sum up, this implementation still needs a bit of work with regard to control transfer handling.

BTW, I can see quite a few of these errors give very verbose Python tracebacks. I'll prepare a patch for the host script and update the error handling. The current output is a bit messy and can be confusing for the user.

@jeromecoutant
Copy link
Collaborator

I have updated my working branch : https://github.com/jeromecoutant/mbed/tree/DEV_USB_STM32
But I still have lots of issues for introduced boards...

@fkjagodzinski
Copy link
Member

BTW, I can see quite a few of these errors give very verbose Python tracebacks. I'll prepare a patch for the host script and update the error handling. The current output is a bit messy and can be confusing for the user.

Updated error formatting in #11540.

@jeromecoutant
Copy link
Collaborator

Hi all
Note I have started to push some code refactoring in #11675
No code addition for the moment for STM32L0 or other not supported yet targets.

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 28, 2019

@paul-szczepanek-arm is this still worth keeping opened?

@paul-szczepanek-arm
Copy link
Member Author

I think this has served its purpose. Thanks.

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.

7 participants