stm32 cubemx(5.3+lib1.8.0)+串口+freeRTOS+USBhost+fatfs

坑1:1.8固件
对于HAL HCD驱动程序,在usbh_conf.c用户文件中添加以下USB回调,以符合USB主机(HAL / Stack)上的最新更改
HAL_HCD_PortEnabled_Callback()
HAL_HCD_PortDisabled_Callback()

void HAL_HCD_PortEnabled_Callback(HCD_HandleTypeDef *hhcd)
{
USBH_LL_PortEnabled(hhcd->pData);//此函数在usbh_core.c中

}
stm32 cubemx(5.3+lib1.8.0)+串口+freeRTOS+USBhost+fatfs_第1张图片

未配置均为默认
1.时钟源 ,外部25MHzstm32 cubemx(5.3+lib1.8.0)+串口+freeRTOS+USBhost+fatfs_第2张图片
2.sw debug TIM1作为时钟源 systick被freeRTOS使用stm32 cubemx(5.3+lib1.8.0)+串口+freeRTOS+USBhost+fatfs_第3张图片
3.UART2stm32 cubemx(5.3+lib1.8.0)+串口+freeRTOS+USBhost+fatfs_第4张图片
4.usb_otg_fs usb主机 host only
sof:一般音视频传输使用
vbus:usb作为从机使用
stm32 cubemx(5.3+lib1.8.0)+串口+freeRTOS+USBhost+fatfs_第5张图片
5.u盘设备
code_page:支持简体中文 GBK
use_lfn:放在stack区
lfn_unicode:编码格式stm32 cubemx(5.3+lib1.8.0)+串口+freeRTOS+USBhost+fatfs_第6张图片
6.freeRTOS
TOTAL_HEAP_SIZE:freeRTOS配置RAM 太小会导致程序崩溃stm32 cubemx(5.3+lib1.8.0)+串口+freeRTOS+USBhost+fatfs_第7张图片
创建任务和队列 ,默认就有的StartDefaultTask任务不可以删除但是可以修改stm32 cubemx(5.3+lib1.8.0)+串口+freeRTOS+USBhost+fatfs_第8张图片
7.USBhsot
USBH_DUG_LEVEL:打印bebug信息stm32 cubemx(5.3+lib1.8.0)+串口+freeRTOS+USBhost+fatfs_第9张图片
usb从设备电源供应脚
需手动设置为输出stm32 cubemx(5.3+lib1.8.0)+串口+freeRTOS+USBhost+fatfs_第10张图片
stm32 cubemx(5.3+lib1.8.0)+串口+freeRTOS+USBhost+fatfs_第11张图片
8.时钟
只需填写HSE和HCLK
enable css:时钟安全stm32 cubemx(5.3+lib1.8.0)+串口+freeRTOS+USBhost+fatfs_第12张图片
stm32 cubemx(5.3+lib1.8.0)+串口+freeRTOS+USBhost+fatfs_第13张图片
stm32 cubemx(5.3+lib1.8.0)+串口+freeRTOS+USBhost+fatfs_第14张图片 代码参考hal库里的例程

你可能感兴趣的:(stm32,cubemx,freertos,usbhost)