Skip to main content
PADAM.1
Associate III
April 29, 2020
Question

BUG report on code generation STM32L476

  • April 29, 2020
  • 6 replies
  • 1124 views

Hello,

I have installed STM32Cube FW_L4 v1.15.1 in CubeMx.

When generating new project STM32L476RG nucleo with Additional Software "STMicroelectroncs.X-CUBE_BLE1.5.0.0", a file "Core/Inc/stm32l4xx_nucleo_errno.h" is created.

In top of the file, there is

#ifdef __cplusplus

 extern "C" {

#endif

but the correspondent

#ifdef __cplusplus

}

#endif

does not exist.

Thus the additional software cannot be used in C++ projects...

I am sure there is an error in code generation of CubeMX.

BR

Paul

This topic has been closed for replies.

6 replies

PADAM.1
PADAM.1Author
Associate III
April 29, 2020

Hello,

of course each time I modify something in the ioc file, the error is re generated and I must re correct manually. It's tiresome...

PADAM.1
PADAM.1Author
Associate III
April 29, 2020

Work arround:

#include "main.h"

#ifdef STM32L4XX_NUCLEO_ERRNO_H

#ifndef STM32L4XX_NUCLEO_ERRNO_H_CORRECTION

#define STM32L4XX_NUCLEO_ERRNO_H_CORRECTION

#ifdef __cplusplus

}

#endif

#endif // STM32L4XX_NUCLEO_ERRNO_H_CORRECTION

#endif // STM32L4XX_NUCLEO_ERRNO_H

Khouloud ZEMMELI
ST Employee
April 29, 2020

​Hello @PADAM.1​ , did you mean that this condition is not present in your case ? could you please explain more your request and share your ioc file ?

Best Regards,

Khouloud

Khouloud ZEMMELI
ST Employee
April 29, 2020

@PADAM.1​  ​Issue confirmed and it will be fixed , but could you please share your ioc file to check it?

regards,

Khouloud

PADAM.1
PADAM.1Author
Associate III
April 29, 2020
Hello Khouloud,
thank you for your answer.
Please find the attached project.
There are some other problems:
* If I rename the pins of the SPI (eg.: "BLE_SPI_MISO"), the project does not compile anymore, since the pin name is defined in main.h, but hci_tl_interface.c (and may be others?) do not include it.
* You should also add "#ifdef __cplusplus extern "C" { #endif" and "#ifdef __cplusplus } #endif" in the files "hci.h", "hci_const.h", "bluenrg_def.h". They cannot be included in customers cpp files. Please verify (and add the lines) in all other header files of the library.
BR
Paul
Khouloud ZEMMELI
ST Employee
May 6, 2020

​Hello @PADAM.1​ 

Your request is raised internally to be analysed.

Best Regards,

Khouloud