From c9236bf6651499cfd5c7c8bb567579df49f5cf36 Mon Sep 17 00:00:00 2001 From: Wilhelm Schuster Date: Thu, 12 Jan 2023 17:19:26 +0100 Subject: [PATCH 1/2] Fix USB host IRQ handler name https://github.com/ChibiOS/ChibiOS-Contrib/issues/267 Reported-by: @tianhuanz --- os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c | 4 ++-- 1 file changed, 2 insertions(+), 2 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 1eeecb4610..41f1aacac8 100644 --- a/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c +++ b/os/hal/ports/STM32/LLD/USBHv1/hal_usbh_lld.c @@ -1419,7 +1419,7 @@ static void usb_lld_serve_interrupt(USBHDriver *host) { /*===========================================================================*/ #if STM32_USBH_USE_OTG1 -OSAL_IRQ_HANDLER(STM32_OTG_FS_HANDLER) { +OSAL_IRQ_HANDLER(STM32_OTG1_HANDLER) { OSAL_IRQ_PROLOGUE(); osalSysLockFromISR(); usb_lld_serve_interrupt(&USBHD1); @@ -1429,7 +1429,7 @@ OSAL_IRQ_HANDLER(STM32_OTG_FS_HANDLER) { #endif #if STM32_USBH_USE_OTG2 -OSAL_IRQ_HANDLER(STM32_OTG_HS_HANDLER) { +OSAL_IRQ_HANDLER(STM32_OTG2_HANDLER) { OSAL_IRQ_PROLOGUE(); osalSysLockFromISR(); usb_lld_serve_interrupt(&USBHD2); From 7d0dd0e7aebd3d35e64492b0db00a4b3f8d7a2ab Mon Sep 17 00:00:00 2001 From: Wilhelm Schuster Date: Thu, 12 Jan 2023 17:21:26 +0100 Subject: [PATCH 2/2] Update STM32F4 USB host testhal to halconf v8.4 --- testhal/STM32/STM32F4xx/USB_HOST/halconf.h | 52 +++++++++++++++------- 1 file changed, 37 insertions(+), 15 deletions(-) diff --git a/testhal/STM32/STM32F4xx/USB_HOST/halconf.h b/testhal/STM32/STM32F4xx/USB_HOST/halconf.h index 0cebad5492..8b7b0907c8 100644 --- a/testhal/STM32/STM32F4xx/USB_HOST/halconf.h +++ b/testhal/STM32/STM32F4xx/USB_HOST/halconf.h @@ -1,5 +1,5 @@ /* - ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio + ChibiOS - Copyright (C) 2006..2023 Giovanni Di Sirio Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -29,7 +29,7 @@ #define HALCONF_H #define _CHIBIOS_HAL_CONF_ -#define _CHIBIOS_HAL_CONF_VER_8_0_ +#define _CHIBIOS_HAL_CONF_VER_8_4_ #include "mcuconf.h" @@ -335,15 +335,18 @@ /*===========================================================================*/ /** - * @brief Delays insertions. - * @details If enabled this options inserts delays into the MMC waiting - * routines releasing some extra CPU time for the threads with - * lower priority, this may slow down the driver a bit however. - * This option is recommended also if the SPI driver does not - * use a DMA channel and heavily loads the CPU. + * @brief Timeout before assuming a failure while waiting for card idle. + * @note Time is in milliseconds. + */ +#if !defined(MMC_IDLE_TIMEOUT_MS) || defined(__DOXYGEN__) +#define MMC_IDLE_TIMEOUT_MS 1000 +#endif + +/** + * @brief Mutual exclusion on the SPI bus. */ -#if !defined(MMC_NICE_WAITING) || defined(__DOXYGEN__) -#define MMC_NICE_WAITING TRUE +#if !defined(MMC_USE_MUTUAL_EXCLUSION) || defined(__DOXYGEN__) +#define MMC_USE_MUTUAL_EXCLUSION TRUE #endif /*===========================================================================*/ @@ -412,7 +415,27 @@ * buffers. */ #if !defined(SERIAL_BUFFERS_SIZE) || defined(__DOXYGEN__) -#define SERIAL_BUFFERS_SIZE 64 +#define SERIAL_BUFFERS_SIZE 16 +#endif + +/*===========================================================================*/ +/* SIO driver related settings. */ +/*===========================================================================*/ + +/** + * @brief Default bit rate. + * @details Configuration parameter, this is the baud rate selected for the + * default configuration. + */ +#if !defined(SIO_DEFAULT_BITRATE) || defined(__DOXYGEN__) +#define SIO_DEFAULT_BITRATE 115200 +#endif + +/** + * @brief Support for thread synchronization API. + */ +#if !defined(SIO_USE_SYNCHRONIZATION) || defined(__DOXYGEN__) +#define SIO_USE_SYNCHRONIZATION TRUE #endif /*===========================================================================*/ @@ -451,11 +474,10 @@ #endif /** - * @brief Enables circular transfers APIs. - * @note Disabling this option saves both code and data space. + * @brief Inserts an assertion on function errors before returning. */ -#if !defined(SPI_USE_CIRCULAR) || defined(__DOXYGEN__) -#define SPI_USE_CIRCULAR FALSE +#if !defined(SPI_USE_ASSERT_ON_ERROR) || defined(__DOXYGEN__) +#define SPI_USE_ASSERT_ON_ERROR TRUE #endif /**