[Error] main.cpp@11,1: 'CAN' does not name a type; did you mean 'CAN1'?

Ni_Zhang
Tue, 26 Jul 2022 15:43:48 +0000
Mbed Studio

I was trying to play with the CAN APIs with the target “IMXRT1050-EVKB”.
However, when I tried to created a simple instance like:

CAN Testcan(CAN2_RX,CAN2_TX);

Where:
#define CAN2_TX GPIO_AD_B0_14
#define CAN2_RX GPIO_AD_B0_15

And I always have the following error when compiling:
[Error] main.cpp@11,1: ‘CAN’ does not name a type; did you mean ‘CAN1’?
[ERROR] .\main.cpp:11:1: error: ‘CAN’ does not name a type; did you mean ‘CAN1’?

The LED and SPI ones works fine.

I am using the latest version of the Mbed studio.
Mbed Studio: 1.4.4

Any one knows what might be the issue there?

Thanks a lot for the help

Ni

10 posts - 3 participants