Sfoglia il codice sorgente

add musb host demo with es32f3xx

sakumisu 3 anni fa
parent
commit
eb8048e98e

+ 311 - 0
demo/es32/usb_host/ES32F369x/Inc/FreeRTOSConfig.h

@@ -0,0 +1,311 @@
+/*
+    FreeRTOS V9.0.0 - Copyright (C) 2016 Real Time Engineers Ltd.
+    All rights reserved
+
+    VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
+
+    This file is part of the FreeRTOS distribution.
+
+    FreeRTOS is free software; you can redistribute it and/or modify it under
+    the terms of the GNU General Public License (version 2) as published by the
+    Free Software Foundation >>>> AND MODIFIED BY <<<< the FreeRTOS exception.
+
+    ***************************************************************************
+    >>!   NOTE: The modification to the GPL is included to allow you to     !<<
+    >>!   distribute a combined work that includes FreeRTOS without being   !<<
+    >>!   obliged to provide the source code for proprietary components     !<<
+    >>!   outside of the FreeRTOS kernel.                                   !<<
+    ***************************************************************************
+
+    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT ANY
+    WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+    FOR A PARTICULAR PURPOSE.  Full license text is available on the following
+    link: http://www.freertos.org/a00114.html
+
+    ***************************************************************************
+     *                                                                       *
+     *    FreeRTOS provides completely free yet professionally developed,    *
+     *    robust, strictly quality controlled, supported, and cross          *
+     *    platform software that is more than just the market leader, it     *
+     *    is the industry's de facto standard.                               *
+     *                                                                       *
+     *    Help yourself get started quickly while simultaneously helping     *
+     *    to support the FreeRTOS project by purchasing a FreeRTOS           *
+     *    tutorial book, reference manual, or both:                          *
+     *    http://www.FreeRTOS.org/Documentation                              *
+     *                                                                       *
+    ***************************************************************************
+
+    http://www.FreeRTOS.org/FAQHelp.html - Having a problem?  Start by reading
+    the FAQ page "My application does not run, what could be wrong?".  Have you
+    defined configASSERT()?
+
+    http://www.FreeRTOS.org/support - In return for receiving this top quality
+    embedded software for free we request you assist our global community by
+    participating in the support forum.
+
+    http://www.FreeRTOS.org/training - Investing in training allows your team to
+    be as productive as possible as early as possible.  Now you can receive
+    FreeRTOS training directly from Richard Barry, CEO of Real Time Engineers
+    Ltd, and the world's leading authority on the world's leading RTOS.
+
+    http://www.FreeRTOS.org/plus - A selection of FreeRTOS ecosystem products,
+    including FreeRTOS+Trace - an indispensable productivity tool, a DOS
+    compatible FAT file system, and our tiny thread aware UDP/IP stack.
+
+    http://www.FreeRTOS.org/labs - Where new FreeRTOS products go to incubate.
+    Come and try FreeRTOS+TCP, our new open source TCP/IP stack for FreeRTOS.
+
+    http://www.OpenRTOS.com - Real Time Engineers ltd. license FreeRTOS to High
+    Integrity Systems ltd. to sell under the OpenRTOS brand.  Low cost OpenRTOS
+    licenses offer ticketed support, indemnification and commercial middleware.
+
+    http://www.SafeRTOS.com - High Integrity Systems also provide a safety
+    engineered and independently SIL3 certified version for use in safety and
+    mission critical applications that require provable dependability.
+
+*/
+
+
+#ifndef FREERTOS_CONFIG_H
+#define FREERTOS_CONFIG_H
+
+
+//针对不同的编译器调用不同的stdint.h文件
+#if defined(__ICCARM__) || defined(__CC_ARM) || defined(__GNUC__)
+    #include <stdint.h>
+    //extern uint32_t SystemCoreClock;
+#endif
+
+//断言
+
+#define configASSERT(x) 
+/************************************************************************
+ *               FreeRTOS基础配置配置选项 
+ *********************************************************************/
+/* 置1:RTOS使用抢占式调度器;置0:RTOS使用协作式调度器(时间片)
+ * 
+ * 注:在多任务管理机制上,操作系统可以分为抢占式和协作式两种。
+ * 协作式操作系统是任务主动释放CPU后,切换到下一个任务。
+ * 任务切换的时机完全取决于正在运行的任务。
+ */
+#define configUSE_PREEMPTION					  1
+
+//1使能时间片调度(默认式使能的)
+#define configUSE_TIME_SLICING					1		
+
+/* 某些运行FreeRTOS的硬件有两种方法选择下一个要执行的任务:
+ * 通用方法和特定于硬件的方法(以下简称“特殊方法”)。
+ * 
+ * 通用方法:
+ *      1.configUSE_PORT_OPTIMISED_TASK_SELECTION 为 0 或者硬件不支持这种特殊方法。
+ *      2.可以用于所有FreeRTOS支持的硬件
+ *      3.完全用C实现,效率略低于特殊方法。
+ *      4.不强制要求限制最大可用优先级数目
+ * 特殊方法:
+ *      1.必须将configUSE_PORT_OPTIMISED_TASK_SELECTION设置为1。
+ *      2.依赖一个或多个特定架构的汇编指令(一般是类似计算前导零[CLZ]指令)。
+ *      3.比通用方法更高效
+ *      4.一般强制限定最大可用优先级数目为32
+ * 一般是硬件计算前导零指令,如果所使用的,MCU没有这些硬件指令的话此宏应该设置为0!
+ */
+#define configUSE_PORT_OPTIMISED_TASK_SELECTION	        1                       
+                                                                        
+/* 置1:使能低功耗tickless模式;置0:保持系统节拍(tick)中断一直运行
+ * 假设开启低功耗的话可能会导致下载出现问题,因为程序在睡眠中,可用以下办法解决
+ * 
+ * 下载方法:
+ *      1.将开发版正常连接好
+ *      2.按住复位按键,点击下载瞬间松开复位按键
+ *     
+ *      1.通过跳线帽将 BOOT 0 接高电平(3.3V)
+ *      2.重新上电,下载
+ *    
+ * 			1.使用FlyMcu擦除一下芯片,然后进行下载
+ *			STMISP -> 清除芯片(z)
+ */
+#define configUSE_TICKLESS_IDLE													0   
+
+/*
+ * 写入实际的CPU内核时钟频率,也就是CPU指令执行频率,通常称为Fclk
+ * Fclk为供给CPU内核的时钟信号,我们所说的cpu主频为 XX MHz,
+ * 就是指的这个时钟信号,相应的,1/Fclk即为cpu时钟周期;
+ */
+#define configCPU_CLOCK_HZ						  (72000000)
+
+//RTOS系统节拍中断的频率。即一秒中断的次数,每次中断RTOS都会进行任务调度
+#define configTICK_RATE_HZ						  (( TickType_t )1000)
+
+//可使用的最大优先级
+#define configMAX_PRIORITIES					  (32)
+
+//空闲任务使用的堆栈大小
+#define configMINIMAL_STACK_SIZE				((unsigned short)128)
+  
+//任务名字字符串长度
+#define configMAX_TASK_NAME_LEN					(16)
+
+ //系统节拍计数器变量数据类型,1表示为16位无符号整形,0表示为32位无符号整形
+#define configUSE_16_BIT_TICKS					0                      
+
+//空闲任务放弃CPU使用权给其他同优先级的用户任务
+#define configIDLE_SHOULD_YIELD					1           
+
+//启用队列
+#define configUSE_QUEUE_SETS					  1    
+
+//开启任务通知功能,默认开启
+#define configUSE_TASK_NOTIFICATIONS    1   
+
+//使用互斥信号量
+#define configUSE_MUTEXES						    1    
+
+//使用递归互斥信号量                                            
+#define configUSE_RECURSIVE_MUTEXES			0   
+
+//为1时使用计数信号量
+#define configUSE_COUNTING_SEMAPHORES		1
+
+/* 设置可以注册的信号量和消息队列个数 */
+#define configQUEUE_REGISTRY_SIZE				10                                 
+                                                                       
+#define configUSE_APPLICATION_TASK_TAG		  0                       
+                      
+
+/*****************************************************************
+              FreeRTOS与内存申请有关配置选项                                               
+*****************************************************************/
+//支持动态内存申请
+#define configSUPPORT_DYNAMIC_ALLOCATION        1    
+//支持静态内存
+#define configSUPPORT_STATIC_ALLOCATION					0					
+//系统所有总的堆大小
+#define configTOTAL_HEAP_SIZE					((size_t)(36*1024))    
+
+
+/***************************************************************
+             FreeRTOS与钩子函数有关的配置选项                                            
+**************************************************************/
+/* 置1:使用空闲钩子(Idle Hook类似于回调函数);置0:忽略空闲钩子
+ * 
+ * 空闲任务钩子是一个函数,这个函数由用户来实现,
+ * FreeRTOS规定了函数的名字和参数:void vApplicationIdleHook(void ),
+ * 这个函数在每个空闲任务周期都会被调用
+ * 对于已经删除的RTOS任务,空闲任务可以释放分配给它们的堆栈内存。
+ * 因此必须保证空闲任务可以被CPU执行
+ * 使用空闲钩子函数设置CPU进入省电模式是很常见的
+ * 不可以调用会引起空闲任务阻塞的API函数
+ */
+#define configUSE_IDLE_HOOK						0      
+
+/* 置1:使用时间片钩子(Tick Hook);置0:忽略时间片钩子
+ * 
+ * 
+ * 时间片钩子是一个函数,这个函数由用户来实现,
+ * FreeRTOS规定了函数的名字和参数:void vApplicationTickHook(void )
+ * 时间片中断可以周期性的调用
+ * 函数必须非常短小,不能大量使用堆栈,
+ * 不能调用以”FromISR" 或 "FROM_ISR”结尾的API函数
+ */
+ /*xTaskIncrementTick函数是在xPortSysTickHandler中断函数中被调用的。因此,vApplicationTickHook()函数执行的时间必须很短才行*/
+#define configUSE_TICK_HOOK						0           
+
+//使用内存申请失败钩子函数
+#define configUSE_MALLOC_FAILED_HOOK			0 
+
+/*
+ * 大于0时启用堆栈溢出检测功能,如果使用此功能 
+ * 用户必须提供一个栈溢出钩子函数,如果使用的话
+ * 此值可以为1或者2,因为有两种栈溢出检测方法 */
+#define configCHECK_FOR_STACK_OVERFLOW			0   
+
+
+/********************************************************************
+          FreeRTOS与运行时间和任务状态收集有关的配置选项   
+**********************************************************************/
+//启用运行时间统计功能
+#define configGENERATE_RUN_TIME_STATS	        0             
+ //启用可视化跟踪调试
+#define configUSE_TRACE_FACILITY				      0    
+/* 与宏configUSE_TRACE_FACILITY同时为1时会编译下面3个函数
+ * prvWriteNameToBuffer()
+ * vTaskList(),
+ * vTaskGetRunTimeStats()
+*/
+#define configUSE_STATS_FORMATTING_FUNCTIONS	1                       
+                                                                        
+                                                                        
+/********************************************************************
+                FreeRTOS与协程有关的配置选项                                                
+*********************************************************************/
+//启用协程,启用协程以后必须添加文件croutine.c
+#define configUSE_CO_ROUTINES 			          0                 
+//协程的有效优先级数目
+#define configMAX_CO_ROUTINE_PRIORITIES       ( 2 )                   
+
+
+/***********************************************************************
+                FreeRTOS与软件定时器有关的配置选项      
+**********************************************************************/
+ //启用软件定时器
+#define configUSE_TIMERS				            0                              
+//软件定时器优先级
+#define configTIMER_TASK_PRIORITY		        (configMAX_PRIORITIES-1)        
+//软件定时器队列长度
+#define configTIMER_QUEUE_LENGTH		        10                               
+//软件定时器任务堆栈大小
+#define configTIMER_TASK_STACK_DEPTH	      (configMINIMAL_STACK_SIZE*2)    
+
+/************************************************************
+            FreeRTOS可选函数配置选项                                                     
+************************************************************/
+#define INCLUDE_xTaskGetSchedulerState       1                       
+#define INCLUDE_vTaskPrioritySet		         1
+#define INCLUDE_uxTaskPriorityGet		         1
+#define INCLUDE_vTaskDelete				           1
+#define INCLUDE_vTaskCleanUpResources	       1
+#define INCLUDE_vTaskSuspend			           1
+#define INCLUDE_vTaskDelayUntil			         1
+#define INCLUDE_vTaskDelay				           1
+#define INCLUDE_eTaskGetState			           1
+#define INCLUDE_xTimerPendFunctionCall	     0
+//#define INCLUDE_xTaskGetCurrentTaskHandle       1
+//#define INCLUDE_uxTaskGetStackHighWaterMark     0
+//#define INCLUDE_xTaskGetIdleTaskHandle          0
+
+
+/******************************************************************
+            FreeRTOS与中断有关的配置选项                                                 
+******************************************************************/
+#ifdef __NVIC_PRIO_BITS
+	#define configPRIO_BITS       		__NVIC_PRIO_BITS
+#else
+	#define configPRIO_BITS       		4                  
+#endif
+//中断最低优先级
+#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY			15     
+
+//系统可管理的最高中断优先级
+#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY	5 
+
+#define configKERNEL_INTERRUPT_PRIORITY 		( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )	/* 240 */
+
+#define configMAX_SYSCALL_INTERRUPT_PRIORITY 	( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - 4) )
+
+
+/****************************************************************
+            FreeRTOS与中断服务函数有关的配置选项                         
+****************************************************************/
+#define xPortPendSVHandler 	PendSV_Handler
+#define vPortSVCHandler 	SVC_Handler
+
+
+/* 以下为使用Percepio Tracealyzer需要的东西,不需要时将 configUSE_TRACE_FACILITY 定义为 0 */
+#if ( configUSE_TRACE_FACILITY == 1 )
+#include "trcRecorder.h"
+#define INCLUDE_xTaskGetCurrentTaskHandle               1   // 启用一个可选函数(该函数被 Trace源码使用,默认该值为0 表示不用)
+#endif
+
+
+#endif /* FREERTOS_CONFIG_H */
+

