Commit Graph

160 Commits (8340f5041a3887193d536f3632b2a80b3e7008c6)

Author SHA1 Message Date
Russ Butler f0b9add71e Fix clearing of ISTAT in Kinetis USB
The ISTAT register is write 1 to clear. Because of this ORing this
register with itself fill clear all bits that are set. This patch
updates the code to use plain assignment so only desired
bit is cleared.
2018-01-27 00:57:55 -06:00
Russ Butler 40125cf121 Remove use of deprecated attach in USB
Attach callbacks with the assignment operator rather than with the
deprecated attach function. This fixes deprecation warnings.

This patch also adds the ability to attach a Callback directly.
2018-01-27 00:57:55 -06:00
Russ Butler 3205901e99 Fix local static initialization in USB
The local static initialization in USB was causing multiple problems:
-Configurable descriptor values are set only once
-USB descriptor initialization causes a trap in debug builds since
 this is acquiring a mutex in an interrupt handler
-Extra ram used since all descriptors  are in RAM

This patch fixes these problems by making fixed descriptors
static const so they are stored in flash and never need to be
initialized and by making descriptors that do change a member
of the class so they are always initialized when requested
rather than once though lazy static local initialization.
2018-01-27 00:57:55 -06:00
bcostm a5598df4d7 Use RawSerial in MBED_11 test 2018-01-27 00:57:53 -06:00
Abdelhak Bougouffa 9c464a0338 Add checking for MAX_HUB_NB in a part of code that depend on MAX_HUB_NB 2018-01-27 00:57:44 -06:00
Abdelhak Bougouffa 597633d445 Replace the old deprecated callbacks 2018-01-27 00:57:44 -06:00
Russ Butler 379daa653d Fix LPC17XX and LPC40XX USB data throttling
Only clear the USB read buffer when endpointRead is called. This
allows data to be read with endpointReadResult without also allowing
USB to transfer more data. Instead additional data is transferred explicitly
with a call to endpointRead.
2018-01-27 00:57:43 -06:00
Russ Butler 183526bc04 Fix LPC17XX and LPC40XX USB race condition
If a SETUP packet arrives shortly after an IN then the packets will be
processed in the wrong order - SETUP first then IN. This causes
the subsequent control transfer to fail. Fix this problem by processing
IN packets before processing SETUP packets.
2018-01-27 00:57:43 -06:00
Russ Butler 09bb1c4919 Kinetis USB improvements and fixes
Make the following improvements and fixes:

1.
Update the Kinetis USB driver so that endpointReadResult only reads the
result of the last read and does not trigger a new read. Instead
move the code to trigger new reads into endpointRead.

2.
Fix the race condition in controlIn caused by a call to
EP0read() followed immediately by  EP0readStage(). This is done by
setting up to read the next setup packet (ignoring the status stage)
in endpointReadResult rather than in EP0readStage. This makes the
function EP0readStage unnecissary.

3.
Remove the Kinetis workaround in controlOut in USBDevice.cpp since
point 2 fixes this bug. For more info on this see the PR which
added this workaround - https://github.com/ARMmbed/mbed-os/pull/414
2018-01-27 00:57:43 -06:00
Adam Heinrich 1ca129ae54 NUCLEO_F413ZH: Add support for the NUCLEO-F413ZH board
Merged from the existing TARGET_DISCO_F413ZH code (which has the same MCU)
and TARGET_NUCLEO_F412ZG code (which has the same Nucleo-144 board and
pinout).
2018-01-12 15:01:47 +00:00
bcostm 177c95b0e3 STM32 USBHOST: Remove DISCO_F429ZI
Impossible to make USBHost working on this board.
Remove it for now until a fix is found.
2018-01-02 15:22:04 +00:00
bcostm 1fb7102cb1 STM32 USBHOST: Corrections for DISCO_F746NG 2018-01-02 15:22:04 +00:00
bcostm 3b795ba499 STM32 USBHOST: Corrections for DISCO_F429ZI 2018-01-02 15:22:04 +00:00
bcostm 791f669024 STM32 USBHOST: Add support of DISCO_F469NI and DISCO_F769NI 2018-01-02 15:22:04 +00:00
bcostm 7059a264bb STM32 USBHOST: Add support of DISCO_F413ZH 2018-01-02 15:22:04 +00:00
bcostm d9e9882fe6 STM32 USBHost: Improvements in USBHALHost_STM.h 2018-01-02 15:22:04 +00:00
bcostm ea842b718e STM32 USBHost: Remove USBHALHost_STM_TARGET.h files
These files are replaced by the USBHALHost_STM.h file common to all boards.
2018-01-02 15:22:04 +00:00
bcostm db43173952 STM32 USBHost: rename files
The USBHALHost_STM_144_64pins.h has been renamed in USBHALHost_STM.h

