diff options
| author | sakumisu <[email protected]> | 2022-08-12 23:26:40 +0800 |
|---|---|---|
| committer | sakumisu <[email protected]> | 2022-08-12 23:26:40 +0800 |
| commit | 0bbced8733ab3f99c09da519642002c1524d115e (patch) | |
| tree | 1975de5f246426e8e19500c27a357eb89e664cd2 /docs/source/quick_start | |
| parent | b1cffc5d996256104fdc8ced09bf6e707f9066c5 (diff) | |
update usbh_class info section
Diffstat (limited to 'docs/source/quick_start')
| -rw-r--r-- | docs/source/quick_start/other_chip.rst | 19 | ||||
| -rw-r--r-- | docs/source/quick_start/rt-thread/rtthread.rst | 9 |
2 files changed, 24 insertions, 4 deletions
diff --git a/docs/source/quick_start/other_chip.rst b/docs/source/quick_start/other_chip.rst index 52c69785..6bf69562 100644 --- a/docs/source/quick_start/other_chip.rst +++ b/docs/source/quick_start/other_chip.rst @@ -25,15 +25,26 @@ USB Host 移植要点 - 拷贝 `usb_config.h` 文件到自己工程目录下,并添加相应的目录头文件路径。所以根目录下的文件仅作为参考,不要添加根目录下的头文件路径 - 实现 `usb_hc_low_level_init` 函数(该函数主要负责 USB 时钟、引脚、中断的初始化)。该函数可以放在你想要放的任何参与编译的 c 文件中。如何进行 USB 的时钟、引脚、中断等初始化,请自行根据你使用的芯片原厂提供的源码中进行添加。 - 调用 `usbh_initialize` 初始化 usb 硬件 -- 如果使用的是 GCC,需要在链接脚本中添加如下代码: +- 如果使用的是 GCC ,需要在链接脚本(ld)中添加如下代码: .. code-block:: C /* section information for usbh class */ . = ALIGN(4); - _usbh_class_info_start = .; - KEEP(*(usbh_class_info)) - _usbh_class_info_end = .; + __usbh_class_info_start__ = .; + KEEP(*(.usbh_class_info)) + __usbh_class_info_end__ = .; + +- 如果使用的是 Segger Embedded Studio ,需要在链接脚本(icf)中添加如下代码: + +.. code-block:: C + + define region CHERRYUSB_RAM = [from 0x1080000 + 700k size 68k]; /* reserve for cherryusb region */ + + define exported symbol __usbh_class_info_start__ = start of region CHERRYUSB_RAM; + define exported symbol __usbh_class_info_end__ = end of region CHERRYUSB_RAM + 1; + + place in CHERRYUSB_RAM { section .usbh_class_info }; - 编译使用。各个 class 如何使用,参考 demo 下的 `usb_host.c` 文件 diff --git a/docs/source/quick_start/rt-thread/rtthread.rst b/docs/source/quick_start/rt-thread/rtthread.rst index 92f847ff..784611b5 100644 --- a/docs/source/quick_start/rt-thread/rtthread.rst +++ b/docs/source/quick_start/rt-thread/rtthread.rst @@ -57,6 +57,15 @@ .. figure:: img/config_file.png * 使用 `scons --target=mdk` 或者 `scons` 进行编译 +* 如果使用的是 GCC ,需要在链接脚本(ld)中添加如下代码: + +.. code-block:: C + + /* section information for usbh class */ + . = ALIGN(4); + __usbh_class_info_start__ = .; + KEEP(*(.usbh_class_info)) + __usbh_class_info_end__ = .; 借助 STM32CubeMX 生成 USB 初始化 |
