Error in stm32u5xx_hal_cryp.h when compiling

Hi All,

This is a heads up for folks who run into this issue. The root cause is that if you include termios (the POSIX terminal control calls) in a file that also includes stm32u5xx_hal.h you will get an error. This is because the _termios.h file that is defined by the GCC cross compiler suite does a #define B0 0 as baud rate 0, and there is a structure member in the stm32u5xx_hal_cryp.h file which is defined as uint32_t *B0;. It’s a class C name space collision issue. Normally you probably won’t see it if you are writing pure RTEMs POSIX/C code, but if you’re writing code that is both RTEMs and reaching into the STM32 HAL for the STM32u5, well you will hit this bug. You can work around it by including the HAL file before you include termios.h and then in your code you can use #undef B0 which will keep it from masking the element of the structure in the HAL.