Dear CANfestival community,


we are implementing an master in xp with a Peak USB to CAN interface. As IDE we use Visual Studio 2008 (VS ) and had some minor problems.

Without knowing what to do and to be honest very new to this project I needed some time to find the essence of some bugs.

We solved much of them and now as its now “running”  we would like to commit them.

I already clone the repository with mercurial but do not know what to do next to handle appropriate to this community.


To the problems I encounter:


1.       File: drivers\can_peak_win32\can_peal_win32.c:
Function: canReceive_driver
Problem: Couldn’t find CAN_ERRMASK_ILLHANDLE
around line 150 and 163 instead of CAN_ERRMASK_ILLHANDLE its now CAN_ERR_ILLHANDLE

2.       File: src\pdo.c:
Function: sendOnePDOevent
Problem: Many errors from VS without any proper error message why it’s all so bad. Well VS compiler is not C99 certified/ready *cough* Take me a while to get to this.
Also an *transmissiontype reference without link to anything in the first view. Later I got the solution from similar calls in other functions and hadn’t to delete/ uncomment it.
Solution:  sorted two or three things and some minor changes that where obvious wrong like pdo. instead of pdo-> …


sendOnePDOevent (CO_Data * d, UNS32 pdoNum)


  UNS16 offsetObjdict;

  Message pdo;


  if (!d->CurrentCommunicationState.csPDO ||

      !(d->PDO_status[pdoNum].transmit_type_parameter & PDO_INHIBITED))


      return 0;



  offsetObjdict = d->firstIndex->PDO_TRS + pdoNum;

  MSG_WAR (0x3968, "  PDO is on EVENT. Transmission type : ",

           *(UNS8 *) d->objdict[offsetObjdict].pSubindex[2].pObject);


  memset(&pdo, 0, sizeof(pdo));



3.       File: example\TestMasterSlave\TestMasterSlave.c
Problem: At runtime VS encountered a problem with the esp (extended stack pointer?) as it called canOpen(xxx,yyy).
So I checked some of the calls. Didn’t follow the assembler but it seems it all comes to a __stdcall which was handled –afaik- properly inside CANfestival with
this “typedef void* (CALLBACK* CANOPEN_DRIVER_PROC)(s_BOARD *board);” CALLBACK is an Makro which stands in windef.h for __stdcall

Solution: I changed the setting  from the can_peak_win32 project from __cdecl(/Gd) to __stdcall (/Gz)

4.       File: example\TestMasterSlave\TestMasterSlave.c
Problem: At runtime in the Moment the StartTimerLoop(&InitNodes) was called a access violation was recognized/triggered

Solution: Call TimerInit(); before J


That was it. I will push this in the repository if it’s ok from your side.

Mit freundlichen Grüßen

with kind regards


Christian Böpple


Christian Böpple



Ringwald Mikroelektronik GmbH

Seiterichstrasse 6a

D-76131 Karlsruhe

Tel: +49 (0)721 - 623 50 722

Fax: +49 (0)721 - 623 50 79




Amtsgericht Mannheim HRB 109712

Ust-ID-Nr.:DE 176636089

Geschäftsführer: Dipl. Ing. Armin Ringwald


Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.


This e-mail and its attachments may contain proprietary information, which is privileged, confidential, or subject to copyright. This e-mail is intended solely for the use of the individual or entity to which it is addressed. If you are not the intended recipient of this e-mail, or the employee or agent responsible for delivering this e-mail to the intended recipient, you are hereby notified that any dissemination, distribution, copying, or action taken in relation to the contents of and attachments to this e-mail is strictly prohibited and may be unlawful. If you have received this e-mail in error, please notify the sender immediately and permanently delete the original and any copy of this e-mail and any printout.