Skip to content

Add USB Device implementation, fix a bug for serial #10712

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
wants to merge 2 commits into from

Conversation

ChazJin
Copy link
Contributor

@ChazJin ChazJin commented May 30, 2019

Description

Implemented USB Device on GD32F450ZI target.

  • Update targets.json for adding USBDEVICE feature

  • Added implementation code for USB Device in usb/device/targets/TARGET_GigaDevice/...

Fix a bug for serial when stdio-buffered-serial is enabled.

Pull request type

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

Reviewers

@0xc0170 @Ronny-Liu I would appreciate if you could review it when you are free.

Release Notes

@ciarmcom ciarmcom requested review from 0xc0170, Ronny-Liu and a team May 30, 2019 05:00
@ciarmcom
Copy link
Member

@ChazJin, thank you for your changes.
@0xc0170 @Ronny-Liu @ARMmbed/mbed-os-maintainers please review.

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 9, 2019

@maciejbocianski - Can you please review?

@ChazJin Can you please rebase? Sorry for the delay to get the review

@0xc0170
Copy link
Contributor

0xc0170 commented Jun 9, 2019

How was this tested ?

@ChazJin
Copy link
Contributor Author

ChazJin commented Jun 10, 2019

How was this tested ?

@0xc0170 We have written some test codes such as virtual USB serial port and USB mouse and verified on GD32_F450ZI board. Once these files are merged, we will upload these routines as example programs.

@ChazJin
Copy link
Contributor Author

ChazJin commented Jun 25, 2019

Hi @0xc0170,

Here is a simple example of virtual USB serial port, which can be compiled and then downloaded directly to the GD32_F450ZI board to observe the results. Do we have to do some other tests?

#include "mbed.h"
#include "USBSerial.h"
 
/* virtual USB serial port */
USBSerial usb_serial(true, 0x28e9, 0x018a, 0x0001);
 
DigitalOut led(LED1);
 
int main(void)
{
    int i = 0;
 
    /* print on STDIO */
    printf("USB Device Serial test started!\r\n");
 
    while(1) {
         /* print on virtual USB serial port */
        usb_serial.printf("Virtual serial port: %d\r\n", i++);

        /* toggle LED */
        led = !led;
        wait(0.5);
    }
}

@maciejbocianski Could you please help to review when you have some time? Thanks a lot.

@maciejbocianski
Copy link
Contributor

Please provide results from all USB tests.
Tests are here https://github.com/ARMmbed/mbed-os/tree/master/TESTS/usb_device

To runt the test use following command:
mbed test -t COMPILER -m TARGET_NAME -n tests-usb_device-XXX -v

Available USB test:

tests-usb_device-basic
tests-usb_device-hid
tests-usb_device-msd   !!!  test is during update see comment below
tests-usb_device-serial

There is a README file describing all corner cases.
https://github.com/ARMmbed/mbed-os/blob/master/TESTS/usb_device/README.md

Mass storage test was unstable and fix was provided. Before running it please download changes provided in the following PR: #10767

@0xc0170
Copy link
Contributor

0xc0170 commented Jul 3, 2019

@ChazJin Any update for this pull request? There's conflict and requests above from @maciejbocianski

@ChazJin
Copy link
Contributor Author

ChazJin commented Jul 4, 2019

@ChazJin Any update for this pull request? There's conflict and requests above from @maciejbocianski

@0xc0170 I am very sorry, we found some problems during the recent USB test. Only TESTS/usb_device/serial can pass the test, and the others all fail. We're looking for reasons.

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 9, 2019

@ChazJin This PR is still opened but has not progressed for 2 months ? I'll close this. Please reopen once updated ,we will review.

@0xc0170 0xc0170 closed this Sep 9, 2019
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.

4 participants