MediaTek-Labs / mt3620_m4_software

mt3620_m4_driver
Other
32 stars 29 forks source link

FreeRTOS build errors on Linux development computer #39

Closed bawilless closed 3 years ago

bawilless commented 3 years ago

I’m trying to build the MT3620_RTApp_FreeRTOS_MBOX/RTAppA example on my Linux development computer. I get the error shown below. I can pull the same source and build it on my Windows computer without any errors. Any idea how to resolve this issue?

Error: selected FPU does not support instruction -- `vstmdbeq r0!,{s16-s31}' Error: selected FPU does not support instruction -- `vldmiaeq r0!,{s16-s31}'

The steps to reproduce the issue . . .

Thanks

LawranceLiu commented 3 years ago

When building the RTApp sample code with Visual Studio Code on Linux, the .vscode/settings.json is generated by VS Code automatically with the following configuration: "CMAKE_TOOLCHAIN_FILE": "${command:azuresphere.AzureSphereSdkDir}/CMakeFiles/AzureSphereRTCoreToolchain.cmake" It means the Azure Sphere SDK default AzureSphereRTCoreToolchain.cmake is used. When building the FreeRTOS RTApp, the FreeRTOS BSP requires the FPU support. and the default cmake file does not turn on the FPU support.

The solution to fix the build error is to modify the Azure Sphere SDK default AzureSphereRTCoreToolchain.cmake (/opt/azurespheresdk/CMakeFiles/AzureSphereRTCoreToolchain.cmake): set(CMAKE_C_FLAGS_INIT "-mcpu=cortex-m4 -mfloat-abi=hard -mfpu=fpv4-sp-d16")

LawranceLiu commented 3 years ago

Welcome to reopen it if any further discussion.