LPC11C24 big CANopen dictionary causes program crash

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

LPC11C24 big CANopen dictionary causes program crash

1,140 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Dfcbkbq on Mon Sep 08 22:01:27 MST 2014
Hello!
I trying to create a realy big object dictionary using CANopen-on-chip on lpc11c24 - 259 elments. So I did the following:
CAN_ODENTRY objDic [] = 
{
    /* index, subindexaccess_type | length,value_pointer */
{ 0x1000,0x00,OD_EXP_RO| 4,(uint8_t *)&deviceType},
{ 0x1800,0x02,OD_EXP_RW| 4,(uint8_t *)&transmitionType},
{ 0x1800,0x03,OD_EXP_RW| 4,(uint8_t *)&inhibitTime},

{ SE_1_INDEX,0x00,OD_EXP_RO| 4,(uint8_t *)&numOfSeSubIndexes},
{ SE_1_INDEX,SE_ON_SUBINDEX,OD_EXP_RW| 4,(uint8_t *)&se1Enable},
{ SE_1_INDEX,SE_GAIN_SUBINDEX,OD_EXP_RW| 4,(uint8_t *)&se1Gain},
{ SE_1_INDEX,SE_CURRENT_OPTION,OD_EXP_RW| 4,(uint8_t *)&se1CurrentOption},
{ SE_1_INDEX,SE_SAMPLING_TIME,OD_EXP_RW| 4,(uint8_t *)&se1SamplingTimeUs},
{ SE_1_INDEX,USE_IIR_SUBINDEX,OD_EXP_RW| 4,(uint8_t *)&se1UseIir},
{ SE_1_INDEX,IIR_A0,OD_EXP_RW| 4,(uint8_t *)&se1A0},
{ SE_1_INDEX,IIR_A1,OD_EXP_RW| 4,(uint8_t *)&se1A1},
{ SE_1_INDEX,IIR_A2,OD_EXP_RW| 4,(uint8_t *)&se1A2},
{ SE_1_INDEX,IIR_A3,OD_EXP_RW| 4,(uint8_t *)&se1A3},
{ SE_1_INDEX,IIR_B0,OD_EXP_RW| 4,(uint8_t *)&se1B0},
{ SE_1_INDEX,IIR_B1,OD_EXP_RW| 4,(uint8_t *)&se1B1},
{ SE_1_INDEX,IIR_B2,OD_EXP_RW| 4,(uint8_t *)&se1B2},
{ SE_1_INDEX,IIR_B3,OD_EXP_RW| 4,(uint8_t *)&se1B3},
{ SE_1_INDEX,SE_ADC_VALUE_SUBINDX,OD_EXP_RO| 4,(uint8_t *)&se1AdcValue},
{ SE_1_INDEX,SE_VOLTAGE_VALUE_SUBINDEX,OD_EXP_RO| 4,(uint8_t *)&se1Voltage},
... and so on,. 259 elements.
};
...
CAN_CANOPENCFG canOpenConfigStruct = 
{
    1,                                        // node_id
    5,                                        // msgobj_rx
    6,                                        // msgobj_tx
    1,                                        // isr_handled
    sizeof(constObjDic)/sizeof(constObjDic[0]),    // od_const_num 
    (CAN_ODCONSTENTRY *)constObjDic,            // od_const_table
    sizeof(objDic)/sizeof(objDic[0]),            // od_num
    (CAN_ODENTRY *)objDic,                    // od_table
};
...

...somewhere in my code...
ROM **rom = (ROM **)0x1fff1ff8;
...
(*rom)->pCAND->config_canopen((CAN_CANOPENCFG *)&canOpenConfigStruct);
...


And it works fine. But the  (*rom)->pCAND->config_canopen((CAN_CANOPENCFG *)&canOpenConfigStruct)  cause programm crash  when total number of elments exceeds 243 elments. When number of elemets less then 243 it work fine. What am I doing wrong? Please help!

Regards
Labels (1)
0 Kudos
Reply
4 Replies

1,073 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Dfcbkbq on Fri Sep 12 05:37:05 MST 2014

Quote: DF9DQ
The user manual says "The maximum OD entries allowed is 255".
This is listed under "Differences to fully-compliant CANopen".



Thanks a lot!
0 Kudos
Reply

1,073 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by DF9DQ on Thu Sep 11 10:21:30 MST 2014
The user manual says "The maximum OD entries allowed is 255".
This is listed under "Differences to fully-compliant CANopen".
0 Kudos
Reply

1,073 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LabRat on Wed Sep 10 09:45:43 MST 2014

Quote: Dfcbkbq
What am I doing wrong? Please help!



There's no OD entry limit at 243 or 255. I've seen 520 entries already ...

Without further information I would guess that's a memory / stack problem or an unreliable CAN setup (no ROM-RAM reserving)...



0 Kudos
Reply

1,073 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LabRat on Tue Sep 09 06:08:23 MST 2014
I'm not sure what we are talking about in detail:

Is it an old CMSIS C project? Which library are you linking? How is it crashing?
0 Kudos
Reply