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

Update USB driver for devices with Kinetis SDK support #3014

Closed
wants to merge 3 commits into from

Conversation

mmahadevan108
Copy link
Contributor

Description

Update USB driver for devices with Kinetis SDK support

  1. Fix build issues with IAR and GCC toolchain
  2. Update clock initialization code

Status

USB unit tests with ARMCC failed, I feel this is something outside the USB driver. The same tests with IAR and GCC_ARM work fine. Also USB unit test with ARMCC without the RTOS work,

@mmahadevan108
Copy link
Contributor Author

@maclobdell @sg-

@sg-
Copy link
Contributor

sg- commented Oct 13, 2016

USB unit tests with ARMCC failed, I feel this is something outside the USB driver. The same tests with IAR and GCC_ARM work fine. Also USB unit test with ARMCC without the RTOS work,

Which device(s) fail with the ARM toolchain?

@mmahadevan108
Copy link
Contributor Author

All the ones I tested. K64F FRDM, Hexiwear, K22F, KL43Z. All these passed with IAR and GCC_ARM

@sg-
Copy link
Contributor

sg- commented Oct 13, 2016

OK - we can come back to that.

@sg- sg- added the needs: CI label Oct 13, 2016
@sg-
Copy link
Contributor

sg- commented Oct 13, 2016

@mbed-bot: TEST

HOST_OSES=ALL
BUILD_TOOLCHAINS=ALL
TARGETS=ALL

@mbed-bot
Copy link

[Build 1038]
FAILURE: Something went wrong when building and testing.

@mmahadevan108
Copy link
Contributor Author

Hi Sam, Is the failure similar to what I had mentioned I am seeing when testing with the ARMCC toolchain.

@mmahadevan108
Copy link
Contributor Author

@maclobdell

@bridadan
Copy link
Contributor

@mmahadevan108 The failure is due to a board that's currently having issues with mbedTLS, not related to your PR. The rest of the tests look OK.

@0xc0170 Should we be adding these platforms to the USB compile step in travis? That's the only thing enforcing USB at the moment.

@sg-
Copy link
Contributor

sg- commented Oct 19, 2016

Should we be adding these platforms to the USB compile step in travis? That's the only thing enforcing USB at the moment.

👍

@mmahadevan108
Copy link
Contributor Author

Hi, Anything else needed for this PR?

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 24, 2016

@mmahadevan108 Can you please update https://github.com/ARMmbed/mbed-os/blob/master/tools/build_travis.py, according to this patch?

@mmahadevan108
Copy link
Contributor Author

mmahadevan108 commented Oct 24, 2016

I have'nt added USB support for any new platform. So there should'nt be any change in this file.

@bridadan
Copy link
Contributor

@mmahadevan108 It looks like we were never enforcing this platform in travis for USB support anyway. If you could add it to the build_travis.py script, it'd help us make sure no other changes break the build.

@mmahadevan108
Copy link
Contributor Author

@bridadan Sorry I am not familiar with this file. Can you guide me what I need to add?

@bridadan
Copy link
Contributor

@mmahadevan108 Sure thing. The relevant file is here: https://github.com/ARMmbed/mbed-os/blob/master/tools/build_travis.py

For whichever platforms this change affects, you'll want to make sure they has an entry in this tuple: https://github.com/ARMmbed/mbed-os/blob/master/tools/build_travis.py#L29

You'll need to make sure "usb" is in the "libs" array.

Also, you'll want to add the USB tests to this array: https://github.com/ARMmbed/mbed-os/blob/master/tools/build_travis.py#L131

You can pretty much copy the LPC1768 entry there, but feel free to remove the "eth" and "fat" tests.

@mmahadevan108
Copy link
Contributor Author

I have updated this PR to include changes to the travis build script.

Copy link
Contributor

@bridadan bridadan left a comment

Choose a reason for hiding this comment

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

Oops, sorry I think wasn't very clear! Please see my comment below.

"usb" : ["USB_1", "USB_2" ,"USB_3"],
}
}
]
Copy link
Contributor

Choose a reason for hiding this comment

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

@mmahadevan108 These all need to be in the same array. Please replace these changes with the following:

