This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
在 SysConfig 中添加 USB 接口时、出现以下编译器错误:
subdir_rules.mk:26: recipe for target 'syscfg/ti_usblib_config.obj' failed "C:/ti/simplelink_msp432e4_sdk_4_20_00_12/source/ti/devices/msp432e4/inc/msp432.h", line 53: fatal error #35: #error directive: "Failed to match a default include file" 1 catastrophic error detected in the compilation of "syscfg/ti_usblib_config.c".
/** * These arguments were used when this file was generated. They will be automatically applied on subsequent loads * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments. * @cliArgs --device "MSP432E" --package "128 Pin QFP|32x32" --part "MSP432E401YTPDT" --product "simplelink_msp432e4_sdk@4.20.00.12" * @versions {"tool":"1.17.0+3128"} */ const Settings = scripting.addModule("/ti/usblib/Settings", {}, false); const Settings1 = Settings.addInstance(); Settings1.$name = "CONFIG_USB_0"; Settings1.usb.$assign = "USB0"; Settings1.usb.dmPin.$assign = "PL7"; Settings1.usb.dpPin.$assign = "PL6"; Settings1.usb.idPin.$assign = "PB0"; Settings1.usb.vbusPin.$assign = "PB1"; Settings1.stringDescriptor.$name = "usb_string0"; Settings1.configuration.$name = "usb_configuration0"; Settings1.configuration.hid.$name = "usb_hid0";
这有点奇怪、因为 SysConfig 生成的文件 ti_usblib_config.h 包含 :
******************************************************************************/ #ifndef __MSP432_H__ #define __MSP432_H__ /****************************************************************************** * MSP432 devices * ******************************************************************************/ #if defined (__MSP432E411Y__) #include "msp432e411y.h" #elif defined (__MSP432E401Y__) #include "msp432e401y.h" /****************************************************************************** * Failed to match a default include file * ******************************************************************************/ #else #error "Failed to match a default include file" #endif #endif /* __MSP432_H__ */
因此、使用 _MSP432E401Y_时、它应该会解析为该条件。 为什么会得到误差?
清洁和重建不起作用。
您好!
C:\ti\simplelink_msp432e4_SDK_4_20_00_12\examples\rtos\MSP_EXP432E401Y\usblib 中有几个 USB 示例。 我尝试导入 USB_serial_device 示例并进行构建。 我看不出任何编译问题。 示例项目具有 usb_serial_device.syscfg。 我将建议您从一个工作示例开始、并根据您的应用要求进行修改。
尊敬的 Charles:
usblib 文件夹中的示例和我的项目(最初基于 buttonled)之间的区别是.project 文件中缺少 MCU 类型的定义。
前两行是相同的,添加缺失的最后两行,它工作.
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="com.ti.ccstudio.buildDefinitions.MSP432_20.2.compilerID.DEFINE.1188864034" superClass="com.ti.ccstudio.buildDefinitions.MSP432_20.2.compilerID.DEFINE" valueType="definedSymbols"> <listOptionValue builtIn="false" value="${INHERITED_SYMBOLS}"/> <listOptionValue builtIn="false" value="${SYSCONFIG_TOOL_SYMBOLS}"/> <listOptionValue builtIn="false" value="DeviceFamily_MSP432E4"/> <listOptionValue builtIn="false" value="__MSP432E401Y__"/> </option>
在任何情况下、 当选择相应的 MCU 时、如果 syscfg 自动设置这些非常重要的定义、会很有用。
此致
彼得