Error: unsupported instruction/invalid instruction in portmacro.h

Hey all, running into this odd issue when I try to make my FreeRTOS project.

For context

  • Using Ubuntu 18.04.5
  • g++/gcc-7 compiler
  • gcc-arm-none-eabi cross compiler (15:6.3.1+svn253039-1build1)
  • Using GCC/ARM_CM4F portmacro.h

When I try to make my project, I get various assembler messages such as
Error: unsupported instruction ‘mov’, even if I have not touched the file. I’ve attached an image below. If anyone has run into this issue before, please let me know how to fix it! I’m thinking it could be something with my compiler, but not too sure.

Cheers!

Images

Probably you are not providing the correct compiler options. Can you share the command you are using for building?

Thanks.

I’m using CMake to generate a makefile, then just using the command “make” to build it. I’ve made sure to include all the FreeRTOS libraries in the CMakeList as well.

Please post the compiler command line used.

make /urs/bin/cmake -H/home/FreeRTOS -B/home/FreeRTOS --check-build-system CMakeFiles/MakeFile.cmake 0 /usr/bin/cmake -E cmake_progress_start /home/FreeRTOS/CMakeFiles /home/FreeRTOS/CMakeFiles/progress.marks

make -f CMakeFiles/Makefile2 all

It’s strange, because with another project, I don’t get any errors like the one in the first post, so I’m assuming it might have to do with the files included in my CMake File?

Richard was asking for the compiler command line, not the make invocation.

I’ve attached both the CMakeList and the generated Makefile associated, as I was unable to find the compiler command line. For context, this is part of a larger library, and I just added FreeRTOS files into the CMakeList to be compiled. I’m a bit hesitant to make any major changes to the file, but will do what’s necessary :slight_smile:

Cheers!

Issue.zip (6.1 KB)

You missed to add the important makefile CMakeFiles/osal_freertos_impl.dir/build.make with the GCC invocation.

Edit: You set

#Define compiler used
set(CMAKE_C_COMPILER "gcc-7")
set(CMAKE_CXX_COMPILER "/usr/bin/g++-7")

in your CMakeLists.txt file. Thats obviously NOT the cross compiler, right :wink:

Sorry how would I go about writing this? Pretty new to the scene :frowning:

Also I set the C/C++ compiler to the crosscompiler (arm-none-eabi-gcc/g++), and getting the error: “selected processor does not support 'isb ’ in ARM mode.” I’m assuming it’s some compiler options that I’ll have to add with add_compile_options() in the CMakeList file.

build.make is used in the generated top Makefile. I just had a look into it. That’s the way cmake works.
Maybe you find a (cmake based) demo project for your GCC/ARM_CM4F project to set the right compiler options. Or have a look into the makefiles of the corr. FreeRTOS demos.

Hey folks, sorry for the delay,

Following Hartmut’s advice, I copied over a set of correct compiler options for a past project to match my current one. Appreciate all the help!