linking_list = [
    {"target": "LPC1768",
     "toolchains": "GCC_ARM",
     "tests": {""     : ["MBED_2", "MBED_10", "MBED_11", "MBED_15", "MBED_16", "MBED_17"],
               "eth"  : ["NET_1", "NET_2", "NET_3", "NET_4"],
               "fat"  : ["MBED_A12", "MBED_19", "PERF_1", "PERF_2", "PERF_3"],
               "rtos" : ["RTOS_1", "RTOS_2", "RTOS_3"],
               "usb"  : ["USB_1", "USB_2" ,"USB_3"],
               }
     },
    {"target": "K64F",
     "toolchains": "GCC_ARM",
     "tests": {""     : ["MBED_2", "MBED_10", "MBED_11", "MBED_15", "MBED_16", "MBED_17"],
               "eth"  : ["NET_1", "NET_2", "NET_3", "NET_4"],
               "fat"  : ["MBED_A12", "MBED_19", "PERF_1", "PERF_2", "PERF_3"],
               "rtos" : ["RTOS_1", "RTOS_2", "RTOS_3"],
               "usb"  : ["USB_1", "USB_2" ,"USB_3"],
               }
     },
    {"target": "K22F",
     "toolchains": "GCC_ARM",
     "tests": {""     : ["MBED_2", "MBED_10", "MBED_11", "MBED_15", "MBED_16", "MBED_17"],
               "fat"  : ["MBED_A12", "MBED_19", "PERF_1", "PERF_2", "PERF_3"],
               "rtos" : ["RTOS_1", "RTOS_2", "RTOS_3"],
               "usb"  : ["USB_1", "USB_2" ,"USB_3"],
               }
     },
    {"target": "KL43Z",
     "toolchains": "GCC_ARM",
     "tests": {""     : ["MBED_2", "MBED_10", "MBED_11", "MBED_15", "MBED_16", "MBED_17"],
               "fat"  : ["MBED_A12", "MBED_19", "PERF_1", "PERF_2", "PERF_3"],
               "rtos" : ["RTOS_1", "RTOS_2", "RTOS_3"],
               "usb"  : ["USB_1", "USB_2" ,"USB_3"],
               }
     }
     ]

@mmahadevan108
Copy link
Contributor Author

@bridadan Thanks. Now I understand :). I have updated the commit.

