2025-09-30 11:56:06 +08:00
<!DOCTYPE html> < html xmlns = "http://www.w3.org/1999/xhtml" xml:lang = "zh-cn" lang = "zh-cn" data-whc_version = "26.0" >
< head > < meta http-equiv = "Content-Type" content = "text/html; charset=UTF-8" / > < meta name = "viewport" content = "width=device-width, initial-scale=1.0" / > < meta http-equiv = "X-UA-Compatible" content = "IE=edge" / > < meta name = "description" content = "ArtInChip 提供了两路 USB Host 端口和一路 USB Device 端口,需要分别进行配置: USB Host Contoller 配置 ArtInChip 在一个 USB Host 端口中提供了下列 Host Contoller, 在软件上需要需要分开配置: 配置 EHCI 控制器 USB Interface 驱动配置 完成 USB Host Contoller ..." / > < meta name = "DC.rights.owner" content = "(C) 版权 2025" / > < meta name = "copyright" content = "(C) 版权 2025" / > < meta name = "generator" content = "DITA-OT" / > < meta name = "DC.type" content = "concept" / > < meta name = "DC.creator" content = "yan.wang" / > < meta name = "DC.date.created" content = "2024-01-24" / > < meta name = "DC.date.modified" content = "2024-12-24" / > < meta name = "DC.format" content = "HTML5" / > < meta name = "DC.identifier" content = "usb_host_configuration" / > < meta name = "DC.language" content = "zh-CN" / > < title > USB Host 配置< / title > <!-- Build number 2023110923. --> < meta name = "wh-path2root" content = "../../../" / > < meta name = "wh-toc-id" content = "" / > < meta name = "wh-source-relpath" content = "topics/sdk/usb/usb-host_configuration.dita" / > < meta name = "wh-out-relpath" content = "topics/sdk/usb/usb-host_configuration.html" / >
< link rel = "stylesheet" type = "text/css" href = "../../../webhelp/app/commons.css?buildId=2023110923" / >
< link rel = "stylesheet" type = "text/css" href = "../../../webhelp/app/topic.css?buildId=2023110923" / >
< script src = "../../../webhelp/app/options/properties.js?buildId=20250121171154" > < / script >
< script src = "../../../webhelp/app/localization/strings.js?buildId=2023110923" > < / script >
< script src = "../../../webhelp/app/search/index/keywords.js?buildId=20250121171154" > < / script >
< script defer = "defer" src = "../../../webhelp/app/commons.js?buildId=2023110923" > < / script >
< script defer = "defer" src = "../../../webhelp/app/topic.js?buildId=2023110923" > < / script >
< link rel = "stylesheet" type = "text/css" href = "../../../webhelp/template/aic-styles-web.css?buildId=2023110923" / > < link rel = "stylesheet" type = "text/css" href = "../../../webhelp/template/notes.css?buildId=2023110923" / > < link rel = "stylesheet" type = "text/css" href = "../../../webhelp/template/aic-common.css?buildId=2023110923" / > < link rel = "stylesheet" type = "text/css" href = "../../../webhelp/template/aic-images.css?buildId=2023110923" / > < link rel = "stylesheet" type = "text/css" href = "../../../webhelp/template/footnote.css?buildId=2023110923" / > < link rel = "stylesheet" type = "text/css" href = "../../../webhelp/template/aic-web-watermark.css?buildId=2023110923" / > < link rel = "stylesheet" type = "text/css" href = "../../../webhelp/template/topic-body-list.css?buildId=2023110923" / > < / head >
< body id = "usb_host_configuration" class = "wh_topic_page frmBody" >
< a href = "#wh_topic_body" class = "sr-only sr-only-focusable" >
跳转到主要内容
< / a >
< header class = "navbar navbar-default wh_header" >
< div class = "container-fluid" >
< div class = "wh_header_flex_container navbar-nav navbar-expand-md navbar-dark" >
< div class = "wh_logo_and_publication_title_container" >
< div class = "wh_logo_and_publication_title" >
< a href = "http://www.artinchip.com" class = " wh_logo d-none d-sm-block " > < img src = "../../../company-logo-white.png" alt = "RTOS SDK 使用指南SDK 指南文件" / > < / a >
< div class = " wh_publication_title " > < a href = "../../../index.html" > < span class = "booktitle" > < span class = "ph mainbooktitle" > RTOS SDK 使用指南< / span > < span class = "ph booktitlealt" > SDK 指南文件< / span > < / span > < / a > < / div >
< / div >
< / div >
< div class = "wh_top_menu_and_indexterms_link collapse navbar-collapse" id = "wh_top_menu_and_indexterms_link" >
< / div >
< / div >
< / div >
< / header >
< div class = " wh_search_input navbar-form wh_topic_page_search search " role = "form" >
< form id = "searchForm" method = "get" role = "search" action = "../../../search.html" > < div > < input type = "search" placeholder = "搜索 " class = "wh_search_textfield" id = "textToSearch" name = "searchQuery" aria-label = "搜索查询" required = "required" / > < button type = "submit" class = "wh_search_button" aria-label = "搜索" > < span class = "search_input_text" > 搜索< / span > < / button > < / div > < / form >
< / div >
< div class = "container-fluid" id = "wh_topic_container" >
< div class = "row" >
< nav class = "wh_tools d-print-none navbar-expand-md" aria-label = "Tools" >
< div data-tooltip-position = "bottom" class = " wh_breadcrumb " > < / div >
< div class = "wh_right_tools" >
< button class = "wh_hide_highlight" aria-label = "切换搜索突出显示" title = "切换搜索突出显示" > < / button >
< button class = "webhelp_expand_collapse_sections" data-next-state = "collapsed" aria-label = "折叠截面" title = "折叠截面" > < / button >
< div class = " wh_print_link print d-none d-md-inline-block " > < button onClick = "window.print()" title = "打印此页" aria-label = "打印此页" > < / button > < / div >
< / div >
< / nav >
< / div >
< div class = "wh_content_area" >
< div class = "row" >
< div class = "col-lg-10 col-md-10 col-sm-10 col-xs-12" id = "wh_topic_body" >
< button id = "wh_close_topic_toc_button" class = "close-toc-button d-none" aria-label = "Toggle topic table of content" aria-controls = "wh_topic_toc" aria-expanded = "true" >
< span class = "close-toc-icon-container" >
< span class = "close-toc-icon" > < / span >
< / span >
< / button >
< div class = " wh_topic_content body " > < main role = "main" > < article class = "- topic/topic concept/concept topic concept" role = "article" aria-labelledby = "ariaid-title1" > < span class = "edit-link" style = "font-size:12px; opacity:0.6; text-align:right; vertical-align:middle" > < a target = "_blank" href = "http://172.16.35.88/tasks/jdssno1uvvbf2mltu9kb9v3if05d5gopuakboe8hlud18rma/edit/F:/aicdita/aicdita-cn/topics/sdk/usb/usb-host_configuration.dita" > Edit online< / a > < / span > < h1 class = "- topic/title title topictitle1" id = "ariaid-title1" > USB Host 配置< / h1 > < div class = "date inPage" > 24 Dec 2024< / div > < div style = "color: gray;" >
Read time: 3 minute(s)
< / div > < div class = "- topic/body concept/conbody body conbody" > < div class = "- topic/p p" data-ofbid = "d181153e23__20250121171625" > ArtInChip 提供了两路 USB Host 端口和一路 USB Device 端口,需要分别进行配置:< ol class = "- topic/ol ol" id = "usb_host_configuration__ul_i55_ght_4dc" data-ofbid = "usb_host_configuration__ul_i55_ght_4dc" > < li class = "- topic/li li" data-ofbid = "d181153e26__20250121171625" >
< p class = "- topic/p p" data-ofbid = "d181153e28__20250121171625" > USB Host Contoller 配置< / p >
< div class = "- topic/p p" data-ofbid = "d181153e31__20250121171625" > ArtInChip 在一个 USB Host 端口中提供了下列 Host Contoller, 在软件上需要需要分开配置: < ul class = "- topic/ul ul" id = "usb_host_configuration__ul_v5h_nht_4dc" data-ofbid = "usb_host_configuration__ul_v5h_nht_4dc" > < li class = "- topic/li li" data-ofbid = "d181153e34__20250121171625" >
< p class = "- topic/p p" data-ofbid = "d181153e36__20250121171625" > < a xml:lang = "zh-CN" lang = "zh-CN" class = "- topic/xref xref" href = "usb-host_configuration.html#usb_host_configuration__section_zj4_shz_21c" > 配置 EHCI 控制器< / a > < / p >
< / li > < / ul > < / div >
< / li > < li class = "- topic/li li" data-ofbid = "d181153e42__20250121171625" >
< p class = "- topic/p p" data-ofbid = "d181153e44__20250121171625" > USB Interface 驱动配置< / p >
< p class = "- topic/p p" data-ofbid = "d181153e47__20250121171625" > 完成 USB Host Contoller 配置后,系统可以正确识别插入 USB 总线的 Device 设备。USB Device 有各种不同类型 ,例如
U 盘、键盘鼠标、无线网卡。在 USB Device 中以 Interface 为单位提供不同类型的功能。如需使用 USB Device
具体功能,需配置不同类型 USB Interface 的驱动。< / p >
< div class = "- topic/p p" data-ofbid = "d181153e50__20250121171625" > 不同类型 USB Interface 驱动的配置可查看:< ul class = "- topic/ul ul" id = "usb_host_configuration__ul_ap2_yht_4dc" data-ofbid = "usb_host_configuration__ul_ap2_yht_4dc" > < li class = "- topic/li li" data-ofbid = "d181153e53__20250121171625" >
< p class = "- topic/p p" data-ofbid = "d181153e55__20250121171625" > < a xml:lang = "zh-CN" lang = "zh-CN" class = "- topic/xref xref" href = "usb-host_configuration.html#usb_host_configuration__section_qbr_13t_4dc" > U 盘配置< / a > < / p >
< / li > < / ul > < / div >
< / li > < / ol > < / div > < section class = "- topic/section section" id = "usb_host_configuration__section_zj4_shz_21c" data-ofbid = "usb_host_configuration__section_zj4_shz_21c" > < h2 class = "- topic/title title sectiontitle" > 配置 EHCI 控制器< / h2 >
< div class = "- topic/p p" data-ofbid = "d181153e66__20250121171625" > 针对 USB 2.0 (High Speed) 的 EHCI 控制器,配置流程如下:< ul class = "- topic/ul ul" id = "usb_host_configuration__ul_pcs_q5q_g1c" data-ofbid = "usb_host_configuration__ul_pcs_q5q_g1c" > < li class = "- topic/li li" data-ofbid = "d181153e69__20250121171625" >
< p class = "- topic/p p" data-ofbid = "d181153e71__20250121171625" > 在 menuconfig 中配置设备。< / p >
< div class = "- topic/p p" data-ofbid = "d181153e74__20250121171625" > 使能 USB 端口,并且配置当前 USB 端口为 Host
模式:< pre class = "+ topic/pre pr-d/codeblock pre codeblock language-c" id = "usb_host_configuration__codeblock_rck_r5q_g1c" data-ofbid = "usb_host_configuration__codeblock_rck_r5q_g1c" > > Board options
[*] Using Usb0
Select Usb0 mode (Host) ---> < / pre > < / div >
< / li > < li class = "- topic/li li" data-ofbid = "d181153e79__20250121171625" >
< p class = "- topic/p p" data-ofbid = "d181153e81__20250121171625" > 在 menuconfig 中配置 CherryUSB 驱动。< / p >
< div class = "- topic/p p" data-ofbid = "d181153e84__20250121171625" > 使能 CherryUSB 驱动,并且使能 Host
模式:< pre class = "+ topic/pre pr-d/codeblock pre codeblock language-c" id = "usb_host_configuration__codeblock_pn2_r5q_g1c" data-ofbid = "usb_host_configuration__codeblock_pn2_r5q_g1c" > > Local packages options
> Third-party packages options
[*] CherryUSB: tiny and portable USB host/device stack < strong class = "hl-keyword" > for< / strong > embedded system with USB IP --->
[*] Enable usb host mode ---> < / pre > < / div >
< / li > < / ul > < / div >
< / section > < section class = "- topic/section section" id = "usb_host_configuration__section_qbr_13t_4dc" data-ofbid = "usb_host_configuration__section_qbr_13t_4dc" > < h2 class = "- topic/title title sectiontitle" > U 盘配置< / h2 >
< div class = "- topic/p p" data-ofbid = "d181153e95__20250121171625" >
< ol class = "- topic/ol ol" id = "usb_host_configuration__ul_nrx_v5q_g1c" data-ofbid = "usb_host_configuration__ul_nrx_v5q_g1c" > < li class = "- topic/li li" data-ofbid = "d181153e98__20250121171625" >
< div class = "- topic/p p" data-ofbid = "d181153e100__20250121171625" > 在 menuconfig 中使能 CherryUSB 中 msc 类型的 Host Class
驱动,并且使能对应实例模板:< pre class = "+ topic/pre pr-d/codeblock pre codeblock language-c" id = "usb_host_configuration__codeblock_kmf_x5q_g1c" data-ofbid = "usb_host_configuration__codeblock_kmf_x5q_g1c" > > Local packages options
> Third-party packages options
[*] CherryUSB: tiny and portable USB host/device stack < strong class = "hl-keyword" > for< / strong > embedded system with USB IP --->
[*] Enable usb host mode --->
[*] Enable usb msc driver --->
[*] Use msc template< / pre > < / div >
< / li > < li class = "- topic/li li" data-ofbid = "d181153e105__20250121171625" >
< div class = "- topic/p p" data-ofbid = "d181153e107__20250121171625" > 插入 U 盘,会自动挂载到 < code class = "+ topic/ph pr-d/codeph ph codeph" > /disk< / code >
目录:< pre class = "+ topic/pre pr-d/codeblock pre codeblock language-c" id = "usb_host_configuration__codeblock_rxf_y5q_g1c" data-ofbid = "usb_host_configuration__codeblock_rxf_y5q_g1c" > [I/USB] New high-speed device on Hub < span class = "hl-number" > 1< / span > , Port < span class = "hl-number" > 1< / span > connected
[I/USB] New device found,idVendor:< span class = "hl-number" > 30< / span > de,idProduct:< span class = "hl-number" > 6544< / span > ,bcdDevice:< span class = "hl-number" > 0100< / span >
[I/USB] The device has < span class = "hl-number" > 1< / span > interfaces
[I/USB] Enumeration success, start loading class driver
[I/USB] Loading msc class driver
[I/USB] Get max LUN:< span class = "hl-number" > 1< / span >
[I/USB] Ep=< span class = "hl-number" > 81< / span > Attr=< span class = "hl-number" > 02< / span > Mps=< span class = "hl-number" > 512< / span > Interval=< span class = "hl-number" > 255< / span > Mult=< span class = "hl-number" > 00< / span >
[I/USB] Ep=< span class = "hl-number" > 02< / span > Attr=< span class = "hl-number" > 02< / span > Mps=< span class = "hl-number" > 512< / span > Interval=< span class = "hl-number" > 255< / span > Mult=< span class = "hl-number" > 00< / span >
[I/USB] Capacity info:
[I/USB] Block num:< span class = "hl-number" > 30274560< / span > ,block size:< span class = "hl-number" > 512< / span >
[I/USB] Register MSC Class:/dev/sda
found part[< span class = "hl-number" > 0< / span > ], begin: < span class = "hl-number" > 32256< / span > , size: < span class = "hl-number" > 14.446< / span > GB
[I] udisk_init()< span class = "hl-number" > 122< / span > Found partition < span class = "hl-number" > 0< / span > : type = < span class = "hl-number" > 11< / span > , offet=< span class = "hl-number" > 0x3f< / span > , size=< span class = "hl-number" > 0x1cdf2a1< / span >
< span class = "hl-number" > 01< / span > -< span class = "hl-number" > 01< / span > < span class = "hl-number" > 08< / span > :< span class = "hl-number" > 00< / span > :< span class = "hl-number" > 06< / span > I/NO_TAG: try to mount file system!< / pre > < / div >
< / li > < / ol >
< / div >
< / section > < / div > < / article > < / main > < / div >
< / div >
< nav role = "navigation" id = "wh_topic_toc" aria-label = "On this page" class = "col-lg-2 d-none d-lg-block navbar d-print-none" >
< div id = "wh_topic_toc_content" >
< div class = " wh_topic_toc " > < div class = "wh_topic_label" > 在本页上< / div > < ul > < li class = "section-item" > < div class = "section-title" > < a href = "#usb_host_configuration__section_zj4_shz_21c" data-tocid = "usb_host_configuration__section_zj4_shz_21c" > 配置 EHCI 控制器< / a > < / div > < / li > < li class = "section-item" > < div class = "section-title" > < a href = "#usb_host_configuration__section_qbr_13t_4dc" data-tocid = "usb_host_configuration__section_qbr_13t_4dc" > U 盘配置< / a > < / div > < / li > < / ul > < / div >
< / div >
< / nav >
< / div >
< / div >
< / div >
< footer class = "navbar navbar-default wh_footer" >
< div class = " footer-container mx-auto " >
< title > footer def< / title >
< style > < ! - -
.p1 {
font-family: FangZhengShuSong, Times, serif;
}
.p2 {
font-family: Arial, Helvetica, sans-serif;
}
.p3 {
font-family: "Lucida Console", "Courier New", monospace;
}
-->< / style >
< div class = "webhelp.fragment.footer" >
< p class = "p1" > Copyright © 2019-2024 广东匠芯创科技有限公司. All rights reserved.< / p >
< / div > < div >
< div class = "generation_time" >
Update Time: 2025-01-21
< / div >
< / div >
< / div >
< / footer >
< div id = "go2top" class = "d-print-none" >
< span class = "oxy-icon oxy-icon-up" > < / span >
< / div >
< div id = "modal_img_large" class = "modal" >
< span class = "close oxy-icon oxy-icon-remove" > < / span >
< div id = "modal_img_container" > < / div >
< div id = "caption" > < / div >
< / div >
< script src = "${pd}/publishing/publishing-styles-AIC-template/js/custom.js" defer = "defer" > < / script >
< / body >
2025-01-23 16:37:00 +08:00
< / html >