cancel
Showing results for 
Search instead for 
Did you mean: 

Bug, Code generation in STM32CubeMX

JongOk Baek
Associate III
Posted on September 26, 2016 at 07:16

Hello,

I used STM32CubeMX with 4.16.0 or 4.16.1 version.

below situation :

''STM32Cube Firmware Library Package'' option is ''Add necessary library files as reference in the toolchain project configuration file''

IAR's error message is all same below 

Fatal Error[Pe1696]: cannot open source file ''D:\Work\IAR_WORK\ARM\Projects\ZNC-514B_3MCU-S1\EWARM\D:\Temp\

STM32CubeMx\STM32Cube_FW_F7_V1.4.0\Middlewares\Third_Party\FreeRTOS\Source\timers.c''

So, IAR cannot find Driver files(HAL_Driver's files)

Because included wrong path for Driver files.

- �Toolchain Folder Location� is 

D:\Work\IAR_WORK\ARM\Projects\ZNC-514B_3MCU-S1\EWARM\

Repository Folder

� is 

D:\Temp\STM32CubeMx\STM32Cube_FW_F7_V1.4.0\Middlewares\Third_Party\FreeRTOS\Source\timers.c0690X00000604maQAA.png

Why combined file path in generation code?

#bug-stm32cubemx
10 REPLIES 10
slimen
Senior
Posted on September 26, 2016 at 15:25

Hello,

Which version of IAR is used ?

I have see this case which due to long path !

Try to share your .ioc to report this case and identify what is going wrong.

Regards

Arnold Bischof
Associate III
Posted on October 19, 2016 at 08:16

Hello

I'm using cubeMx 4.16 and now 4.17 and have a similar problem with the cubeMX code generator. The code generator updates the IAR project files in a wrong manner as shown below.

<file> <name>

$PROJ_DIR$\D:\

SVNRoot\Drive3Ph_F4\Plus\stmCubeRepos\STM32Cube_FW_F1_V1.4.0\Drivers\CMSIS\Device\ST\STM32F1xx\Source\Templates\system_stm32f1xx.c</name>

</file> This error is very annoying

slimen
Senior
Posted on October 19, 2016 at 10:50

Hello,

Please share your .ioc to check this case.

Regards

Arnold Bischof
Associate III
Posted on October 19, 2016 at 18:10

Hello

attached you will find the .ioc and the .mxproject

Regards

________________

Attachments :

BasePalDrive_A.ioc : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hth6&d=%2Fa%2F0X0000000aVq%2FaWMRlueSAzws1Q.CGSJ.86huW_PpoHgFVRnnZkUy2es&asPdf=false
Arnold Bischof
Associate III
Posted on October 19, 2016 at 18:11

Hello

attached you will find the .ioc

Regards

________________

Attachments :

BasePalDrive_A.ioc : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Htcw&d=%2Fa%2F0X0000000aS9%2FGnnD03tBLOSJSmEp0Y4nyLKodeo.MigmFNxXMZpKEzo&asPdf=false
Arnold Bischof
Associate III
Posted on November 06, 2016 at 15:38

I still have the same problem with the corrupt path entries in the IAR project file *.ewp.

I've found that the problem has to do with relative paths in the IAR project settings.

cubeMX always generates code with absolute path entries in the project file and gets a mess when there are relative paths in the IAR project file to update during code generation phase.

Is someone there who can help?

Regards AB

Posted on November 06, 2016 at 17:08

Is someone there who can help?

This would really have to come from the handful of ST staff on the board that interface with the engineering teams. Pretty sure it has found it's way onto the bug list.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
Arnold Bischof
Associate III
Posted on November 16, 2016 at 08:50

Hello,

One month has now passed without STM assuming the problem. This is annoying, because I have to edit the project file after every Code generation within cubeMX!

Here some hints for the ST team:

-

I think that the cause for the problem is that IAR uses relative paths and the cubeMX code generator uses absolute paths.

- cubeMX generates duplicated entries in the *.ewp project file (leaves the relative entries of IAR and creates new absolute entries).

- It seems that in the case that cubeMX (C:) and the project (D:) are in different drives, doubling through cubeMX will generate wrong paths (with $PROJ_DIR$/\D:\...) causing the problem.

- if cubeMX and the project are on the same drive (C:), cubeMX still doubles entries in the project file but with correct absolute paths and IAR can handle this situation.

Regards AB

stm32cube-t
Senior III
Posted on November 17, 2016 at 10:10

Dear user,

This issue is fixed in the release 4.18 coming out in the next few weeks.

Best regards