All the configuration is done in this file now for Nucleo and Disco boards
2018-01-02 15:22:04 +00:00
bcostm a19520ab1c STM32: Add USB Device on DISCO_F413ZH 2017-12-20 16:05:42 +00:00
Steven Cooreman f195f5bf17 Remove usage from USB driver as well 2017-12-20 16:05:42 +00:00
Martin Kojtal 221b8a84b1
Merge pull request #5580 from bcostm/dev_usb_speed_disco-f746ng
DISCO_F746NG: add usp_speed configuration
2017-11-30 18:09:47 +00:00
Steven Cooreman 2becfbe2e4 Convert USB library from em_int to em_core 2017-11-25 13:03:40 +01:00
bcostm b1073c165f DISCO_F746NG: add usp_speed config 2017-11-24 16:52:59 +01:00
bcostm dc9eab795e STM32 USBDevice: Add DISCO_F429ZI 2017-11-17 13:10:52 +01:00
Bartek Szatkowski 6e11dc2c4a Modification to arm_math.h
Remove redefinition of __CLZ and __SSAT.
2017-11-10 09:53:42 +00:00
bcostm 8f4b6e241d STM32 USBDevice: Add DISCO_F407VG target 2017-09-05 14:08:52 +02:00
bcostm 9e3b509a99 STM32 USBDevice: Add NUCLEO_F446RE target 2017-09-05 14:08:52 +02:00
bcostm 1d72b3124d STM32 USBDevice: Remove disco-f429zi, clean-up nucleo-f103rb 2017-09-05 13:24:32 +02:00
bcostm 211d2011eb STM32 USBDevice: add more supported targets 2017-09-05 13:24:32 +02:00
bcostm 58c9f4b9bd STM32 USBDevice: refactor files 2017-09-05 13:24:32 +02:00
ccli8 d22d086a87 [M487] Add SPI pins for test code 2017-08-22 11:00:29 +08:00
ccli8 478a1b62ea [NUC472/M453] Support USB device/host for chip series
With this fix, USB support is not limited to one target.
2017-08-22 09:30:23 +08:00
ccli8 cacc444b73 [M487] Support USB device/host 2017-08-22 09:27:31 +08:00
bcostm 6b721d345a DISCO_L475VG_IOT01A: Add support of USBHost 2017-08-04 13:19:13 +02:00
jeromecoutant bdd4f18acb ST USB config files 2017-07-11 16:29:44 +02:00
Mihail Stoyanov 717150cdf2 Reorganize vendor specific code into targets folders, following the mbed-os/targets/ design pattern 2017-06-27 14:20:36 -05:00
Jimmy Brisson 453d9ee96c Deduplicate USBHAL_STM_TARGET.h 2017-06-26 14:55:29 -05:00
Jimmy Brisson d103979e92 Merge pull request #4572 from bcostm/add_usb_disco_l072cz
DISCO_L072CZ_LRWAN1: Add support of USB Device
2017-06-26 10:28:31 -05:00
Jimmy Brisson 1dfc2296a7 Merge pull request #4400 from jeromecoutant/PR_USB_REORG
STM32 USBDevice files
2017-06-26 10:21:19 -05:00
bcostm 43646330e9 DISCO_F413ZH: Add this board in mbedOS2 CAN tests 2017-06-22 09:23:06 +02:00
arostm 5e3350ce38 DISCO_F413ZH: Modification needed to build 2017-06-22 09:07:00 +02:00
bcostm cc47104059 DISCO_L072CZ_LRWAN1: Remove unused code 2017-06-20 16:12:32 +02:00
bcostm 24d94c8425 DISCO_L072CZ_LRWAN1: Add USB device configuration files 2017-06-20 16:07:07 +02:00
bcostm f6a48838ad DISCO_L475VG_IOT01A: Move USB device config files 2017-06-12 17:03:12 +02:00
bcostm 6c585e6e05 DISCO_L475VG_IOT01A: add this target in i2c master/slave tests 2017-06-12 17:03:12 +02:00
bcostm 8c7000cce4 Add "01A" suffix in target name 2017-06-12 17:03:12 +02:00
bcostm 9ced451307 Add target in unsupported main.cpp test files 2017-06-12 17:03:12 +02:00
Mahadevan Mahesh 30ef311933 Issue#4250: Fix USB driver for Kinetis devices
Move memory allocation to be done at a different location. Currently allocated
in a function that is called from the interrupt handler.

Signed-off-by: Mahadevan Mahesh <Mahesh.Mahadevan@nxp.com>
2017-06-02 16:36:23 -05:00
jeromecoutant 2c610b392e Move STM32 USB device cpp file with other cpp files 2017-05-29 12:08:51 +02:00
jeromecoutant ba073da70a STM32 USBDevice : simplify include files
NB: there is now a default configuration
2017-05-29 12:08:48 +02:00