+ 213 - 0
demo/es32/usb_host/ES32F369x/Inc/ald_conf.h

@@ -0,0 +1,213 @@
+/**
+  *********************************************************************************
+  *
+  * @file    ald_conf.h
+  * @brief   Enable/Disable the peripheral module.
+  *
+  * @version V1.0
+  * @date    26 Jun 2019
+  * @author  AE Team
+  * @note
+  *          Change Logs:
+  *          Date            Author          Notes
+  *          26 Jun 2019     AE Team         The first version
+  *
+  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
+  *
+  * SPDX-License-Identifier: Apache-2.0
+  *
+  * 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
+  *
+  * 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 __ALD_CONF_H__
+#define __ALD_CONF_H__
+
+
+#define ALD_DMA
+#define ALD_GPIO
+#define ALD_UART
+#define ALD_I2C
+#define ALD_CMU
+#define ALD_RMU
+#define ALD_PMU
+#define ALD_WDT
+#define ALD_LCD
+#define ALD_RTC
+#define ALD_CAN
+#define ALD_FLASH
+#define ALD_ADC
+#define ALD_CRC
+#define ALD_CRYPT
+#define ALD_TIMER
+#define ALD_LPTIM
+#define ALD_PIS
+#define ALD_SPI
+#define ALD_CALC
+#define ALD_ACMP
+#define ALD_OPAMP
+#define ALD_TRNG
+#define ALD_TSENSE
+#define ALD_BKPC
+#define ALD_DAC
+#define ALD_IAP
+#define ALD_I2S
+#define ALD_ECC
+#define ALD_NAND
+#define ALD_QSPI
+#define ALD_NOR
+#define ALD_SRAM
+#define ALD_USB
+#define ALD_NOR_LCD
+#define ALD_SYSCFG
+#define ALD_RTCHW
+#if defined(ALD_NAND) || defined(ALD_NOR) || defined(ALD_SRAM)
+#define ALD_EBI
+#endif
+
+#ifdef ALD_GPIO
+	#include "ald_gpio.h"
+#endif	/*ALD_GPIO */
+
+#ifdef ALD_DMA
+	#include "ald_dma.h"
+#endif	/* ALD_DMA */
+
+#ifdef ALD_UART
+	#include "ald_uart.h"
+#endif	/* ALD_UART */
+
+#ifdef ALD_I2C
+	#include "ald_i2c.h"
+#endif	/* ALD_I2C */
+
+#ifdef ALD_CMU
+	#include "ald_cmu.h"
+#endif	/* ALD_CMU */
+
+#ifdef ALD_RMU
+	#include "ald_rmu.h"
+#endif	/* ALD_RMU */
+
+#ifdef ALD_PMU
+	#include "ald_pmu.h"
+#endif	/* ALD_PUM */
+
+#ifdef ALD_WDT
+	#include "ald_wdt.h"
+#endif	/* ALD_WDT */
+
+#ifdef ALD_RTC
+	#include "ald_rtc.h"
+#endif	/* ALD_RTC */
+
+#ifdef ALD_FLASH
+	#include "ald_flash.h"
+#endif	/*ALD_FLASH*/
+
+#ifdef ALD_ADC
+	#include "ald_adc.h"
+#endif	/* ALD_ADC */
+
+#ifdef ALD_CRC
+	#include "ald_crc.h"
+#endif	/* ALD_CRC */
+
+#ifdef ALD_CRYPT
+	#include "ald_crypt.h"
+#endif	/* ALD_CRYPT */
+
+#ifdef ALD_TIMER
+	#include "ald_timer.h"
+#endif	/* ALD_TIMER */
+
+#ifdef ALD_PIS
+	#include "ald_pis.h"
+#endif	/* ALD_PIS */
+
+#ifdef ALD_SPI
+	#include "ald_spi.h"
+#endif	/* ALD_SPI */
+
+#ifdef ALD_CALC
+	#include "ald_calc.h"
+#endif	/* ALD_CALC */
+
+#ifdef ALD_ACMP
+	#include "ald_acmp.h"
+#endif	/* ALD_ACMP */
+
+#ifdef ALD_TRNG
+	#include "ald_trng.h"
+#endif	/* ALD_TRNG */
+
+#ifdef ALD_TSENSE
+	#include "ald_tsense.h"
+#endif	/* ALD_TSENSE */
+
+#ifdef ALD_BKPC
+	#include "ald_bkpc.h"
+#endif	/* ALD_BKPC */
+
+#ifdef ALD_DAC
+	#include "ald_dac.h"
+#endif	/* ALD_DAC */
+
+#ifdef ALD_IAP
+	#include "ald_iap.h"
+#endif	/* ALD_IAP */
+
+#ifdef ALD_CAN
+	#include "ald_can.h"
+#endif	/* ALD_CAN */
+
+#ifdef ALD_QSPI
+	#include "ald_qspi.h"
+#endif	/* ALD_QSPI */
+
+#ifdef ALD_USB
+	#include "ald_usb.h"
+#endif	/* ALD_USB */
+
+#ifdef ALD_SRAM
+	#include "ald_sram.h"
+#endif	/* ALD_SRAM */
+
+#ifdef ALD_EBI
+	#include "ald_ebi.h"
+#endif	/* ALD_EBI */
+
+#ifdef ALD_NAND 
+	#include "ald_nand.h"
+#endif	/* ALD_NAND */
+
+#ifdef ALD_NOR_LCD
+	#include "ald_nor_lcd.h"
+#endif	/* ALD_NOR_LCD */	
+
+#ifdef ALD_I2S
+	#include "ald_i2s.h"
+#endif	/* ALD_I2S */
+
+#ifdef ALD_SYSCFG
+	#include "ald_syscfg.h"
+#endif	/* ALD_SYSCFG */
+
+#ifdef ALD_RTCHW
+	#include "ald_rtchw.h"
+#endif	/* ALD_RTCHW */
+
+#define TICK_INT_PRIORITY	3
+
+#endif

+ 47 - 0
demo/es32/usb_host/ES32F369x/Inc/main.h

@@ -0,0 +1,47 @@
+/**
+  *********************************************************************************
+  *
+  * @file    main.h
+  * @brief   Header file for DEMO
+  *
+  * @version V1.0
+  * @date    26 Jun 2019
+  * @author  AE Team
+  * @note
+  *          Change Logs:
+  *          Date            Author          Notes
+  *          26 Jun 2019     AE Team         The first version
+  *
+  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
+  *
+  * SPDX-License-Identifier: Apache-2.0
+  *
+  * 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
+  *
+  * 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   __MAIN_H__
+#define   __MAIN_H__
+
+#include "ald_conf.h"
+
+typedef struct env_s {
+	uint8_t conn;
+	uint8_t update;
+	uint32_t button;
+	int32_t x_pos;
+	int32_t y_pos;
+} env_t;
+
+extern env_t env;
+#endif

+ 60 - 0
demo/es32/usb_host/ES32F369x/Inc/usb_config.h

@@ -0,0 +1,60 @@
+#ifndef _USB_CONFIG_H
+#define _USB_CONFIG_H
+
+/* USB DEVICE Configuration */
+
+/* USB HOST Configuration */
+#ifndef CONFIG_USBHOST_RHPORTS
+#define CONFIG_USBHOST_RHPORTS 1
+#endif
+
+#ifndef CONFIG_USBHOST_EHPORTS
+#define CONFIG_USBHOST_EHPORTS 4
+#endif
+
+#ifndef CONFIG_USBHOST_INTF_NUM
+#define CONFIG_USBHOST_INTF_NUM 6
+#endif
+
+#ifndef CONFIG_USBHOST_EP_NUM
+#define CONFIG_USBHOST_EP_NUM 2
+#endif
+
+#ifndef CONFIG_USBHOST_HPWORKQ_PRIO
+#define CONFIG_USBHOST_HPWORKQ_PRIO 5
+#endif
+#ifndef CONFIG_USBHOST_HPWORKQ_STACKSIZE
+#define CONFIG_USBHOST_HPWORKQ_STACKSIZE 2048
+#endif
+
+#ifndef CONFIG_USBHOST_LPWORKQ_PRIO
+#define CONFIG_USBHOST_LPWORKQ_PRIO 1
+#endif
+#ifndef CONFIG_USBHOST_LPWORKQ_STACKSIZE
+#define CONFIG_USBHOST_LPWORKQ_STACKSIZE 2048
+#endif
+
+#ifndef CONFIG_USBHOST_PSC_PRIO
+#define CONFIG_USBHOST_PSC_PRIO 4
+#endif
+#ifndef CONFIG_USBHOST_PSC_STACKSIZE
+#define CONFIG_USBHOST_PSC_STACKSIZE 4096
+#endif
+
+#ifndef CONFIG_USBHOST_DEV_NAMELEN
+#define CONFIG_USBHOST_DEV_NAMELEN 16
+#endif
+
+#define CONFIG_USBHOST_ASYNCH
+//#define CONFIG_USBHOST_GET_STRING_DESC
+
+/* EHCI Configuration */
+#define CONFIG_USB_EHCI_HCCR_BASE (0x20072000)
+#define CONFIG_USB_EHCI_HCOR_BASE (0x20072000 + 0x10)
+#define CONFIG_USB_EHCI_QH_NUM    (10)
+#define CONFIG_USB_EHCI_QTD_NUM   (10)
+// #define CONFIG_USB_EHCI_INFO_ENABLE
+// #define CONFIG_USB_ECHI_HCOR_RESERVED
+// #define CONFIG_USB_EHCI_CONFIGFLAG
+
+#endif

