Hi Peter. Can't quote your message, sorry.
I'm not using CANFestival and CANopen that long, just a couple of weeks. rc-3 didn't work for me because I couldn't find compatible wxwidgets and/or python version for Windows. Hourly tgz had updated Objedit and I started from this. gene_SYNC for HCS12 didn't work but I found than HCS12 driver is outdated and it just needs to endianize RX and TX message IDs. After this change it started to work partially. After so many fixes in almost all sources now I'm quite happy with CANfestival. I don't mind the type of message cob-id. Of course 16bits are lighter for my 16bits MCU. But something like EMCY Cob-id, or SDO server Cob-id, PDO COB-id etc objects are specified by standard as being 32bits only, isn't it? I agree that driver COBID type could be configureable. Also I think driver COBID shouldn't be endianized. The most recent CANfestival code always endianizes COBID on receive and transmition. I'm sure driver should care about endianness of message ID. Endianness of data payload is specified by standard (low endian) and CANfestival should care and cares about it. Regards Edward ----- Original Message ----- From: <[email protected]> To: <[email protected]> Sent: Friday, March 28, 2008 12:38 PM Subject: Re: [Canfestival-devel] SDO server endianness bugs Hi I fear these problems could be a consequence of the change of the data type of the cob-id. At 21.01.2008 we changed the COB ID from UNS32 to UNS16: I wrote: > - Use of UNS16 instead UNS32 for the COB id? > For a PC is UNS32 never mind, but not for a 8 bit microcontroller. > Or make it configurable by typedef? the answer from Edouard: I think UNS16 should be the default type in can.h. (it compiles without any warning) Is there any 29bit cob-id user here ? The typedef is the smartest way. Please use corresponding configure command line parameter (default to 11b cob-id). My suggestion is to use a define for the COB ID. 1. Add in applicfg.h: // CAN ID #define COBID UNS32 // UNS16 or UNS32 2. in can.h, line 42: COBID cob_id; /* l'ID du mesg */ 3. replacement of all datatypes of cob-ids from UNSxx to COBID. So the user can fit cob-id to the platform and there is the possibilty to use 29b cob-ids if anyone should need that. What do you think about that? Regards Peter -----Ursprüngliche Nachricht----- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von [email protected] Gesendet: Donnerstag, 27. März 2008 20:53 An: [email protected] Betreff: [Canfestival-devel] SDO server endianness bugs Hi The problem is SDO server parameters are endianized. I mean using CANopen Device Monitor I read from index 1200h, subindexes 1 and 2 not 600h+nodeid and 580h+nodeid, but (nodeid<<24) + 60000h and (nodeid<<24) + 80050000h respectively. 1) states.c setNodeId() function is used to init SDO server parameters in case server is present. 1.1) Lines 258, 259: UNS32 tmp = 0x600 + nodeId; *(UNS32*)d->objdict[offset].pSubindex[1].pObject = UNS32_LE(tmp); should be changed to *(UNS32*)d->objdict[offset].pSubindex[1].pObject = 0x600 + nodeId; 1.2) lines 264,265: UNS32 tmp = 0x580 + nodeId; *(UNS32*)d->objdict[offset].pSubindex[2].pObject = UNS32_LE(tmp); should be changed to *(UNS32*)d->objdict[offset].pSubindex[2].pObject = 0x580 + nodeId; After these two chaged SDO server stops working. sdo.c chages are necessary: 2) sdo.c 2.1) wrong type sdo.c line 496: UNS16 * pwCobId = NULL; should be UNS32 * pwCobId = NULL; 2.2) typecast on line 512 pwCobId = (UNS16*) d->objdict[offset].pSubindex[2].pObject; should be pwCobId = (UNS32*) d->objdict[offset].pSubindex[2].pObject; 2.3) typecast on line 545 pwCobId = (UNS16*) d->objdict[offset].pSubindex[1].pObject; should be pwCobId = (UNS32*) d->objdict[offset].pSubindex[1].pObject; 2.4) line 548 /* message copy for sending */ m.cob_id = *pwCobId; should be endianized m.cob_id = UNS16_LE(*pwCobId); 2.5) wrong type at sdo.c line 613 UNS16 *pCobId = NULL; should be UNS32 *pCobId = NULL; 2.6) sdo.c lines 629-630 pCobId = (UNS16*) d->objdict[offset].pSubindex[1].pObject; if ( *pCobId == (*m).cob_id ) { should be pCobId = (UNS32*)d->objdict[offset].pSubindex[1].pObject; if ( *pCobId == UNS16_LE(m->cob_id) ) { 2.7) lines 652-653 pCobId = (UNS16*) d->objdict[offset].pSubindex[2].pObject; if (*pCobId == (*m).cob_id ) { should be pCobId = (UNS32*)d->objdict[offset].pSubindex[2].pObject; if (*pCobId == UNS16_LE(m->cob_id) ) { Regards Edward ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ Canfestival-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/canfestival-devel ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ Canfestival-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/canfestival-devel ------------------------------------------------------------------------- Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just about anything Open Source. http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace _______________________________________________ Canfestival-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/canfestival-devel
