From c466db250c1f2254c44e1ca067a93f489dabf931 Mon Sep 17 00:00:00 2001 From: Diego Ismirlian Date: Tue, 8 Aug 2017 14:19:35 -0300 Subject: USBH: testhal example: improve support for multiple FAT devices --- os/various/fatfs_bindings/fatfs.mk | 2 +- os/various/fatfs_bindings/fatfs_devices.h | 59 ++++++++++++++++++++++++++++ os/various/fatfs_bindings/fatfs_diskio.c | 63 ++++++++---------------------- testhal/STM32/STM32F4xx/USB_HOST/halconf.h | 2 +- testhal/STM32/STM32F4xx/USB_HOST/main.c | 11 +++--- 5 files changed, 83 insertions(+), 54 deletions(-) create mode 100644 os/various/fatfs_bindings/fatfs_devices.h diff --git a/os/various/fatfs_bindings/fatfs.mk b/os/various/fatfs_bindings/fatfs.mk index 238037e..e3ab0c7 100644 --- a/os/various/fatfs_bindings/fatfs.mk +++ b/os/various/fatfs_bindings/fatfs.mk @@ -4,4 +4,4 @@ FATFSSRC = ${CHIBIOS_CONTRIB}/os/various/fatfs_bindings/fatfs_diskio.c \ ${CHIBIOS}/ext/fatfs/src/ff.c \ ${CHIBIOS}/ext/fatfs/src/option/unicode.c -FATFSINC = ${CHIBIOS}/ext/fatfs/src +FATFSINC = ${CHIBIOS}/ext/fatfs/src ${CHIBIOS_CONTRIB}/os/various/fatfs_bindings diff --git a/os/various/fatfs_bindings/fatfs_devices.h b/os/various/fatfs_bindings/fatfs_devices.h new file mode 100644 index 0000000..5ec05ca --- /dev/null +++ b/os/various/fatfs_bindings/fatfs_devices.h @@ -0,0 +1,59 @@ +/* + ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio + Copyright (C) 2015..2017 Diego Ismirlian, (dismirlian (at) google's mail) + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +#ifndef FATFS_DEVICES_H_ +#define FATFS_DEVICES_H_ + +#include "hal.h" + +#if HAL_USE_MMC_SPI && HAL_USE_SDC +#error "cannot specify both MMC_SPI and SDC drivers" +#endif + +#if HAL_USE_MMC_SPI +extern MMCDriver MMCD1; +#elif HAL_USE_SDC +extern SDCDriver SDCD1; +#elif HAL_USBH_USE_MSD + +#else +#error "MMC_SPI, SDC or USBH_MSD driver must be specified" +#endif + +/*-----------------------------------------------------------------------*/ +/* Correspondence between physical drive number and physical drive. */ +#if HAL_USE_MMC_SPI +#define FATFSDEV_MMC 0 +#define FATFSDEV_MMC_DRIVE "0:" +#endif + +#if HAL_USE_SDC +#define FATFSDEV_SDC 0 +#define FATFSDEV_SDC_DRIVE "0:" +#endif + +#if HAL_USBH_USE_MSD +#if defined(FATFSDEV_MMC) || defined(FATFSDEV_SDC) +#define FATFSDEV_MSDLUN0 1 +#define FATFSDEV_MSDLUN0_DRIVE "1:" +#else +#define FATFSDEV_MSDLUN0 0 +#define FATFSDEV_MSDLUN0_DRIVE "0:" +#endif +#endif + +#endif /* FATFS_DEVICES_H_ */ diff --git a/os/various/fatfs_bindings/fatfs_diskio.c b/os/various/fatfs_bindings/fatfs_diskio.c index 9fa41e2..f80c85c 100644 --- a/os/various/fatfs_bindings/fatfs_diskio.c +++ b/os/various/fatfs_bindings/fatfs_diskio.c @@ -9,38 +9,7 @@ #include "ffconf.h" #include "diskio.h" #include "usbh/dev/msd.h" - -#if HAL_USE_MMC_SPI && HAL_USE_SDC -#error "cannot specify both MMC_SPI and SDC drivers" -#endif - -#if HAL_USE_MMC_SPI -extern MMCDriver MMCD1; -#elif HAL_USE_SDC -extern SDCDriver SDCD1; -#elif HAL_USBH_USE_MSD - -#else -#error "MMC_SPI, SDC or USBH_MSD driver must be specified" -#endif - -/*-----------------------------------------------------------------------*/ -/* Correspondence between physical drive number and physical drive. */ -#if HAL_USE_MMC_SPI -#define MMC 0 -#endif - -#if HAL_USE_SDC -#define SDC 0 -#endif - -#if HAL_USBH_USE_MSD -#if defined(MMC) || defined(SDC) -#define MSDLUN0 1 -#else -#define MSDLUN0 0 -#endif -#endif +#include "fatfs_devices.h" /*-----------------------------------------------------------------------*/ /* Inidialize a Drive */ @@ -53,7 +22,7 @@ DSTATUS disk_initialize ( switch (pdrv) { #if HAL_USE_MMC_SPI - case MMC: + case FATFSDEV_MMC: stat = 0; /* It is initialized externally, just reads the status.*/ if (blkGetDriverState(&MMCD1) != BLK_READY) @@ -62,7 +31,7 @@ DSTATUS disk_initialize ( stat |= STA_PROTECT; return stat; #elif HAL_USE_SDC - case SDC: + case FATFSDEV_SDC: stat = 0; /* It is initialized externally, just reads the status.*/ if (blkGetDriverState(&SDCD1) != BLK_READY) @@ -72,7 +41,7 @@ DSTATUS disk_initialize ( return stat; #endif #if HAL_USBH_USE_MSD - case MSDLUN0: + case FATFSDEV_MSDLUN0: stat = 0; /* It is initialized externally, just reads the status.*/ if (blkGetDriverState(&MSBLKD[0]) != BLK_READY) @@ -96,7 +65,7 @@ DSTATUS disk_status ( switch (pdrv) { #if HAL_USE_MMC_SPI - case MMC: + case FATFSDEV_MMC: stat = 0; /* It is initialized externally, just reads the status.*/ if (blkGetDriverState(&MMCD1) != BLK_READY) @@ -105,7 +74,7 @@ DSTATUS disk_status ( stat |= STA_PROTECT; return stat; #elif HAL_USE_SDC - case SDC: + case FATFSDEV_SDC: stat = 0; /* It is initialized externally, just reads the status.*/ if (blkGetDriverState(&SDCD1) != BLK_READY) @@ -115,7 +84,7 @@ DSTATUS disk_status ( return stat; #endif #if HAL_USBH_USE_MSD - case MSDLUN0: + case FATFSDEV_MSDLUN0: stat = 0; /* It is initialized externally, just reads the status.*/ if (blkGetDriverState(&MSBLKD[0]) != BLK_READY) @@ -140,7 +109,7 @@ DRESULT disk_read ( { switch (pdrv) { #if HAL_USE_MMC_SPI - case MMC: + case FATFSDEV_MMC: if (blkGetDriverState(&MMCD1) != BLK_READY) return RES_NOTRDY; if (mmcStartSequentialRead(&MMCD1, sector)) @@ -155,7 +124,7 @@ DRESULT disk_read ( return RES_ERROR; return RES_OK; #elif HAL_USE_SDC - case SDC: + case FATFSDEV_SDC: if (blkGetDriverState(&SDCD1) != BLK_READY) return RES_NOTRDY; if (sdcRead(&SDCD1, sector, buff, count)) @@ -163,7 +132,7 @@ DRESULT disk_read ( return RES_OK; #endif #if HAL_USBH_USE_MSD - case MSDLUN0: + case FATFSDEV_MSDLUN0: /* It is initialized externally, just reads the status.*/ if (blkGetDriverState(&MSBLKD[0]) != BLK_READY) return RES_NOTRDY; @@ -189,7 +158,7 @@ DRESULT disk_write ( { switch (pdrv) { #if HAL_USE_MMC_SPI - case MMC: + case FATFSDEV_MMC: if (blkGetDriverState(&MMCD1) != BLK_READY) return RES_NOTRDY; if (mmcIsWriteProtected(&MMCD1)) @@ -206,7 +175,7 @@ DRESULT disk_write ( return RES_ERROR; return RES_OK; #elif HAL_USE_SDC - case SDC: + case FATFSDEV_SDC: if (blkGetDriverState(&SDCD1) != BLK_READY) return RES_NOTRDY; if (sdcWrite(&SDCD1, sector, buff, count)) @@ -214,7 +183,7 @@ DRESULT disk_write ( return RES_OK; #endif #if HAL_USBH_USE_MSD - case MSDLUN0: + case FATFSDEV_MSDLUN0: /* It is initialized externally, just reads the status.*/ if (blkGetDriverState(&MSBLKD[0]) != BLK_READY) return RES_NOTRDY; @@ -239,7 +208,7 @@ DRESULT disk_ioctl ( { switch (pdrv) { #if HAL_USE_MMC_SPI - case MMC: + case FATFSDEV_MMC: switch (cmd) { case CTRL_SYNC: return RES_OK; @@ -257,7 +226,7 @@ DRESULT disk_ioctl ( return RES_PARERR; } #elif HAL_USE_SDC - case SDC: + case FATFSDEV_SDC: switch (cmd) { case CTRL_SYNC: return RES_OK; @@ -282,7 +251,7 @@ DRESULT disk_ioctl ( } #endif #if HAL_USBH_USE_MSD - case MSDLUN0: + case FATFSDEV_MSDLUN0: switch (cmd) { case CTRL_SYNC: return RES_OK; diff --git a/testhal/STM32/STM32F4xx/USB_HOST/halconf.h b/testhal/STM32/STM32F4xx/USB_HOST/halconf.h index 1511a42..9ddbb1b 100644 --- a/testhal/STM32/STM32F4xx/USB_HOST/halconf.h +++ b/testhal/STM32/STM32F4xx/USB_HOST/halconf.h @@ -125,7 +125,7 @@ * @brief Enables the SDC subsystem. */ #if !defined(HAL_USE_SDC) || defined(__DOXYGEN__) -#define HAL_USE_SDC TRUE +#define HAL_USE_SDC FALSE #endif /** diff --git a/testhal/STM32/STM32F4xx/USB_HOST/main.c b/testhal/STM32/STM32F4xx/USB_HOST/main.c index c540233..a93a59e 100644 --- a/testhal/STM32/STM32F4xx/USB_HOST/main.c +++ b/testhal/STM32/STM32F4xx/USB_HOST/main.c @@ -297,6 +297,7 @@ start: #if HAL_USBH_USE_MSD #include "usbh/dev/msd.h" #include "ff.h" +#include "fatfs_devices.h" static FATFS MSDLUN0FS; @@ -388,14 +389,14 @@ start: usbDbgPuts("FS: Block driver ready, try mount..."); - res = f_mount(&MSDLUN0FS, "0:", 1); + res = f_mount(&MSDLUN0FS, FATFSDEV_MSDLUN0_DRIVE, 1); if (res != FR_OK) { usbDbgPuts("FS: Can't mount. Check file system."); continue; } usbDbgPuts("FS: Mounted."); - res = f_getfree("0:", &clusters, &fsp); + res = f_getfree(FATFSDEV_MSDLUN0_DRIVE, &clusters, &fsp); if (res != FR_OK) { usbDbgPuts("FS: f_getfree() failed"); continue; @@ -419,7 +420,7 @@ start: //write test if (1) { usbDbgPuts("FS: Write test (create file /test.dat, 1MB)"); - f_open(&file, "/test.dat", FA_CREATE_ALWAYS | FA_WRITE); + f_open(&file, FATFSDEV_MSDLUN0_DRIVE "/test.dat", FA_CREATE_ALWAYS | FA_WRITE); src = start; st = chVTGetSystemTime(); for (j = 0; j < 2048; j++) { @@ -439,7 +440,7 @@ start: //read test if (1) { usbDbgPuts("FS: Read test (read file /test.dat, 1MB, compare)"); - f_open(&file, "/test.dat", FA_READ); + f_open(&file, FATFSDEV_MSDLUN0_DRIVE "/test.dat", FA_READ); src = start; st = chVTGetSystemTime(); for (j = 0; j < 2048; j++) { @@ -463,7 +464,7 @@ start: //scan files test if (1) { usbDbgPuts("FS: Scan files test"); - fbuff[0] = 0; + strcpy(fbuff, FATFSDEV_MSDLUN0_DRIVE); scan_files(chp, (char *)fbuff); } } -- cgit v1.2.3 From 354313f408db8f979cd729a19e80ede3a1c83283 Mon Sep 17 00:00:00 2001 From: Axoloti Date: Tue, 12 Sep 2017 11:41:38 +0200 Subject: allow enabling IAD without UVC --- os/hal/include/hal_usbh.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/os/hal/include/hal_usbh.h b/os/hal/include/hal_usbh.h index 1ed6416..7ff8de0 100644 --- a/os/hal/include/hal_usbh.h +++ b/os/hal/include/hal_usbh.h @@ -52,7 +52,9 @@ #define HAL_USBH_USE_ADDITIONAL_CLASS_DRIVERS FALSE #endif +#ifndef HAL_USBH_USE_IAD #define HAL_USBH_USE_IAD HAL_USBH_USE_UVC +#endif #if (HAL_USE_USBH == TRUE) || defined(__DOXYGEN__) -- cgit v1.2.3 From d2269527b744e0ab249d38663436613158b0a282 Mon Sep 17 00:00:00 2001 From: Mark Harris Date: Tue, 12 Sep 2017 16:55:01 +0200 Subject: implement ptxfe_int for outbound INT ep --- os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c | 18 +++++++++++++++--- os/hal/src/hal_usbh.c | 2 +- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c b/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c index 4723508..05054d0 100644 --- a/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c +++ b/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c @@ -1172,9 +1172,21 @@ static inline void _nptxfe_int(USBHDriver *host) { } static inline void _ptxfe_int(USBHDriver *host) { - //TODO: implement - (void)host; - uinfo("PTXFE"); + // //TODO: implement + // (void)host; + // uinfo("PTXFE"); + + uint32_t rem; + stm32_otg_t *const otg = host->otg; + + rem = _write_packet(&host->ep_active_lists[USBH_EPTYPE_CTRL], + otg->HNPTXSTS & HPTXSTS_PTXFSAVL_MASK); + + rem += _write_packet(&host->ep_active_lists[USBH_EPTYPE_INT], + otg->HNPTXSTS & HPTXSTS_PTXFSAVL_MASK); + + if (!rem) + otg->GINTMSK &= ~GINTMSK_PTXFEM; } static void _disable(USBHDriver *host) { diff --git a/os/hal/src/hal_usbh.c b/os/hal/src/hal_usbh.c index 7dff98a..10c5c03 100644 --- a/os/hal/src/hal_usbh.c +++ b/os/hal/src/hal_usbh.c @@ -338,7 +338,7 @@ usbh_urbstatus_t usbhBulkTransfer(usbh_ep_t *ep, osalDbgCheck(ep != NULL); osalDbgCheck((data != NULL) || (len == 0)); - osalDbgAssert(ep->type == USBH_EPTYPE_BULK, "wrong ep"); + // osalDbgAssert(ep->type == USBH_EPTYPE_BULK, "wrong ep"); usbh_urb_t urb; usbhURBObjectInit(&urb, ep, 0, 0, data, len); -- cgit v1.2.3 From f5f3c8ffdb666682868c0280995f2a5fb8c62aa3 Mon Sep 17 00:00:00 2001 From: Mark Harris Date: Thu, 14 Sep 2017 14:41:28 +0200 Subject: usbh:_ptxfe_int, use HPTXSTS, introduce usbhSyncrhonousTransfer --- os/hal/include/hal_usbh.h | 6 ++++++ os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c | 10 +++------- os/hal/src/hal_usbh.c | 11 ++++++++++- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/os/hal/include/hal_usbh.h b/os/hal/include/hal_usbh.h index 7ff8de0..9e31096 100644 --- a/os/hal/include/hal_usbh.h +++ b/os/hal/include/hal_usbh.h @@ -301,6 +301,12 @@ extern "C" { } /* Synchronous API */ + usbh_urbstatus_t usbhSyncrhonousTransfer(usbh_ep_t *ep, + void *data, + uint32_t len, + uint32_t *actual_len, + systime_t timeout); + usbh_urbstatus_t usbhBulkTransfer(usbh_ep_t *ep, void *data, uint32_t len, diff --git a/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c b/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c index 05054d0..0403eae 100644 --- a/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c +++ b/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c @@ -1172,18 +1172,14 @@ static inline void _nptxfe_int(USBHDriver *host) { } static inline void _ptxfe_int(USBHDriver *host) { - // //TODO: implement - // (void)host; - // uinfo("PTXFE"); - uint32_t rem; stm32_otg_t *const otg = host->otg; - rem = _write_packet(&host->ep_active_lists[USBH_EPTYPE_CTRL], - otg->HNPTXSTS & HPTXSTS_PTXFSAVL_MASK); + rem = _write_packet(&host->ep_active_lists[USBH_EPTYPE_ISO], + otg->HPTXSTS & HPTXSTS_PTXFSAVL_MASK); rem += _write_packet(&host->ep_active_lists[USBH_EPTYPE_INT], - otg->HNPTXSTS & HPTXSTS_PTXFSAVL_MASK); + otg->HPTXSTS & HPTXSTS_PTXFSAVL_MASK); if (!rem) otg->GINTMSK &= ~GINTMSK_PTXFEM; diff --git a/os/hal/src/hal_usbh.c b/os/hal/src/hal_usbh.c index 10c5c03..a7ceedf 100644 --- a/os/hal/src/hal_usbh.c +++ b/os/hal/src/hal_usbh.c @@ -335,10 +335,19 @@ usbh_urbstatus_t usbhBulkTransfer(usbh_ep_t *ep, uint32_t len, uint32_t *actual_len, systime_t timeout) { + osalDbgAssert(ep->type == USBH_EPTYPE_BULK, "wrong ep"); + + return usbhSyncrhonousTransfer(ep,data,len,actual_len,timeout); +} + +usbh_urbstatus_t usbhSyncrhonousTransfer(usbh_ep_t *ep, + void *data, + uint32_t len, + uint32_t *actual_len, + systime_t timeout) { osalDbgCheck(ep != NULL); osalDbgCheck((data != NULL) || (len == 0)); - // osalDbgAssert(ep->type == USBH_EPTYPE_BULK, "wrong ep"); usbh_urb_t urb; usbhURBObjectInit(&urb, ep, 0, 0, data, len); -- cgit v1.2.3 From 741459ac27f9efb158ff28860c5d8e9affb87b68 Mon Sep 17 00:00:00 2001 From: Mark Harris Date: Thu, 14 Sep 2017 17:36:21 +0200 Subject: usbh:correct spelling of usbhSynchronousTransfer --- os/hal/include/hal_usbh.h | 2 +- os/hal/src/hal_usbh.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/os/hal/include/hal_usbh.h b/os/hal/include/hal_usbh.h index 9e31096..6a6be21 100644 --- a/os/hal/include/hal_usbh.h +++ b/os/hal/include/hal_usbh.h @@ -301,7 +301,7 @@ extern "C" { } /* Synchronous API */ - usbh_urbstatus_t usbhSyncrhonousTransfer(usbh_ep_t *ep, + usbh_urbstatus_t usbhSynchronousTransfer(usbh_ep_t *ep, void *data, uint32_t len, uint32_t *actual_len, diff --git a/os/hal/src/hal_usbh.c b/os/hal/src/hal_usbh.c index a7ceedf..3949c68 100644 --- a/os/hal/src/hal_usbh.c +++ b/os/hal/src/hal_usbh.c @@ -337,10 +337,10 @@ usbh_urbstatus_t usbhBulkTransfer(usbh_ep_t *ep, systime_t timeout) { osalDbgAssert(ep->type == USBH_EPTYPE_BULK, "wrong ep"); - return usbhSyncrhonousTransfer(ep,data,len,actual_len,timeout); + return usbhSynchronousTransfer(ep,data,len,actual_len,timeout); } -usbh_urbstatus_t usbhSyncrhonousTransfer(usbh_ep_t *ep, +usbh_urbstatus_t usbhSynchronousTransfer(usbh_ep_t *ep, void *data, uint32_t len, uint32_t *actual_len, -- cgit v1.2.3 From c1e174b5b2a1bae962d9a0fca1a5916f20c9e816 Mon Sep 17 00:00:00 2001 From: Diego Ismirlian Date: Sun, 29 Oct 2017 17:39:56 -0300 Subject: USBH: testhal: fix compile warning --- testhal/STM32/STM32F4xx/USB_HOST/.project | 4 ++-- testhal/STM32/STM32F4xx/USB_HOST/main.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/testhal/STM32/STM32F4xx/USB_HOST/.project b/testhal/STM32/STM32F4xx/USB_HOST/.project index 066a4d6..e2dd63e 100644 --- a/testhal/STM32/STM32F4xx/USB_HOST/.project +++ b/testhal/STM32/STM32F4xx/USB_HOST/.project @@ -31,9 +31,9 @@ $%7BPARENT-5-PROJECT_LOC%7D/ChibiOS-contrib/os - ChibiOS-RT-os + ChibiOS-RT 2 - $%7BPARENT-5-PROJECT_LOC%7D/ChibiOS-RT/os + $%7BPARENT-5-PROJECT_LOC%7D/ChibiOS-RT diff --git a/testhal/STM32/STM32F4xx/USB_HOST/main.c b/testhal/STM32/STM32F4xx/USB_HOST/main.c index a93a59e..6bc859e 100644 --- a/testhal/STM32/STM32F4xx/USB_HOST/main.c +++ b/testhal/STM32/STM32F4xx/USB_HOST/main.c @@ -464,7 +464,7 @@ start: //scan files test if (1) { usbDbgPuts("FS: Scan files test"); - strcpy(fbuff, FATFSDEV_MSDLUN0_DRIVE); + strcpy((char *)fbuff, FATFSDEV_MSDLUN0_DRIVE); scan_files(chp, (char *)fbuff); } } -- cgit v1.2.3 From 06af5833ed2253ff1334e0143692657085acf04c Mon Sep 17 00:00:00 2001 From: Diego Ismirlian Date: Sun, 29 Oct 2017 17:41:30 -0300 Subject: USBH: main driver: implement usbhBulkTransfer as inline function --- os/hal/include/hal_usbh.h | 9 +++++++-- os/hal/src/hal_usbh.c | 10 ---------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/os/hal/include/hal_usbh.h b/os/hal/include/hal_usbh.h index 6a6be21..8d9a85b 100644 --- a/os/hal/include/hal_usbh.h +++ b/os/hal/include/hal_usbh.h @@ -307,11 +307,16 @@ extern "C" { uint32_t *actual_len, systime_t timeout); - usbh_urbstatus_t usbhBulkTransfer(usbh_ep_t *ep, + static inline usbh_urbstatus_t usbhBulkTransfer(usbh_ep_t *ep, void *data, uint32_t len, uint32_t *actual_len, - systime_t timeout); + systime_t timeout) { + osalDbgAssert(ep->type == USBH_EPTYPE_BULK, "wrong ep"); + + return usbhSynchronousTransfer(ep, data, len, actual_len, timeout); + } + usbh_urbstatus_t usbhControlRequest(usbh_device_t *dev, uint8_t bmRequestType, uint8_t bRequest, diff --git a/os/hal/src/hal_usbh.c b/os/hal/src/hal_usbh.c index 3949c68..f9f4687 100644 --- a/os/hal/src/hal_usbh.c +++ b/os/hal/src/hal_usbh.c @@ -330,16 +330,6 @@ void _usbh_urb_completeI(usbh_urb_t *urb, usbh_urbstatus_t status) { /* Synchronous API. */ /*===========================================================================*/ -usbh_urbstatus_t usbhBulkTransfer(usbh_ep_t *ep, - void *data, - uint32_t len, - uint32_t *actual_len, - systime_t timeout) { - osalDbgAssert(ep->type == USBH_EPTYPE_BULK, "wrong ep"); - - return usbhSynchronousTransfer(ep,data,len,actual_len,timeout); -} - usbh_urbstatus_t usbhSynchronousTransfer(usbh_ep_t *ep, void *data, uint32_t len, -- cgit v1.2.3 From decde2ca4c21220f6daab0880de08cd974dd62ef Mon Sep 17 00:00:00 2001 From: Diego Ismirlian Date: Sun, 29 Oct 2017 17:43:27 -0300 Subject: USBH: silence compiler warning --- os/various/fatfs_bindings/fatfs_diskio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/os/various/fatfs_bindings/fatfs_diskio.c b/os/various/fatfs_bindings/fatfs_diskio.c index f80c85c..85b07df 100644 --- a/os/various/fatfs_bindings/fatfs_diskio.c +++ b/os/various/fatfs_bindings/fatfs_diskio.c @@ -206,6 +206,7 @@ DRESULT disk_ioctl ( void *buff /* Buffer to send/receive control data */ ) { + (void)buff; switch (pdrv) { #if HAL_USE_MMC_SPI case FATFSDEV_MMC: -- cgit v1.2.3 From 61dfc26804aba33384ff57876f76b3f9031eb7c2 Mon Sep 17 00:00:00 2001 From: Diego Ismirlian Date: Sun, 19 Nov 2017 21:17:56 -0300 Subject: USBH: improve disconnection detection; added a necessary reschedule. --- os/hal/src/hal_usbh.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/os/hal/src/hal_usbh.c b/os/hal/src/hal_usbh.c index f9f4687..78ac837 100644 --- a/os/hal/src/hal_usbh.c +++ b/os/hal/src/hal_usbh.c @@ -302,6 +302,7 @@ msg_t usbhURBSubmitAndWaitS(usbh_urb_t *urb, systime_t timeout) { _check_urb(urb); usbhURBSubmitI(urb); + osalOsRescheduleS(); /* This call is necessary because usbhURBSubmitI may require a reschedule */ ret = usbhURBWaitTimeoutS(urb, timeout); if (ret == MSG_TIMEOUT) _usbh_urb_abort_and_waitS(urb, USBH_URBSTATUS_TIMEOUT); @@ -859,9 +860,7 @@ static void _port_process_status_change(usbh_port_t *port) { usbhhubClearFeaturePort(port, USBH_PORT_FEAT_C_CONNECTION); if (port->device.status != USBH_DEVSTATUS_DISCONNECTED) { - if (!(port->status & USBH_PORTSTATUS_CONNECTION)) { - _usbh_port_disconnected(port); - } + _usbh_port_disconnected(port); } } -- cgit v1.2.3 From dbaa1b87001d7c0c1e7970b66304011e7538c457 Mon Sep 17 00:00:00 2001 From: Diego Ismirlian Date: Sun, 19 Nov 2017 21:20:57 -0300 Subject: USBH: AOA: Various improvements --- os/hal/src/usbh/hal_usbh_aoa.c | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/os/hal/src/usbh/hal_usbh_aoa.c b/os/hal/src/usbh/hal_usbh_aoa.c index 85c3130..cb3fd18 100644 --- a/os/hal/src/usbh/hal_usbh_aoa.c +++ b/os/hal/src/usbh/hal_usbh_aoa.c @@ -161,6 +161,11 @@ static usbh_baseclassdriver_t *_aoa_load(usbh_device_t *dev, const uint8_t *desc } }; + if (descriptor[1] != USBH_DT_DEVICE) { + uinfo("AOA: Won't try to detect Android device at interface level"); + return NULL; + } + uinfo("AOA: Unrecognized VID"); #if defined(HAL_USBHAOA_FILTER_CALLBACK) @@ -171,6 +176,7 @@ static usbh_baseclassdriver_t *_aoa_load(usbh_device_t *dev, const uint8_t *desc uinfo("AOA: Try if it's an Android device"); if (_get_protocol(dev, &protocol) != HAL_SUCCESS) { + uinfo("AOA: not an Android device"); return NULL; } uinfof("AOA: Possible Android device found (protocol=%d)", protocol); @@ -196,6 +202,8 @@ static usbh_baseclassdriver_t *_aoa_load(usbh_device_t *dev, const uint8_t *desc if (_accessory_start(dev) != HAL_SUCCESS) { uerr("AOA: Can't start accessory; abort channel start"); + } else { + uinfo("AOA: Accessory started"); } return NULL; @@ -320,7 +328,7 @@ static void _out_cb(usbh_urb_t *urb) { return; case USBH_URBSTATUS_DISCONNECTED: uwarn("AOA: URB OUT disconnected"); - chThdDequeueNextI(&aoacp->oq_waiting, Q_RESET); + chThdDequeueAllI(&aoacp->oq_waiting, Q_RESET); chnAddFlagsI(aoacp, CHN_OUTPUT_EMPTY); return; default: @@ -419,7 +427,10 @@ static void _in_cb(usbh_urb_t *urb) { break; case USBH_URBSTATUS_DISCONNECTED: uwarn("AOA: URB IN disconnected"); - chThdDequeueNextI(&aoacp->iq_waiting, Q_RESET); + chThdDequeueAllI(&aoacp->iq_waiting, Q_RESET); + chnAddFlagsI(aoacp, CHN_DISCONNECTED); + aoacp->state = USBHAOA_CHANNEL_STATE_ACTIVE; + container_of(aoacp, USBHAOADriver, channel)->state = USBHAOA_STATE_ACTIVE; break; default: uerrf("AOA: URB IN status unexpected = %d", urb->status); @@ -526,14 +537,16 @@ static void _stop_channelS(USBHAOAChannel *aoacp) { static void _vt(void *p) { USBHAOAChannel *const aoacp = (USBHAOAChannel *)p; osalSysLockFromISR(); - uint32_t len = aoacp->oq_ptr - aoacp->oq_buff; - if (len && !usbhURBIsBusy(&aoacp->oq_urb)) { - _submitOutI(aoacp, len); - } - if ((aoacp->iq_counter == 0) && !usbhURBIsBusy(&aoacp->iq_urb)) { - _submitInI(aoacp); + if (aoacp->state == USBHAOA_CHANNEL_STATE_READY) { + uint32_t len = aoacp->oq_ptr - aoacp->oq_buff; + if (len && !usbhURBIsBusy(&aoacp->oq_urb)) { + _submitOutI(aoacp, len); + } + if ((aoacp->iq_counter == 0) && !usbhURBIsBusy(&aoacp->iq_urb)) { + _submitInI(aoacp); + } + chVTSetI(&aoacp->vt, MS2ST(16), _vt, aoacp); } - chVTSetI(&aoacp->vt, MS2ST(16), _vt, aoacp); osalSysUnlockFromISR(); } -- cgit v1.2.3 From 03615f40dc3d1cbb5354035c326963b49759f440 Mon Sep 17 00:00:00 2001 From: Diego Ismirlian Date: Mon, 4 Dec 2017 13:11:16 -0300 Subject: USBH: debug improvements --- os/hal/src/usbh/hal_usbh_debug.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/os/hal/src/usbh/hal_usbh_debug.c b/os/hal/src/usbh/hal_usbh_debug.c index d32f1c6..85c6640 100644 --- a/os/hal/src/usbh/hal_usbh_debug.c +++ b/os/hal/src/usbh/hal_usbh_debug.c @@ -22,7 +22,13 @@ #include "ch.h" #include "usbh/debug.h" #include +#if 0 +#include "debug.h" +#else #include "chprintf.h" +#define dbg_lock() +#define dbg_unlock() +#endif #define MAX_FILLER 11 #define FLOAT_PRECISION 9 @@ -393,6 +399,9 @@ void usbDbgPrintf(const char *fmt, ...) chThdDequeueNextI(&USBH_DEBUG_USBHD.iq.q_waiting, Q_OK); } chSysRestoreStatusX(sts); + if (!port_is_isr_context() && chSchIsPreemptionRequired()) { + chSchRescheduleS(); + } va_end(ap); } @@ -422,6 +431,9 @@ void usbDbgPuts(const char *s) chThdDequeueNextI(&USBH_DEBUG_USBHD.iq.q_waiting, Q_OK); } chSysRestoreStatusX(sts); + if (!port_is_isr_context() && chSchIsPreemptionRequired()) { + chSchRescheduleS(); + } } void usbDbgReset(void) { @@ -435,6 +447,9 @@ void usbDbgReset(void) { USBH_DEBUG_SD.oqueue.q_counter--; } chSysRestoreStatusX(sts); + if (!port_is_isr_context() && chSchIsPreemptionRequired()) { + chSchRescheduleS(); + } } static int _get(void) { @@ -527,6 +542,7 @@ static void usb_debug_thread(void *arg) { uint32_t f = hfnum & 0xffff; uint32_t p = 1000 - ((hfnum >> 16) / (hfir / 1000)); + dbg_lock(); chprintf((BaseSequentialStream *)&USBH_DEBUG_SD, "%05d.%03d ", f, p); state = 4; } else if (state == 3) { @@ -543,6 +559,7 @@ static void usb_debug_thread(void *arg) { c = iqGet(&host->iq); if (c < 0) goto reset; t |= c << 24; + dbg_lock(); chprintf((BaseSequentialStream *)&USBH_DEBUG_SD, "+%08d ", t); state = 4; } else { @@ -550,8 +567,7 @@ static void usb_debug_thread(void *arg) { if (!c) { sdPut(&USBH_DEBUG_SD, '\r'); sdPut(&USBH_DEBUG_SD, '\n'); - state = 0; - break; + goto reset; } sdPut(&USBH_DEBUG_SD, (uint8_t)c); c = iqGet(&host->iq); if (c < 0) goto reset; @@ -560,6 +576,9 @@ static void usb_debug_thread(void *arg) { continue; reset: + if (state == 4) { + dbg_unlock(); + } state = 0; } } -- cgit v1.2.3 From 2a9d939d72a8c22d248450107b26e25506d42160 Mon Sep 17 00:00:00 2001 From: Paul Roukema Date: Sun, 5 Aug 2018 23:59:06 -0400 Subject: Fix incompatible USBH VMTs --- os/hal/src/usbh/hal_usbh_aoa.c | 4 +++- os/hal/src/usbh/hal_usbh_ftdi.c | 5 ++++- os/hal/src/usbh/hal_usbh_msd.c | 1 + 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/os/hal/src/usbh/hal_usbh_aoa.c b/os/hal/src/usbh/hal_usbh_aoa.c index d565595..c2a7646 100644 --- a/os/hal/src/usbh/hal_usbh_aoa.c +++ b/os/hal/src/usbh/hal_usbh_aoa.c @@ -499,6 +499,7 @@ static size_t _read(USBHAOAChannel *aoacp, uint8_t *bp, size_t n) { } static const struct AOADriverVMT async_channel_vmt = { + (size_t) 0, (size_t (*)(void *, const uint8_t *, size_t))_write, (size_t (*)(void *, uint8_t *, size_t))_read, (msg_t (*)(void *, uint8_t))_put, @@ -506,7 +507,8 @@ static const struct AOADriverVMT async_channel_vmt = { (msg_t (*)(void *, uint8_t, systime_t))_put_timeout, (msg_t (*)(void *, systime_t))_get_timeout, (size_t (*)(void *, const uint8_t *, size_t, systime_t))_write_timeout, - (size_t (*)(void *, uint8_t *, size_t, systime_t))_read_timeout + (size_t (*)(void *, uint8_t *, size_t, systime_t))_read_timeout, + (void*) 0 // FIXME: Implement CTL }; static void _stop_channelS(USBHAOAChannel *aoacp) { diff --git a/os/hal/src/usbh/hal_usbh_ftdi.c b/os/hal/src/usbh/hal_usbh_ftdi.c index 6966028..070dbcf 100644 --- a/os/hal/src/usbh/hal_usbh_ftdi.c +++ b/os/hal/src/usbh/hal_usbh_ftdi.c @@ -150,6 +150,7 @@ alloc_ok: case 0x900: //232H; uinfo("FTDI: Type H chip"); ftdip->type = USBHFTDI_TYPE_H; + break; default: uerr("FTDI: Unrecognized chip type"); return NULL; @@ -615,6 +616,7 @@ static void _vt(void *p) { } static const struct FTDIPortDriverVMT async_channel_vmt = { + (size_t) 0, (size_t (*)(void *, const uint8_t *, size_t))_write, (size_t (*)(void *, uint8_t *, size_t))_read, (msg_t (*)(void *, uint8_t))_put, @@ -622,7 +624,8 @@ static const struct FTDIPortDriverVMT async_channel_vmt = { (msg_t (*)(void *, uint8_t, systime_t))_put_timeout, (msg_t (*)(void *, systime_t))_get_timeout, (size_t (*)(void *, const uint8_t *, size_t, systime_t))_write_timeout, - (size_t (*)(void *, uint8_t *, size_t, systime_t))_read_timeout + (size_t (*)(void *, uint8_t *, size_t, systime_t))_read_timeout, + (void*) 0 // FIXME: Implement CTL }; diff --git a/os/hal/src/usbh/hal_usbh_msd.c b/os/hal/src/usbh/hal_usbh_msd.c index 7233a0b..fe97ff0 100644 --- a/os/hal/src/usbh/hal_usbh_msd.c +++ b/os/hal/src/usbh/hal_usbh_msd.c @@ -683,6 +683,7 @@ static msd_result_t scsi_write10(USBHMassStorageLUNDriver *lunp, uint32_t lba, u USBHMassStorageLUNDriver MSBLKD[HAL_USBHMSD_MAX_LUNS]; static const struct USBHMassStorageDriverVMT blk_vmt = { + (size_t)0, (bool (*)(void *))usbhmsdLUNIsInserted, (bool (*)(void *))usbhmsdLUNIsProtected, (bool (*)(void *))usbhmsdLUNConnect, -- cgit v1.2.3 From 9692d1b7ae9f5f9d9c1520381fb3edcee131c3ee Mon Sep 17 00:00:00 2001 From: Paul Roukema Date: Sun, 5 Aug 2018 23:59:28 -0400 Subject: Update USB_HOST testhal project for latest ChibiOS --- testhal/STM32/STM32F4xx/USB_HOST/Makefile | 27 +++++++++++---------------- testhal/STM32/STM32F4xx/USB_HOST/chconf.h | 2 +- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/testhal/STM32/STM32F4xx/USB_HOST/Makefile b/testhal/STM32/STM32F4xx/USB_HOST/Makefile index a29150e..7bd8ea1 100644 --- a/testhal/STM32/STM32F4xx/USB_HOST/Makefile +++ b/testhal/STM32/STM32F4xx/USB_HOST/Makefile @@ -30,7 +30,7 @@ endif # Enable this if you want link time optimizations (LTO) ifeq ($(USE_LTO),) - USE_LTO = yes + USE_LTO = no endif # If enabled, this option allows to compile the application in THUMB mode. @@ -88,6 +88,9 @@ PROJECT = ch # Imported source files and paths CHIBIOS = ../../../../../ChibiOS-RT CHIBIOS_CONTRIB = $(CHIBIOS)/../ChibiOS-Contrib + +# Licensing files. +include $(CHIBIOS)/os/license/license.mk # Startup files. include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f4xx.mk # HAL-OSAL files (optional). @@ -98,6 +101,8 @@ include $(CHIBIOS)/os/hal/osal/rt/osal.mk # RTOS files (optional). include $(CHIBIOS)/os/rt/rt.mk include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk +# Auto-build files in ./source recursively. +include $(CHIBIOS)/tools/mk/autobuild.mk # Other files (optional). include $(CHIBIOS)/test/lib/test.mk include $(CHIBIOS)/test/rt/rt_test.mk @@ -111,17 +116,9 @@ LDSCRIPT= $(STARTUPLD)/STM32F407xG.ld # C sources that can be compiled in ARM or THUMB mode depending on the global # setting. -CSRC = $(STARTUPSRC) \ - $(KERNSRC) \ - $(PORTSRC) \ - $(OSALSRC) \ - $(HALSRC) \ - $(PLATFORMSRC) \ - $(BOARDSRC) \ - $(TESTSRC) \ +CSRC = $(ALLCSRC) \ + $(TESTSRC) \ $(FATFSSRC) \ - $(STREAMSSRC) \ - $(SHELLSRC) \ main.c usbh_custom_class_example.c # C++ sources that can be compiled in ARM or THUMB mode depending on the global @@ -152,10 +149,7 @@ TCPPSRC = ASMSRC = ASMXSRC = $(STARTUPASM) $(PORTASM) $(OSALASM) -INCDIR = $(CHIBIOS)/os/license \ - $(STARTUPINC) $(KERNINC) $(PORTINC) $(OSALINC) \ - $(HALINC) $(PLATFORMINC) $(BOARDINC) $(TESTINC) \ - $(STREAMSINC) $(SHELLINC) $(FATFSINC) \ +INCDIR = $(ALLINC) $(TESTINC) $(FATFSINC) \ $(CHIBIOS_CONTRIB)/os/various # @@ -224,5 +218,6 @@ ULIBS = # End of user defines ############################################################################## -RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC +RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk +include $(RULESPATH)/arm-none-eabi.mk include $(RULESPATH)/rules.mk diff --git a/testhal/STM32/STM32F4xx/USB_HOST/chconf.h b/testhal/STM32/STM32F4xx/USB_HOST/chconf.h index 53bd676..d94d8c3 100644 --- a/testhal/STM32/STM32F4xx/USB_HOST/chconf.h +++ b/testhal/STM32/STM32F4xx/USB_HOST/chconf.h @@ -29,7 +29,7 @@ #define CHCONF_H #define _CHIBIOS_RT_CONF_ -#define _CHIBIOS_RT_CONF_VER_5_0_ +#define _CHIBIOS_RT_CONF_VER_6_0_ /*===========================================================================*/ /** -- cgit v1.2.3 From 2366ead14ea7c0b2b782fce9ece511c391f89b6c Mon Sep 17 00:00:00 2001 From: Diego Ismirlian Date: Mon, 20 Aug 2018 21:29:16 -0300 Subject: FATFS: update diskio to match FATFS version --- os/various/fatfs_bindings/fatfs_diskio.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/os/various/fatfs_bindings/fatfs_diskio.c b/os/various/fatfs_bindings/fatfs_diskio.c index 3d068f3..0104a11 100644 --- a/os/various/fatfs_bindings/fatfs_diskio.c +++ b/os/various/fatfs_bindings/fatfs_diskio.c @@ -213,12 +213,12 @@ DRESULT disk_ioctl ( switch (cmd) { case CTRL_SYNC: return RES_OK; -#if _MAX_SS > _MIN_SS +#if FF_MAX_SS > FF_MIN_SS case GET_SECTOR_SIZE: *((WORD *)buff) = MMCSD_BLOCK_SIZE; return RES_OK; #endif -#if _USE_TRIM +#if FF_USE_TRIM case CTRL_TRIM: mmcErase(&MMCD1, *((DWORD *)buff), *((DWORD *)buff + 1)); return RES_OK; @@ -234,7 +234,7 @@ DRESULT disk_ioctl ( case GET_SECTOR_COUNT: *((DWORD *)buff) = mmcsdGetCardCapacity(&SDCD1); return RES_OK; -#if _MAX_SS > _MIN_SS +#if FF_MAX_SS > FF_MIN_SS case GET_SECTOR_SIZE: *((WORD *)buff) = MMCSD_BLOCK_SIZE; return RES_OK; @@ -242,7 +242,7 @@ DRESULT disk_ioctl ( case GET_BLOCK_SIZE: *((DWORD *)buff) = 256; /* 512b blocks in one erase block */ return RES_OK; -#if _USE_TRIM +#if FF_USE_TRIM case CTRL_TRIM: sdcErase(&SDCD1, *((DWORD *)buff), *((DWORD *)buff + 1)); return RES_OK; @@ -259,12 +259,12 @@ DRESULT disk_ioctl ( case GET_SECTOR_COUNT: *((DWORD *)buff) = MSBLKD[0].info.blk_num; return RES_OK; -#if _MAX_SS > _MIN_SS +#if FF_MAX_SS > FF_MIN_SS case GET_SECTOR_SIZE: *((WORD *)buff) = MSBLKD[0].info.blk_size; return RES_OK; #endif -#if _USE_TRIM +#if FF_USE_TRIM #error "unimplemented yet!" // case CTRL_TRIM: // .... -- cgit v1.2.3 From 81391097156ce2c9fc71c3350457522841e10095 Mon Sep 17 00:00:00 2001 From: Diego Ismirlian Date: Sun, 2 Sep 2018 11:59:32 -0300 Subject: USBH test corrections --- testhal/STM32/STM32F4xx/USB_HOST/chconf.h | 8 +++++--- testhal/STM32/STM32F4xx/USB_HOST/halconf.h | 6 +++--- testhal/STM32/STM32F4xx/USB_HOST/mcuconf.h | 6 +++--- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/testhal/STM32/STM32F4xx/USB_HOST/chconf.h b/testhal/STM32/STM32F4xx/USB_HOST/chconf.h index d94d8c3..682ae51 100644 --- a/testhal/STM32/STM32F4xx/USB_HOST/chconf.h +++ b/testhal/STM32/STM32F4xx/USB_HOST/chconf.h @@ -49,7 +49,7 @@ * @details Frequency of the system timer that drives the system ticks. This * setting also defines the system tick time unit. */ -#define CH_CFG_ST_FREQUENCY 10000 +#define CH_CFG_ST_FREQUENCY 1000 /** * @brief Time intervals data size. @@ -71,7 +71,7 @@ * The value one is not valid, timeouts are rounded up to * this value. */ -#define CH_CFG_ST_TIMEDELTA 2 +#define CH_CFG_ST_TIMEDELTA 0 /** @} */ @@ -427,7 +427,7 @@ * * @note The default is @p CH_DBG_TRACE_MASK_DISABLED. */ -#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_ALL +#define CH_DBG_TRACE_MASK CH_DBG_TRACE_MASK_DISABLED /** * @brief Trace buffer entries. @@ -586,6 +586,8 @@ */ #define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ /* System halt code here.*/ \ + void usbDbgSystemHalted(void); \ + usbDbgSystemHalted(); \ } /** diff --git a/testhal/STM32/STM32F4xx/USB_HOST/halconf.h b/testhal/STM32/STM32F4xx/USB_HOST/halconf.h index 33f3f94..26f5eae 100644 --- a/testhal/STM32/STM32F4xx/USB_HOST/halconf.h +++ b/testhal/STM32/STM32F4xx/USB_HOST/halconf.h @@ -41,7 +41,7 @@ * @brief Enables the ADC subsystem. */ #if !defined(HAL_USE_ADC) || defined(__DOXYGEN__) -#define HAL_USE_ADC TRUE +#define HAL_USE_ADC FALSE #endif /** @@ -323,7 +323,7 @@ * default configuration. */ #if !defined(SERIAL_DEFAULT_BITRATE) || defined(__DOXYGEN__) -#define SERIAL_DEFAULT_BITRATE 38400 +#define SERIAL_DEFAULT_BITRATE 115200 #endif /** @@ -334,7 +334,7 @@ * buffers. */ #if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_BUFFERS_SIZE 16 +#define SERIAL_BUFFERS_SIZE 64 #endif /*===========================================================================*/ diff --git a/testhal/STM32/STM32F4xx/USB_HOST/mcuconf.h b/testhal/STM32/STM32F4xx/USB_HOST/mcuconf.h index 65258ff..d2ff44e 100644 --- a/testhal/STM32/STM32F4xx/USB_HOST/mcuconf.h +++ b/testhal/STM32/STM32F4xx/USB_HOST/mcuconf.h @@ -86,9 +86,9 @@ * ADC driver system settings. */ #define STM32_ADC_ADCPRE ADC_CCR_ADCPRE_DIV4 -#define STM32_ADC_USE_ADC1 TRUE -#define STM32_ADC_USE_ADC2 TRUE -#define STM32_ADC_USE_ADC3 TRUE +#define STM32_ADC_USE_ADC1 FALSE +#define STM32_ADC_USE_ADC2 FALSE +#define STM32_ADC_USE_ADC3 FALSE #define STM32_ADC_ADC1_DMA_STREAM STM32_DMA_STREAM_ID(2, 4) #define STM32_ADC_ADC2_DMA_STREAM STM32_DMA_STREAM_ID(2, 2) #define STM32_ADC_ADC3_DMA_STREAM STM32_DMA_STREAM_ID(2, 1) -- cgit v1.2.3 From eb10a7d52faa133a699d859322246f654ccd9042 Mon Sep 17 00:00:00 2001 From: Diego Ismirlian Date: Sun, 29 Sep 2019 19:31:05 -0300 Subject: Update copyright --- os/hal/include/hal_usbh.h | 2 +- os/hal/include/usbh/debug.h | 2 +- os/hal/include/usbh/defs.h | 2 +- os/hal/include/usbh/desciter.h | 2 +- os/hal/include/usbh/dev/aoa.h | 2 +- os/hal/include/usbh/dev/ftdi.h | 2 +- os/hal/include/usbh/dev/hid.h | 2 +- os/hal/include/usbh/dev/hub.h | 2 +- os/hal/include/usbh/dev/msd.h | 2 +- os/hal/include/usbh/dev/uvc.h | 2 +- os/hal/include/usbh/internal.h | 2 +- os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c | 2 +- os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.h | 2 +- os/hal/src/hal_usbh.c | 2 +- os/hal/src/usbh/hal_usbh_aoa.c | 2 +- os/hal/src/usbh/hal_usbh_debug.c | 2 +- os/hal/src/usbh/hal_usbh_desciter.c | 2 +- os/hal/src/usbh/hal_usbh_ftdi.c | 2 +- os/hal/src/usbh/hal_usbh_hid.c | 2 +- os/hal/src/usbh/hal_usbh_hub.c | 2 +- os/hal/src/usbh/hal_usbh_msd.c | 2 +- os/hal/src/usbh/hal_usbh_uvc.c | 2 +- os/various/fatfs_bindings/fatfs_devices.h | 2 +- testhal/STM32/STM32F4xx/USB_HOST/usbh_additional_class_drivers.h | 2 +- testhal/STM32/STM32F4xx/USB_HOST/usbh_custom_class_example.c | 2 +- testhal/STM32/STM32F4xx/USB_HOST/usbh_custom_class_example.h | 2 +- 26 files changed, 26 insertions(+), 26 deletions(-) diff --git a/os/hal/include/hal_usbh.h b/os/hal/include/hal_usbh.h index 8d9a85b..aa49205 100644 --- a/os/hal/include/hal_usbh.h +++ b/os/hal/include/hal_usbh.h @@ -1,6 +1,6 @@ /* ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio - Copyright (C) 2015..2017 Diego Ismirlian, (dismirlian (at) google's mail) + Copyright (C) 2015..2019 Diego Ismirlian, (dismirlian(at)google's mail) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/os/hal/include/usbh/debug.h b/os/hal/include/usbh/debug.h index d3bdee7..41319b9 100644 --- a/os/hal/include/usbh/debug.h +++ b/os/hal/include/usbh/debug.h @@ -1,6 +1,6 @@ /* ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio - Copyright (C) 2015..2017 Diego Ismirlian, (dismirlian (at) google's mail) + Copyright (C) 2015..2019 Diego Ismirlian, (dismirlian(at)google's mail) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/os/hal/include/usbh/defs.h b/os/hal/include/usbh/defs.h index 5e0c466..eb06192 100644 --- a/os/hal/include/usbh/defs.h +++ b/os/hal/include/usbh/defs.h @@ -1,6 +1,6 @@ /* ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio - Copyright (C) 2015..2017 Diego Ismirlian, (dismirlian (at) google's mail) + Copyright (C) 2015..2019 Diego Ismirlian, (dismirlian(at)google's mail) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/os/hal/include/usbh/desciter.h b/os/hal/include/usbh/desciter.h index 142bd3c..0223101 100644 --- a/os/hal/include/usbh/desciter.h +++ b/os/hal/include/usbh/desciter.h @@ -1,6 +1,6 @@ /* ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio - Copyright (C) 2015..2017 Diego Ismirlian, (dismirlian (at) google's mail) + Copyright (C) 2015..2019 Diego Ismirlian, (dismirlian(at)google's mail) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/os/hal/include/usbh/dev/aoa.h b/os/hal/include/usbh/dev/aoa.h index a7f1c1b..8205dd5 100644 --- a/os/hal/include/usbh/dev/aoa.h +++ b/os/hal/include/usbh/dev/aoa.h @@ -1,6 +1,6 @@ /* ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio - Copyright (C) 2015..2017 Diego Ismirlian, (dismirlian (at) google's mail) + Copyright (C) 2015..2019 Diego Ismirlian, (dismirlian(at)google's mail) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/os/hal/include/usbh/dev/ftdi.h b/os/hal/include/usbh/dev/ftdi.h index eedb056..84ea4bc 100644 --- a/os/hal/include/usbh/dev/ftdi.h +++ b/os/hal/include/usbh/dev/ftdi.h @@ -1,6 +1,6 @@ /* ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio - Copyright (C) 2015..2017 Diego Ismirlian, (dismirlian (at) google's mail) + Copyright (C) 2015..2019 Diego Ismirlian, (dismirlian(at)google's mail) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/os/hal/include/usbh/dev/hid.h b/os/hal/include/usbh/dev/hid.h index c7371ee..de001ab 100644 --- a/os/hal/include/usbh/dev/hid.h +++ b/os/hal/include/usbh/dev/hid.h @@ -1,6 +1,6 @@ /* ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio - Copyright (C) 2015..2017 Diego Ismirlian, (dismirlian (at) google's mail) + Copyright (C) 2015..2019 Diego Ismirlian, (dismirlian(at)google's mail) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/os/hal/include/usbh/dev/hub.h b/os/hal/include/usbh/dev/hub.h index 406fbaf..05a7b4f 100644 --- a/os/hal/include/usbh/dev/hub.h +++ b/os/hal/include/usbh/dev/hub.h @@ -1,6 +1,6 @@ /* ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio - Copyright (C) 2015..2017 Diego Ismirlian, (dismirlian (at) google's mail) + Copyright (C) 2015..2019 Diego Ismirlian, (dismirlian(at)google's mail) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/os/hal/include/usbh/dev/msd.h b/os/hal/include/usbh/dev/msd.h index eedd474..b245bfc 100644 --- a/os/hal/include/usbh/dev/msd.h +++ b/os/hal/include/usbh/dev/msd.h @@ -1,6 +1,6 @@ /* ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio - Copyright (C) 2015..2017 Diego Ismirlian, (dismirlian (at) google's mail) + Copyright (C) 2015..2019 Diego Ismirlian, (dismirlian(at)google's mail) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/os/hal/include/usbh/dev/uvc.h b/os/hal/include/usbh/dev/uvc.h index 0477312..713d16c 100644 --- a/os/hal/include/usbh/dev/uvc.h +++ b/os/hal/include/usbh/dev/uvc.h @@ -1,6 +1,6 @@ /* ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio - Copyright (C) 2015..2017 Diego Ismirlian, (dismirlian (at) google's mail) + Copyright (C) 2015..2019 Diego Ismirlian, (dismirlian(at)google's mail) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/os/hal/include/usbh/internal.h b/os/hal/include/usbh/internal.h index f6f17b7..2473775 100644 --- a/os/hal/include/usbh/internal.h +++ b/os/hal/include/usbh/internal.h @@ -1,6 +1,6 @@ /* ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio - Copyright (C) 2015..2017 Diego Ismirlian, (dismirlian (at) google's mail) + Copyright (C) 2015..2019 Diego Ismirlian, (dismirlian(at)google's mail) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c b/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c index 192b008..787a831 100644 --- a/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c +++ b/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c @@ -1,6 +1,6 @@ /* ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio - Copyright (C) 2015..2017 Diego Ismirlian, (dismirlian (at) google's mail) + Copyright (C) 2015..2019 Diego Ismirlian, (dismirlian(at)google's mail) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.h b/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.h index fd7f4e0..bb92ede 100644 --- a/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.h +++ b/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.h @@ -1,6 +1,6 @@ /* ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio - Copyright (C) 2015..2017 Diego Ismirlian, (dismirlian (at) google's mail) + Copyright (C) 2015..2019 Diego Ismirlian, (dismirlian(at)google's mail) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/os/hal/src/hal_usbh.c b/os/hal/src/hal_usbh.c index 78ac837..feaf956 100644 --- a/os/hal/src/hal_usbh.c +++ b/os/hal/src/hal_usbh.c @@ -1,6 +1,6 @@ /* ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio - Copyright (C) 2015..2017 Diego Ismirlian, (dismirlian (at) google's mail) + Copyright (C) 2015..2019 Diego Ismirlian, (dismirlian(at)google's mail) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/os/hal/src/usbh/hal_usbh_aoa.c b/os/hal/src/usbh/hal_usbh_aoa.c index 4e1d65d..0686179 100644 --- a/os/hal/src/usbh/hal_usbh_aoa.c +++ b/os/hal/src/usbh/hal_usbh_aoa.c @@ -1,6 +1,6 @@ /* ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio - Copyright (C) 2015..2017 Diego Ismirlian, (dismirlian (at) google's mail) + Copyright (C) 2015..2019 Diego Ismirlian, (dismirlian(at)google's mail) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/os/hal/src/usbh/hal_usbh_debug.c b/os/hal/src/usbh/hal_usbh_debug.c index 85c6640..57df535 100644 --- a/os/hal/src/usbh/hal_usbh_debug.c +++ b/os/hal/src/usbh/hal_usbh_debug.c @@ -1,6 +1,6 @@ /* ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio - Copyright (C) 2015..2017 Diego Ismirlian, (dismirlian (at) google's mail) + Copyright (C) 2015..2019 Diego Ismirlian, (dismirlian(at)google's mail) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/os/hal/src/usbh/hal_usbh_desciter.c b/os/hal/src/usbh/hal_usbh_desciter.c index 3695881..cfce62b 100644 --- a/os/hal/src/usbh/hal_usbh_desciter.c +++ b/os/hal/src/usbh/hal_usbh_desciter.c @@ -1,6 +1,6 @@ /* ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio - Copyright (C) 2015..2017 Diego Ismirlian, (dismirlian (at) google's mail) + Copyright (C) 2015..2019 Diego Ismirlian, (dismirlian(at)google's mail) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/os/hal/src/usbh/hal_usbh_ftdi.c b/os/hal/src/usbh/hal_usbh_ftdi.c index b262256..b4b03df 100644 --- a/os/hal/src/usbh/hal_usbh_ftdi.c +++ b/os/hal/src/usbh/hal_usbh_ftdi.c @@ -1,6 +1,6 @@ /* ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio - Copyright (C) 2015..2017 Diego Ismirlian, (dismirlian (at) google's mail) + Copyright (C) 2015..2019 Diego Ismirlian, (dismirlian(at)google's mail) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/os/hal/src/usbh/hal_usbh_hid.c b/os/hal/src/usbh/hal_usbh_hid.c index 2b2c5ce..a34325b 100644 --- a/os/hal/src/usbh/hal_usbh_hid.c +++ b/os/hal/src/usbh/hal_usbh_hid.c @@ -1,6 +1,6 @@ /* ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio - Copyright (C) 2015..2017 Diego Ismirlian, (dismirlian (at) google's mail) + Copyright (C) 2015..2019 Diego Ismirlian, (dismirlian(at)google's mail) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/os/hal/src/usbh/hal_usbh_hub.c b/os/hal/src/usbh/hal_usbh_hub.c index 6a83c66..900c6f8 100644 --- a/os/hal/src/usbh/hal_usbh_hub.c +++ b/os/hal/src/usbh/hal_usbh_hub.c @@ -1,6 +1,6 @@ /* ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio - Copyright (C) 2015..2017 Diego Ismirlian, (dismirlian (at) google's mail) + Copyright (C) 2015..2019 Diego Ismirlian, (dismirlian(at)google's mail) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/os/hal/src/usbh/hal_usbh_msd.c b/os/hal/src/usbh/hal_usbh_msd.c index 3d57934..230bf9a 100644 --- a/os/hal/src/usbh/hal_usbh_msd.c +++ b/os/hal/src/usbh/hal_usbh_msd.c @@ -1,6 +1,6 @@ /* ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio - Copyright (C) 2015..2017 Diego Ismirlian, (dismirlian (at) google's mail) + Copyright (C) 2015..2019 Diego Ismirlian, (dismirlian(at)google's mail) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/os/hal/src/usbh/hal_usbh_uvc.c b/os/hal/src/usbh/hal_usbh_uvc.c index a795cd8..ca16c66 100644 --- a/os/hal/src/usbh/hal_usbh_uvc.c +++ b/os/hal/src/usbh/hal_usbh_uvc.c @@ -1,6 +1,6 @@ /* ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio - Copyright (C) 2015..2017 Diego Ismirlian, (dismirlian (at) google's mail) + Copyright (C) 2015..2019 Diego Ismirlian, (dismirlian(at)google's mail) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/os/various/fatfs_bindings/fatfs_devices.h b/os/various/fatfs_bindings/fatfs_devices.h index fe28383..cd1ad2f 100644 --- a/os/various/fatfs_bindings/fatfs_devices.h +++ b/os/various/fatfs_bindings/fatfs_devices.h @@ -1,6 +1,6 @@ /* ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio - Copyright (C) 2015..2017 Diego Ismirlian, (dismirlian (at) google's mail) + Copyright (C) 2015..2019 Diego Ismirlian, (dismirlian(at)google's mail) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/testhal/STM32/STM32F4xx/USB_HOST/usbh_additional_class_drivers.h b/testhal/STM32/STM32F4xx/USB_HOST/usbh_additional_class_drivers.h index ac9fc18..9a1a37c 100644 --- a/testhal/STM32/STM32F4xx/USB_HOST/usbh_additional_class_drivers.h +++ b/testhal/STM32/STM32F4xx/USB_HOST/usbh_additional_class_drivers.h @@ -1,6 +1,6 @@ /* ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio - Copyright (C) 2015..2017 Diego Ismirlian, (dismirlian (at) google's mail) + Copyright (C) 2015..2019 Diego Ismirlian, (dismirlian(at)google's mail) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/testhal/STM32/STM32F4xx/USB_HOST/usbh_custom_class_example.c b/testhal/STM32/STM32F4xx/USB_HOST/usbh_custom_class_example.c index 4585a5c..b0b5560 100644 --- a/testhal/STM32/STM32F4xx/USB_HOST/usbh_custom_class_example.c +++ b/testhal/STM32/STM32F4xx/USB_HOST/usbh_custom_class_example.c @@ -1,6 +1,6 @@ /* ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio - Copyright (C) 2015..2017 Diego Ismirlian, (dismirlian (at) google's mail) + Copyright (C) 2015..2019 Diego Ismirlian, (dismirlian(at)google's mail) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/testhal/STM32/STM32F4xx/USB_HOST/usbh_custom_class_example.h b/testhal/STM32/STM32F4xx/USB_HOST/usbh_custom_class_example.h index 3f00fe7..c848fc2 100644 --- a/testhal/STM32/STM32F4xx/USB_HOST/usbh_custom_class_example.h +++ b/testhal/STM32/STM32F4xx/USB_HOST/usbh_custom_class_example.h @@ -1,6 +1,6 @@ /* ChibiOS - Copyright (C) 2006..2017 Giovanni Di Sirio - Copyright (C) 2015..2017 Diego Ismirlian, (dismirlian (at) google's mail) + Copyright (C) 2015..2019 Diego Ismirlian, (dismirlian(at)google's mail) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. -- cgit v1.2.3 From ebe30922cce9cb81e9a3d876056f295e0ca56a5f Mon Sep 17 00:00:00 2001 From: Diego Ismirlian Date: Sun, 29 Sep 2019 19:31:43 -0300 Subject: Update to RT version 6.1 --- testhal/STM32/STM32F4xx/USB_HOST/chconf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testhal/STM32/STM32F4xx/USB_HOST/chconf.h b/testhal/STM32/STM32F4xx/USB_HOST/chconf.h index 17496b1..40612ff 100644 --- a/testhal/STM32/STM32F4xx/USB_HOST/chconf.h +++ b/testhal/STM32/STM32F4xx/USB_HOST/chconf.h @@ -29,7 +29,7 @@ #define CHCONF_H #define _CHIBIOS_RT_CONF_ -#define _CHIBIOS_RT_CONF_VER_6_0_ +#define _CHIBIOS_RT_CONF_VER_6_1_ /*===========================================================================*/ /** -- cgit v1.2.3 From 2644acd83a14e8652e30d65ac934d95992175ea0 Mon Sep 17 00:00:00 2001 From: Diego Ismirlian Date: Tue, 1 Oct 2019 09:18:18 -0300 Subject: USBH: testhal: fix compile with ChibiOS 18.2 --- testhal/STM32/STM32F4xx/USB_HOST/Makefile | 6 +- testhal/STM32/STM32F4xx/USB_HOST/chconf.h | 26 +----- testhal/STM32/STM32F4xx/USB_HOST/halconf.h | 134 +++-------------------------- 3 files changed, 16 insertions(+), 150 deletions(-) diff --git a/testhal/STM32/STM32F4xx/USB_HOST/Makefile b/testhal/STM32/STM32F4xx/USB_HOST/Makefile index 54c23ca..e38a6e5 100644 --- a/testhal/STM32/STM32F4xx/USB_HOST/Makefile +++ b/testhal/STM32/STM32F4xx/USB_HOST/Makefile @@ -97,7 +97,7 @@ include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f4xx.m include $(CHIBIOS_CONTRIB)/os/hal/hal.mk include $(CHIBIOS_CONTRIB)/os/hal/ports/STM32/STM32F4xx/platform.mk include $(CHIBIOS)/os/hal/boards/ST_STM32F4_DISCOVERY/board.mk -include $(CHIBIOS)/os/hal/osal/rt-nil/osal.mk +include $(CHIBIOS)/os/hal/osal/rt/osal.mk # RTOS files (optional). include $(CHIBIOS)/os/rt/rt.mk include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk @@ -216,6 +216,6 @@ ULIBS = # End of user defines ############################################################################## -RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk -include $(RULESPATH)/arm-none-eabi.mk +RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC +#include $(RULESPATH)/arm-none-eabi.mk include $(RULESPATH)/rules.mk diff --git a/testhal/STM32/STM32F4xx/USB_HOST/chconf.h b/testhal/STM32/STM32F4xx/USB_HOST/chconf.h index 40612ff..0788ce6 100644 --- a/testhal/STM32/STM32F4xx/USB_HOST/chconf.h +++ b/testhal/STM32/STM32F4xx/USB_HOST/chconf.h @@ -15,7 +15,7 @@ */ /** - * @file rt/templates/chconf.h + * @file templates/chconf.h * @brief Configuration file template. * @details A copy of this file must be placed in each project directory, it * contains the application specific kernel settings. @@ -29,7 +29,7 @@ #define CHCONF_H #define _CHIBIOS_RT_CONF_ -#define _CHIBIOS_RT_CONF_VER_6_1_ +#define _CHIBIOS_RT_CONF_VER_5_1_ /*===========================================================================*/ /** @@ -360,7 +360,7 @@ #endif /** - * @brief Objects FIFOs APIs. + * @brief Objects FIFOs APIs. * @details If enabled then the objects FIFOs APIs are included * in the kernel. * @@ -370,17 +370,6 @@ #define CH_CFG_USE_OBJ_FIFOS TRUE #endif -/** - * @brief Pipes APIs. - * @details If enabled then the pipes APIs are included - * in the kernel. - * - * @note The default is @p TRUE. - */ -#if !defined(CH_CFG_USE_PIPES) -#define CH_CFG_USE_PIPES TRUE -#endif - /** * @brief Dynamic Threads APIs. * @details If enabled then the dynamic threads creation APIs are included @@ -458,13 +447,6 @@ #define CH_CFG_FACTORY_OBJ_FIFOS TRUE #endif -/** - * @brief Enables factory for Pipes. - */ -#if !defined(CH_CFG_FACTORY_PIPES) || defined(__DOXYGEN__) -#define CH_CFG_FACTORY_PIPES TRUE -#endif - /** @} */ /*===========================================================================*/ @@ -692,8 +674,6 @@ */ #define CH_CFG_SYSTEM_HALT_HOOK(reason) { \ /* System halt code here.*/ \ - void usbDbgSystemHalted(void); \ - usbDbgSystemHalted(); \ } /** diff --git a/testhal/STM32/STM32F4xx/USB_HOST/halconf.h b/testhal/STM32/STM32F4xx/USB_HOST/halconf.h index 8b5d823..7096a3b 100644 --- a/testhal/STM32/STM32F4xx/USB_HOST/halconf.h +++ b/testhal/STM32/STM32F4xx/USB_HOST/halconf.h @@ -28,9 +28,6 @@ #ifndef HALCONF_H #define HALCONF_H -#define _CHIBIOS_HAL_CONF_ -#define _CHIBIOS_HAL_CONF_VER_7_1_ - #include "mcuconf.h" /** @@ -69,10 +66,10 @@ #endif /** - * @brief Enables the EFlash subsystem. + * @brief Enables the EXT subsystem. */ -#if !defined(HAL_USE_EFL) || defined(__DOXYGEN__) -#define HAL_USE_EFL FALSE +#if !defined(HAL_USE_EXT) || defined(__DOXYGEN__) +#define HAL_USE_EXT FALSE #endif /** @@ -124,6 +121,13 @@ #define HAL_USE_PWM FALSE #endif +/** + * @brief Enables the QSPI subsystem. + */ +#if !defined(HAL_USE_QSPI) || defined(__DOXYGEN__) +#define HAL_USE_QSPI FALSE +#endif + /** * @brief Enables the RTC subsystem. */ @@ -152,13 +156,6 @@ #define HAL_USE_SERIAL_USB FALSE #endif -/** - * @brief Enables the SIO subsystem. - */ -#if !defined(HAL_USE_SIO) || defined(__DOXYGEN__) -#define HAL_USE_SIO FALSE -#endif - /** * @brief Enables the SPI subsystem. */ @@ -166,13 +163,6 @@ #define HAL_USE_SPI FALSE #endif -/** - * @brief Enables the TRNG subsystem. - */ -#if !defined(HAL_USE_TRNG) || defined(__DOXYGEN__) -#define HAL_USE_TRNG FALSE -#endif - /** * @brief Enables the UART subsystem. */ @@ -194,33 +184,6 @@ #define HAL_USE_WDG FALSE #endif -/** - * @brief Enables the WSPI subsystem. - */ -#if !defined(HAL_USE_WSPI) || defined(__DOXYGEN__) -#define HAL_USE_WSPI FALSE -#endif - -/*===========================================================================*/ -/* PAL driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(PAL_USE_CALLBACKS) || defined(__DOXYGEN__) -#define PAL_USE_CALLBACKS FALSE -#endif - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(PAL_USE_WAIT) || defined(__DOXYGEN__) -#define PAL_USE_WAIT FALSE -#endif - /*===========================================================================*/ /* ADC driver related settings. */ /*===========================================================================*/ @@ -252,13 +215,6 @@ #define CAN_USE_SLEEP_MODE TRUE #endif -/** - * @brief Enforces the driver to use direct callbacks rather than OSAL events. - */ -#if !defined(CAN_ENFORCE_USE_CALLBACKS) || defined(__DOXYGEN__) -#define CAN_ENFORCE_USE_CALLBACKS FALSE -#endif - /*===========================================================================*/ /* CRY driver related settings. */ /*===========================================================================*/ @@ -281,26 +237,6 @@ #define HAL_CRY_ENFORCE_FALLBACK FALSE #endif -/*===========================================================================*/ -/* DAC driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(DAC_USE_WAIT) || defined(__DOXYGEN__) -#define DAC_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p dacAcquireBus() and @p dacReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(DAC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define DAC_USE_MUTUAL_EXCLUSION TRUE -#endif - /*===========================================================================*/ /* I2C driver related settings. */ /*===========================================================================*/ @@ -377,20 +313,6 @@ #define SDC_NICE_WAITING TRUE #endif -/** - * @brief OCR initialization constant for V20 cards. - */ -#if !defined(SDC_INIT_OCR_V20) || defined(__DOXYGEN__) -#define SDC_INIT_OCR_V20 0x50FF8000U -#endif - -/** - * @brief OCR initialization constant for non-V20 cards. - */ -#if !defined(SDC_INIT_OCR) || defined(__DOXYGEN__) -#define SDC_INIT_OCR 0x80100000U -#endif - /*===========================================================================*/ /* SERIAL driver related settings. */ /*===========================================================================*/ @@ -450,14 +372,6 @@ #define SPI_USE_WAIT TRUE #endif -/** - * @brief Enables circular transfers APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_USE_CIRCULAR) || defined(__DOXYGEN__) -#define SPI_USE_CIRCULAR FALSE -#endif - /** * @brief Enables the @p spiAcquireBus() and @p spiReleaseBus() APIs. * @note Disabling this option saves both code and data space. @@ -466,14 +380,6 @@ #define SPI_USE_MUTUAL_EXCLUSION TRUE #endif -/** - * @brief Handling method for SPI CS line. - * @note Disabling this option saves both code and data space. - */ -#if !defined(SPI_SELECT_MODE) || defined(__DOXYGEN__) -#define SPI_SELECT_MODE SPI_SELECT_MODE_PAD -#endif - /*===========================================================================*/ /* UART driver related settings. */ /*===========================================================================*/ @@ -506,26 +412,6 @@ #define USB_USE_WAIT FALSE #endif -/*===========================================================================*/ -/* WSPI driver related settings. */ -/*===========================================================================*/ - -/** - * @brief Enables synchronous APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(WSPI_USE_WAIT) || defined(__DOXYGEN__) -#define WSPI_USE_WAIT TRUE -#endif - -/** - * @brief Enables the @p wspiAcquireBus() and @p wspiReleaseBus() APIs. - * @note Disabling this option saves both code and data space. - */ -#if !defined(WSPI_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) -#define WSPI_USE_MUTUAL_EXCLUSION TRUE -#endif - #include "halconf_community.h" #endif /* HALCONF_H */ -- cgit v1.2.3 From d685cfd0c27252b77fe3cb5416d3921f37033e81 Mon Sep 17 00:00:00 2001 From: Diego Ismirlian Date: Tue, 1 Oct 2019 09:27:51 -0300 Subject: USBH: testhal: fix compile with FATFS 0.13 --- testhal/STM32/STM32F4xx/USB_HOST/ffconf.h | 89 ++++++++++++------------------- 1 file changed, 35 insertions(+), 54 deletions(-) diff --git a/testhal/STM32/STM32F4xx/USB_HOST/ffconf.h b/testhal/STM32/STM32F4xx/USB_HOST/ffconf.h index c3530a5..944ffde 100644 --- a/testhal/STM32/STM32F4xx/USB_HOST/ffconf.h +++ b/testhal/STM32/STM32F4xx/USB_HOST/ffconf.h @@ -2,10 +2,10 @@ #include "ch.h" /*---------------------------------------------------------------------------/ -/ FatFs Functional Configurations +/ FatFs - Configuration file /---------------------------------------------------------------------------*/ -#define FFCONF_DEF 86604 /* Revision ID */ +#define FFCONF_DEF 87030 /* Revision ID */ /*---------------------------------------------------------------------------/ / Function Configurations @@ -21,7 +21,7 @@ #define FF_FS_MINIMIZE 0 /* This option defines minimization level to remove some basic API functions. / -/ 0: Basic functions are fully enabled. +/ 0: All basic functions are enabled. / 1: f_stat(), f_getfree(), f_unlink(), f_mkdir(), f_truncate() and f_rename() / are removed. / 2: f_opendir(), f_readdir() and f_closedir() are removed in addition to 1. @@ -71,7 +71,7 @@ / Locale and Namespace Configurations /---------------------------------------------------------------------------*/ -#define FF_CODE_PAGE 437 +#define FF_CODE_PAGE 850 /* This option specifies the OEM code page to be used on the target system. / Incorrect code page setting can cause a file open failure. / @@ -100,8 +100,8 @@ */ -#define FF_USE_LFN 3 -#define FF_MAX_LFN 255 +#define FF_USE_LFN 3 +#define FF_MAX_LFN 255 /* The FF_USE_LFN switches the support for LFN (long file name). / / 0: Disable LFN. FF_MAX_LFN has no effect. @@ -109,47 +109,32 @@ / 2: Enable LFN with dynamic working buffer on the STACK. / 3: Enable LFN with dynamic working buffer on the HEAP. / -/ To enable the LFN, ffunicode.c needs to be added to the project. The LFN function -/ requiers certain internal working buffer occupies (FF_MAX_LFN + 1) * 2 bytes and -/ additional (FF_MAX_LFN + 44) / 15 * 32 bytes when exFAT is enabled. -/ The FF_MAX_LFN defines size of the working buffer in UTF-16 code unit and it can -/ be in range of 12 to 255. It is recommended to be set 255 to fully support LFN -/ specification. +/ To enable the LFN, Unicode handling functions (option/unicode.c) must be added +/ to the project. The working buffer occupies (FF_MAX_LFN + 1) * 2 bytes and +/ additional 608 bytes at exFAT enabled. FF_MAX_LFN can be in range from 12 to 255. +/ It should be set 255 to support full featured LFN operations. / When use stack for the working buffer, take care on stack overflow. When use heap / memory for the working buffer, memory management functions, ff_memalloc() and -/ ff_memfree() in ffsystem.c, need to be added to the project. */ +/ ff_memfree(), must be added to the project. */ #define FF_LFN_UNICODE 0 -/* This option switches the character encoding on the API when LFN is enabled. -/ -/ 0: ANSI/OEM in current CP (TCHAR = char) -/ 1: Unicode in UTF-16 (TCHAR = WCHAR) -/ 2: Unicode in UTF-8 (TCHAR = char) -/ 3: Unicode in UTF-32 (TCHAR = DWORD) -/ -/ Also behavior of string I/O functions will be affected by this option. -/ When LFN is not enabled, this option has no effect. */ - - -#define FF_LFN_BUF 255 -#define FF_SFN_BUF 12 -/* This set of options defines size of file name members in the FILINFO structure -/ which is used to read out directory items. These values should be suffcient for -/ the file names to read. The maximum possible length of the read file name depends -/ on character encoding. When LFN is not enabled, these options have no effect. */ +/* This option switches character encoding on the API, 0:ANSI/OEM or 1:UTF-16, +/ when LFN is enabled. Also behavior of string I/O functions will be affected by +/ this option. When LFN is not enabled, this option has no effect. +*/ #define FF_STRF_ENCODE 3 -/* When FF_LFN_UNICODE >= 1 with LFN enabled, string I/O functions, f_gets(), +/* When FF_LFN_UNICODE = 1 with LFN enabled, string I/O functions, f_gets(), / f_putc(), f_puts and f_printf() convert the character encoding in it. / This option selects assumption of character encoding ON THE FILE to be / read/written via those functions. / -/ 0: ANSI/OEM in current CP -/ 1: Unicode in UTF-16LE -/ 2: Unicode in UTF-16BE -/ 3: Unicode in UTF-8 +/ 0: ANSI/OEM +/ 1: UTF-16LE +/ 2: UTF-16BE +/ 3: UTF-8 */ @@ -172,16 +157,11 @@ #define FF_STR_VOLUME_ID 0 #define FF_VOLUME_STRS "RAM","NAND","CF","SD","SD2","USB","USB2","USB3" -/* FF_STR_VOLUME_ID switches support for volume ID in arbitrary strings. -/ When FF_STR_VOLUME_ID is set to 1 or 2, arbitrary strings can be used as drive -/ number in the path name. FF_VOLUME_STRS defines the volume ID strings for each -/ logical drives. Number of items must not be less than FF_VOLUMES. Valid -/ characters for the volume ID strings are A-Z, a-z and 0-9, however, they are -/ compared in case-insensitive. If FF_STR_VOLUME_ID >= 1 and FF_VOLUME_STRS is -/ not defined, a user defined volume string table needs to be defined as: -/ -/ const char* VolumeStr[FF_VOLUMES] = {"ram","flash","sd","usb",... -*/ +/* FF_STR_VOLUME_ID switches string support for volume ID. +/ When FF_STR_VOLUME_ID is set to 1, also pre-defined strings can be used as drive +/ number in the path name. FF_VOLUME_STRS defines the drive ID strings for each +/ logical drives. Number of items must be equal to FF_VOLUMES. Valid characters for +/ the drive ID strings are: A-Z and 0-9. */ #define FF_MULTI_PARTITION 0 @@ -233,19 +213,19 @@ / buffer in the filesystem object (FATFS) is used for the file data transfer. */ -#define FF_FS_EXFAT 1 +#define FF_FS_EXFAT 1 /* This option switches support for exFAT filesystem. (0:Disable or 1:Enable) / When enable exFAT, also LFN needs to be enabled. / Note that enabling exFAT discards ANSI C (C89) compatibility. */ -#define FF_FS_NORTC 1 -#define FF_NORTC_MON 1 +#define FF_FS_NORTC 1 +#define FF_NORTC_MON 5 #define FF_NORTC_MDAY 1 -#define FF_NORTC_YEAR 2018 +#define FF_NORTC_YEAR 2017 /* The option FF_FS_NORTC switches timestamp functiton. If the system does not have / any RTC function or valid timestamp is not needed, set FF_FS_NORTC = 1 to disable -/ the timestamp function. Every object modified by FatFs will have a fixed timestamp +/ the timestamp function. All objects modified by FatFs will have a fixed timestamp / defined by FF_NORTC_MON, FF_NORTC_MDAY and FF_NORTC_YEAR in local time. / To enable timestamp function (FF_FS_NORTC = 0), get_fattime() function need to be / added to the project to read current time form real-time clock. FF_NORTC_MON, @@ -265,10 +245,9 @@ / lock control is independent of re-entrancy. */ -/* #include // O/S definitions */ -#define FF_FS_REENTRANT 0 -#define FF_FS_TIMEOUT 1000 -#define FF_SYNC_t HANDLE +#define FF_FS_REENTRANT 0 +#define FF_FS_TIMEOUT MS2ST(1000) +#define FF_SYNC_t semaphore_t* /* The option FF_FS_REENTRANT switches the re-entrancy (thread safe) of the FatFs / module itself. Note that regardless of this option, file access to different / volume is always re-entrant and volume control functions, f_mount(), f_mkfs() @@ -286,6 +265,8 @@ / SemaphoreHandle_t and etc. A header file for O/S definitions needs to be / included somewhere in the scope of ff.h. */ +/* #include // O/S definitions */ + /*--- End of configuration options ---*/ -- cgit v1.2.3 From 2cd41f99df0fc857afaef091ca3b984a728d0e3c Mon Sep 17 00:00:00 2001 From: Diego Ismirlian Date: Wed, 2 Oct 2019 11:41:39 -0300 Subject: USBH: testhal: disable LTO --- testhal/STM32/STM32F4xx/USB_HOST/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testhal/STM32/STM32F4xx/USB_HOST/Makefile b/testhal/STM32/STM32F4xx/USB_HOST/Makefile index 2f9ba4f..5950691 100644 --- a/testhal/STM32/STM32F4xx/USB_HOST/Makefile +++ b/testhal/STM32/STM32F4xx/USB_HOST/Makefile @@ -30,7 +30,7 @@ endif # Enable this if you want link time optimizations (LTO) ifeq ($(USE_LTO),) - USE_LTO = yes + USE_LTO = no endif # If enabled, this option allows to compile the application in THUMB mode. -- cgit v1.2.3