Migration from LPC FullCAN to LPC15xx

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Migration from LPC FullCAN to LPC15xx

631 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rjm on Fri Oct 30 08:20:31 MST 2015
LPC15xx have another CAN architecture compared to LPC17xx and LPC2xxx.
On NXP pages I did not find a document à la migration path to CAN using ROM-API or anything like that.

Currently I'm doing a migration job. Regarding tx, the procedure is quite straightforward. Old calls to FullCAN_PushMessage are replaced by calls to the messageTX-function in the ROM-API using a single macro:


Quote:
#define FullCAN_PushMessage(a,b) LPC_CAND_API->hwCAN_ConfigRxmsgobj(pCanHandle, (CAN_MSG_OBJ *)b)



This works quite well (of course, the CAN-ID struct element does not contain the message length, which requires some more individual changes.

It is more demanding to migrate the RX code with message filters and semaphore bits into the new handling API. Perhaps you could give some hints about that. Or.... does a "migration to"-document exist?
Labels (1)
0 Kudos
3 Replies

516 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by rjm on Fri Nov 06 00:56:07 MST 2015
Thanks for the comments. This made definitely clear that FullCAN is more sophisticated than C_CAN.

Since a migration of existing FullCAN code was necessary, I started to create a wrapper code which leaves virtually all of the application code for FullCAN unchanged.
For this to be effective, a change in the basic data structure rom_can_15xx.h is necessary. Actually, part of the data structure usese an anonymous union in order to facilitate element names that are typically used in FullCAN code. The changes are compatible with existing C_CAN code.

The attachment represents a test project for LPCxpresso. A c_can.c has been constructed from existing c_can code, and does standard c_can stuff, as well as init.
fullcan_wrap is the wrapper itself. Here, a test main function is included - serves as black box test function.
A git patch file for the CAN-ROM library is included.
0 Kudos

516 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by starblue on Fri Oct 30 13:00:40 MST 2015
... and LPC18xx/LPC43xx.
It's called C_CAN.
0 Kudos

516 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Fri Oct 30 08:32:43 MST 2015

Quote: rjm
LPC15xx have another CAN architecture compared to LPC17xx and LPC2xxx.



...it's the LPC11Cxx architecture  :O
0 Kudos