Loading...
 
Skip to main content

System Workbench for STM32


cubeMX generation problem

Hi,

I have a cubeMx code generation problem. I generated the whole project with cubeMX but after some modifications I got the following compiler error:

warning: cannot find entry symbol Reset_Handler; defaulting to 08000000

I figured out that the source of the error is first line of my .cproject file.

before (compiler => OK):


after(compiler => error!):


Can somebody help me to solve this problem?

Thank you in advance,
Dave

Hi Dave,

To me, it seems that the startup file (startup_stm32xxxxx.s) is missing from your project. Can you try to copy it from the folder generated by CubeMX (into Drivers\CMSIS\Device\ST\STM32Xxxx\Source\Templates\gcc) into your project.

Hope my guess it correct.

Kevin.


Thank you for ur answer!

Meanwhile I have figured out that the only lines which is causing the error is the following at .cproject file.

before:

Copy to clipboard
<sourceEntries> <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/> </sourceEntries>


after:

Copy to clipboard
<sourceEntries><entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Src" /><entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="Inc" /> </sourceEntries>





if I revert that line to "before" state, everything works fine.

Dave


Tunisia

the before & after are not well displayed

please use code plugin


Sorry! Problems with the forum. Looks like if I write xml tags it is not showing... Unfortunately there is no code section at formatting
Tunisia

there is

Copy to clipboard
{CODE(colors="htmlmixed")}<node>text</node>{CODE}


will be displayed like this

Copy to clipboard
<node>text</node>

Tunisia

Now, I can see the problem 😊

the duplicated entry node is causing the problem
I doubt if you regenerate the project a third one will appears (to be confirmed) :/

before reporting the issue to CubeMx team, could you please specify your STM32CubeMX version?

Best Regards,
Tarek BOUCHKATI
STMicroelectronics


cubeMx about box:

version 4.14.0
STM32Cube V1.0

The flaw described here applies to both the libraries as well as CubeMx generation under C++.

1. CubeMX and the libraries are currently aligned with "C" compilation and linking (eg no name mangling).
2. For the existing libraries and generated code to WORK in both "C" and "C++" ALL of the libraries and the generated code's include files requires that the function prototypes in the header files MUST be bracketed by the following construction to insure that the linkers will blend "C" and "C++" properly.

  1. ifdef __cplusplus

extern "C" {

  1. endif


// "C" compliant function prototypes

  1. ifdef __cplusplus

}

  1. endif // __cplusplus


This is an imperative and requires updating of cubeMX AND all libraries. With this construct added, all of the libraries and generated code will work as they do now when the remainder of the application is compiled under C++ in order to use class, inheritance and template functionality.

This will help significantly when making C++ classes portable across many embedded systems.

Ah, they already do include this (I use C++ in CubeMX projects right now - as in today).

You will however find life much easier if you confine yourself to naming C++ _exclusive_ headers to *.hpp (or similar)
There are several posts here about converting a project to C++


Tunisia

I have tried to reproduce the issue uinsg the version 4.14 but in vain :/

are you enabling the "Generate Under Root Option" (in project settings) ?


yes

attached the bad .cproject file, maybe it helps. I have added some folders to my project with source and header files to Paths and symbols. Is it possible that is causing the problem?


Tunisia

Thank you for reporting the issue and for your reactivity
and sorry for the inconvenience it may bring

I have reproduced the problem, and reported it to STM32CubeMX team

Best Regards,
Tarek


Thank you for your help.
Just to summarize it for others.

SOLUTION

revert the sourceEntries to this:

Copy to clipboard
<sourceEntries> <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name=""/> </sourceEntries>

Hi,
This problem still exists. I am using Version 4.24.0
Thanks,


The name attribute is supposed to indicate the directory for source or include files? How is that done when those two directories are separate?
Is there a kind "includePath" that allows specifying the header directory so that you'd use a second entry tag with "kind='includePath'" and "name='include_directory'"?
Thanks,
Chris


 
Collapse/expand modules below