Informations on LPC11C24 Can Onchip

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

Informations on LPC11C24 Can Onchip

661 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by pollo89 on Thu Oct 25 01:31:19 MST 2012
Hi, I've an LPC11C24 board with Can Onchip driver.
I wanna logging my CAN receive into my SDcard with elm-chanFSmodule.
I tried to use Can Onchip Interrupts but after a f_write function, Can Onchip Interrupts is no longer caught.
I don't know how to fix it, so I want to check to manually catch Incoming Message in a while(true) but I find few documentation. Is it possible?
Can anyone help me?
0 Kudos
Reply
10 Replies

497 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by pollo89 on Thu Oct 25 05:11:46 MST 2012
Resolved!

added this at top of my main.c
#if defined (  __GNUC__  )/* only for LPCXpresso, for keil/IAR this is done by linker */
#include "cr_section_macros.h"
__BSS(RESERVED) char CAN_driver_memory[184]; /* reserve 184 bytes for CAN driver */
#endif




Thanks Zero!!!
0 Kudos
Reply

497 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Thu Oct 25 04:46:42 MST 2012
I still don't know which code you use as 'Can Onchip driver' :confused:

Even NXP samples include a modern version (without changing linker script) to reserve ROM-RAM

Something like:

__BSS(RESERVED) char CAN_driver_memory[184];     /* reserve 184 bytes for CAN driver */
Working LPCXpresso sample:   AN11238     http://www.lpcware.com/content/nxpfile/an11238-lpc11cxx-canopen-network-demo-0
0 Kudos
Reply

497 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by pollo89 on Thu Oct 25 04:36:15 MST 2012
You're right as always.
FSmodule use a struct FIL that it's my File Pointer and it's allocated into that range.
When I'm going understand how change linker files, I'll post if it's resolved.
Thank you, Zero. Again.
0 Kudos
Reply

497 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Thu Oct 25 02:58:29 MST 2012

Quote: pollo89
http://www.nxp.com/documents/user_manual/UM10398.pdf
Chapter 17



And did you read this chapter :confused:


Quote:

17.4.1 Calling the C_CAN API
A fixed location in ROM contains a pointer to the ROM driver table i.e. 0x1FFF 1FF8. This location is the same for all LPC11Cxx parts. The ROM driver table contains pointer to the CAN API table. Pointers to the various CAN API functions are stored in this table. CAN API functions can be called by using a C structure. Figure 67 illustrates the pointer mechanism used to access the on-chip CAN API. [B][COLOR=Red]On-chip RAM from address 0x1000 0050 to 0x1000 00B8 is used by the CAN API. This address range should not be used by the application.[/COLOR][/B] For applications using the on-chip CAN API, the linker control file should be modified appropriately to prevent usage of this area for application’s variable storage.

0 Kudos
Reply

497 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by pollo89 on Thu Oct 25 02:48:20 MST 2012
http://www.nxp.com/documents/user_manual/UM10398.pdf
Chapter 17


Quote:
The on-chip drivers are stored in boot ROM and offer CAN and CANopen initialization and
communication features to user applications via a defined API.

0 Kudos
Reply

497 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Thu Oct 25 02:42:12 MST 2012

Quote:

I user Can onchip driver, it's not mine.

:confused:

The main question is: Is your CAN code faulty or your SD code?

I don't know which 'onchip driver' :confused: you are using and which project settings you made, but I would strongly recommend to check ROM-RAM and Stack offset.
0 Kudos
Reply

497 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by pollo89 on Thu Oct 25 02:28:07 MST 2012

Quote: Zero
Check your 'CanOpen Driver'. Does it reserve ROM-RAM? Did you increase Stack offset?



Sorry but i'm don't speak english very well.
I user Can onchip driver, it's not mine. If I understand well, Drivers should be stored in ROM by board. It should works because I can receive/translate message very well ( with interrupts ) but adding a f_write Interrupts work no longer.

I think that I can't directly see Stack pointer or Driver.
I wrong?
0 Kudos
Reply

497 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Thu Oct 25 02:12:00 MST 2012

Quote: pollo89
... any advice?


Check your 'CanOpen Driver'. Does it reserve ROM-RAM? Did you increase Stack offset?
0 Kudos
Reply

497 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by pollo89 on Thu Oct 25 02:03:00 MST 2012
I see, Zero but i'm new in this world. I try to see NVIC register but i found no differents before and after f_write. I retry, any advice?
0 Kudos
Reply

497 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Thu Oct 25 01:52:02 MST 2012

Quote: pollo89
I don't know how to fix it..., so I want to check to manually catch Incoming Message in a while(true) but I find few documentation. Is it possible?
Can anyone help me?



Use Debugger and Peripherals View as the rest of the world ;)
0 Kudos
Reply