6 years, 11 months ago.

CAN gmlan(PTA13, PTA14); tossing an error

Nope, never used mbed before so bare with me. I found this example on this page that I wanted to try: https://developer.mbed.org/users/foxdie/code/GMLAN-Sniffer/file/cdd2bb40e72f/

I followed the "first program example and video" (all went well) I added the Teensy3.1 as my platform for the blinky example and the following trials.

Then I tried the CAN example, It fails. Why would an example fail?

I changed the names of the pins used in the CAN statement on line 7 but still have compiler errors. I looked at the CAN class in mbed.h .....seems my format is the same as the docs for CAN suggest.

Next I tried the GMLAN-Sniffer code posted by Jason Gaunt. I used the "import into compiler" button on Jason's page for the Sniffer code. Same type of error on the CAN statement.

getting a compiler error: Identifier "CAN" is undefined "CAN gmlan(PTA13, PTA14);" and Expected a ")" "CAN gmlan(PTA13, PTA14);"

stumped!

1 Answer

6 years, 11 months ago.

CAN is not implemented on Teensy. No CAN pins defined here: https://github.com/ARMmbed/mbed-os/blob/mbed-os-5.4/targets/TARGET_Freescale/TARGET_K20XX/TARGET_TEENSY3_1/PeripheralPins.c

Your correct, the Teensy 3.1 does not, however the 3.2 and up do. This implies the Teensy "target" is not up to date.

posted by Keshka Kotera 31 May 2017

Teensy 3.1 and 3.2 have the same MCU: MK20DX256VLH7, so both boards has CAN interface. The two boards are same except "Teensy 3.2 adds a more powerful 3.3 volt regulator". https://www.pjrc.com/teensy/teensy31.html

The board has CAN interface, but there is no mbed driver. Maybe in the future if somebody implements...

posted by Mark Peter Vargha 31 May 2017