+ 705 - 0
demo/es32/usb_host/ES32F369x/MDK-ARM/example.uvoptx

@@ -0,0 +1,705 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd">
+
+  <SchemaVersion>1.0</SchemaVersion>
+
+  <Header>### uVision Project, (C) Keil Software</Header>
+
+  <Extensions>
+    <cExt>*.c</cExt>
+    <aExt>*.s*; *.src; *.a*</aExt>
+    <oExt>*.obj; *.o</oExt>
+    <lExt>*.lib</lExt>
+    <tExt>*.txt; *.h; *.inc; *.md</tExt>
+    <pExt>*.plm</pExt>
+    <CppX>*.cpp</CppX>
+    <nMigrate>0</nMigrate>
+  </Extensions>
+
+  <DaveTm>
+    <dwLowDateTime>0</dwLowDateTime>
+    <dwHighDateTime>0</dwHighDateTime>
+  </DaveTm>
+
+  <Target>
+    <TargetName>target</TargetName>
+    <ToolsetNumber>0x4</ToolsetNumber>
+    <ToolsetName>ARM-ADS</ToolsetName>
+    <TargetOption>
+      <CLKADS>12000000</CLKADS>
+      <OPTTT>
+        <gFlags>1</gFlags>
+        <BeepAtEnd>1</BeepAtEnd>
+        <RunSim>0</RunSim>
+        <RunTarget>1</RunTarget>
+        <RunAbUc>0</RunAbUc>
+      </OPTTT>
+      <OPTHX>
+        <HexSelection>1</HexSelection>
+        <FlashByte>65535</FlashByte>
+        <HexRangeLowAddress>0</HexRangeLowAddress>
+        <HexRangeHighAddress>0</HexRangeHighAddress>
+        <HexOffset>0</HexOffset>
+      </OPTHX>
+      <OPTLEX>
+        <PageWidth>79</PageWidth>
+        <PageLength>66</PageLength>
+        <TabStop>8</TabStop>
+        <ListingPath>.\</ListingPath>
+      </OPTLEX>
+      <ListingPage>
+        <CreateCListing>1</CreateCListing>
+        <CreateAListing>1</CreateAListing>
+        <CreateLListing>1</CreateLListing>
+        <CreateIListing>0</CreateIListing>
+        <AsmCond>1</AsmCond>
+        <AsmSymb>1</AsmSymb>
+        <AsmXref>0</AsmXref>
+        <CCond>1</CCond>
+        <CCode>0</CCode>
+        <CListInc>0</CListInc>
+        <CSymb>0</CSymb>
+        <LinkerCodeListing>0</LinkerCodeListing>
+      </ListingPage>
+      <OPTXL>
+        <LMap>1</LMap>
+        <LComments>1</LComments>
+        <LGenerateSymbols>1</LGenerateSymbols>
+        <LLibSym>1</LLibSym>
+        <LLines>1</LLines>
+        <LLocSym>1</LLocSym>
+        <LPubSym>1</LPubSym>
+        <LXref>0</LXref>
+        <LExpSel>0</LExpSel>
+      </OPTXL>
+      <OPTFL>
+        <tvExp>1</tvExp>
+        <tvExpOptDlg>0</tvExpOptDlg>
+        <IsCurrentTarget>1</IsCurrentTarget>
+      </OPTFL>
+      <CpuCode>255</CpuCode>
+      <DebugOpt>
+        <uSim>0</uSim>
+        <uTrg>1</uTrg>
+        <sLdApp>1</sLdApp>
+        <sGomain>1</sGomain>
+        <sRbreak>1</sRbreak>
+        <sRwatch>1</sRwatch>
+        <sRmem>1</sRmem>
+        <sRfunc>1</sRfunc>
+        <sRbox>1</sRbox>
+        <tLdApp>1</tLdApp>
+        <tGomain>1</tGomain>
+        <tRbreak>1</tRbreak>
+        <tRwatch>1</tRwatch>
+        <tRmem>1</tRmem>
+        <tRfunc>0</tRfunc>
+        <tRbox>1</tRbox>
+        <tRtrace>0</tRtrace>
+        <sRSysVw>1</sRSysVw>
+        <tRSysVw>1</tRSysVw>
+        <sRunDeb>0</sRunDeb>
+        <sLrtime>0</sLrtime>
+        <bEvRecOn>1</bEvRecOn>
+        <bSchkAxf>0</bSchkAxf>
+        <bTchkAxf>0</bTchkAxf>
+        <nTsel>6</nTsel>
+        <sDll></sDll>
+        <sDllPa></sDllPa>
+        <sDlgDll></sDlgDll>
+        <sDlgPa></sDlgPa>
+        <sIfile></sIfile>
+        <tDll></tDll>
+        <tDllPa></tDllPa>
+        <tDlgDll></tDlgDll>
+        <tDlgPa></tDlgPa>
+        <tIfile></tIfile>
+        <pMon>STLink\ST-LINKIII-KEIL_SWO.dll</pMon>
+      </DebugOpt>
+      <TargetDriverDllRegistry>
+        <SetRegEntry>
+          <Number>0</Number>
+          <Key>ST-LINKIII-KEIL_SWO</Key>
+          <Name>-U066EFF555453774987091527 -O207 -SF4000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO131090 -TC10000000 -TT10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO7 -FD20000000 -FC1000 -FN1 -FF0es32f36xx.FLM -FS00 -FL080000 -FP0($$Device:ES32F3696LT$Flash\es32f36xx.FLM)</Name>
+        </SetRegEntry>
+        <SetRegEntry>
+          <Number>0</Number>
+          <Key>CMSIS_AGDI</Key>
+          <Name>-X"essemi CMSIS-DAP" -U0001A000000A -O495 -S0 -C0 -P00000000 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO65554 -TC10000000 -TT10000000 -TP20 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC1000 -FN1 -FF0es32f36xx.FLM -FS00 -FL080000 -FP0($$Device:ES32F3696LT$Flash\es32f36xx.FLM)</Name>
+        </SetRegEntry>
+        <SetRegEntry>
+          <Number>0</Number>
+          <Key>DLGUARM</Key>
+          <Name>(105=-1,-1,-1,-1,0)</Name>
+        </SetRegEntry>
+        <SetRegEntry>
+          <Number>0</Number>
+          <Key>UL2CM3</Key>
+          <Name>UL2CM3(-S0 -C0 -P0 )  -FN1 -FC1000 -FD20000000 -FF0es32f36xx -FL080000 -FS00 -FP0($$Device:ES32F3696LT$Flash\es32f36xx.FLM)</Name>
+        </SetRegEntry>
+        <SetRegEntry>
+          <Number>0</Number>
+          <Key>JL2CM3</Key>
+          <Name>-U788594195 -O78 -S5 -ZTIFSpeedSel1000 -A0 -C0 -JU1 -JI127.0.0.1 -JP0 -RST0 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8004 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -TB1 -TFE0 -FO23 -FD20000000 -FC4000 -FN1 -FF0es32f36xx.FLM -FS00 -FL080000 -FP0($$Device:ES32F3696LT$Flash\es32f36xx.FLM)</Name>
+        </SetRegEntry>
+        <SetRegEntry>
+          <Number>0</Number>
+          <Key>ARMRTXEVENTFLAGS</Key>
+          <Name>-L70 -Z18 -C0 -M0 -T1</Name>
+        </SetRegEntry>
+        <SetRegEntry>
+          <Number>0</Number>
+          <Key>DLGDARM</Key>
+          <Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)</Name>
+        </SetRegEntry>
+        <SetRegEntry>
+          <Number>0</Number>
+          <Key>DLGTARM</Key>
+          <Name>(1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0)</Name>
+        </SetRegEntry>
+        <SetRegEntry>
+          <Number>0</Number>
+          <Key>ARMDBGFLAGS</Key>
+          <Name>-T0</Name>
+        </SetRegEntry>
+      </TargetDriverDllRegistry>
+      <Breakpoint>
+        <Bp>
+          <Number>0</Number>
+          <Type>0</Type>
+          <LineNumber>174</LineNumber>
+          <EnabledFlag>1</EnabledFlag>
+          <Address>14404</Address>
+          <ByteObject>0</ByteObject>
+          <HtxType>0</HtxType>
+          <ManyObjects>0</ManyObjects>
+          <SizeOfObject>0</SizeOfObject>
+          <BreakByAccess>0</BreakByAccess>
+          <BreakIfRCount>1</BreakIfRCount>
+          <Filename>..\..\..\..\..\class\hid\usbh_hid.c</Filename>
+          <ExecCommand></ExecCommand>
+          <Expression>\\out\../../../../../class/hid/usbh_hid.c\174</Expression>
+        </Bp>
+        <Bp>
+          <Number>1</Number>
+          <Type>0</Type>
+          <LineNumber>175</LineNumber>
+          <EnabledFlag>1</EnabledFlag>
+          <Address>14412</Address>
+          <ByteObject>0</ByteObject>
+          <HtxType>0</HtxType>
+          <ManyObjects>0</ManyObjects>
+          <SizeOfObject>0</SizeOfObject>
+          <BreakByAccess>0</BreakByAccess>
+          <BreakIfRCount>1</BreakIfRCount>
+          <Filename>..\..\..\..\..\class\hid\usbh_hid.c</Filename>
+          <ExecCommand></ExecCommand>
+          <Expression>\\out\../../../../../class/hid/usbh_hid.c\175</Expression>
+        </Bp>
+        <Bp>
+          <Number>2</Number>
+          <Type>0</Type>
+          <LineNumber>88</LineNumber>
+          <EnabledFlag>1</EnabledFlag>
+          <Address>0</Address>
+          <ByteObject>0</ByteObject>
+          <HtxType>0</HtxType>
+          <ManyObjects>0</ManyObjects>
+          <SizeOfObject>0</SizeOfObject>
+          <BreakByAccess>0</BreakByAccess>
+          <BreakIfRCount>0</BreakIfRCount>
+          <Filename>..\..\..\..\..\class\hid\usbh_hid.c</Filename>
+          <ExecCommand></ExecCommand>
+          <Expression></Expression>
+        </Bp>
+      </Breakpoint>
+      <WatchWindow1>
+        <Ww>
+          <count>0</count>
+          <WinNumber>1</WinNumber>
+          <ItemText>class_driver</ItemText>
+        </Ww>
+        <Ww>
+          <count>1</count>
+          <WinNumber>1</WinNumber>
+          <ItemText>report_buffer</ItemText>
+        </Ww>
+      </WatchWindow1>
+      <MemoryWindow1>
+        <Mm>
+          <WinNumber>1</WinNumber>
+          <SubType>1</SubType>
+          <ItemText>0x40086510</ItemText>
+          <AccSizeX>0</AccSizeX>
+        </Mm>
+      </MemoryWindow1>
+      <MemoryWindow2>
+        <Mm>
+          <WinNumber>2</WinNumber>
+          <SubType>2</SubType>
+          <ItemText>0x40000000</ItemText>
+          <AccSizeX>0</AccSizeX>
+        </Mm>
+      </MemoryWindow2>
+      <MemoryWindow3>
+        <Mm>
+          <WinNumber>3</WinNumber>
+          <SubType>2</SubType>
+          <ItemText>0x00000000</ItemText>
+          <AccSizeX>0</AccSizeX>
+        </Mm>
+      </MemoryWindow3>
+      <MemoryWindow4>
+        <Mm>
+          <WinNumber>4</WinNumber>
+          <SubType>2</SubType>
+          <ItemText>0x5000</ItemText>
+          <AccSizeX>0</AccSizeX>
+        </Mm>
+      </MemoryWindow4>
+      <Tracepoint>
+        <THDelay>0</THDelay>
+      </Tracepoint>
+      <DebugFlag>
+        <trace>0</trace>
+        <periodic>1</periodic>
+        <aLwin>1</aLwin>
+        <aCover>0</aCover>
+        <aSer1>0</aSer1>
+        <aSer2>0</aSer2>
+        <aPa>0</aPa>
+        <viewmode>1</viewmode>
+        <vrSel>0</vrSel>
+        <aSym>0</aSym>
+        <aTbox>0</aTbox>
+        <AscS1>0</AscS1>
+        <AscS2>0</AscS2>
+        <AscS3>0</AscS3>
+        <aSer3>0</aSer3>
+        <eProf>0</eProf>
+        <aLa>0</aLa>
+        <aPa1>0</aPa1>
+        <AscS4>0</AscS4>
+        <aSer4>0</aSer4>
+        <StkLoc>0</StkLoc>
+        <TrcWin>0</TrcWin>
+        <newCpu>0</newCpu>
+        <uProt>0</uProt>
+      </DebugFlag>
+      <LintExecutable></LintExecutable>
+      <LintConfigFile></LintConfigFile>
+      <bLintAuto>0</bLintAuto>
+      <bAutoGenD>0</bAutoGenD>
+      <LntExFlags>0</LntExFlags>
+      <pMisraName></pMisraName>
+      <pszMrule></pszMrule>
+      <pSingCmds></pSingCmds>
+      <pMultCmds></pMultCmds>
+      <pMisraNamep></pMisraNamep>
+      <pszMrulep></pszMrulep>
+      <pSingCmdsp></pSingCmdsp>
+      <pMultCmdsp></pMultCmdsp>
+    </TargetOption>
+  </Target>
+
+  <Group>
+    <GroupName>startup</GroupName>
+    <tvExp>1</tvExp>
+    <tvExpOptDlg>0</tvExpOptDlg>
+    <cbSel>0</cbSel>
+    <RteFlg>0</RteFlg>
+    <File>
+      <GroupNumber>1</GroupNumber>
+      <FileNumber>1</FileNumber>
+      <FileType>2</FileType>
+      <tvExp>0</tvExp>
+      <tvExpOptDlg>0</tvExpOptDlg>
+      <bDave2>0</bDave2>
+      <PathWithFileName>..\Drivers\CMSIS\Device\EastSoft\ES32F36xx\Startup\keil\startup_es32f36xx.s</PathWithFileName>
+      <FilenameWithoutPath>startup_es32f36xx.s</FilenameWithoutPath>
+      <RteFlg>0</RteFlg>
+      <bShared>0</bShared>
+    </File>
+  </Group>
+
+  <Group>
+    <GroupName>ald</GroupName>
+    <tvExp>0</tvExp>
+    <tvExpOptDlg>0</tvExpOptDlg>
+    <cbSel>0</cbSel>
+    <RteFlg>0</RteFlg>
+    <File>
+      <GroupNumber>2</GroupNumber>
+      <FileNumber>2</FileNumber>
+      <FileType>1</FileType>
+      <tvExp>0</tvExp>
+      <tvExpOptDlg>0</tvExpOptDlg>
+      <bDave2>0</bDave2>
+      <PathWithFileName>..\Drivers\ALD\ES32F36xx\Source\ald_bkpc.c</PathWithFileName>
+      <FilenameWithoutPath>ald_bkpc.c</FilenameWithoutPath>
+      <RteFlg>0</RteFlg>
+      <bShared>0</bShared>
+    </File>
+    <File>
+      <GroupNumber>2</GroupNumber>
+      <FileNumber>3</FileNumber>
+      <FileType>1</FileType>
+      <tvExp>0</tvExp>
+      <tvExpOptDlg>0</tvExpOptDlg>
+      <bDave2>0</bDave2>
+      <PathWithFileName>..\Drivers\ALD\ES32F36xx\Source\ald_cmu.c</PathWithFileName>
+      <FilenameWithoutPath>ald_cmu.c</FilenameWithoutPath>
+      <RteFlg>0</RteFlg>
+      <bShared>0</bShared>
+    </File>
+    <File>
+      <GroupNumber>2</GroupNumber>
+      <FileNumber>4</FileNumber>
+      <FileType>1</FileType>
+      <tvExp>0</tvExp>
+      <tvExpOptDlg>0</tvExpOptDlg>
+      <bDave2>0</bDave2>
+      <PathWithFileName>..\Drivers\ALD\ES32F36xx\Source\ald_dma.c</PathWithFileName>
+      <FilenameWithoutPath>ald_dma.c</FilenameWithoutPath>
+      <RteFlg>0</RteFlg>
+      <bShared>0</bShared>
+    </File>
+    <File>
+      <GroupNumber>2</GroupNumber>
+      <FileNumber>5</FileNumber>
+      <FileType>1</FileType>
+      <tvExp>0</tvExp>
+      <tvExpOptDlg>0</tvExpOptDlg>
+      <bDave2>0</bDave2>
+      <PathWithFileName>..\Drivers\ALD\ES32F36xx\Source\ald_gpio.c</PathWithFileName>
+      <FilenameWithoutPath>ald_gpio.c</FilenameWithoutPath>
+      <RteFlg>0</RteFlg>
+      <bShared>0</bShared>
+    </File>
+    <File>
+      <GroupNumber>2</GroupNumber>
+      <FileNumber>6</FileNumber>
+      <FileType>1</FileType>
+      <tvExp>0</tvExp>
+      <tvExpOptDlg>0</tvExpOptDlg>
+      <bDave2>0</bDave2>
+      <PathWithFileName>..\Drivers\ALD\ES32F36xx\Source\ald_pmu.c</PathWithFileName>
+      <FilenameWithoutPath>ald_pmu.c</FilenameWithoutPath>
+      <RteFlg>0</RteFlg>
+      <bShared>0</bShared>
+    </File>
+    <File>
+      <GroupNumber>2</GroupNumber>
+      <FileNumber>7</FileNumber>
+      <FileType>1</FileType>
+      <tvExp>0</tvExp>
+      <tvExpOptDlg>0</tvExpOptDlg>
+      <bDave2>0</bDave2>
+      <PathWithFileName>..\Drivers\ALD\ES32F36xx\Source\ald_rmu.c</PathWithFileName>
+      <FilenameWithoutPath>ald_rmu.c</FilenameWithoutPath>
+      <RteFlg>0</RteFlg>
+      <bShared>0</bShared>
+    </File>
+    <File>
+      <GroupNumber>2</GroupNumber>
+      <FileNumber>8</FileNumber>
+      <FileType>1</FileType>
+      <tvExp>0</tvExp>
+      <tvExpOptDlg>0</tvExpOptDlg>
+      <bDave2>0</bDave2>
+      <PathWithFileName>..\Drivers\ALD\ES32F36xx\Source\ald_uart.c</PathWithFileName>
+      <FilenameWithoutPath>ald_uart.c</FilenameWithoutPath>
+      <RteFlg>0</RteFlg>
+      <bShared>0</bShared>
+    </File>
+    <File>
+      <GroupNumber>2</GroupNumber>
+      <FileNumber>9</FileNumber>
+      <FileType>1</FileType>
+      <tvExp>0</tvExp>
+      <tvExpOptDlg>0</tvExpOptDlg>
+      <bDave2>0</bDave2>
+      <PathWithFileName>..\Drivers\ALD\ES32F36xx\Source\ald_usb.c</PathWithFileName>
+      <FilenameWithoutPath>ald_usb.c</FilenameWithoutPath>
+      <RteFlg>0</RteFlg>
+      <bShared>0</bShared>
+    </File>
+    <File>
+      <GroupNumber>2</GroupNumber>
+      <FileNumber>10</FileNumber>
+      <FileType>1</FileType>
+      <tvExp>0</tvExp>
+      <tvExpOptDlg>0</tvExpOptDlg>
+      <bDave2>0</bDave2>
+      <PathWithFileName>..\Drivers\ALD\ES32F36xx\Source\ald_iap.c</PathWithFileName>
+      <FilenameWithoutPath>ald_iap.c</FilenameWithoutPath>
+      <RteFlg>0</RteFlg>
+      <bShared>0</bShared>
+    </File>
+    <File>
+      <GroupNumber>2</GroupNumber>
+      <FileNumber>11</FileNumber>
+      <FileType>1</FileType>
+      <tvExp>0</tvExp>
+      <tvExpOptDlg>0</tvExpOptDlg>
+      <bDave2>0</bDave2>
+      <PathWithFileName>..\Drivers\ALD\ES32F36xx\Source\utils.c</PathWithFileName>
+      <FilenameWithoutPath>utils.c</FilenameWithoutPath>
+      <RteFlg>0</RteFlg>
+      <bShared>0</bShared>
+    </File>
+  </Group>
+
+  <Group>
+    <GroupName>app</GroupName>
+    <tvExp>0</tvExp>
+    <tvExpOptDlg>0</tvExpOptDlg>
+    <cbSel>0</cbSel>
+    <RteFlg>0</RteFlg>
+    <File>
+      <GroupNumber>3</GroupNumber>
+      <FileNumber>12</FileNumber>
+      <FileType>1</FileType>
+      <tvExp>0</tvExp>
+      <tvExpOptDlg>0</tvExpOptDlg>
+      <bDave2>0</bDave2>
+      <PathWithFileName>..\Src\main.c</PathWithFileName>
+      <FilenameWithoutPath>main.c</FilenameWithoutPath>
+      <RteFlg>0</RteFlg>
+      <bShared>0</bShared>
+    </File>
+    <File>
+      <GroupNumber>3</GroupNumber>
+      <FileNumber>13</FileNumber>
+      <FileType>1</FileType>
+      <tvExp>0</tvExp>
+      <tvExpOptDlg>0</tvExpOptDlg>
+      <bDave2>0</bDave2>
+      <PathWithFileName>..\Src\irq.c</PathWithFileName>
+      <FilenameWithoutPath>irq.c</FilenameWithoutPath>
+      <RteFlg>0</RteFlg>
+      <bShared>0</bShared>
+    </File>
+    <File>
+      <GroupNumber>3</GroupNumber>
+      <FileNumber>14</FileNumber>
+      <FileType>1</FileType>
+      <tvExp>0</tvExp>
+      <tvExpOptDlg>0</tvExpOptDlg>
+      <bDave2>0</bDave2>
+      <PathWithFileName>..\..\..\..\usb_host.c</PathWithFileName>
+      <FilenameWithoutPath>usb_host.c</FilenameWithoutPath>
+      <RteFlg>0</RteFlg>
+      <bShared>0</bShared>
+    </File>
+  </Group>
+
+  <Group>
+    <GroupName>CherryUSB</GroupName>
+    <tvExp>1</tvExp>
+    <tvExpOptDlg>0</tvExpOptDlg>
+    <cbSel>0</cbSel>
+    <RteFlg>0</RteFlg>
+    <File>
+      <GroupNumber>4</GroupNumber>
+      <FileNumber>15</FileNumber>
+      <FileType>1</FileType>
+      <tvExp>0</tvExp>
+      <tvExpOptDlg>0</tvExpOptDlg>
+      <bDave2>0</bDave2>
+      <PathWithFileName>..\..\..\..\..\core\usbh_core.c</PathWithFileName>
+      <FilenameWithoutPath>usbh_core.c</FilenameWithoutPath>
+      <RteFlg>0</RteFlg>
+      <bShared>0</bShared>
+    </File>
+    <File>
+      <GroupNumber>4</GroupNumber>
+      <FileNumber>16</FileNumber>
+      <FileType>1</FileType>
+      <tvExp>0</tvExp>
+      <tvExpOptDlg>0</tvExpOptDlg>
+      <bDave2>0</bDave2>
+      <PathWithFileName>..\..\..\..\..\class\cdc\usbh_cdc_acm.c</PathWithFileName>
+      <FilenameWithoutPath>usbh_cdc_acm.c</FilenameWithoutPath>
+      <RteFlg>0</RteFlg>
+      <bShared>0</bShared>
+    </File>
+    <File>
+      <GroupNumber>4</GroupNumber>
+      <FileNumber>17</FileNumber>
+      <FileType>1</FileType>
+      <tvExp>0</tvExp>
+      <tvExpOptDlg>0</tvExpOptDlg>
+      <bDave2>0</bDave2>
+      <PathWithFileName>..\..\..\..\..\class\msc\usbh_msc.c</PathWithFileName>
+      <FilenameWithoutPath>usbh_msc.c</FilenameWithoutPath>
+      <RteFlg>0</RteFlg>
+      <bShared>0</bShared>
+    </File>
+    <File>
+      <GroupNumber>4</GroupNumber>
+      <FileNumber>18</FileNumber>
+      <FileType>1</FileType>
+      <tvExp>0</tvExp>
+      <tvExpOptDlg>0</tvExpOptDlg>
+      <bDave2>0</bDave2>
+      <PathWithFileName>..\..\..\..\..\class\hid\usbh_hid.c</PathWithFileName>
+      <FilenameWithoutPath>usbh_hid.c</FilenameWithoutPath>
+      <RteFlg>0</RteFlg>
+      <bShared>0</bShared>
+    </File>
+    <File>
+      <GroupNumber>4</GroupNumber>
+      <FileNumber>19</FileNumber>
+      <FileType>1</FileType>
+      <tvExp>0</tvExp>
+      <tvExpOptDlg>0</tvExpOptDlg>
+      <bDave2>0</bDave2>
+      <PathWithFileName>..\..\..\..\..\class\hub\usbh_hub.c</PathWithFileName>
+      <FilenameWithoutPath>usbh_hub.c</FilenameWithoutPath>
+      <RteFlg>0</RteFlg>
+      <bShared>0</bShared>
+    </File>
+    <File>
+      <GroupNumber>4</GroupNumber>
+      <FileNumber>20</FileNumber>
+      <FileType>1</FileType>
+      <tvExp>0</tvExp>
+      <tvExpOptDlg>0</tvExpOptDlg>
+      <bDave2>0</bDave2>
+      <PathWithFileName>..\..\..\..\..\osal\usb_osal_freertos.c</PathWithFileName>
+      <FilenameWithoutPath>usb_osal_freertos.c</FilenameWithoutPath>
+      <RteFlg>0</RteFlg>
+      <bShared>0</bShared>
+    </File>
+    <File>
+      <GroupNumber>4</GroupNumber>
+      <FileNumber>21</FileNumber>
+      <FileType>1</FileType>
+      <tvExp>0</tvExp>
+      <tvExpOptDlg>0</tvExpOptDlg>
+      <bDave2>0</bDave2>
+      <PathWithFileName>..\..\..\..\..\osal\usb_workq.c</PathWithFileName>
+      <FilenameWithoutPath>usb_workq.c</FilenameWithoutPath>
+      <RteFlg>0</RteFlg>
+      <bShared>0</bShared>
+    </File>
+    <File>
+      <GroupNumber>4</GroupNumber>
+      <FileNumber>22</FileNumber>
+      <FileType>1</FileType>
+      <tvExp>0</tvExp>
+      <tvExpOptDlg>0</tvExpOptDlg>
+      <bDave2>0</bDave2>
+      <PathWithFileName>..\..\..\..\..\port\musb\usb_hc_musb.c</PathWithFileName>
+      <FilenameWithoutPath>usb_hc_musb.c</FilenameWithoutPath>
+      <RteFlg>0</RteFlg>
+      <bShared>0</bShared>
+    </File>
+  </Group>
+
+  <Group>
+    <GroupName>FreeRTOS</GroupName>
+    <tvExp>0</tvExp>
+    <tvExpOptDlg>0</tvExpOptDlg>
+    <cbSel>0</cbSel>
+    <RteFlg>0</RteFlg>
+    <File>
+      <GroupNumber>5</GroupNumber>
+      <FileNumber>23</FileNumber>
+      <FileType>1</FileType>
+      <tvExp>0</tvExp>
+      <tvExpOptDlg>0</tvExpOptDlg>
+      <bDave2>0</bDave2>
+      <PathWithFileName>..\..\..\..\..\third_party\FreeRTOS-10.4\croutine.c</PathWithFileName>
+      <FilenameWithoutPath>croutine.c</FilenameWithoutPath>
+      <RteFlg>0</RteFlg>
+      <bShared>0</bShared>
+    </File>
+    <File>
+      <GroupNumber>5</GroupNumber>
+      <FileNumber>24</FileNumber>
+      <FileType>1</FileType>
+      <tvExp>0</tvExp>
+      <tvExpOptDlg>0</tvExpOptDlg>
+      <bDave2>0</bDave2>
+      <PathWithFileName>..\..\..\..\..\third_party\FreeRTOS-10.4\event_groups.c</PathWithFileName>
+      <FilenameWithoutPath>event_groups.c</FilenameWithoutPath>
+      <RteFlg>0</RteFlg>
+      <bShared>0</bShared>
+    </File>
+    <File>
+      <GroupNumber>5</GroupNumber>
+      <FileNumber>25</FileNumber>
+      <FileType>1</FileType>
+      <tvExp>0</tvExp>
+      <tvExpOptDlg>0</tvExpOptDlg>
+      <bDave2>0</bDave2>
+      <PathWithFileName>..\..\..\..\..\third_party\FreeRTOS-10.4\list.c</PathWithFileName>
+      <FilenameWithoutPath>list.c</FilenameWithoutPath>
+      <RteFlg>0</RteFlg>
+      <bShared>0</bShared>
+    </File>
+    <File>
+      <GroupNumber>5</GroupNumber>
+      <FileNumber>26</FileNumber>
+      <FileType>1</FileType>
+      <tvExp>0</tvExp>
+      <tvExpOptDlg>0</tvExpOptDlg>
+      <bDave2>0</bDave2>
+      <PathWithFileName>..\..\..\..\..\third_party\FreeRTOS-10.4\queue.c</PathWithFileName>
+      <FilenameWithoutPath>queue.c</FilenameWithoutPath>
+      <RteFlg>0</RteFlg>
+      <bShared>0</bShared>
+    </File>
+    <File>
+      <GroupNumber>5</GroupNumber>
+      <FileNumber>27</FileNumber>
+      <FileType>1</FileType>
+      <tvExp>0</tvExp>
+      <tvExpOptDlg>0</tvExpOptDlg>
+      <bDave2>0</bDave2>
+      <PathWithFileName>..\..\..\..\..\third_party\FreeRTOS-10.4\tasks.c</PathWithFileName>
+      <FilenameWithoutPath>tasks.c</FilenameWithoutPath>
+      <RteFlg>0</RteFlg>
+      <bShared>0</bShared>
+    </File>
+    <File>
+      <GroupNumber>5</GroupNumber>
+      <FileNumber>28</FileNumber>
+      <FileType>1</FileType>
+      <tvExp>0</tvExp>
+      <tvExpOptDlg>0</tvExpOptDlg>
+      <bDave2>0</bDave2>
+      <PathWithFileName>..\..\..\..\..\third_party\FreeRTOS-10.4\timers.c</PathWithFileName>
+      <FilenameWithoutPath>timers.c</FilenameWithoutPath>
+      <RteFlg>0</RteFlg>
+      <bShared>0</bShared>
+    </File>
+    <File>
+      <GroupNumber>5</GroupNumber>
+      <FileNumber>29</FileNumber>
+      <FileType>1</FileType>
+      <tvExp>0</tvExp>
+      <tvExpOptDlg>0</tvExpOptDlg>
+      <bDave2>0</bDave2>
+      <PathWithFileName>..\..\..\..\..\third_party\FreeRTOS-10.4\portable\MemMang\heap_4.c</PathWithFileName>
+      <FilenameWithoutPath>heap_4.c</FilenameWithoutPath>
+      <RteFlg>0</RteFlg>
+      <bShared>0</bShared>
+    </File>
+    <File>
+      <GroupNumber>5</GroupNumber>
+      <FileNumber>30</FileNumber>
+      <FileType>1</FileType>
+      <tvExp>0</tvExp>
+      <tvExpOptDlg>0</tvExpOptDlg>
+      <bDave2>0</bDave2>
+      <PathWithFileName>..\..\..\..\..\third_party\FreeRTOS-10.4\portable\GCC\ARM_CM3\port.c</PathWithFileName>
+      <FilenameWithoutPath>port.c</FilenameWithoutPath>
+      <RteFlg>0</RteFlg>
+      <bShared>0</bShared>
+    </File>
+  </Group>
+
+</ProjectOpt>

