From bee4488811befc7d7bce1b89bfdfb67e1ca15d87 Mon Sep 17 00:00:00 2001 From: hathach Date: Sun, 8 Apr 2018 13:46:39 +0700 Subject: [PATCH] update nrf errata --- .../drivers_nrf/usbd/nrf_drv_usbd_errata.h | 54 ++++++++++++++++++- src/tusb_config.h | 2 +- 2 files changed, 54 insertions(+), 2 deletions(-) diff --git a/lib/sdk/components/drivers_nrf/usbd/nrf_drv_usbd_errata.h b/lib/sdk/components/drivers_nrf/usbd/nrf_drv_usbd_errata.h index a06a0a5..3b2a696 100644 --- a/lib/sdk/components/drivers_nrf/usbd/nrf_drv_usbd_errata.h +++ b/lib/sdk/components/drivers_nrf/usbd/nrf_drv_usbd_errata.h @@ -1,5 +1,5 @@ /** - * Copyright (c) 2017 - 2017, Nordic Semiconductor ASA + * Copyright (c) 2017 - 2018, Nordic Semiconductor ASA * * All rights reserved. * @@ -85,6 +85,19 @@ static inline bool nrf_drv_usbd_errata_type_52840_proto1(void) ( ((*(uint32_t *)0xF0000FEC) & 0xF0) == 0x00 ) ); } +/** + * @brief Internal auxiliary function to check if the program is running on first final product of + * NRF52840 chip + * @retval true It is NRF52480 chip and it is first final product + * @retval false It is other chip + */ +static inline bool nrf_drv_usbd_errata_type_52840_fp1(void) +{ + return ( nrf_drv_usbd_errata_type_52840() && + ( ((*(uint32_t *)0xF0000FE8) & 0xF0) == 0x10 ) && + ( ((*(uint32_t *)0xF0000FEC) & 0xF0) == 0x00 ) ); +} + /** * @brief Function to check if chip requires errata 104 * @@ -124,6 +137,32 @@ static inline bool nrf_drv_usbd_errata_166(void) return NRF_DRV_USBD_ERRATA_ENABLE && true; } +/** + * @brief Function to check if chip requires errata 171 + * + * Errata: USBD might not reach its active state. + * + * @retval true Errata should be implemented + * @retval false Errata should not be implemented + */ +static inline bool nrf_drv_usbd_errata_171(void) +{ + return NRF_DRV_USBD_ERRATA_ENABLE && true; +} + +/** + * @brief Function to check if chip requires errata 187 + * + * Errata: USB cannot be enabled + * + * @retval true Errata should be implemented + * @retval false Errata should not be implemented + */ +static inline bool nrf_drv_usbd_errata_187(void) +{ + return NRF_DRV_USBD_ERRATA_ENABLE && nrf_drv_usbd_errata_type_52840_fp1(); +} + /** * @brief Function to check if chip requires errata ??? * @@ -137,5 +176,18 @@ static inline bool nrf_drv_usbd_errata_sizeepout_rw(void) return NRF_DRV_USBD_ERRATA_ENABLE && nrf_drv_usbd_errata_type_52840_proto1(); } +/** + * @brief Function to check if chip requires errata 199 + * + * Errata: USBD cannot receive tasks during DMA + * + * @retval true Errata should be implemented + * @retval false Errata should not be implemented + */ +static inline bool nrf_drv_usb_errata_199(void) +{ + return NRF_DRV_USBD_ERRATA_ENABLE && true; +} + /** @} */ #endif /* NRF_DRV_USBD_ERRATA_H__ */ diff --git a/src/tusb_config.h b/src/tusb_config.h index 34d158b..8d1d865 100644 --- a/src/tusb_config.h +++ b/src/tusb_config.h @@ -60,7 +60,7 @@ #define TUSB_CFG_DEVICE_HID_KEYBOARD 0 #define TUSB_CFG_DEVICE_HID_MOUSE 0 #define TUSB_CFG_DEVICE_HID_GENERIC 0 // not supported yet -#define TUSB_CFG_DEVICE_MSC 1 +#define TUSB_CFG_DEVICE_MSC 0 #define TUSB_CFG_DEVICE_CDC 1 //--------------------------------------------------------------------+