2024-11-17 01:53 AM
I am trying to create some example code for a Nucleo G474RE board and one of the initialization steps was whether I would like to use the BSP for the Virtual COM port, user LED and user button. Note that this is what the configuration looks like
Building straight out of the box we run into a build error where it cannot find COM_InitTypeDef. This is because the USE_BSP_COM_FEATURE macro is not set to 1. If I hand code this to enable the COM feature, I run into a second build error where this code is generated
void EXTI15_10_IRQHandler(void)
{
/* USER CODE BEGIN EXTI15_10_IRQn 0 */
/* USER CODE END EXTI15_10_IRQn 0 */
HAL_EXTI_IRQHandler(&H_EXTI_13);
/* USER CODE BEGIN EXTI15_10_IRQn 1 */
/* USER CODE END EXTI15_10_IRQn 1 */
}
The problem is that the handle H_EXIT_13 is never defined
My STM32CubeIDE version is
Version: 1.16.1
Build: 22882_20240916_0822 (UTC)
My HAL version for the G4 series is
1.6.1
Has this issue been raised internally?
One other issue with configurator is there are no parameters to configure the various peripherals. I am thinking in particular the UART parameters as the configuration header file defines BUS_UART1_BAUDRATE to be 9600 and it isn't used anywhere that I can see, and in fact, the main.c uses a hardcoded value of 115200.
Cheers
Solved! Go to Solution.
2024-11-18 04:41 AM
Hello @Adam Hamilton
This has been escalated to the concerned team for correction on the future (under internal ticket number 196480).
Best Regards.
STTwo-32
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.
2024-11-17 05:20 AM
Hello @Adam Hamilton
Could you please add your .ioc file that reproduce the issue. Also, more details on your second request will be helpful.
Best Regards.
STTwo-32
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.
2024-11-17 11:54 AM
2024-11-18 04:41 AM
Hello @Adam Hamilton
This has been escalated to the concerned team for correction on the future (under internal ticket number 196480).
Best Regards.
STTwo-32
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.
2024-11-30 09:57 PM
Hi @STTwo-32
I have a little more information that might be useful. I am using a Nucleo G474RE for this, but it might actually apply to other boards. I also did upgrade the SW to version 1.17.0, Build: 23558_20241125_2245 (UTC)
This morning, I tried again and there are actually a few interesting things coming out of this. I will document here what I am doing.
At this point, everything appears to be setup and then If I click the Build button, I get no build errors. So far, so good. I can update the BSP configuration, say uncheck the VCOM port, then build, check the VCOM port, then build and at no point do I get build errors.
Now, if I add the X-CUBE-TOF1 Middleware library (v3.4.2) and select the board extension 53L5A1 v1.0.7. When I build this, again, so far, so good. Note at this stage I have not actually enabled the board extension.
I now enable the I2C1 peripheral and change the default pin muxing to what the TOF board expects. Build it, no errors.
Here is where the trouble starts. I enable the board extension, select the BUS IO driver to I2C1 and build. Now I get a bunch of build errors
../Core/Src/main.c:44:1: error: unknown type name 'COM_InitTypeDef'; did you mean 'I2C_InitTypeDef'?
44 | COM_InitTypeDef BspCOMInit;
| ^~~~~~~~~~~~~~~
| I2C_InitTypeDef
../Core/Src/main.c: In function 'main':
../Core/Src/main.c:102:13: error: request for member 'BaudRate' in something not a structure or union
102 | BspCOMInit.BaudRate = 115200;
| ^
../Core/Src/main.c:103:13: error: request for member 'WordLength' in something not a structure or union
103 | BspCOMInit.WordLength = COM_WORDLENGTH_8B;
| ^
../Core/Src/main.c:103:27: error: 'COM_WORDLENGTH_8B' undeclared (first use in this function); did you mean 'UART_WORDLENGTH_8B'?
103 | BspCOMInit.WordLength = COM_WORDLENGTH_8B;
| ^~~~~~~~~~~~~~~~~
| UART_WORDLENGTH_8B
../Core/Src/main.c:103:27: note: each undeclared identifier is reported only once for each function it appears in
../Core/Src/main.c:104:13: error: request for member 'StopBits' in something not a structure or union
104 | BspCOMInit.StopBits = COM_STOPBITS_1;
| ^
../Core/Src/main.c:104:27: error: 'COM_STOPBITS_1' undeclared (first use in this function); did you mean 'UART_STOPBITS_1'?
104 | BspCOMInit.StopBits = COM_STOPBITS_1;
| ^~~~~~~~~~~~~~
| UART_STOPBITS_1
../Core/Src/main.c:105:13: error: request for member 'Parity' in something not a structure or union
105 | BspCOMInit.Parity = COM_PARITY_NONE;
| ^
../Core/Src/main.c:105:27: error: 'COM_PARITY_NONE' undeclared (first use in this function); did you mean 'UART_PARITY_NONE'?
105 | BspCOMInit.Parity = COM_PARITY_NONE;
| ^~~~~~~~~~~~~~~
| UART_PARITY_NONE
../Core/Src/main.c:106:13: error: request for member 'HwFlowCtl' in something not a structure or union
106 | BspCOMInit.HwFlowCtl = COM_HWCONTROL_NONE;
| ^
../Core/Src/main.c:106:27: error: 'COM_HWCONTROL_NONE' undeclared (first use in this function); did you mean 'UART_HWCONTROL_NONE'?
106 | BspCOMInit.HwFlowCtl = COM_HWCONTROL_NONE;
| ^~~~~~~~~~~~~~~~~~
| UART_HWCONTROL_NONE
../Core/Src/main.c:107:7: warning: implicit declaration of function 'BSP_COM_Init'; did you mean 'BSP_PB_Init'? [-Wimplicit-function-declaration]
107 | if (BSP_COM_Init(COM1, &BspCOMInit) != BSP_ERROR_NONE)
| ^~~~~~~~~~~~
| BSP_PB_Init
../Core/Src/main.c:107:20: error: 'COM1' undeclared (first use in this function); did you mean 'COMP1'?
107 | if (BSP_COM_Init(COM1, &BspCOMInit) != BSP_ERROR_NONE)
| ^~~~
| COMP1
make: *** [Core/Src/subdir.mk:37: Core/Src/main.o] Error 1
make: *** Waiting for unfinished jobs....
"make -j24 all" terminated with exit code 2. Build might be incomplete.
There are some other problems now. When I disable the board extension for the 53L5A1 and regenerate the code and build, I get a build error
../Core/Inc/main.h:31:10: fatal error: stm32g4xx_nucleo.h: No such file or directory
31 | #include "stm32g4xx_nucleo.h"
| ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from ../Core/Src/stm32g4xx_hal_msp.c:22:
../Core/Inc/main.h:31:10: fatal error: stm32g4xx_nucleo.h: No such file or directory
31 | #include "stm32g4xx_nucleo.h"
| ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Core/Src/subdir.mk:34: Core/Src/main.o] Error 1
make: *** Waiting for unfinished jobs....
make: *** [Core/Src/subdir.mk:34: Core/Src/stm32g4xx_hal_msp.o] Error 1
In file included from ../Core/Src/stm32g4xx_it.c:21:
../Core/Inc/main.h:31:10: fatal error: stm32g4xx_nucleo.h: No such file or directory
31 | #include "stm32g4xx_nucleo.h"
| ^~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Core/Src/subdir.mk:34: Core/Src/stm32g4xx_it.o] Error 1
"make -j24 all" terminated with exit code 2. Build might be incomplete.
So from what I can tell, disabling the X-CUBE-TOF1 removed the entire BSP directory from the Drivers directory along with the stm32g4xx_nucleo_conf.h from the Inc directory.
And now for the other interesting bug I found.
Below is a pinout view at this point in time.
To kind of fix this, I then go to the Bsp category, click on NUCLEO-G474RE and uncheck the Human Machine Interface. This then, rightly removes the reservation on the pins for the UART, LED and Button
I click Save and then Build. No more errors. But I want the BSP enabled so I go back an enable the Human Machine Interface. The pinout configuration remains the same, as per the above config even though the LED, Button (Set to EXTI) and VCOM port are checked. This behaviour I do not believe is correct so I uncheck and disable the LED, Button and VCOM port and then reenable them, when I do this, the pinout view now shows the expected reservations.
Sorry for the long post, I am a SW dev at work and accustomed to providing a lot of info for bugs. I thought if this is going to fixed it might be useful to have a lot of detailed information that might help your developers.
Thanks