+ 594 - 0
demo/es32/usb_host/ES32F369x/MDK-ARM/example.uvprojx

@@ -0,0 +1,594 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
+<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_projx.xsd">
+
+  <SchemaVersion>2.1</SchemaVersion>
+
+  <Header>### uVision Project, (C) Keil Software</Header>
+
+  <Targets>
+    <Target>
+      <TargetName>target</TargetName>
+      <ToolsetNumber>0x4</ToolsetNumber>
+      <ToolsetName>ARM-ADS</ToolsetName>
+      <pArmCC>6140001::V6.14.1::ARMCLANG</pArmCC>
+      <pCCUsed>6140001::V6.14.1::ARMCLANG</pCCUsed>
+      <uAC6>1</uAC6>
+      <TargetOption>
+        <TargetCommonOption>
+          <Device>ES32F3696LT</Device>
+          <Vendor>Eastsoft</Vendor>
+          <PackID>Eastsoft.ES32_DFP.1.0.10</PackID>
+          <PackURL>http://www.essemi.com/index/article/download?id=921</PackURL>
+          <Cpu>IRAM(0x20000000,0x00018000) IROM(0x00000000,0x00080000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE</Cpu>
+          <FlashUtilSpec></FlashUtilSpec>
+          <StartupFile></StartupFile>
+          <FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0es32f36xx -FS00 -FL080000 -FP0($$Device:ES32F3696LT$Flash\es32f36xx.FLM))</FlashDriverDll>
+          <DeviceId>0</DeviceId>
+          <RegisterFile>$$Device:ES32F3696LT$Device\Include\es32f36xx.h</RegisterFile>
+          <MemoryEnv></MemoryEnv>
+          <Cmp></Cmp>
+          <Asm></Asm>
+          <Linker></Linker>
+          <OHString></OHString>
+          <InfinionOptionDll></InfinionOptionDll>
+          <SLE66CMisc></SLE66CMisc>
+          <SLE66AMisc></SLE66AMisc>
+          <SLE66LinkerMisc></SLE66LinkerMisc>
+          <SFDFile>$$Device:ES32F3696LT$SVD\es32f3xx.svd</SFDFile>
+          <bCustSvd>0</bCustSvd>
+          <UseEnv>0</UseEnv>
+          <BinPath></BinPath>
+          <IncludePath></IncludePath>
+          <LibPath></LibPath>
+          <RegisterFilePath></RegisterFilePath>
+          <DBRegisterFilePath></DBRegisterFilePath>
+          <TargetStatus>
+            <Error>0</Error>
+            <ExitCodeStop>0</ExitCodeStop>
+            <ButtonStop>0</ButtonStop>
+            <NotGenerated>0</NotGenerated>
+            <InvalidFlash>1</InvalidFlash>
+          </TargetStatus>
+          <OutputDirectory>.\obj\</OutputDirectory>
+          <OutputName>out</OutputName>
+          <CreateExecutable>1</CreateExecutable>
+          <CreateLib>0</CreateLib>
+          <CreateHexFile>1</CreateHexFile>
+          <DebugInformation>1</DebugInformation>
+          <BrowseInformation>1</BrowseInformation>
+          <ListingPath>.\</ListingPath>
+          <HexFormatSelection>1</HexFormatSelection>
+          <Merge32K>0</Merge32K>
+          <CreateBatchFile>0</CreateBatchFile>
+          <BeforeCompile>
+            <RunUserProg1>0</RunUserProg1>
+            <RunUserProg2>0</RunUserProg2>
+            <UserProg1Name></UserProg1Name>
+            <UserProg2Name></UserProg2Name>
+            <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
+            <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
+            <nStopU1X>0</nStopU1X>
+            <nStopU2X>0</nStopU2X>
+          </BeforeCompile>
+          <BeforeMake>
+            <RunUserProg1>0</RunUserProg1>
+            <RunUserProg2>0</RunUserProg2>
+            <UserProg1Name></UserProg1Name>
+            <UserProg2Name></UserProg2Name>
+            <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
+            <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
+            <nStopB1X>0</nStopB1X>
+            <nStopB2X>0</nStopB2X>
+          </BeforeMake>
+          <AfterMake>
+            <RunUserProg1>0</RunUserProg1>
+            <RunUserProg2>0</RunUserProg2>
+            <UserProg1Name></UserProg1Name>
+            <UserProg2Name></UserProg2Name>
+            <UserProg1Dos16Mode>0</UserProg1Dos16Mode>
+            <UserProg2Dos16Mode>0</UserProg2Dos16Mode>
+            <nStopA1X>0</nStopA1X>
+            <nStopA2X>0</nStopA2X>
+          </AfterMake>
+          <SelectedForBatchBuild>0</SelectedForBatchBuild>
+          <SVCSIdString></SVCSIdString>
+        </TargetCommonOption>
+        <CommonProperty>
+          <UseCPPCompiler>0</UseCPPCompiler>
+          <RVCTCodeConst>0</RVCTCodeConst>
+          <RVCTZI>0</RVCTZI>
+          <RVCTOtherData>0</RVCTOtherData>
+          <ModuleSelection>0</ModuleSelection>
+          <IncludeInBuild>1</IncludeInBuild>
+          <AlwaysBuild>0</AlwaysBuild>
+          <GenerateAssemblyFile>0</GenerateAssemblyFile>
+          <AssembleAssemblyFile>0</AssembleAssemblyFile>
+          <PublicsOnly>0</PublicsOnly>
+          <StopOnExitCode>3</StopOnExitCode>
+          <CustomArgument></CustomArgument>
+          <IncludeLibraryModules></IncludeLibraryModules>
+          <ComprImg>1</ComprImg>
+        </CommonProperty>
+        <DllOption>
+          <SimDllName>SARMCM3.DLL</SimDllName>
+          <SimDllArguments>  -MPU</SimDllArguments>
+          <SimDlgDll>DCM.DLL</SimDlgDll>
+          <SimDlgDllArguments>-pCM3</SimDlgDllArguments>
+          <TargetDllName>SARMCM3.DLL</TargetDllName>
+          <TargetDllArguments> -MPU</TargetDllArguments>
+          <TargetDlgDll>TCM.DLL</TargetDlgDll>
+          <TargetDlgDllArguments>-pCM3</TargetDlgDllArguments>
+        </DllOption>
+        <DebugOption>
+          <OPTHX>
+            <HexSelection>1</HexSelection>
+            <HexRangeLowAddress>0</HexRangeLowAddress>
+            <HexRangeHighAddress>0</HexRangeHighAddress>
+            <HexOffset>0</HexOffset>
+            <Oh166RecLen>16</Oh166RecLen>
+          </OPTHX>
+        </DebugOption>
+        <Utilities>
+          <Flash1>
+            <UseTargetDll>1</UseTargetDll>
+            <UseExternalTool>0</UseExternalTool>
+            <RunIndependent>0</RunIndependent>
+            <UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging>
+            <Capability>1</Capability>
+            <DriverSelection>4096</DriverSelection>
+          </Flash1>
+          <bUseTDR>1</bUseTDR>
+          <Flash2>BIN\UL2CM3.DLL</Flash2>
+          <Flash3></Flash3>
+          <Flash4></Flash4>
+          <pFcarmOut></pFcarmOut>
+          <pFcarmGrp></pFcarmGrp>
+          <pFcArmRoot></pFcArmRoot>
+          <FcArmLst>0</FcArmLst>
+        </Utilities>
+        <TargetArmAds>
+          <ArmAdsMisc>
+            <GenerateListings>0</GenerateListings>
+            <asHll>1</asHll>
+            <asAsm>1</asAsm>
+            <asMacX>1</asMacX>
+            <asSyms>1</asSyms>
+            <asFals>1</asFals>
+            <asDbgD>1</asDbgD>
+            <asForm>1</asForm>
+            <ldLst>0</ldLst>
+            <ldmm>1</ldmm>
+            <ldXref>1</ldXref>
+            <BigEnd>0</BigEnd>
+            <AdsALst>1</AdsALst>
+            <AdsACrf>1</AdsACrf>
+            <AdsANop>0</AdsANop>
+            <AdsANot>0</AdsANot>
+            <AdsLLst>1</AdsLLst>
+            <AdsLmap>1</AdsLmap>
+            <AdsLcgr>1</AdsLcgr>
+            <AdsLsym>1</AdsLsym>
+            <AdsLszi>1</AdsLszi>
+            <AdsLtoi>1</AdsLtoi>
+            <AdsLsun>1</AdsLsun>
+            <AdsLven>1</AdsLven>
+            <AdsLsxf>1</AdsLsxf>
+            <RvctClst>0</RvctClst>
+            <GenPPlst>0</GenPPlst>
+            <AdsCpuType>"Cortex-M3"</AdsCpuType>
+            <RvctDeviceName></RvctDeviceName>
+            <mOS>0</mOS>
+            <uocRom>0</uocRom>
+            <uocRam>0</uocRam>
+            <hadIROM>1</hadIROM>
+            <hadIRAM>1</hadIRAM>
+            <hadXRAM>0</hadXRAM>
+            <uocXRam>0</uocXRam>
+            <RvdsVP>0</RvdsVP>
+            <RvdsMve>0</RvdsMve>
+            <RvdsCdeCp>0</RvdsCdeCp>
+            <hadIRAM2>0</hadIRAM2>
+            <hadIROM2>0</hadIROM2>
+            <StupSel>8</StupSel>
+            <useUlib>1</useUlib>
+            <EndSel>0</EndSel>
+            <uLtcg>0</uLtcg>
+            <nSecure>0</nSecure>
+            <RoSelD>3</RoSelD>
+            <RwSelD>3</RwSelD>
+            <CodeSel>0</CodeSel>
+            <OptFeed>0</OptFeed>
+            <NoZi1>0</NoZi1>
+            <NoZi2>0</NoZi2>
+            <NoZi3>0</NoZi3>
+            <NoZi4>0</NoZi4>
+            <NoZi5>0</NoZi5>
+            <Ro1Chk>0</Ro1Chk>
+            <Ro2Chk>0</Ro2Chk>
+            <Ro3Chk>0</Ro3Chk>
+            <Ir1Chk>1</Ir1Chk>
+            <Ir2Chk>0</Ir2Chk>
+            <Ra1Chk>0</Ra1Chk>
+            <Ra2Chk>0</Ra2Chk>
+            <Ra3Chk>0</Ra3Chk>
+            <Im1Chk>1</Im1Chk>
+            <Im2Chk>0</Im2Chk>
+            <OnChipMemories>
+              <Ocm1>
+                <Type>0</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x0</Size>
+              </Ocm1>
+              <Ocm2>
+                <Type>0</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x0</Size>
+              </Ocm2>
+              <Ocm3>
+                <Type>0</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x0</Size>
+              </Ocm3>
+              <Ocm4>
+                <Type>0</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x0</Size>
+              </Ocm4>
+              <Ocm5>
+                <Type>0</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x0</Size>
+              </Ocm5>
+              <Ocm6>
+                <Type>0</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x0</Size>
+              </Ocm6>
+              <IRAM>
+                <Type>0</Type>
+                <StartAddress>0x20000000</StartAddress>
+                <Size>0x18000</Size>
+              </IRAM>
+              <IROM>
+                <Type>1</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x80000</Size>
+              </IROM>
+              <XRAM>
+                <Type>0</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x0</Size>
+              </XRAM>
+              <OCR_RVCT1>
+                <Type>1</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x0</Size>
+              </OCR_RVCT1>
+              <OCR_RVCT2>
+                <Type>1</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x0</Size>
+              </OCR_RVCT2>
+              <OCR_RVCT3>
+                <Type>1</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x0</Size>
+              </OCR_RVCT3>
+              <OCR_RVCT4>
+                <Type>1</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x80000</Size>
+              </OCR_RVCT4>
+              <OCR_RVCT5>
+                <Type>1</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x0</Size>
+              </OCR_RVCT5>
+              <OCR_RVCT6>
+                <Type>0</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x0</Size>
+              </OCR_RVCT6>
+              <OCR_RVCT7>
+                <Type>0</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x0</Size>
+              </OCR_RVCT7>
+              <OCR_RVCT8>
+                <Type>0</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x0</Size>
+              </OCR_RVCT8>
+              <OCR_RVCT9>
+                <Type>0</Type>
+                <StartAddress>0x20000000</StartAddress>
+                <Size>0x18000</Size>
+              </OCR_RVCT9>
+              <OCR_RVCT10>
+                <Type>0</Type>
+                <StartAddress>0x0</StartAddress>
+                <Size>0x0</Size>
+              </OCR_RVCT10>
+            </OnChipMemories>
+            <RvctStartVector></RvctStartVector>
+          </ArmAdsMisc>
+          <Cads>
+            <interw>1</interw>
+            <Optim>2</Optim>
+            <oTime>0</oTime>
+            <SplitLS>0</SplitLS>
+            <OneElfS>1</OneElfS>
+            <Strict>0</Strict>
+            <EnumInt>0</EnumInt>
+            <PlainCh>0</PlainCh>
+            <Ropi>0</Ropi>
+            <Rwpi>0</Rwpi>
+            <wLevel>3</wLevel>
+            <uThumb>0</uThumb>
+            <uSurpInc>0</uSurpInc>
+            <uC99>0</uC99>
+            <uGnu>0</uGnu>
+            <useXO>0</useXO>
+            <v6Lang>3</v6Lang>
+            <v6LangP>3</v6LangP>
+            <vShortEn>1</vShortEn>
+            <vShortWch>1</vShortWch>
+            <v6Lto>0</v6Lto>
+            <v6WtE>0</v6WtE>
+            <v6Rtti>0</v6Rtti>
+            <VariousControls>
+              <MiscControls></MiscControls>
+              <Define>USE_ASSERT,ES32F36xx,USBD_CDC_HS</Define>
+              <Undefine></Undefine>
+              <IncludePath>..\Drivers\CMSIS\Include;..\Drivers\CMSIS\Device\EastSoft\ES32F36xx\Include;..\Drivers\ALD\ES32F36xx\Include;..\Inc;..\..\..\..\..\common;..\..\..\..\..\core;..\..\..\..\..\class\cdc;..\..\..\..\..\class\hid;..\..\..\..\..\class\msc;..\..\..\..\..\class\hub;..\..\..\..\..\osal;..\..\..\..\..\third_party\FreeRTOS-10.4\include;..\..\..\..\..\third_party\FreeRTOS-10.4\portable\GCC\ARM_CM3</IncludePath>
+            </VariousControls>
+          </Cads>
+          <Aads>
+            <interw>1</interw>
+            <Ropi>0</Ropi>
+            <Rwpi>0</Rwpi>
+            <thumb>0</thumb>
+            <SplitLS>0</SplitLS>
+            <SwStkChk>0</SwStkChk>
+            <NoWarn>0</NoWarn>
+            <uSurpInc>0</uSurpInc>
+            <useXO>0</useXO>
+            <ClangAsOpt>4</ClangAsOpt>
+            <VariousControls>
+              <MiscControls></MiscControls>
+              <Define></Define>
+              <Undefine></Undefine>
+              <IncludePath></IncludePath>
+            </VariousControls>
+          </Aads>
+          <LDads>
+            <umfTarg>1</umfTarg>
+            <Ropi>0</Ropi>
+            <Rwpi>0</Rwpi>
+            <noStLib>0</noStLib>
+            <RepFail>1</RepFail>
+            <useFile>0</useFile>
+            <TextAddressRange>0x00000000</TextAddressRange>
+            <DataAddressRange>0x00000000</DataAddressRange>
+            <pXoBase></pXoBase>
+            <ScatterFile></ScatterFile>
+            <IncludeLibs></IncludeLibs>
+            <IncludeLibsPath></IncludeLibsPath>
+            <Misc></Misc>
+            <LinkerInputFile></LinkerInputFile>
+            <DisabledWarnings></DisabledWarnings>
+          </LDads>
+        </TargetArmAds>
+      </TargetOption>
+      <Groups>
+        <Group>
+          <GroupName>startup</GroupName>
+          <Files>
+            <File>
+              <FileName>startup_es32f36xx.s</FileName>
+              <FileType>2</FileType>
+              <FilePath>..\Drivers\CMSIS\Device\EastSoft\ES32F36xx\Startup\keil\startup_es32f36xx.s</FilePath>
+            </File>
+          </Files>
+        </Group>
+        <Group>
+          <GroupName>ald</GroupName>
+          <Files>
+            <File>
+              <FileName>ald_bkpc.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\Drivers\ALD\ES32F36xx\Source\ald_bkpc.c</FilePath>
+            </File>
+            <File>
+              <FileName>ald_cmu.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\Drivers\ALD\ES32F36xx\Source\ald_cmu.c</FilePath>
+            </File>
+            <File>
+              <FileName>ald_dma.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\Drivers\ALD\ES32F36xx\Source\ald_dma.c</FilePath>
+            </File>
+            <File>
+              <FileName>ald_gpio.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\Drivers\ALD\ES32F36xx\Source\ald_gpio.c</FilePath>
+            </File>
+            <File>
+              <FileName>ald_pmu.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\Drivers\ALD\ES32F36xx\Source\ald_pmu.c</FilePath>
+            </File>
+            <File>
+              <FileName>ald_rmu.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\Drivers\ALD\ES32F36xx\Source\ald_rmu.c</FilePath>
+            </File>
+            <File>
+              <FileName>ald_uart.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\Drivers\ALD\ES32F36xx\Source\ald_uart.c</FilePath>
+            </File>
+            <File>
+              <FileName>ald_usb.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\Drivers\ALD\ES32F36xx\Source\ald_usb.c</FilePath>
+            </File>
+            <File>
+              <FileName>ald_iap.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\Drivers\ALD\ES32F36xx\Source\ald_iap.c</FilePath>
+            </File>
+            <File>
+              <FileName>utils.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\Drivers\ALD\ES32F36xx\Source\utils.c</FilePath>
+            </File>
+          </Files>
+        </Group>
+        <Group>
+          <GroupName>app</GroupName>
+          <Files>
+            <File>
+              <FileName>main.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\Src\main.c</FilePath>
+            </File>
+            <File>
+              <FileName>irq.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\Src\irq.c</FilePath>
+            </File>
+            <File>
+              <FileName>usb_host.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\..\..\..\usb_host.c</FilePath>
+            </File>
+          </Files>
+        </Group>
+        <Group>
+          <GroupName>CherryUSB</GroupName>
+          <Files>
+            <File>
+              <FileName>usbh_core.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\..\..\..\..\core\usbh_core.c</FilePath>
+            </File>
+            <File>
+              <FileName>usbh_cdc_acm.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\..\..\..\..\class\cdc\usbh_cdc_acm.c</FilePath>
+            </File>
+            <File>
+              <FileName>usbh_msc.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\..\..\..\..\class\msc\usbh_msc.c</FilePath>
+            </File>
+            <File>
+              <FileName>usbh_hid.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\..\..\..\..\class\hid\usbh_hid.c</FilePath>
+            </File>
+            <File>
+              <FileName>usbh_hub.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\..\..\..\..\class\hub\usbh_hub.c</FilePath>
+            </File>
+            <File>
+              <FileName>usb_osal_freertos.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\..\..\..\..\osal\usb_osal_freertos.c</FilePath>
+            </File>
+            <File>
+              <FileName>usb_workq.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\..\..\..\..\osal\usb_workq.c</FilePath>
+            </File>
+            <File>
+              <FileName>usb_hc_musb.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\..\..\..\..\port\musb\usb_hc_musb.c</FilePath>
+            </File>
+          </Files>
+        </Group>
+        <Group>
+          <GroupName>FreeRTOS</GroupName>
+          <Files>
+            <File>
+              <FileName>croutine.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\..\..\..\..\third_party\FreeRTOS-10.4\croutine.c</FilePath>
+            </File>
+            <File>
+              <FileName>event_groups.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\..\..\..\..\third_party\FreeRTOS-10.4\event_groups.c</FilePath>
+            </File>
+            <File>
+              <FileName>list.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\..\..\..\..\third_party\FreeRTOS-10.4\list.c</FilePath>
+            </File>
+            <File>
+              <FileName>queue.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\..\..\..\..\third_party\FreeRTOS-10.4\queue.c</FilePath>
+            </File>
+            <File>
+              <FileName>tasks.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\..\..\..\..\third_party\FreeRTOS-10.4\tasks.c</FilePath>
+            </File>
+            <File>
+              <FileName>timers.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\..\..\..\..\third_party\FreeRTOS-10.4\timers.c</FilePath>
+            </File>
+            <File>
+              <FileName>heap_4.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\..\..\..\..\third_party\FreeRTOS-10.4\portable\MemMang\heap_4.c</FilePath>
+            </File>
+            <File>
+              <FileName>port.c</FileName>
+              <FileType>1</FileType>
+              <FilePath>..\..\..\..\..\third_party\FreeRTOS-10.4\portable\GCC\ARM_CM3\port.c</FilePath>
+            </File>
+          </Files>
+        </Group>
+      </Groups>
+    </Target>
+  </Targets>
+
+  <RTE>
+    <apis/>
+    <components/>
+    <files>
+      <file attr="config" category="source" condition="Compiler ARMCC" name="Device\Source\ARM\startup_es32f0xx.s" version="0.0.1">
+        <instance index="0" removed="1">RTE\Device\ES32F0031XNLN\startup_es32f0xx.s</instance>
+        <component Cclass="Device" Cgroup="Startup" Cvendor="Eastsoft" Cversion="0.0.1" condition="ES32F0xx"/>
+        <package name="ES32_DFP" schemaVersion="1.4" supportContact="support@essemi.com" url="www.essemi.com" vendor="Eastsoft" version="0.0.1"/>
+        <targetInfos/>
+      </file>
+      <file attr="config" category="source" condition="Compiler ARMCC" name="Device\Source\ARM\startup_es32f0xx.s" version="1.0.0">
+        <instance index="0" removed="1">RTE\Device\ES32F0334LX\startup_es32f0xx.s</instance>
+        <component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="ES32F0xx"/>
+        <package name="ES32F033x_F065x_F093x_DFP" schemaVersion="1.4" supportContact="support@essemi.com" url="http://www.essemi.com" vendor="Keil" version="1.0.0"/>
+        <targetInfos/>
+      </file>
+      <file attr="config" category="source" condition="Compiler ARMCC" name="Device\Source\ARM\startup_es32f0xx.s" version="1.0.0">
+        <instance index="0" removed="1">RTE\Device\ES32F0356NLXN\startup_es32f0xx.s</instance>
+        <component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="ES32F0xx"/>
+        <package name="ES32F0396_F0356_F0336_DFP" schemaVersion="1.4" supportContact="support@essemi.com" url="http://www.essemi.com" vendor="Keil" version="1.0.0"/>
+        <targetInfos/>
+      </file>
+      <file attr="config" category="source" condition="Compiler ARMCC" name="Device\Source\ARM\startup_es32f0xx.s" version="1.0.0">
+        <instance index="0" removed="1">RTE\Device\ES32F0396XNLN\startup_es32f0xx.s</instance>
+        <component Cclass="Device" Cgroup="Startup" Cvendor="Keil" Cversion="1.0.0" condition="ES32F0xx"/>
+        <package name="ES32F0396_F0356_F0336_DFP" schemaVersion="1.4" supportContact="support@essemi.com" url="http://www.essemi.com" vendor="Keil" version="1.0.0"/>
+        <targetInfos/>
+      </file>
+    </files>
+  </RTE>
+
+</Project>

