cancel
Showing results for 
Search instead for 
Did you mean: 

How to properly include X-CUBE-BLE1 Middleware in a STM32 project generated by CubeMx

CSatz
Associate II

Hi,

I have the following issue with the cubeMX code generator (v. 5.1.0) with X-CUBE-BLE1 (v. 4.3.0) middleware:

Using the Nucleoboard (STM32F401RE) with the X-Nucleo-IDB05A1 , I can easily generate a working nucleo BLE application code. In the CubeMx I have the following setup for the BLE Middleware:

  • Controller check
  • HCI_TL basic
  • HCI_TL_INTERFACE UserBoard
  • Utils check
  • Application SensorDemo

following the STMicroelectronics.X-CUBE-BLE1_GettingStarted.pdf availlable at the X-cube BLE pack install folder ...\X-CUBE-BLE1\4.3.0\Documentation.

In this example code, I can nicely include my own header files in the app_x-cube-ble1.c file. Because it contains the /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ environment. This way I was able to easily modify the application to my needs.

However, If I just use the setup without the application SensorDemo and now generate the code with the CubeMx, the app_x-cube-ble1.c does not contain the /* USER CODE BEGIN Includes */ /* USER CODE END Includes */ at the beginning of the file. In my view, I require this to include custom code, which is not overwritten by the CubeMx. And as it is my goal to have an application realized, where I can always migrate to other CubeMx setup I can not properly use the X-CUBE-BLE Middleware.

Is there any way to resolve this issue? Do I need to select other settings in the CubeMx to resolve this properly?

Thank you very much for your help!

Best Regards,

Clemens

2 REPLIES 2
Silvio
ST Employee

​Hi Clemens,

thank you for signaling the issue.

In the coming X-CUBE-BLE1 V4.4.0, available with the STM32CubeMX v5.2.0, you'll find the sections

/* USER CODE BEGIN */

/* USER CODE END */

in the app_x-cube-ble1.c/.h files also when selecting the setup without any sample application.

Best Regards,

Silvio

CSatz
Associate II

Hi Silvio,

thanks for considering my request. I directly moved to the next X-CUBE-BLE1 version, which solved my problem.

Best Regards,

Clemens