lpcware

LPC11C24 big CANopen dictionary causes program crash

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
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

Outcomes