+ 181 - 0
demo/es32/usb_host/ES32F369x/Src/irq.c

@@ -0,0 +1,181 @@
+/**
+  *********************************************************************************
+  *
+  * @file    irq.c
+  * @brief   Interrupt handler
+  *
+  * @version V1.0
+  * @date    26 Jun 2019
+  * @author  AE Team
+  * @note
+  *          Change Logs:
+  *          Date            Author          Notes
+  *          26 Jun 2019     AE Team         The first version
+  *
+  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
+  *
+  * SPDX-License-Identifier: Apache-2.0
+  *
+  * 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
+  *
+  * 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.
+  **********************************************************************************
+  */
+
+#include "main.h"
+#include "utils.h"
+#include "ald_cmu.h"
+#ifdef ALD_DMA
+#include "ald_dma.h"
+#endif
+#include "FreeRTOS.h"
+#include "task.h"
+
+/** @addtogroup Projects_Examples_ALD
+  * @{
+  */
+
+/** @addtogroup Examples
+  * @{
+  */
+
+/**
+  * @brief  NMI IRQ handler
+  * @retval None
+  */
+void NMI_Handler(void)
+{
+	/* Added Emergency operation */
+	return;
+}
+
+/**
+  * @brief  Hardfault IRQ handler
+  * @retval None
+  */
+void HardFault_Handler(void)
+{
+	/* Added debug information */
+	while (1)
+		;
+}
+
+/**
+  * @brief  MemManage IRQ handler
+  * @retval None
+  */
+void MemManage_Handler(void)
+{
+	/* Added debug information */
+	while (1)
+		;
+}
+
+/**
+  * @brief  BusFault IRQ handler
+  * @retval None
+  */
+void BusFault_Handler(void)
+{
+	/* Added debug information */
+	while (1)
+		;
+}
+
+/**
+  * @brief  UsageFault IRQ handler
+  * @retval None
+  */
+void UsageFault_Handler(void)
+{
+	/* Added debug information */
+	while (1)
+		;
+}
+
+/**
+  * @brief  Supervisor Call IRQ handler
+  * @retval None
+  */
+//void SVC_Handler(void)
+//{
+//	/* Added system callback */
+//	return;
+//}
+
+/**
+  * @brief  Debug Monitor IRQ handler
+  * @retval None
+  */
+void DebugMon_Handler(void)
+{
+	/* Added debug operation */
+	return;
+}
+
+///**
+//  * @brief  PendSV IRQ handler
+//  * @retval None
+//  */
+//void PendSV_Handler(void)
+//{
+//	/* Added thread switching operation */
+//	return;
+//}
+
+/**
+  * @brief  SysTick IRQ handler
+  * @retval None
+  */
+void SysTick_Handler(void)
+{
+    ald_inc_tick();
+    if (xTaskGetSchedulerState() != taskSCHEDULER_NOT_STARTED){
+	xPortSysTickHandler();
+}
+	return;
+}
+
+#ifdef ALD_DMA
+/**
+  * @brief  DMA IRQ#66 handler
+  * @retval None
+  */
+void DMA_Handler(void)
+{
+	ald_dma_irq_handler();
+}
+#endif
+
+
+/**
+  * @brief  USB IRQ#70 handler
+  * @retval None
+  */
+//void USB_INT_Handler()
+//{
+//	usb0_device_int_handler();
+//}
+
+/**
+  * @brief  USB_DMA IRQ#71 handler
+  * @retval None
+  */
+//void USB_DMA_Handler()
+//{
+//	usb0_dma_int_handler();
+//}
+/**
+  * @}
+  */
+/**
+  * @}
+  */

