diff --git a/docs/source/quick_start/es32.rst b/docs/source/quick_start/es32.rst index f0e0e7a7..5c63290d 100644 --- a/docs/source/quick_start/es32.rst +++ b/docs/source/quick_start/es32.rst @@ -10,11 +10,8 @@ ES32F3xx 系列单片机中 USB 外设使用标准的 musb ip,并且拥有 usb ----------------------- 在 CherryUSB demo 目录下已经有主机跟从机的样例,在有板子的情况下,可以先跑工程样例,试用一下。 -- 试用之前,需要先下载 `ES32 SDK `_ ,并进入 ES32 SDK 中,复制 `Drivers` 到 如图所示目录下: -.. figure:: img/es321.png - -- 然后进入 MDK-ARM 目录下,双击 `example.uvprojx` 打开工程,选择好调试器后,编译烧录即可。 +- 进入 MDK-ARM 目录下,双击 `example.uvprojx` 打开工程,选择好调试器后,编译烧录即可。 - 如果是从机,默认提供的是 cdc acm 的示例,代码烧录以后,将 usb 线插到 板子的丝印为 USB-OTG 口,并接上电脑,按下复位键,电脑便会枚举出一个串口。打开串口,勾选 DTR 可以接收数据,在发送缓冲区填入数据并发送,调试器的串口便可以打印出接收的长度和数据。 - 如果是主机,则需要一个 usb 母口转接线,并接入相关 usb 设备,就可以进行测试了。比如接上鼠标、U盘、4G 网卡等等。 diff --git a/docs/source/quick_start/img/es321.png b/docs/source/quick_start/img/es321.png deleted file mode 100644 index ce010843..00000000 Binary files a/docs/source/quick_start/img/es321.png and /dev/null differ diff --git a/docs/source/quick_start/img/stm32_18.png b/docs/source/quick_start/img/stm32_18.png index b779f7f7..4a780b56 100644 Binary files a/docs/source/quick_start/img/stm32_18.png and b/docs/source/quick_start/img/stm32_18.png differ diff --git a/docs/source/quick_start/img/stm32_19.png b/docs/source/quick_start/img/stm32_19.png index e6508aa8..b779f7f7 100644 Binary files a/docs/source/quick_start/img/stm32_19.png and b/docs/source/quick_start/img/stm32_19.png differ diff --git a/docs/source/quick_start/img/stm32_20.png b/docs/source/quick_start/img/stm32_20.png index 977bda82..96736d01 100644 Binary files a/docs/source/quick_start/img/stm32_20.png and b/docs/source/quick_start/img/stm32_20.png differ diff --git a/docs/source/quick_start/img/stm32_21.png b/docs/source/quick_start/img/stm32_21.png new file mode 100644 index 00000000..977bda82 Binary files /dev/null and b/docs/source/quick_start/img/stm32_21.png differ diff --git a/docs/source/quick_start/other_chip.rst b/docs/source/quick_start/other_chip.rst index a693cd82..52c69785 100644 --- a/docs/source/quick_start/other_chip.rst +++ b/docs/source/quick_start/other_chip.rst @@ -15,7 +15,7 @@ USB Device 移植要点 - 编译使用。各个 class 如何使用,参考 demo 下的 template -.. note:: device 移植要点其实就三个,实现 `usb_dc_low_level_init` ;改 `USBD_IRQHandler=xxxx` 、`USB_BASE=0xxxxx` 、 `USB_NUM_BIDIR_ENDPOINTS=x`;改 `usb_config.h` 中的内容 +.. note:: device 移植要点其实就三个,实现 `usb_dc_low_level_init` ;改 `USBD_IRQHandler=xxxx` 、`USB_BASE=0xxxxx` 、 `USB_NUM_BIDIR_ENDPOINTS=x`;改 `usb_config.h` 中的内容。其中前面说到的3个宏也可以在 `usb_config.h` 添加 USB Host 移植要点 ----------------------- @@ -37,7 +37,7 @@ USB Host 移植要点 - 编译使用。各个 class 如何使用,参考 demo 下的 `usb_host.c` 文件 -.. note:: device 移植要点其实就三个,实现 `usb_hc_low_level_init` ; 改 `USBH_IRQHandler=xxxx` 、`USB_BASE=0xxxxx` ; 改 `usb_config.h` 中的内容 +.. note:: device 移植要点其实就三个,实现 `usb_hc_low_level_init` ; 改 `USBH_IRQHandler=xxxx` 、`USB_BASE=0xxxxx` ; 改 `usb_config.h` 中的内容。其中前面说到的2个宏也可以在 `usb_config.h` 添加 .. note:: 使用 host 时,推荐添加除了 hub 以外的所有适配的 class 驱动,达到自动加载驱动的目的。当然,如果不用,那就不添加。 diff --git a/docs/source/quick_start/stm32.rst b/docs/source/quick_start/stm32.rst index c471448e..0981146a 100644 --- a/docs/source/quick_start/stm32.rst +++ b/docs/source/quick_start/stm32.rst @@ -87,6 +87,7 @@ USB Host 移植要点 .. figure:: img/stm32_17.png +- 如果使用 STM32H7 或者 F7 ,需要添加 `STM32H7` 或者 `STM32F7` 编译选项 - 如果使用的是 F7/H7 这种带 cache功能的,由于 dma 原因,所以需要刷 cache,编译选项中需要添加 `CONFIG_USB_DCACHE_ENABLE`,并实现刷 cache的两个函数。当然,可以不开 dcahe功能,就不需要添加编译选项。 并且需要搭配 MPU 使用,如果是新手,对 cache不了解,推荐关闭 cache功能。默认 cache 使用 Write Back 属性。 @@ -94,7 +95,7 @@ USB Host 移植要点 .. figure:: img/stm32_17_2.png .. figure:: img/stm32_17_3.png -.. note:: STM32 usb dma 访问的 ram 只能在 0x24000000 开始的地址,所以,推荐关闭 0x20000000开始的地址。 +.. note:: STM32 h7/f7 usb dma 访问的 ram 只能是从 0x24000000 开始的地址,所以,推荐关闭 0x20000000 开始的地址。 .. figure:: img/stm32_17_4.png @@ -104,14 +105,14 @@ USB Host 移植要点 - 拷贝 **xxx_msp.c** 中的 **HAL_HCD_MspInit** 函数中的内容到 **usb_hc_low_level_init** 函数中,屏蔽 st 生成的 usb 中断函数和 usb 初始化 -.. figure:: img/stm32_12.png +.. figure:: img/stm32_18.png .. figure:: img/stm32_13.png .. figure:: img/stm32_19.png - 调用 **usbh_initialize** 以及 os 需要的启动线程的函数即可使用 -.. figure:: img/stm32_18.png +.. figure:: img/stm32_20.png - 如果使用 **msc**,并且带文件系统,需要自行添加文件系统文件了,对应的 porting 编写参考 **fatfs_usbh.c** 文件。 -.. figure:: img/stm32_20.png \ No newline at end of file +.. figure:: img/stm32_21.png \ No newline at end of file