{"target": "K64F",
"toolchains": "GCC_ARM",
"tests": {"" : ["MBED_2", "MBED_10", "MBED_11", "MBED_15", "MBED_16", "MBED_17"],
"eth" : ["NET_1", "NET_2", "NET_3", "NET_4"],
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 remove the "eth" line? It looks like travis isn't happy about that one. It's an older mbed 2 test.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have removed the "eth" line.

@@ -65,7 +68,14 @@ typedef struct BDT {
// there are:
// * 16 bidirectionnal endpt -> 32 physical endpt
// * as there are ODD and EVEN buffer -> 32*2 bdt
#if defined(__ICCARM__)
Copy link
Contributor

Choose a reason for hiding this comment

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

shall we use MBED_ALIGN 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.

Thanks for pointing this. I will have made the change to use MBED_ALIGN.

{"target": "K64F",
"toolchains": "GCC_ARM",
"tests": {"" : ["MBED_2", "MBED_10", "MBED_11", "MBED_15", "MBED_16", "MBED_17"],
"fat" : ["MBED_A12", "MBED_19", "PERF_1", "PERF_2", "PERF_3"],
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like Travis isn't happy about the "fat" tests either. It's saying that the pins aren't defined.

The following tests need the pins set just for the KL43Z:

And the following tests need the pins set for the K64F, K22F, KL43Z.

Alternatively, you can disable the "fat" checks for these platforms.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see the pin defined in MBED_19, why is this failing? I will add the pin defines for KL43Z

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My mistake, I was looking at MBED_A19. Where is MBED_A19 test located?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have added the changes to the tests and removed MBED_19 from the list of fat tests.

Copy link
Contributor

Choose a reason for hiding this comment

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

1. Fix build issues with IAR and GCC toolchain
2. Update clock initialization code

Signed-off-by: Mahadevan Mahesh <[email protected]>
Signed-off-by: Mahadevan Mahesh <[email protected]>
@mmahadevan108
Copy link
Contributor Author

Anything else needed for this PR?

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 31, 2016

Anything else needed for this PR?

Green travis and then we will run CI.

This is output from Travis that fails:

Executing: python tools/make.py -m K22F -t GCC_ARM -c --silent  -n MBED_2,MBED_10,MBED_11,MBED_15,MBED_16,MBED_17 

[ERROR] In file included from /home/travis/build/ARMmbed/mbed-os/.build/mbed/mbed.h:34:0,

                 from /home/travis/build/ARMmbed/mbed-os/features/unsupported/tests/mbed/env/test_env.h:5,

                 from /home/travis/build/ARMmbed/mbed-os/features/unsupported/tests/mbed/env/test_env.cpp:1:

/home/travis/build/ARMmbed/mbed-os/.build/mbed/platform/platform.h:27:20: fatal error: device.h: No such file or directory

 #include "device.h"

@bridadan bridadan mentioned this pull request Oct 31, 2016
4 tasks
@bridadan
Copy link
Contributor

Hi @mmahadevan108, there were a bunch of little things that needed to be patched/updated in order to make Travis CI happy, so I did them over in this PR: #3169

I just pushed the relevant changes on top of your PR, I hope you don't mind :) Would you mind taking a look at it when you get a chance? Thanks!

@0xc0170 0xc0170 closed this Nov 1, 2016
sg- added a commit that referenced this pull request Nov 1, 2016
oter pushed a commit to oter/mbed-os that referenced this pull request Nov 21, 2016
Release mbed OS 5.2.2 and mbed lib v129

Known issues in this release

There is currently a DNS resolution failure in Thread mode with this release. This causes a failure in the
mbed-os-example-client. This will be fixed in a subsequent release. This can be worked around by reverting
to mbed-os-5.2.0

Ports for Upcoming Targets

3011: Add u-blox Sara-N target. ARMmbed#3011
3099: MAX32625 ARMmbed#3099
3151: Add support for FRDM-K82F ARMmbed#3151
3177: New mcu k22512 fixing pr 3136 ARMmbed#3177

Fixes and Changes

2990: [tools] Parallel building of tests ARMmbed#2990
3008: NUCLEO_F072RB: Fix wrong timer channel number on pwm PB_5 pin ARMmbed#3008
3013: STM32xx - Change how the ADC internal pins are checked before pinmap_ ARMmbed#3013
3023: digital_loop tests update for STM32 ARMmbed#3023
3041: [nRF5] - added implementation of API of serial port flow control configuration. ARMmbed#3041
3092: [tools + tests] Adding parallelized build option for iar and uvision exporters ARMmbed#3092
3084: [nrf5] fix in Digital I/O : a gpioe pin was uninitialized badly ARMmbed#3084
3009: TRNG enabled. TRNG APIs implemented. REV A/B/C/D flags removed. Warnings removed ARMmbed#3009
3139: Handle [NOT_SUPPORTED] exception in make.py ARMmbed#3139
3074: Target stm init gcc alignement ARMmbed#3074
3140: [tests] Replacing getchar with RawSerial getc in greentea-client ARMmbed#3140
3158: Added support for 6lowpan PAN ID filter to mbed mesh api configuration ARMmbed#3158
2988: Update of can_api.c fixing ARMmbed#2987 ARMmbed#2988
3175: Updating IAR definition for the NCS36510 for IAR EW v7.8 ARMmbed#3175
3170: [tests] Preventing test from printing before Greentea __sync ARMmbed#3170
3169: [Update of ARMmbed#3014] Usb updates ARMmbed#3169
3143: CFStore fix needed for the Cloud Client ARMmbed#3143
3135: lwip - Fix memory leak in k64f cyclic-buffer overflow ARMmbed#3135
3048: Make update.py test compile examples prior to updating mbed-os version. ARMmbed#3048
3162: lwip/nsapi - Clean up warnings in network code ARMmbed#3162
3161: nsapi - Add better heuristic for the default record of DNS queries ARMmbed#3161
3173: [Exporters] Add a device_name to microbit entry in targets.json ARMmbed#3173
3072: i2c_loop tests update for STM32 ARMmbed#3072
2958: Allowing mbed_app.json files to be discovered for tests. ARMmbed#2958
2969: [nRF52] - switch irq priorities of driver handlers to the lowest level ARMmbed#2969
3078: lwip: Allow several configuration macros to be set externally (bis) ARMmbed#3078
3165: Add address type checks to NanostackInterface ARMmbed#3165
3166: nsapi_dns: Provide 2 IPv6-hosted default servers ARMmbed#3166
3171: [tools] Fixing project.py -S printing problem ARMmbed#3171
3172: [Exporters] New export-build tests ARMmbed#3172
3184: ARMmbed#3183 Compiler warning in trng_api.c with K64F  ARMmbed#3184
3185: Update tests to fix build failures. Also make the code similar to oth ARMmbed#3185
3104: [NuMaker] Support CAN and fix PWM CLK error ARMmbed#3104
3182: Exporter documentation ARMmbed#3182
3186: MultiTech mDot - add back SPI3 pins ARMmbed#3186
3187: [Export-Make] Use internal class variable for resolving templates in makefiles ARMmbed#3187
3195: [Exporters - Make-based] Quote the shell call in mkdir and rmdir ARMmbed#3195
3204: [Export build-test] Directory traversal error ARMmbed#3204
3189: [Exporters - Make-based] Force make exporter to search PATH for compilers ARMmbed#3189
3200: Using Popen for uVision and unifying the structure of the build function ARMmbed#3200
3075: nsapi - Add standardized return types for size and errors ARMmbed#3075
3221: u-blox odin w2 drivers update ARMmbed#3221
@mmahadevan108 mmahadevan108 deleted the USB_Updates branch November 23, 2016 13:50
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.

5 participants