Fix FDCAN interrupt configuration in CO_driver_STM32.c#107
Conversation
|
Does this compile for all series or you just tested H5? If only H5, we must verify compilation is OK for the rest, too. |
|
I can only validate H5. |
|
I am almost 100% sure this won't compile for STM32G0, or older STM32s, so I prefer we don't merge this now. My suggestion, if you agree, is that in the same file, we start the #if-else macro logic to set the flags. #if defined(STM32H5xx)
#define MY_VAR ....
#else
/* Keep legacy for now */
#define MY_VAR 0xFFFFFFFF
#endif |
|
Yes I agree this would be a much better approach. |
|
I have a couple G0 based projects, I may be able to check this later today... |
|
I added the check based on STM32H5xx_HAL_CONF_H which is always defined by stm32h5xx_hal_conf.h. |
|
The macros do exist in stm32g0xx_hal_fdcan.h which means it compiles correctly. |
|
Yes, the G0 and H5 use the same FDCAN configuration, you are right. Same will be with C5, G4, C0 and at least U5. Anyway, the 0xFFFFFFFF was used to simplify the usage. For example STM32H7 uses FDCAN with 32 buffers, therefore in this case we want to get interrupts for all of them. Same here. The HAL driver will correctly select bits in the implementation. Therefore, when I think, do we need to do any update? |
|
@MaJerle as @TheCitrusMan verified one of your doubts is clear. |
|
@MaJerle From stm32h5xx_hal_fdcan.h: If assertion is active this is a problem as IS_FDCAN_TX_LOCATION_LIST wont return true in case of 0xFFFFFFFF |
I have a G4 project also -> confirm that this is also fine. |
Fix assertion by using realistic values from stm32h5xx_hal_fdcan.h