cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMx for STM32L476RG bug report

Oros Nig
Associate II
Posted on May 20, 2017 at 15:56

Hi,

After generation of code with STM32CubeMx (release 4.21.0), Error_Handler() interface present in main.h is not specified to be used in C-style linkage as it's done in the rest of the code.

This performing a linkage error with IAR C++ compiler.

Please, fix it in the next release.

Thx and Regards

#main.h #c-style-linkage #stm32cubemx-4.21.0 #error_handler()
1 ACCEPTED SOLUTION

Accepted Solutions
Posted on November 01, 2017 at 23:54

Hi,

I just test the new release 4.23.0 and I confirm the issue has been fixed.

My C++ project is compiled now without any error.

Thanks for this,

Br

Nig

PS: the other issue 'PLLM = 1' has been fixed too !

View solution in original post

15 REPLIES 15
Khouloud GARSI
Lead II
Posted on May 22, 2017 at 17:14

Hi

Oros.Nig

‌,

Using IAR version 8.11, I'm not encountering any issue.

Could you please precise the IAR version you're using and share your ioc file.

Best regards,

Khouloud.

Posted on May 22, 2017 at 21:48

Hi, Here my ioc file. I use IAR version 7.10 with C++ compiler (mandatory to obtain the error). I’ve got this error message: Error[Pe337]: linkage specification is incompatible with previous '_Error_Handler' (declared at line 82 of 'C:\ Test_bug\EWARM/../Inc\main.h') C: \Test_bug\Inc\i2c.h 60 Br Nig Provenance: Courrier pour Windows 10 De: Khouloud G Envoyé le:lundi 22 mai 2017 17:15 À: Oros Nig Objet:You have been mentioned by Khouloud G in Re: STM32CubeMx forSTM32L476RG bug report in STMicroelectronics Community STMicroelectronics Community

You have been mentioned by Khouloud G in Re: STM32CubeMx for STM32L476RG bug report in STMicroelectronics Community - View Khouloud G's reference to you Hi Oros Nig, Using IAR version 8.11, I'm not encountering any issue. Could you please precise the IAR version you're using and share your ioc file. Best regards, Khouloud. Participate in the conversation by replying to this email

This email was sent by STMicroelectronics Community because you are a registered user.

You may unsubscribe instantly from STMicroelectronics Community, or adjust email frequency in your email preferences

________________

Attachments :

TestNig.ioc.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyeV&d=%2Fa%2F0X0000000bAX%2FL.nYmXCXHpMzDTnJUp5WJhFf1GzNj0T4Z90arQ6Bjwo&asPdf=false

22D18B1210434C438756D53B5577C131.png : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyeQ&d=%2Fa%2F0X0000000bAY%2F0iEjPqLAoL9VDe.5FK2DD4_0ktjnkRZi3ykDtFm2Ke4&asPdf=false
Khouloud GARSI
Lead II
Posted on May 23, 2017 at 10:51

Hi

Oros.Nig

‌,

Thanks for sharing those details.

Your issue is reported internally to our CubeMX team and we will keep you posted about any further update.

Khouloud.

166103CGIL2
Sirma Siang
ST Employee
Posted on September 12, 2017 at 15:45

Hello

Oros.Nig

,

I am using IAR 4.2.13606, and cannot reproduce this issue.

I cannot go back to a previous version as it is not available on the original website.

Taking into account the fact that new SoC are supported by latest IAR release, I recommend to use latest one.

It should not mixup your build.

Could you please try to upgrade your tool ?

Thanks in advance.

Kind regards

Sirma

Posted on September 12, 2017 at 19:19

Hi Sirma

I use IAR Embedded Workbench for ARM 7.8 to compile my Project. My target is a Nucleo SMT32L476RG.

Version 7.8 is not a very old one.

It seems your IAR version is regarding a Texas Instrument target ?!

Thanks and regards

Nig

Use the ioc file I give to see the issue ...

Posted on September 13, 2017 at 16:21

Hello

,

I used cubeMX4.1, from which I open your ioc.

I migrate it to that version;

Then I generate the code and open the IAR Embedded Workbench (mine is version 8.2, and not 4.2 as I wrote before).

I built it and get following trace:

Building configuration: Sh4047_4.1_L476_ErrorHandlerWithIAR - Sh4047_4.1_L476_ErrorHandlerWithIAR

Updating build tree...

28 file(s) deleted.

Updating build tree...

startup_stm32l476xx.s

i2c.c

gpio.c

main.c

stm32l4xx_hal.c

stm32l4xx_hal_cortex.c

stm32l4xx_hal_dma.c

stm32l4xx_hal_dma_ex.c

stm32l4xx_hal_flash.c

stm32l4xx_hal_flash_ex.c

stm32l4xx_hal_flash_ramfunc.c

stm32l4xx_hal_gpio.c

stm32l4xx_hal_i2c_ex.c

stm32l4xx_hal_msp.c

stm32l4xx_hal_i2c.c

stm32l4xx_hal_pwr.c

stm32l4xx_hal_pwr_ex.c

stm32l4xx_hal_rcc.c

stm32l4xx_hal_rcc_ex.c

stm32l4xx_hal_tim_ex.c

stm32l4xx_hal_tim.c

stm32l4xx_hal_uart_ex.c

stm32l4xx_hal_uart.c

stm32l4xx_it.c

system_stm32l4xx.c

tim.c

usart.c

Linking

Total number of errors: 0

Total number of warnings: 0

At my end everything went well.

I know IAR is regularly updated, and rules might have changes since your version.

Could you upgrade and test with version 8.2 ?

I attached a picture showing you my env.

Kind regards

Sirma

________________

Attachments :

Capture.PNG : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyRv&d=%2Fa%2F0X0000000b7o%2FQp0egt.2A6jh9kQlc0qyqsFVZzf4yinO3L5DmeD0Tys&asPdf=false
Posted on September 13, 2017 at 21:14

Hi Sirma,

This issue occured only with the C++ compiler. I suppose you've compiled your project with C compiler.

The '' ♯ defined __cplusplus integer'' is defined only in C++ compilers. Its value activate or not the directive '' ♯ extern C'' which have an effect on linkage and name-mangling of wrapped declarations.

As it's done in i2c.h (and may be in other peripherical interfaces), the declaration of extern void __Error_Handler(char *, int);

must be declared as ♯ extern ''C'' also in main.h.

I attached a picture showing my compiler options.

Thx and Regards

Nig

0690X00000603zHQAQ.jpg
Posted on September 15, 2017 at 13:45

Hello

Oros.Nig

,

A great thanks for your guidance and patience 🙂

I understand your point, and I confirm it.

The correction will be part of the Cube version 4.

Kind regards

Sirma