您好,我在 PIL 模式下构建 PMSM_FOC 示例时遇到问题。问题在于使用 CRL:“ARM CMSIS SIN CON”。在包含路径 (-l) 中手动添加 arm_math.h 目录 (
C:MATLABSTM32-MATSTM32CRLCMSIS_SIN_COS_CRLFastMathFunctions)后,构建过程会为 100 个元素返回以下错误代码。
- Building file: C:/matlab/STM32-MAT/STM32/STM32demos/MotorControl/FOC/PMSM_FOC_Compute_PIL/PMSM_FOC_Compute/Src/arm_cos_f32.c
- Invoking: MCU GCC Compiler
- C:MATLABSTM32-MATSTM32STM32demosMotorControlFOCPMSM_FOC_Compute_PILSW4STM32PMSM_FOC_ComputeDebug
- arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv4-sp-d16 -DUSE_HAL_DRIVER -DARM_MATH_CM4 '-DMemUnit_T=uint8_T' '-DMEM_UNIT_BYTES=1' '-DRtiOSTREAM_TX_BUFFER_BYTE_SIZE=128' '-DRTIOSTREAM_RX_BUFFER_BYTE_SIZE=128' '-DCODER_ASSUMPTIONS_ENABLED=1' -DCODE_INSTRUMENTATION_ENABLED -DCA_CHECK_FLOATING_POINT_ENABLED -DCA_CHECK_LONG_LONG_ENABLED -DCA_CHECK_DAZ_ENABLED -DSTM32F429xx -I"C:/MATLAB/STM32-MAT/STM32/STM32demos/MotorControl/FOC/PMSM_FOC_Compute_PIL/Inc" -I"C:/MATLAB/STM32-MAT/STM32/STM32demos/MotorControl/FOC/PMSM_FOC_Compute_PIL/Drivers/STM32F4xx_HAL_Driver/Inc" -I"C:/MATLAB/STM32-MAT/STM32/STM32demos/MotorControl/FOC/PMSM_FOC_Compute_PIL/Drivers/STM32F4xx_HAL_Driver/Inc/Legacy" -I"C:/MATLAB/STM32-MAT/STM32/STM32demos/MotorControl/FOC/PMSM_FOC_Compute_PIL/Drivers/CMSIS/Device/ST/STM32F4xx/Include" -I"C:/MATLAB/STM32-MAT/STM32/STM32demos/MotorControl/FOC/PMSM_FOC_Compute_PIL/Drivers/CMSIS/Include" -I"C:/MATLAB/STM32-MAT/STM32/STM32demos/MotorControl/FOC/PMSM_FOC_Compute_PIL/PMSM_FOC_Compute/Inc" -I"C:/MATLAB/STM32-MAT/STM32/STM32demos/MotorControl/FOC" -I"C:/MATLAB/STM32-MAT/STM32/STM32demos/MotorControl/FOC/slprj/stm32/PMSM_FOC_Compute" -I"C:/MATLAB/STM32-MAT/STM32/STM32demos/MotorControl/FOC/slprj/stm32/PMSM_FOC_Compute/coderassumptions" -I"C:/MATLAB/STM32-MAT/STM32/STM32demos/MotorControl/FOC/slprj/stm32/PMSM_FOC_Compute/pil" -I"C:/MATLAB/STM32-MAT/STM32/STM32demos/MotorControl/FOC/slprj/stm32/_sharedutils" -I"C:/MATLAB/STM32-MAT/STM32/addSrc/inc" -I"C:/MATLAB/STM32-MAT/STM32/pil/stm32SerialRtiostream" -I"C:/Program Files/MATLAB/R2019b/extern/include" -I"C:/Program Files/MATLAB/R2019b/extern/include/coder/connectivity/CodeInstrTgtAppSvc" -I"C:/Program Files/MATLAB/R2019b/extern/include/coder/connectivity/CoderAssumpTgtAppSvc" -I"C:/Program Files/MATLAB/R2019b/extern/include/coder/connectivity/XILTgtAppSvc" -I"C:/Program Files/MATLAB/R2019b/rtw/c/ert" -I"C:/Program Files/MATLAB/R2019b/rtw/c/src" -I"C:/Program Files/MATLAB/R2019b/rtw/c/src/ext_mode/common" -I"C:/Program Files/MATLAB/R2019b/simulink/include" -I"C:/Program Files/MATLAB/R2019b/toolbox/coder/rtiostream/src" -I"C:/Program Files/MATLAB/R2019b/toolbox/coder/rtiostream/src/utils" -I"C:/Program Files/MATLAB/R2019b/toolbox/rtw/targets/pil/c" -I"C:/MATLAB/STM32-MAT/STM32/CRL/CMSIS_SIN_COS_CRL/FastMathFunctions" -Og -g3 -Wall -fmessage-length=0 -ffunction-sections -c -fmessage-length=0 -MMD -MP -MF"MATLAB/arm_cos_f32.d" -MT"MATLAB/arm_cos_f32.o" -o "MATLAB/arm_cos_f32.o" "C:/MATLAB/STM32-MAT/STM32/STM32demos/MotorControl/FOC/PMSM_FOC_Compute_PIL/PMSM_FOC_Compute/Src/arm_cos_f32.c"
- In file included from C:/MATLAB/STM32-MAT/STM32/STM32demos/MotorControl/FOC/PMSM_FOC_Compute_PIL/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f4xx.h:141:0,
- from C:/MATLAB/STM32-MAT/STM32/STM32demos/MotorControl/FOC/PMSM_FOC_Compute_PIL/PMSM_FOC_Compute/Inc/STM32_Config.h:40,
- from C:/MATLAB/STM32-MAT/STM32/CRL/CMSIS_SIN_COS_CRL/FastMathFunctions/arm_math.h:256,
- from C:/MATLAB/STM32-MAT/STM32/STM32demos/MotorControl/FOC/PMSM_FOC_Compute_PIL/PMSM_FOC_Compute/Src/arm_cos_f32.c:30:
- C:/MATLAB/STM32-MAT/STM32/STM32demos/MotorControl/FOC/PMSM_FOC_Compute_PIL/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f429xx.h:188:3: error: unknown type name '__IO'
- __IO uint32_t SR; /*!< ADC status register, Address offset: 0x00 */
- ^~~~
- C:/MATLAB/STM32-MAT/STM32/STM32demos/MotorControl/FOC/PMSM_FOC_Compute_PIL/Drivers/CMSIS/Device/ST/STM32F4xx/Include/stm32f429xx.h:188:17: error: expected ':', ',', ';', '}' or '__attribute__' before 'SR'
- __IO uint32_t SR; /*!< ADC status register, Address offset: 0x00 */
有人可以帮助我吗?我试图添加 arm_cm4.h 和 stm32f429xx.h ditectories,我有同样的错误。