cancel
Showing results for 
Search instead for 
Did you mean: 

STM32WB IDE update to 1.12 caused hundreds of compile errors

One of the biggest offenders is shown in the image below.

0693W00000aIpQtQAK.png 

All of the USB device types from usbd_def.h are not getting recognized by the compiler, even though usbd_def.h is in the include list at the top of the file in this image, and I can control-click to any of these structure definitions to go right to the defnition in usbd_def.h. I'm stumped about how to fix this. I have tried refresh, clean project and restart the IDE.

6 REPLIES 6
Semer CHERNI
ST Employee

Hello @Adrian Adamson​ 

First let me thank you for posting.

I tried to reproduce the described behavior but with no luck.

I created a project with 1.11.2 version of CubeIDe then made an update to the 1.12.0. As a result the project build successfully.

Could you please describe in details the steps that let to the errors.

Also, could you check if nothing have been changed in the build setting especially with the include paths.

Best regards,

Semer.

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Thank you for responding quickly. I have been moving forward for now with my project based on IDE 1.11 but I would like to complete the upgrade if it's not too disruptive. My current project was built with assistance from another ST employee to enable USB CDC concurrently with BLE, in case number 00169492: https://community.st.com/s/case/5003W00000M0VWYQA3/can-usb-interface-run-concurrently-with-ble-on-the-stm32wb55

I was provided with an example project that used USB and BLE concurrently, and I have been building off of that project ever since. I have attached it. I will try to repeat my issue with this provided project and let you know if I run into the same issue.

I was able to migrate the attached example project without issues. My steps were:

  1. Extract files in Windows and Import the project into the workspace
  2. Open the .ioc file. Accept the dialog box to migrate the project to FW 1.16.
  3. Generate code.
  4. Compile. It was o.k.

Next I did the same steps with my current project.

  1. Open the .ioc file. Accept the dialog box to migrate to 1.16.
  2. Generate code.
  3. Compile. I'm still getting 229 compile errors, like I showed at the top.

What files do you recommend I diff between the example project and my current project?

Thanks.

-Adrian

For things not defined, look at the stm32_xyz_hal_conf.h file

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

The new version of usbd_conf.h added an #include "main.h" that wasn't there before. After I commented that out, the USB compile errors went away and the compile error count went from 229 to 19. Some of the remaining errors are in the auto-generated p2p_stm.h file because "ble_types.h" was not included. I added that include in, and I'm down to 14 errors, mostly in my own BLE app. I added in #include "tl.h", and that fixed the rest, and I can now compile.

The problem is that now when I re-generate code, the #include "main.h" gets added back in, and #include "ble_types.h" gets taken back out of the p2p_stm.h file, and I'm back to 222 errors. Is there a trick I'm missing?

I already have to do some manual edits after every code re-generation (particularly the STM_OTA flag), and it is discouraging that there seems to be a growing list.

I'm back working on this again, and I went to see why adding in main.h to usbd_conf.h would hurt anything. I looked for any user-added defines in my main.h that are usb-related, and I found that I had an #include for usbd_cdc_if.h. Once I commented that out, it fixed my USB errors.

For the ble_types.h problem, I see that it's because I include "p2p_stm.h" in the user code area of main.h. I put an #include "ble_types.h" just before it, and that fixed that set of problems.

It turned out that my USB receive buffer was defined in usbd_cdc_if.h, which is why I originally put it into main.h. It still causes hundreds of compile-time problems if I put it there, so I put the include in main.c instead, so that any other USB definitions would have already happened. Now my project compiles entirely without error.

I do still need to change BLE_CFG_OTA_REBOOT_CHAR back to 1 after every re-generation of code. ST, will you make that a Cube option at some point?

Also, I have to re-define CFG_USB_INTERFACE_ENABLE as 1 in the user error, which gives me warning messages every time I compile, since there doesn't appear to be a way from CubeMX to enable this flag. It's defined to zero in the non-user-modifiable part of app_conf.h and so I re-define it later in the same file.