C_CAN with LPC4357?

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

C_CAN with LPC4357?

710 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mysepp on Mon Nov 10 05:30:57 MST 2014
What possibilities exist to do CAN/C_CAN on a LPC4357? Are there working example projects?
Currently environment/IDE does not matter.

I have seen there is a CAN/C_CAN driver in LpcOpen V2.12, as well as an example app.
Has someone already used this? What is the way to compile the driver and app?
Is there some description how to compile it?







Labels (1)
0 Kudos
6 Replies

627 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mysepp on Sun Nov 16 13:37:01 MST 2014
I meanwhile be able to send some CAN frames. But reception is not working.

I have removed CCAN_IF_MCTRL_UMSK from msgCtrl in Chip_CCAN_SetMsgObject to be able to receive every frame (without acceptance mask,
I keep this for step 2...)

When I send a CAN packet to my device with LPC4357:
I see that I get a CAN interrupt, can_int is 0x8000 (which means Status Interrupt), can_stat is 0x0010 (which means RXOK).
But this is all. According to example code RXOK is cleared. But what shall happen? Shall I get a new interrupt,
which gives me the data?

What I also don't understand:
In the user manual there are the following sentences:
"The IF1 Registers are used as Transmit Buffer." and "The IF2 Registers are used as Receive Buffer."
But example periph_ccan only uses IF1, never IF2.
So is this assignment that IF1 is as transmit buffer not so fixed as described in user manual and therefore can also be used for reception?

I know errata of CAN which is also affecting my used LPC4357 (revision '-'),
but at the moment I am using only CAN0, USART3 and some on-board LEDs.

Has someone an idea? Or has someone a reception example which is known to be working?



0 Kudos

627 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by capiman on Thu Nov 13 13:16:34 MST 2014
Sorry, wrong thread.
0 Kudos

627 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mysepp on Wed Nov 12 07:05:51 MST 2014
Ok, problem found.
Sorry, LPCXpresso beginner error: I had not deleted a project, which is to be put into RAM, but the RAM areas (in MCU settings).
I have put the RAM areas back to the place (via Restore Defaults) and now it is compiling.
I am creating a hex file by post build steps:

arm-none-eabi-size "${BuildArtifactFileName}"
arm-none-eabi-objcopy -v -O binary "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin"
checksum -p ${TargetChip} -d "${BuildArtifactFileBaseName}.bin"
arm-none-eabi-objcopy -I binary "${BuildArtifactFileBaseName}.bin" -O ihex "${BuildArtifactFileBaseName}.hex"

Now I am getting a hex file, hopefully with a valid checksum.
Now I am trying to flash the hex file via flash magic.

When doing this via "Erase blocks used by Hex File", I am getting a error message "Invalid value or command sent".
When selecting "Erase all flash" then it is downloading.

But I see no reaction.

I also added some blinking LED into this example, but also no reaction.

Someone an idea, what could be wrong?


0 Kudos

627 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mysepp on Wed Nov 12 01:54:10 MST 2014
Can you give me an additional hint? I now took "periph_ccan".
I changed processor from LPC4337 to LPC4357 and deleted all "download to RAM" and have only a flash project left for bank A.
Now when the application is linked, i get the following error:

c:/nxp/lpcxpresso_7.5.0_254/lpcxpresso/tools/bin/../lib/gcc/arm-none-eabi/4.8.4/../../../../arm-none-eabi/bin/ld.exe:periph_ccan_Debug.ld:81: warning: memory region `RAM' not declared
periph_ccan_Debug.ld:102: undefined symbol `__top_RAM' referenced in expression

Looking into periph_ccan_Debug_mem.ld I see only:

MEMORY
{
  /* Define each memory region */
  MFlashA512 (rx) : ORIGIN = 0x1a000000, LENGTH = 0x80000 /* 512K bytes */


}
  /* Define a symbol for the top of each memory region */
  __top_MFlashA512 = 0x1a000000 + 0x80000;

How can I add the RAM section?

0 Kudos

627 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Tue Nov 11 00:44:30 MST 2014

Quote: mysepp

I have seen there is a CAN/C_CAN driver in LpcOpen V2.12, as well as an example app.
Has someone already used this? What is the way to compile the driver and app?
Is there some description how to compile it?



For LPCXpresso, use the Import project(s) option, then build. For more details please read the LPCXpresso User Guide, and you might also find the "Rapid Embedded Development" video useful in getting started with LPCXpresso…

http://www.lpcware.com/lpcxpresso

I would also recommend:

http://www.lpcware.com/content/project/lpcopen-platform-nxp-lpc-microcontrollers/lpcopen-v200-quicks...
[Versions are available for LPCXpresso, Keil and IAR.]

Regards,
LPCXpresso Support
0 Kudos

627 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by normnet22 on Mon Nov 10 19:31:42 MST 2014
On my PC I found these after doing an unzip:
C:\nxp\LPCXpresso_7.4.0_229\lpcxpresso\Examples\NXP\LPC4000\LPC43xx\CMSIS_LPC43xx_DriverLib\src\lpc43xx_can.c
C:\nxp\LPCXpresso_7.4.0_229\lpcxpresso\Examples\NXP\LPC4000\LPC43xx\CMSIS_LPC43xx_DriverLib\inc\lpc43xx_can.h
C:\nxp\LPCXpresso_7.4.0_229\lpcxpresso\Examples\NXP\LPC4000\LPC43xx\CMSIS_LPC43xx_DriverLib-M0\src\lpc43xx_can.c
C:\nxp\LPCXpresso_7.4.0_229\lpcxpresso\Examples\NXP\LPC4000\LPC43xx\CMSIS_LPC43xx_DriverLib-M0\inc\lpc43xx_can.h


Norm
0 Kudos