I have a similar code, where I define a message buffer of type CanTxMsgTypeDef. However, when compiling, I get an error saying CanTxMsgTypeDef is an unknown type. So I guess this needs to be defined somewhere, or there is a file where it is already defined that needs to be included in the project? I am using STM32CubeMX to configure the CAN peripheral and I was thinking it should take care of all the include files.
Thanks in advance for the help!