STM32 F4 CubeMX Generated Code Compile Problem
02-07-2017
Compiler v3.65.2016061400.28363 non-commercial license
OS: Win7 SP1
A month or so ago, I asked RCW to provide a simple example program so that I could learn where & how all the peices fit. RCW recommended that I download and use STM32CubeMX for a solution. Great idea, but no matter what I do, Crossworks fails to compile the resultant F4 Cube generated code. This also happens for STM32L152C-Disco & STM32F401RE Nucleo boards in varying degrees.
After code generation, I import via the Kiel import mechanizm, then attempt to compile. I receive the following error message in module core_cm4.h, line 275:
Error: expected '{' before 'volatile'
275: #define __IM volatile const /*! Defines 'read only' struct member perms */
Also, under the CubeMX lib 'repository' examples for both L15x & F401 CPUs, only three of the seven L15x series compile successfully, and of those, only two execute properly, all the rest either fail to compile or fall into a 'hard-fault handler'. None of the F401 repository examples import/compile. All of the F401 Cube generated source fail to compile as I noted above. There are likely other errors, but these are those that stop the process.
I posted a help request on the STM forum/BBS, so far, apparently, no one else is having these type problems and it appears that STM hasn't deemed it to be in their court.
I know it is (hopefully) something simple that I don't as yet understand. I have looked all over the InterNet but haven't found anything that even comes close. Any help is appreciated.
Thanks in advance
tron nee
-
To check whether the project has been generated correctly, I suggest to build it with the evaluation version of Keil and see what happens. If it still fails then there's something wrong in the project.
In my experience, generating the project for Keil v5 and then importing it in CW usually works. Sometime I had to check that the processor defined was the right one but this only happened in older versions. The last 3.7.x does the job. And also check for stack and heap dimensions (in the imported project).
Andrea
-
Andrea,
Great idea and I did so tonight, but I also installed my RCW 3.6,5 version toolchain onto a new laptop and attempted to compile the project that was failing to compile on the older laptop. It compiles ok. So, I screwed something up in the other RCW 3.6.5 toolchain configuration. Tomorrow (its 2AM here), I'll test compile the project using the freebie, 32k limited Keil MDK-V5 toolchain. But I suspect it'll compile just fine.
Thanks for your comment.
walt
retired control segment GPS engineer
Please sign in to leave a comment.
Comments
2 comments