查看: 1309|回复: 0

[分享] OKdo E1双核Cortex M33开发板之免晶振USB

[复制链接]
  • TA的每日心情
    开心
    2024-3-26 15:16
  • 签到天数: 266 天

    [LV.8]以坛为家I

    3298

    主题

    6545

    帖子

    0

    管理员

    Rank: 9Rank: 9Rank: 9

    积分
    32004
    最后登录
    2024-4-9
    发表于 2020-12-7 13:33:33 | 显示全部楼层 |阅读模式
    OKdo E1双核Cortex M33开发板之免晶振USB


    转发自 文波_苏州


    OKDO E1的开发板上有两个USB口,一个标注为"DEBUG",接到LPC11U35F上用于下载调试。另一个标注着"USER"的连到LPC55S69的USB0端口,可以用来开发用户应用。通过板上的两个跳线电阻的不同接法,也可以改为连接到USB1端口。


    LPC55S69的USB0是全速端口,USB1是高速端口,那OKDO E1为什么不默认连到USB1上呢?毕竟USB1可以向下兼容全速。其实这样连是还是有一定道理的--LPC55S69支持免晶振全速USB。


    注意到OKDO E1默认并没有焊接16MHz的高精度外部晶振,而内部RC晶振只在出厂时校准到了+/-2%。这就没法满足全速USB 12 Mbps +/- 0.25%的要求,在以前的LPC系列应用笔记中https://www.nxp.com.cn/docs/en/application-note/AN11392.pdf:


    Clock circuit
    When using a full-speed USB peripheral, it is important to use an external crystal, or a tight frequency tolerance ceramic resonator, for the timing element. The internal 12 MHz ±1 % RC oscillator, while very accurate, does not have the accuracy required for USB. The USB peripheral operates at a clock frequency of 48 MHz, so the crystal must be chosen such that a multiple of its frequency is equal to 48 MHz. A parallel resonant 12 MHz crystal with a data signaling tolerance of 0.25 %, or ±2500 ppm is required.


    好在LPC55S69提供了crystal less全速USB,该设计可利用USB全速协议中主机方SOF包对内部FRO进行校准,这样不需要使用外部晶振,也能满足时钟精度的要求。甚至可以设想,在工控等环境严苛温度变化剧烈的场合,如果主机的时钟发生了一定的偏移,crystal less动态跟踪的特性反而可能使设计更为健壮。这样看来,OKDO E1的默认接法省掉一颗晶振的同时方便以crystal less的方式实现USB全速的各种功能。而如果要实现一些高速USB的应用,才有必要找一颗晶振焊上,顺便就可以两个跳线电阻改为连接USB1端口。


    目前我还没有一定要使用高速USB的应用,所以暂时不用动烙铁。先到恩智浦的网站上下载免晶振USB的参考设计:
    https://www.nxp.com/docs/en/application-note-software/TN00063.zip
    下载解压后,按照文档的指示,到SDK_2.6.2_LPCXpresso55S69_RFP20_RC1/boards/lpcxpresso55s69/usb_examples/usb_device_composite_hid_audio_unified/bm/cm33_core0/armgcc下, 执行:
    11.png
    编译成功后,在debug文件夹下出现了一个"dev_composite_hid_audio_unified_bm.elf"文件。 用pyocd把它烧写到OKDO板上,并把“USER”口和电脑连起来,主机声音设置毫无反应。在Terimial输入“system_profiler SPUSBDataType | grep -B3 "Vendor ID", 可以看到同一个hub下面LPC11U3x被成功识别,但没有其他USB被识别出来。看来这个例子不是开箱即用的。


    按照文档中2.3 Source code modifications的提示,看下源代码。首先检查fro_calib_Get_Lib_Ver()函数是否被调用,发现它出现在了composite.c 426行。 但是该函数并没有被编译进可执行文件中,USB_DEVICE_FRO_CAL_LIBRARY_ENABLE, USB_DEVICE_SOF_EVENT_ENABLE两个编译开关并未定义。


    于是修改CMakeList.txt,加入:
    add_compile_definitions(USB_DEVICE_FRO_CAL_LIBRARY_ENABLE=1)


    再编译,fro_calib_Get_Lib_Ver()被成功编译进去了,但链接阶段提示出现了7个“undefined reference“,看来是有些依赖还是没有成功链接,查找这些函数出现的地方,在CMakeList.txt再加入:
    "${ProjDirPath}/../../../../../../../devices/LPC55S69/drivers/fsl_ctimer.c"
    "${ProjDirPath}/../../../../../../../devices/LPC55S69/drivers/fsl_ctimer.h"


    以及:
    link_directories(${ProjDirPath}/../../../../../../../devices/LPC55S69/gcc)


    target_link_libraries(dev_composite_hid_audio_unified_bm.elf debug ${ProjDirPath}/../../../../../../../devices/LPC55S69/gcc/libfro_calib_hardabi.a)

    link_directories(${ProjDirPath}/../../../../../../../devices/LPC55S69/gcc)


    target_link_libraries(dev_composite_hid_audio_unified_bm.elf debug ${ProjDirPath}/../../../../../../../devices/LPC55S69/gcc/libfro_calib_softabi.a)


    这次链接就成功了。再进行烧写,还是没有被主机识别。挂上gdb一看,程序一直在函数CLOCK_SetPLL0Freq 的一个while循环中,原来composite.c里的main函数中还是把PLL0挂在了16M的外部晶振上。
    12.png
    先把相关的代码注释掉,看看能不能跑下去。
    13.png
    14.png
    重新编译烧写后复位,发现USB设备已经被成功识别了。
    15.png
    不过,我们到目前只是得到了一个USB的静音按钮,下一步是让它真正发出点声音。


    1. INCLUDE(CMakeForceCompiler)

    2. # CROSS COMPILER SETTING
    3. SET(CMAKE_SYSTEM_NAME Generic)
    4. CMAKE_MINIMUM_REQUIRED (VERSION 2.6)

    5. # THE VERSION NUMBER
    6. SET (Tutorial_VERSION_MAJOR 1)
    7. SET (Tutorial_VERSION_MINOR 0)

    8. # ENABLE ASM
    9. ENABLE_LANGUAGE(ASM)

    10. SET(CMAKE_STATIC_LIBRARY_PREFIX)
    11. SET(CMAKE_STATIC_LIBRARY_SUFFIX)

    12. SET(CMAKE_EXECUTABLE_LIBRARY_PREFIX)
    13. SET(CMAKE_EXECUTABLE_LIBRARY_SUFFIX)


    14. # CURRENT DIRECTORY
    15. SET(ProjDirPath ${CMAKE_CURRENT_SOURCE_DIR})


    16. SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -DNDEBUG")

    17. SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -D__STARTUP_CLEAR_BSS")

    18. SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -Wall")

    19. SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -fno-common")

    20. SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -ffunction-sections")

    21. SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -fdata-sections")

    22. SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -ffreestanding")

    23. SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -fno-builtin")

    24. SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -mthumb")

    25. SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -mapcs")

    26. SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -std=gnu99")

    27. SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -mcpu=cortex-m33")

    28. SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -mfloat-abi=hard")

    29. SET(CMAKE_ASM_FLAGS_RELEASE "${CMAKE_ASM_FLAGS_RELEASE} -mfpu=fpv5-sp-d16")

    30. SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -DDEBUG")

    31. SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -D__STARTUP_CLEAR_BSS")

    32. SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -g")

    33. SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -Wall")

    34. SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -fno-common")

    35. SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -ffunction-sections")

    36. SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -fdata-sections")

    37. SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -ffreestanding")

    38. SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -fno-builtin")

    39. SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -mthumb")

    40. SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -mapcs")

    41. SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -std=gnu99")

    42. SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -mcpu=cortex-m33")

    43. SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -mfloat-abi=hard")

    44. SET(CMAKE_ASM_FLAGS_DEBUG "${CMAKE_ASM_FLAGS_DEBUG} -mfpu=fpv5-sp-d16")

    45. SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -D_DEBUG=0")

    46. SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DNDEBUG")

    47. SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DCPU_LPC55S69JBD100_cm33_core0=1")

    48. SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DARM_MATH_CM33")

    49. SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DUSB_STACK_BM")

    50. SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DUSB_STACK_USE_DEDICATED_RAM=1")

    51. SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DSDK_I2C_BASED_COMPONENT_USED=1")

    52. SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DBOARD_USE_CODEC=1")

    53. SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -DCODEC_WM8904_ENABLE")

    54. SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -mno-unaligned-access")

    55. SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Os")

    56. SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wall")

    57. SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fno-common")

    58. SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -ffunction-sections")

    59. SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fdata-sections")

    60. SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -ffreestanding")

    61. SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fno-builtin")

    62. SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -mthumb")

    63. SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -mapcs")

    64. SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -std=gnu99")

    65. SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -mcpu=cortex-m33")

    66. SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -mfloat-abi=hard")

    67. SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -mfpu=fpv5-sp-d16")

    68. SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -MMD")

    69. SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -MP")

    70. SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG=1")

    71. SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DDEBUG")

    72. SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DCPU_LPC55S69JBD100_cm33_core0=1")

    73. SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DARM_MATH_CM33")

    74. SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DUSB_STACK_BM")

    75. SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DUSB_STACK_USE_DEDICATED_RAM=1")

    76. SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DSDK_I2C_BASED_COMPONENT_USED=1")

    77. SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DBOARD_USE_CODEC=1")

    78. SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DCODEC_WM8904_ENABLE")

    79. SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -g")

    80. SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0")

    81. SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall")

    82. SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fno-common")

    83. SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -ffunction-sections")

    84. SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fdata-sections")

    85. SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -ffreestanding")

    86. SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -fno-builtin")

    87. SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -mthumb")

    88. SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -mapcs")

    89. SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -std=gnu99")

    90. SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -mcpu=cortex-m33")

    91. SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -mfloat-abi=hard")

    92. SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -mfpu=fpv5-sp-d16")

    93. SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -MMD")

    94. SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -MP")

    95. SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG")

    96. SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DCPU_LPC55S69JBD100_cm33_core0")

    97. SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DARM_MATH_CM33")

    98. SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Os")

    99. SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wall")

    100. SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-common")

    101. SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ffunction-sections")

    102. SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fdata-sections")

    103. SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -ffreestanding")

    104. SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-builtin")

    105. SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -mthumb")

    106. SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -mapcs")

    107. SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-rtti")

    108. SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-exceptions")

    109. SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -mcpu=cortex-m33")

    110. SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -mfloat-abi=hard")

    111. SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -mfpu=fpv5-sp-d16")

    112. SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -MMD")

    113. SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -MP")

    114. SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")

    115. SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DCPU_LPC55S69JBD100_cm33_core0")

    116. SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DARM_MATH_CM33")

    117. SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g")

    118. SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0")

    119. SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall")

    120. SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-common")

    121. SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ffunction-sections")

    122. SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fdata-sections")

    123. SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -ffreestanding")

    124. SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-builtin")

    125. SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -mthumb")

    126. SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -mapcs")

    127. SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-rtti")

    128. SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fno-exceptions")

    129. SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -mcpu=cortex-m33")

    130. SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -mfloat-abi=hard")

    131. SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -mfpu=fpv5-sp-d16")

    132. SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -MMD")

    133. SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -MP")

    134. SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} --specs=nano.specs")

    135. SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} --specs=nosys.specs")

    136. SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -Wall")

    137. SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -fno-common")

    138. SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -ffunction-sections")

    139. SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -fdata-sections")

    140. SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -ffreestanding")

    141. SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -fno-builtin")

    142. SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -mthumb")

    143. SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -mapcs")

    144. SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -Xlinker")

    145. SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} --gc-sections")

    146. SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -Xlinker")

    147. SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -static")

    148. SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -Xlinker")

    149. SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -z")

    150. SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -Xlinker")

    151. SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} muldefs")

    152. SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -Xlinker")

    153. SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -Map=output.map")

    154. SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -mcpu=cortex-m33")

    155. SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -mfloat-abi=hard")

    156. SET(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -mfpu=fpv5-sp-d16")

    157. SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -g")

    158. SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} --specs=nano.specs")

    159. SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} --specs=nosys.specs")

    160. SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -Wall")

    161. SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -fno-common")

    162. SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -ffunction-sections")

    163. SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -fdata-sections")

    164. SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -ffreestanding")

    165. SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -fno-builtin")

    166. SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -mthumb")

    167. SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -mapcs")

    168. SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -Xlinker")

    169. SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} --gc-sections")

    170. SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -Xlinker")

    171. SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -static")

    172. SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -Xlinker")

    173. SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -z")

    174. SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -Xlinker")

    175. SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} muldefs")

    176. SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -Xlinker")

    177. SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -Map=output.map")

    178. SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -mcpu=cortex-m33")

    179. SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -mfloat-abi=hard")

    180. SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -mfpu=fpv5-sp-d16")

    181. include_directories(${ProjDirPath}/..)

    182. include_directories(${ProjDirPath}/../..)

    183. include_directories(${ProjDirPath}/../../../../../../../CMSIS/Include)

    184. include_directories(${ProjDirPath}/../../../../../../../devices)

    185. include_directories(${ProjDirPath}/../../../../../../../devices/LPC55S69)

    186. include_directories(${ProjDirPath}/../../../../../../../platform/drivers)

    187. include_directories(${ProjDirPath}/../../../../../../../platform/drivers/common)

    188. include_directories(${ProjDirPath}/../../../../..)

    189. include_directories(${ProjDirPath}/../../../../../../../middleware/usb)

    190. include_directories(${ProjDirPath}/../../../../../../../middleware/usb/osa)

    191. include_directories(${ProjDirPath}/../../../../../../../middleware/usb/include)

    192. include_directories(${ProjDirPath}/../../../../../../../middleware/usb/device)

    193. include_directories(${ProjDirPath}/../../../../../../../devices/LPC55S69/drivers)

    194. include_directories(${ProjDirPath}/../../../../../../../components/codec/wm8904)

    195. include_directories(${ProjDirPath}/../../../../../../../components/codec/i2c)

    196. include_directories(${ProjDirPath}/../../../../../../../components/codec)

    197. include_directories(${ProjDirPath}/../../../../../../../components/codec/port)

    198. include_directories(${ProjDirPath}/../../../../../../../components/i2c)

    199. include_directories(${ProjDirPath}/../../../../../../../middleware/usb/phy)

    200. include_directories(${ProjDirPath}/../../../../../../../devices/LPC55S69/utilities/str)

    201. include_directories(${ProjDirPath}/../../../../../../../devices/LPC55S69/utilities/debug_console)

    202. include_directories(${ProjDirPath}/../../../../../../../components/uart)

    203. include_directories(${ProjDirPath}/../../../../../../../components/serial_manager)

    204. include_directories(${ProjDirPath}/../../../../../../../components/lists)

    205. add_compile_definitions(USB_DEVICE_FRO_CAL_LIBRARY_ENABLE=1)
    206. add_executable(dev_composite_hid_audio_unified_bm.elf
    207. "${ProjDirPath}/../audio_unified.c"
    208. "${ProjDirPath}/../audio_unified.h"
    209. "${ProjDirPath}/../composite.c"
    210. "${ProjDirPath}/../composite.h"
    211. "${ProjDirPath}/../hid_keyboard.c"
    212. "${ProjDirPath}/../hid_keyboard.h"
    213. "${ProjDirPath}/../usb_device_descriptor.c"
    214. "${ProjDirPath}/../usb_device_descriptor.h"
    215. "${ProjDirPath}/../usb_device_config.h"
    216. "${ProjDirPath}/../board.c"
    217. "${ProjDirPath}/../board.h"
    218. "${ProjDirPath}/../clock_config.c"
    219. "${ProjDirPath}/../clock_config.h"
    220. "${ProjDirPath}/../pin_mux.c"
    221. "${ProjDirPath}/../pin_mux.h"
    222. "${ProjDirPath}/../../../../../../../middleware/usb/device/usb_device_lpcip3511.c"
    223. "${ProjDirPath}/../../../../../../../middleware/usb/device/usb_device_lpcip3511.h"
    224. "${ProjDirPath}/../../../../../../../middleware/usb/include/usb.h"
    225. "${ProjDirPath}/../../../../../../../middleware/usb/include/usb_misc.h"
    226. "${ProjDirPath}/../../../../../../../middleware/usb/include/usb_spec.h"
    227. "${ProjDirPath}/../../../../../../../middleware/usb/osa/usb_osa.h"
    228. "${ProjDirPath}/../../../../../../../middleware/usb/osa/usb_osa_bm.c"
    229. "${ProjDirPath}/../../../../../../../middleware/usb/osa/usb_osa_bm.h"
    230. "${ProjDirPath}/../../../../../../../devices/LPC55S69/drivers/fsl_i2c.c"
    231. "${ProjDirPath}/../../../../../../../devices/LPC55S69/drivers/fsl_i2c.h"
    232. "${ProjDirPath}/../../../../../../../devices/LPC55S69/drivers/fsl_i2s.c"
    233. "${ProjDirPath}/../../../../../../../devices/LPC55S69/drivers/fsl_i2s.h"
    234. "${ProjDirPath}/../../../../../../../devices/LPC55S69/drivers/fsl_i2s_dma.c"
    235. "${ProjDirPath}/../../../../../../../devices/LPC55S69/drivers/fsl_i2s_dma.h"
    236. "${ProjDirPath}/../../../../../../../devices/LPC55S69/drivers/fsl_ctimer.c"
    237. "${ProjDirPath}/../../../../../../../devices/LPC55S69/drivers/fsl_ctimer.h"
    238. "${ProjDirPath}/../../../../../../../devices/LPC55S69/drivers/fsl_dma.c"
    239. "${ProjDirPath}/../../../../../../../devices/LPC55S69/drivers/fsl_dma.h"
    240. "${ProjDirPath}/../../../../../../../components/codec/wm8904/fsl_wm8904.c"
    241. "${ProjDirPath}/../../../../../../../components/codec/wm8904/fsl_wm8904.h"
    242. "${ProjDirPath}/../../../../../../../components/codec/port/wm8904/fsl_codec_adapter.c"
    243. "${ProjDirPath}/../../../../../../../components/codec/fsl_codec_common.c"
    244. "${ProjDirPath}/../../../../../../../components/codec/fsl_codec_common.h"
    245. "${ProjDirPath}/../../../../../../../components/codec/port/fsl_codec_adapter.h"
    246. "${ProjDirPath}/../../../../../../../components/i2c/flexcomm_i2c_adapter.c"
    247. "${ProjDirPath}/../../../../../../../components/i2c/i2c.h"
    248. "${ProjDirPath}/../../../../../../../devices/LPC55S69/drivers/fsl_gint.c"
    249. "${ProjDirPath}/../../../../../../../devices/LPC55S69/drivers/fsl_gint.h"
    250. "${ProjDirPath}/../../../../../../../middleware/usb/device/usb_device.h"
    251. "${ProjDirPath}/../../../../../../../middleware/usb/device/usb_device_dci.c"
    252. "${ProjDirPath}/../../../../../../../middleware/usb/device/usb_device_dci.h"
    253. "${ProjDirPath}/../usb_device_ch9.c"
    254. "${ProjDirPath}/../usb_device_ch9.h"
    255. "${ProjDirPath}/../usb_device_class.c"
    256. "${ProjDirPath}/../usb_device_class.h"
    257. "${ProjDirPath}/../usb_device_audio.c"
    258. "${ProjDirPath}/../usb_device_audio.h"
    259. "${ProjDirPath}/../usb_device_hid.c"
    260. "${ProjDirPath}/../usb_device_hid.h"
    261. "${ProjDirPath}/../../../../../../../devices/LPC55S69/drivers/fsl_clock.c"
    262. "${ProjDirPath}/../../../../../../../devices/LPC55S69/drivers/fsl_clock.h"
    263. "${ProjDirPath}/../../../../../../../devices/LPC55S69/drivers/fsl_common.c"
    264. "${ProjDirPath}/../../../../../../../devices/LPC55S69/drivers/fsl_common.h"
    265. "${ProjDirPath}/../../../../../../../devices/LPC55S69/fsl_device_registers.h"
    266. "${ProjDirPath}/../../../../../../../devices/LPC55S69/LPC55S69_cm33_core0.h"
    267. "${ProjDirPath}/../../../../../../../devices/LPC55S69/LPC55S69_cm33_core0_features.h"
    268. "${ProjDirPath}/../../../../../../../devices/LPC55S69/system_LPC55S69_cm33_core0.c"
    269. "${ProjDirPath}/../../../../../../../devices/LPC55S69/system_LPC55S69_cm33_core0.h"
    270. "${ProjDirPath}/../../../../../../../devices/LPC55S69/gcc/startup_LPC55S69_cm33_core0.S"
    271. "${ProjDirPath}/../../../../../../../devices/LPC55S69/drivers/fsl_usart.c"
    272. "${ProjDirPath}/../../../../../../../devices/LPC55S69/drivers/fsl_usart.h"
    273. "${ProjDirPath}/../../../../../../../devices/LPC55S69/drivers/fsl_flexcomm.c"
    274. "${ProjDirPath}/../../../../../../../devices/LPC55S69/drivers/fsl_flexcomm.h"
    275. "${ProjDirPath}/../../../../../../../devices/LPC55S69/drivers/fsl_gpio.c"
    276. "${ProjDirPath}/../../../../../../../devices/LPC55S69/drivers/fsl_gpio.h"
    277. "${ProjDirPath}/../../../../../../../devices/LPC55S69/drivers/fsl_iocon.h"
    278. "${ProjDirPath}/../../../../../../../devices/LPC55S69/drivers/fsl_power.c"
    279. "${ProjDirPath}/../../../../../../../devices/LPC55S69/drivers/fsl_power.h"
    280. "${ProjDirPath}/../../../../../../../devices/LPC55S69/drivers/fsl_reset.c"
    281. "${ProjDirPath}/../../../../../../../devices/LPC55S69/drivers/fsl_reset.h"
    282. "${ProjDirPath}/../../../../../../../devices/LPC55S69/utilities/fsl_assert.c"
    283. "${ProjDirPath}/../../../../../../../middleware/usb/phy/usb_phy.c"
    284. "${ProjDirPath}/../../../../../../../middleware/usb/phy/usb_phy.h"
    285. "${ProjDirPath}/../../../../../../../devices/LPC55S69/utilities/debug_console/fsl_debug_console.c"
    286. "${ProjDirPath}/../../../../../../../devices/LPC55S69/utilities/debug_console/fsl_debug_console.h"
    287. "${ProjDirPath}/../../../../../../../devices/LPC55S69/utilities/debug_console/fsl_debug_console_conf.h"
    288. "${ProjDirPath}/../../../../../../../devices/LPC55S69/utilities/str/fsl_str.c"
    289. "${ProjDirPath}/../../../../../../../devices/LPC55S69/utilities/str/fsl_str.h"
    290. "${ProjDirPath}/../../../../../../../components/uart/uart.h"
    291. "${ProjDirPath}/../../../../../../../components/uart/usart_adapter.c"
    292. "${ProjDirPath}/../../../../../../../components/serial_manager/serial_manager.c"
    293. "${ProjDirPath}/../../../../../../../components/serial_manager/serial_manager.h"
    294. "${ProjDirPath}/../../../../../../../components/serial_manager/serial_port_internal.h"
    295. "${ProjDirPath}/../../../../../../../components/serial_manager/serial_port_uart.c"
    296. "${ProjDirPath}/../../../../../../../components/serial_manager/serial_port_uart.h"
    297. "${ProjDirPath}/../../../../../../../components/lists/generic_list.c"
    298. "${ProjDirPath}/../../../../../../../components/lists/generic_list.h"
    299. "${ProjDirPath}/../../../../../../../CMSIS/Include/core_cm33.h"
    300. "${ProjDirPath}/../../../../../../../CMSIS/Include/tz_context.h"
    301. "${ProjDirPath}/../../../../../../../CMSIS/Include/arm_common_tables.h"
    302. "${ProjDirPath}/../../../../../../../CMSIS/Include/arm_const_structs.h"
    303. "${ProjDirPath}/../../../../../../../CMSIS/Include/arm_math.h"
    304. "${ProjDirPath}/../../../../../../../CMSIS/Include/cmsis_armcc.h"
    305. "${ProjDirPath}/../../../../../../../CMSIS/Include/cmsis_armclang.h"
    306. "${ProjDirPath}/../../../../../../../CMSIS/Include/cmsis_compiler.h"
    307. "${ProjDirPath}/../../../../../../../CMSIS/Include/cmsis_gcc.h"
    308. "${ProjDirPath}/../../../../../../../CMSIS/Include/cmsis_iccarm.h"
    309. "${ProjDirPath}/../../../../../../../CMSIS/Include/cmsis_version.h"
    310. "${ProjDirPath}/../../../../../../../CMSIS/Include/core_armv8mbl.h"
    311. "${ProjDirPath}/../../../../../../../CMSIS/Include/core_armv8mml.h"
    312. "${ProjDirPath}/../../../../../../../CMSIS/Include/mpu_armv7.h"
    313. "${ProjDirPath}/../../../../../../../CMSIS/Include/mpu_armv8.h"
    314. "${ProjDirPath}/../../../../../../../components/codec/i2c/fsl_codec_i2c.c"
    315. "${ProjDirPath}/../../../../../../../components/codec/i2c/fsl_codec_i2c.h"
    316. )


    317. set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -T${ProjDirPath}/LPC55S69_cm33_core0_flash.ld -static")

    318. set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -T${ProjDirPath}/LPC55S69_cm33_core0_flash.ld -static")

    319. TARGET_LINK_LIBRARIES(dev_composite_hid_audio_unified_bm.elf -Wl,--start-group)
    320. target_link_libraries(dev_composite_hid_audio_unified_bm.elf optimized m)

    321. target_link_libraries(dev_composite_hid_audio_unified_bm.elf optimized c)

    322. target_link_libraries(dev_composite_hid_audio_unified_bm.elf optimized gcc)

    323. target_link_libraries(dev_composite_hid_audio_unified_bm.elf optimized nosys)

    324. target_link_libraries(dev_composite_hid_audio_unified_bm.elf debug m)

    325. target_link_libraries(dev_composite_hid_audio_unified_bm.elf debug c)

    326. target_link_libraries(dev_composite_hid_audio_unified_bm.elf debug gcc)

    327. target_link_libraries(dev_composite_hid_audio_unified_bm.elf debug nosys)

    328. link_directories(${ProjDirPath}/../../../../../../../devices/LPC55S69/gcc)

    329. target_link_libraries(dev_composite_hid_audio_unified_bm.elf optimized ${ProjDirPath}/../../../../../../../devices/LPC55S69/gcc/libpower_hardabi.a)

    330. link_directories(${ProjDirPath}/../../../../../../../devices/LPC55S69/gcc)

    331. target_link_libraries(dev_composite_hid_audio_unified_bm.elf debug ${ProjDirPath}/../../../../../../../devices/LPC55S69/gcc/libpower_hardabi.a)

    332. link_directories(${ProjDirPath}/../../../../../../../devices/LPC55S69/gcc)

    333. target_link_libraries(dev_composite_hid_audio_unified_bm.elf debug ${ProjDirPath}/../../../../../../../devices/LPC55S69/gcc/libfro_calib_hardabi.a)


    334. link_directories(${ProjDirPath}/../../../../../../../devices/LPC55S69/gcc)

    335. target_link_libraries(dev_composite_hid_audio_unified_bm.elf debug ${ProjDirPath}/../../../../../../../devices/LPC55S69/gcc/libfro_calib_softabi.a)

    336. TARGET_LINK_LIBRARIES(dev_composite_hid_audio_unified_bm.elf -Wl,--end-group)

    复制代码




    签到签到
    回复

    使用道具 举报

    您需要登录后才可以回帖 注册/登录

    本版积分规则

    关闭

    站长推荐上一条 /4 下一条

    Archiver|手机版|小黑屋|恩智浦技术社区

    GMT+8, 2024-4-20 17:55 , Processed in 0.104583 second(s), 19 queries , MemCache On.

    Powered by Discuz! X3.4

    Copyright © 2001-2021, Tencent Cloud.

    快速回复 返回顶部 返回列表