Errors when compiling imported MDK-V4 from STM32CubeMX
I'm trying to build CubeMX generated code. I use MDK-V4 as output. I then import into Crossworkks V3.3.1
I'm using the STM32F103VGT, and plan on using FreeRTOS with CubeMX.
In the port.c file, I get these compiling errors:
1) __asm void vPortSVCHandler( void ) // error: expected '(' before 'void'
2) mov r0, #0 // stray '#' in program. I get various of these errors in this file, everywhere '#' is used.
I've tried importing MDK-V5, but the same happens.
-
Looks like you are using FreeRTOS' port.c from portable\RVDS\ARM_CM3 directory. Replace that file with port.c from portable\GCC\ARM_CM3. Do also same for all other files which are taken from portable\RVDS\ directories, and don't forget to change the include paths to point to portable\GCC\ARM_CM3.
Other approach could be to use SW4STM32 output, which generates code for GCC. (But then you lose ability to import generated project file and need to create the project file manually in Crossworks.)
-
Thanks Tero!
I copied the port.c and portmacro.h files from GCC and it solved this error.
Then I ran into another problem, __stack_process_end__ and __stack_process_start__ were not defined. After searching the net, I saw that I should use the STM32 template, not the STM32F10x template, and that solved the problem, I can now compile without errors.
Thanks!
Please sign in to leave a comment.
Comments
2 comments