Skip to content

[NUC472/M453] Support USB device #3365

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

Merged
merged 5 commits into from
Dec 30, 2016
Merged

Conversation

ccli8
Copy link
Contributor

@ccli8 ccli8 commented Dec 5, 2016

Description

This PR includes NuMaker-PFM-NUC472/NuMaker-PFM-M453's support for USB device.

@0xc0170
Copy link
Contributor

0xc0170 commented Dec 5, 2016

cc @sg-

@bridadan
Copy link
Contributor

bridadan commented Dec 8, 2016

Thanks for the PR @ccli8! Currently the only USB testing that's done by CI is a build test done by Travis CI.

Could you please make similar edits for the appropriate platforms in this PR like I made here: https://github.com/ARMmbed/mbed-os/pull/3169/files#diff-41911d756af2c8c1e30cb1228ed5b7c3L98

That will enable USB build testing. Thanks!

1. Add targets into build_travis.py and tests.py.
2. Add target SPI pins into SPI SD test samples.
3. Rename target TOOLCHAIN_GCC_ARM/retarget.c to avoid name collision of compiled retarget.o with platform/retargets.cpp.
@ccli8
Copy link
Contributor Author

ccli8 commented Dec 9, 2016

@bridadan Hi, I've made such edits. Please check it.

Besides, on NUMAKER_PFM_NUC472, I meet compile error with mbedtls. It is a known issue with #3006.

@@ -0,0 +1,65 @@

Copy link
Contributor

Choose a reason for hiding this comment

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

please add license header here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@0xc0170 I've added it with fc16917.

@@ -0,0 +1,75 @@

Copy link
Contributor

Choose a reason for hiding this comment

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

same here - license

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Same as above.

@bridadan
Copy link
Contributor

bridadan commented Dec 9, 2016

@ccli8 Thanks so much for adding the build tests! Unfortunately we can't merge this if Travis CI is failing as it will cause all others to start failing as well.

@0xc0170 do we have a way forward to address #3006?

Use MBED_CONF_RTOS_PRESENT to filter out mbedtls alternative for mbed OS 2.
@ccli8
Copy link
Contributor Author

ccli8 commented Dec 15, 2016

@bridadan Following #3096 I use MBED_CONF_RTOS_PRESENT to filter out mbedtls alternative to pass Travis CI check.

@bridadan
Copy link
Contributor

@ccli8 It looks like a FAT filesystem test is failing to compile in Travis CI:

Executing: python tools/make.py -m NUMAKER_PFM_NUC472 -t GCC_ARM -c --silent --fat -n MBED_A12,MBED_19,PERF_1,PERF_2,PERF_3 
Image: /home/travis/build/ARMmbed/mbed-os/BUILD/test/NUMAKER_PFM_NUC472/GCC_ARM/MBED_A12/sd.bin
[ERROR] /home/travis/build/ARMmbed/mbed-os/features/unsupported/tests/mbed/dir_sd/main.cpp: In function 'void test_write(FILE*, const char*)':
/home/travis/build/ARMmbed/mbed-os/features/unsupported/tests/mbed/dir_sd/main.cpp:44:11: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     if (n != strlen(str)) {
           ^
/home/travis/build/ARMmbed/mbed-os/features/unsupported/tests/mbed/dir_sd/main.cpp: In function 'int main()':
/home/travis/build/ARMmbed/mbed-os/features/unsupported/tests/mbed/dir_sd/main.cpp:87:21: error: 'p11' was not declared in this scope
     SDFileSystem sd(p11, p12, p13, p14, "sd");
                     ^
/home/travis/build/ARMmbed/mbed-os/features/unsupported/tests/mbed/dir_sd/main.cpp:87:26: error: 'p12' was not declared in this scope
     SDFileSystem sd(p11, p12, p13, p14, "sd");
                          ^
/home/travis/build/ARMmbed/mbed-os/features/unsupported/tests/mbed/dir_sd/main.cpp:87:31: error: 'p13' was not declared in this scope
     SDFileSystem sd(p11, p12, p13, p14, "sd");
                               ^
/home/travis/build/ARMmbed/mbed-os/features/unsupported/tests/mbed/dir_sd/main.cpp:87:36: error: 'p14' was not declared in this scope
     SDFileSystem sd(p11, p12, p13, p14, "sd");
                                    ^
/home/travis/build/ARMmbed/mbed-os/features/unsupported/tests/mbed/dir_sd/main.cpp:25:23: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
 #define TEST_STRING   "Hello World!"
                       ^
/home/travis/build/ARMmbed/mbed-os/features/unsupported/tests/mbed/dir_sd/main.cpp:92:17: note: in expansion of macro 'TEST_STRING'
     char *str = TEST_STRING;
                 ^
/home/travis/build/ARMmbed/mbed-os/features/unsupported/tests/mbed/dir_sd/main.cpp:93:11: warning: unused variable 'buffer' [-Wunused-variable]
     char *buffer = (char *)malloc(sizeof(unsigned char) * strlen(TEST_STRING));
           ^
/home/travis/build/ARMmbed/mbed-os/features/unsupported/tests/mbed/dir_sd/main.cpp:94:9: warning: unused variable 'str_len' [-Wunused-variable]
     int str_len = strlen(TEST_STRING);
         ^
In file included from /home/travis/build/ARMmbed/mbed-os/BUILD/mbed/TARGET_NUMAKER_PFM_NUC472/TARGET_NUVOTON/TARGET_NUC472/device/NUC472_442.h:32577:0,
                 from /home/travis/build/ARMmbed/mbed-os/BUILD/mbed/TARGET_NUMAKER_PFM_NUC472/TARGET_NUVOTON/TARGET_NUC472/device/cmsis.h:20,
                 from /home/travis/build/ARMmbed/mbed-os/BUILD/mbed/TARGET_NUMAKER_PFM_NUC472/TARGET_NUVOTON/TARGET_NUC472/TARGET_NUMAKER_PFM_NUC472/objects.h:20,
                 from /home/travis/build/ARMmbed/mbed-os/BUILD/mbed/TARGET_NUMAKER_PFM_NUC472/TARGET_NUVOTON/TARGET_NUC472/TARGET_NUMAKER_PFM_NUC472/device.h:22,
                 from /home/travis/build/ARMmbed/mbed-os/BUILD/mbed/platform/platform.h:27,
                 from /home/travis/build/ARMmbed/mbed-os/BUILD/mbed/mbed.h:51,
                 from /home/travis/build/ARMmbed/mbed-os/features/unsupported/tests/mbed/dir_sd/main.cpp:1:
/home/travis/build/ARMmbed/mbed-os/BUILD/mbed/TARGET_NUMAKER_PFM_NUC472/TARGET_NUVOTON/TARGET_NUC472/device/StdDriver/nuc472_cap.h: At global scope:
/home/travis/build/ARMmbed/mbed-os/BUILD/mbed/TARGET_NUMAKER_PFM_NUC472/TARGET_NUVOTON/TARGET_NUC472/device/StdDriver/nuc472_cap.h:86:17: warning: 'u32EscapeFrame' defined but not used [-Wunused-variable]
 static uint32_t u32EscapeFrame = 0;

Looks like you just need to add valid pins to the test.

@ccli8
Copy link
Contributor Author

ccli8 commented Dec 16, 2016

@bridadan I added SPI SD pins to failed samples. Please continue the check.

@bridadan
Copy link
Contributor

/morph test

@mbed-bot
Copy link

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph test

Output

mbed Build Number: 1329

All builds and test passed!

#define NU_MAX_EPX_BUFSIZE 4096
#define NU_EP2EPL(ep) ((ep) >> 1)
#define NU_EP2EPH(ep) (((ep) >> 1) + 1)
#define NU_EPL2EPH(ep) ((ep) + 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please fix the formatting in this file? the line 19 (there are more). Using tabs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fix with another PR #3514.

#define NU_EP2EPL(ep) ((ep) >> 1)
#define NU_EP2EPH(ep) (((ep) >> 1) - 1)
#define NU_EPX2EP(ep) ((ep == CEP) ? EP0OUT : ((ep) - EPA + EP1OUT))
#define NU_EPL2EPH(ep) ((ep) - 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

same here (alignment)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fix with another PR #3514.

Copy link
Contributor

@0xc0170 0xc0170 left a comment

Choose a reason for hiding this comment

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

Future reference: code style

LGTM as it is, you can send a patch to fix.

@0xc0170 0xc0170 merged commit e7361eb into ARMmbed:master Dec 30, 2016
aisair pushed a commit to aisair/mbed that referenced this pull request Apr 30, 2024
Ports for Upcoming Targets

3459: Target: Add new target UBLOX_EVK_NINA_B1 ARMmbed/mbed-os#3459

Fixes and Changes

3430: Fix ci shield eeprom test ARMmbed/mbed-os#3430
3381: STM32F1 : map ST HAL assert into MBED assert ARMmbed/mbed-os#3381
3389: STM32F2 : map ST HAL assert into MBED assert ARMmbed/mbed-os#3389
3390: STM32F3 : map ST HAL assert into MBED assert ARMmbed/mbed-os#3390
3410: STM32L4 : map ST HAL assert into MBED assert ARMmbed/mbed-os#3410
3422: Enable CAN on DISCO_F303VC ARMmbed/mbed-os#3422
3442: Dev stm i2c f1 ARMmbed/mbed-os#3442
3460: KSDK I2C: Update the return value to match the API documentation change ARMmbed/mbed-os#3460
3472: [RZ/A1H]Fix TTB setting of RO_DATA area ARMmbed/mbed-os#3472
3451: Rename KSDK2 to MCUXpresso. This is the new name of this package ARMmbed/mbed-os#3451
3391: STM32F4 : map ST HAL assert into MBED assert ARMmbed/mbed-os#3391
3454: STM32: Refactor lp_ticker.c + rtc_api.c + sleep.c + rtc_api_hal.h files  ARMmbed/mbed-os#3454
3489: NUCLEO_F103RB - Correct CAN and PWM alternate-functions ARMmbed/mbed-os#3489
3405: Repair the transmit mailbox (0,1,2) empty interrupt flag not clear BUG ARMmbed/mbed-os#3405
3502: MCUXpresso I2C: Handle 0 byte write ARMmbed/mbed-os#3502
3365: [NUC472/M453] Support USB device ARMmbed/mbed-os#3365
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