+ 178 - 0
demo/es32/usb_host/ES32F369x/Src/main.c

@@ -0,0 +1,178 @@
+/**
+  *********************************************************************************
+  *
+  * @file    main.c
+  * @brief   Main file for DEMO
+  *
+  * @version V1.0
+  * @date    26 Jun 2019
+  * @author  AE Team
+  * @note
+  *          Change Logs:
+  *          Date            Author          Notes
+  *          26 Jun 2019     AE Team         The first version
+  *
+  * Copyright (C) Shanghai Eastsoft Microelectronics Co. Ltd. All rights reserved.
+  *
+  * SPDX-License-Identifier: Apache-2.0
+  *
+  * 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
+  *
+  * 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.
+  **********************************************************************************
+  */
+#include "main.h"
+#include "stdio.h"
+#include "FreeRTOS.h"
+#include "task.h"
+#include "usbh_core.h"
+
+static void vtask_led(void *pvParameters);
+uart_handle_t h_uart = { 0 };
+/** @addtogroup Projects_Examples_USB
+  * @{
+  */
+int fputc(int ch, FILE *f)
+{
+    ald_uart_send(&h_uart, (uint8_t *)&ch, 1, 1000);
+    return ch;
+}
+
+/**
+  * @brief  Initializate pin of USB.
+  * @retval None
+  */
+void usb_pin_init(void)
+{
+    gpio_init_t x;
+
+    /* Initialize vbus pin */
+    x.mode = GPIO_MODE_OUTPUT;
+    x.odos = GPIO_PUSH_PULL;
+    x.pupd = GPIO_PUSH_UP;
+    x.podrv = GPIO_OUT_DRIVE_6;
+    x.nodrv = GPIO_OUT_DRIVE_6;
+    x.flt = GPIO_FILTER_DISABLE;
+    x.type = GPIO_TYPE_TTL;
+    x.func = GPIO_FUNC_5;
+    ald_gpio_init(GPIOB, GPIO_PIN_15, &x);
+
+    return;
+}
+/**
+  * @brief  Initializate pin of uart module.
+  * @retval None
+  */
+void uart_pin_init(void)
+{
+    gpio_init_t x;
+
+    /* Initialize tx pin */
+    x.mode = GPIO_MODE_OUTPUT;
+    x.odos = GPIO_PUSH_PULL;
+    x.pupd = GPIO_PUSH_UP;
+    x.podrv = GPIO_OUT_DRIVE_1;
+    x.nodrv = GPIO_OUT_DRIVE_0_1;
+    x.flt = GPIO_FILTER_DISABLE;
+    x.type = GPIO_TYPE_TTL;
+    x.func = GPIO_FUNC_3;
+    ald_gpio_init(GPIOB, GPIO_PIN_10, &x);
+
+    /* Initialize rx pin */
+    x.mode = GPIO_MODE_INPUT;
+    x.odos = GPIO_PUSH_PULL;
+    x.pupd = GPIO_PUSH_UP;
+    x.podrv = GPIO_OUT_DRIVE_1;
+    x.nodrv = GPIO_OUT_DRIVE_0_1;
+    x.flt = GPIO_FILTER_DISABLE;
+    x.type = GPIO_TYPE_TTL;
+    x.func = GPIO_FUNC_3;
+    ald_gpio_init(GPIOB, GPIO_PIN_11, &x);
+
+    /* Initialize uart */
+    h_uart.perh = UART0;
+    h_uart.init.baud = 115200;
+    h_uart.init.word_length = UART_WORD_LENGTH_8B;
+    h_uart.init.stop_bits = UART_STOP_BITS_1;
+    h_uart.init.parity = UART_PARITY_NONE;
+    h_uart.init.mode = UART_MODE_UART;
+    h_uart.init.fctl = UART_HW_FLOW_CTL_DISABLE;
+    h_uart.tx_cplt_cbk = NULL;
+    h_uart.rx_cplt_cbk = NULL;
+    h_uart.error_cbk = NULL;
+    ald_uart_init(&h_uart);
+}
+
+void usb_hc_low_level_init(void)
+{
+    ald_pmu_perh_power_config(PMU_POWER_USB, ENABLE);
+    ald_cmu_perh_clock_config(CMU_PERH_USB, ENABLE);
+    ald_cmu_perh_clock_config(CMU_PERH_GPIO, ENABLE);
+    ald_cmu_usb_clock_config(CMU_USB_CLOCK_SEL_HOSC, CMU_USB_DIV_1);
+    ald_rmu_reset_periperal(RMU_PERH_USB);
+    ald_mcu_irq_config(USB_INT_IRQn, 2, 2, ENABLE);
+    ald_mcu_irq_config(USB_DMA_IRQn, 2, 2, ENABLE);
+    usb_pin_init();
+}
+
+void delay(uint32_t delay_us)
+{
+    while (delay_us--) {
+    }
+}
+/**
+  * @brief  Test main function
+  * @retval Status.
+  */
+int main()
+{
+    int i;
+
+    /* Initialize ALD */
+    ald_cmu_init();
+    /* Configure system clock */
+    ald_cmu_pll1_config(CMU_PLL1_INPUT_HOSC_3, CMU_PLL1_OUTPUT_48M);
+    ald_cmu_clock_config(CMU_CLOCK_PLL1, 48000000);
+    ald_cmu_perh_clock_config(CMU_PERH_ALL, ENABLE);
+
+    uart_pin_init();
+    printf("\rSystem start...\r\n");
+
+    usbh_initialize();
+   vTaskStartScheduler();
+    while (1) {
+
+    }
+}
+
+/**
+  * @brief  led task entry function
+  * @param  parameter: user's paramter
+  * @retval None
+  */
+static void vtask_led(void *pvParameters)
+{
+	TickType_t xlast_wake_time;
+	const TickType_t xfreq = 500;
+	
+	xlast_wake_time = xTaskGetTickCount();
+
+	while(1) {
+        printf("test\r\n");
+		vTaskDelayUntil(&xlast_wake_time, pdMS_TO_TICKS(xfreq));
+	}
+}
+/**
+  * @}
+  */
+/**
+  * @}
+  */

+ 0 - 0
demo/es32/usb_host/ES32F369x/copy Drivers from es32 sdk here.txt