mbed-ce / mbed-os

Arm Mbed OS is a platform operating system designed for the internet of things
https://mbed.com
Other
37 stars 12 forks source link

Fix CMake error on Cortex-A targets #293

Closed wdx04 closed 1 week ago

wdx04 commented 1 week ago

Summary of changes

Recently I bought a GR-MANGO board, which is officially supported by Mbed OS. But, when I try to compile a simple blinky app with Mbed CE, I got the following error message:

[cmake] -- Mbed: First CMake run detected, generating configs...
[cmake] mbed_config.cmake has been generated and written to 'D:\Develop\Mbed\mbed-ce-app\build\GR_MANGO-Develop\mbed_config.cmake'
[cmake] -- The C compiler identification is GNU 13.2.1
[cmake] -- The CXX compiler identification is GNU 13.2.1
[cmake] -- The ASM compiler identification is GNU
[cmake] -- Found assembler: D:/Develop/Mbed/arm_gcc/bin/arm-none-eabi-gcc.exe
[cmake] -- Detecting C compiler ABI info
[cmake] -- Detecting C compiler ABI info - done
[cmake] -- Check for working C compiler: D:/Develop/Mbed/arm_gcc/bin/arm-none-eabi-gcc.exe - skipped
[cmake] -- Detecting C compile features
[cmake] -- Detecting C compile features - done
[cmake] -- Detecting CXX compiler ABI info
[cmake] -- Detecting CXX compiler ABI info - done
[cmake] -- Check for working CXX compiler: D:/Develop/Mbed/arm_gcc/bin/arm-none-eabi-g++.exe - skipped
[cmake] -- Detecting CXX compile features
[cmake] -- Detecting CXX compile features - done
[cmake] -- Mbed: Target does not have any upload method configuration.  'make flash-' commands will not be available unless configured by the upper-level project.
[cmake] -- Mbed: Not building any Mbed OS tests.
[cmake] -- Mbed: Code upload enabled via upload method MBED
[cmake] CMake Error at mbed-os/cmsis/CMSIS_5/CMSIS/RTOS2/RTX/CMakeLists.txt:35 (target_sources):
[cmake]   Cannot specify sources for target "mbed-rtos" which is not built by this
[cmake]   project.
[cmake] Call Stack (most recent call first):
[cmake]   mbed-os/cmsis/CMSIS_5/CMSIS/RTOS2/RTX/CMakeLists.txt:40 (_mbed_get_cortex_a_exception_handlers)
[cmake] 
[cmake] 
[cmake] -- Configuring incomplete, errors occurred!

The error is caused by a typo in mbed-os/cmsis/CMSIS_5/CMSIS/RTOS2/RTX/CMakeLists.txt, line 35, where "mbed-rtos" should be renamed to "mbed-rtos-sources".

The error would affect all Cortex-A based targets.

I applied the fix and successfully compiled and run the blinky app on my GR-Mango board.

Documentation

None


Pull request type

[X] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)

Test results

[X] No Tests required for this change (E.g docs only update)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[] Tests / results supplied as part of this PR

multiplemonomials commented 1 week ago

Thanks, good catch! That's awesome to hear that mbed-ce builds on GR_MANGO, that's a device I haven't gotten a chance to test. Please submit an upload method file if you have a chance to make one!