background image

 

  The expert for industrial and automotive communication

 

 

Manual 

 

 
 

 
 
 

 
 
 

 
 

 
 

IXXAT FlexRay Interface UCI

 

Programming Manual 

 
 
 

 

 
 

 

 

 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Содержание FlexRay CCM

Страница 1: ...The expert for industrial and automotive communication Manual IXXAT FlexRay Interface UCI Programming Manual...

Страница 2: ...ts please contact IXXAT in written form by Fax 49 0 7 51 5 61 46 29 e Mail support ixxat de For customers from the USA Canada Fax 1 603 471 0880 e Mail techsupport ixxat com Copyright Duplication copy...

Страница 3: ...Reception of NULL frames 11 3 7 Status information 11 4 CONTROLLER STATES 12 4 1 Status diagram FlexRay controller 12 4 1 1 Remark to the running state 13 5 EXTERNAL INTERFACES 14 5 1 SW interfaces 1...

Страница 4: ...matError 33 5 1 5 IUciFlxMsgTrigger 33 5 1 5 1 GetOutTriggerCount 33 5 1 5 2 SetOutTrigger 33 5 1 5 3 ResetOutTrigger 34 5 1 5 4 GetOutTrigger 34 5 1 5 5 GetInTriggerCount 35 5 1 5 6 SetInTrigger 35 5...

Страница 5: ...oller states version 9 0 MFR4200 61 6 1 5 Controller states version 10 x MFR43x0 61 6 2 Registration Functions XATxxReg DLL 62 6 2 1 Type Definitions of the Call back Handler 62 6 2 1 1 Call back to l...

Страница 6: ......

Страница 7: ...the receive and remote buffers of the VCI API One receive and one transmit queue of fixed hardware dependent size is available per CAN and per FlexRay controller The UCI is also independent of the us...

Страница 8: ...transmit FIFOs The programming interface of the IXXAT FlexRay interface board described in this document is based on COM technology The board itself and the FlexRay control lers are thus represented b...

Страница 9: ...pecific information on the IXXAT FlexRay interface can be called up and controllers selectively opened In turn by opening a controller a pointer to the relevant controller COM interface is requested I...

Страница 10: ...Object the function returns WAIT_OBJECT_0 After the event is signaled at least one FlexRay message can be read with GetMsg from the RX FIFO 3 2 2 Overruns If a receive FIFO is not read out quickly eno...

Страница 11: ...individual ly taking the timestamp of the status message 3 5 Reception of invalid messages If desired it is possible to receive invalid frames via the asynchronous receiver Therefore the Flag Invalid...

Страница 12: ...e init stopped status To put the controller in running status call Start In this status FlexRay messages can be received and retrieved via GetMsg To get back in in it stopped status call Stop In this...

Страница 13: ...controllers are synchronised Reception and tranmission via the communication controller is possible On systems with an MFR4200 communication controller the asynchronous receiver is disabled meanwhile...

Страница 14: ...functions XAT_SelectHardware XAT_GetDefaultHwEntry XAT_EnumHWEntry and XAT_FindHwEntry taken from the VCI V2 pro gramming manual see Annex section 6 2 As different UCI DLLs have to be loaded for the...

Страница 15: ...NING The user than has to dis able or remove all LAN MC add on modules and ensure the default settings are not changed on the FlexRay de vice 1 IGNORE_TXBUFFER_TIMEBUDGET_WARNING value value is either...

Страница 16: ...s DISABLEPOPUP FALSE ENABLE_HEARTBEAT FALSE DISABLE_HEARTBEAT_TIMEOUT_DIALOG FALSE 1 FORBID_LANMC_ADDON FALSE 1 DISABLE_AUTO_IRQTIME_SETTING FALSE 1 IGNORE_TXBUFFER_TIMEBUDGET_WARNING FALSE 1 ppBrd IN...

Страница 17: ...0 open select hardware dialog hr XAT_SelectHardware hwndParent sConfig if 1 hr get name of UCI DLL for this board hr XAT_GetHwEntryVar sConfig board_no UCI_DLL szUCIDLL dwTmp if S_OK hr load UCI libra...

Страница 18: ...Pointer to sufficient memory for receiving an error string pszError OUT Pointer to the error description Return value UCI error codes 5 1 2 IUciBoard3 IUciBoard3 includes all methods form IUciBoard an...

Страница 19: ...uested Opening of a CAN controller __uuidof IUciCanCtrl Opening of a byteflight controller __uuidof IUciBftCtrl Opening of a FlexRay controller __uuidof IUciFlxCtrl bCtrlNo IN Number of the requested...

Страница 20: ...etTimestamp Via the ResetTimestamp method the timer of the board can be set to zero This function is not effective if external timers are used e g ES600 for some IXXAT FlexRay interfaces like ES520 Pr...

Страница 21: ...receiving the error string pszError OUT Pointer to the error description Return value UCI error codes 5 1 3 IUciBoardPowerSave This interface is only available by external hardware like FlexRay CCM F...

Страница 22: ...h max UCI_MAX_ERRSTR characters For this sufficient memory must be reserved via the parameter pszError Prototype virtual HRESULT __stdcall FormatError HRESULT hrError PCHAR pszError Parameters hrError...

Страница 23: ...rror codes 5 1 4 2 GetStatus Reading of the FlexRay controller state via the structure UCI_FLXSTATUS such as Controller state not initialized stopped started Error flags Error handling level lost mess...

Страница 24: ...R4300 INI File for backward compatibility wInitMode IN Flag field with additional initialization information UCI_FLXINIT MODE_TIMES TAMP_TYPE bit 0 1 0x0003 Type of the timestamp that the UCI should p...

Страница 25: ...d initialization will fail if this flag is set in this case set this flag to zero If the FlexRay firmware is too old this flag is ignored UCI_FLXINIT MODE_NULL FRAMES_ DISABLE bit 3 0x0008 This flag c...

Страница 26: ...has been initialized via Init and is in init stopped mode See Fig 4 1 Prototype virtual HRESULT __stdcall Start void Parameters none Return value UCI error codes 5 1 4 7 GetMsg With this method FlexRa...

Страница 27: ...stcFlxMsg 0 DWORD dwTimeout 5000 HANDLE hRxEvent NULL UCICtrl GetRxEventHandle hRxEvent while again until abort through user wait for at least one message timeout in ms if WAIT_OBJECT_0 WaitForSingle...

Страница 28: ...ata Return value UCI error codes 5 1 4 9 GetTxMsgInfo Retrieves the configuration TX message prototype of the transmit messages spe cified by dwTxMsgInfoIndex for the current configuration You also ge...

Страница 29: ...__stdcall SendMsg PUCI_FLXMSG pMsg DWORD dwTxMsgInfoIndex Parameters pMsg IN Pointer to union structure with substructure The sub structure is filled with the TX message you want to send on the FlexR...

Страница 30: ...age buffer on its own using only the Buffers without configured cycle counter filter The configuration of the FlexRay Identifier leads to a reconfi guration of the message buffer on the FlexRay hardwa...

Страница 31: ...dwIndex Copy prototype to message struct and set type memcpy stcFlxMsg stcDataMsg astcFlxTxMsgInfo dwIndex stcFlexRayDataMsg sizeof UCI_FLXDATAMSG stcFlxMsg wMessageType UCI_FLXMSGTYPE_DATA Send Mess...

Страница 32: ...t void Parameters none Return value UCI error codes 5 1 4 13Lock Via this method it is possible to prevent simultaneous processing of methods of this interface from several threads in multithreaded cl...

Страница 33: ...If the device does not support trigger outputs or trigger inputs the GetOutTriggerCount resp GetInTriggerCount returns zero Please ensure to retrieve the amount of triggers before modifying the trigg...

Страница 34: ...etOutTrigger UINT16 wOutTriggerNumber Parameters wOutTrig gerNumber IN Number of out trigger which shall be reset Call this function with UCI_FLXTRIGGER_RESETALL to reset all out triggers Return value...

Страница 35: ...nput pin which is provided by the FlexRay Interface board The reaction is the transmit message given in the UCI_FLXMSGINTRIGGER structure Remark For a FlexRay message in the static segment the cycle f...

Страница 36: ...of the given trigger number which was set with SetInTrigger before Prototype virtual HRESULT __stdcall GetInTrigger PUCI_ FLXMSGINTRIGGER pstcInTrigger Parameters pstcIn Trigger IN OUT Pointer to the...

Страница 37: ...haracters For this sufficient memory must be reserved via the parameter pszError Prototype virtual HRESULT __stdcall FormatError HRESULT hrError PCHAR pszError Parameters hrError IN UCI error code psz...

Страница 38: ...ORD wUCIVersion UCI software version e g 3 7 as 0x0307 BYTE bCanNum Number of CAN controllers supported BYTE bBftNum Number of byteflight controllers supported BYTE bFlxNum Number of FlexRay controlle...

Страница 39: ...r version second and third digit to find out the controller version 9 0 Freescale MFR4200 10 0 Freescale MFR4300 10 1 Freescale MFR4310 DWORD dwSupported Features Flag field of supported features acco...

Страница 40: ...ASYNCMODE Asynchronous reception mode support bit 14 0x4000 UCI_FLXHDRINFO_ INVALIDHEADER CRC Header checksum validation support bit 15 0x8000 UCI_FLXHDRINFO_ VARIABLEBITRATE Variable bit rate support...

Страница 41: ...DWORD dwStaticSlotLength Length of one static slot in ns WORD wMacrotickLength Length of one Macrotick in ns WORD wMicrotickLength Length of one Microtick in ns char szBoardManu facturer 24 Zero termi...

Страница 42: ...rmal passive UCI_FLXCTRLSTATE_STARTED_ NORMALPASSIVE 5 started halt mode UCI_FLXCTRLSTATE_STARTED_ HALT DWORD dwStatusInfoFlags Flag field of status information bit 0 7 0x00FF UCI_FLXSTSINFO_ ERRORHAN...

Страница 43: ...000 UCI_FLXSTSINFO_ CHIERROR Controller host interface error bit 15 0x8000 UCI_FLXSTSINFO_ COMMCTRL HARDWAREERROR Communication controller hardware error bit 16 0x1 0000 UCI_FLXSTSINFO_ FATALPROTOCOL...

Страница 44: ...KNOWN 1 UCI_FLXMSGTYPE_STATUS 2 UCI_FLXMSGTYPE_DATA 3 UCI_FLXMSGTYPE_CONTROL UINT64 qwTimestamp 64bit Timestamp with 100ns resolution RX UCI_FLX STATUSMSG stcStatusMsg Status message structure RX For...

Страница 45: ...ution LONG lRateCorrection signed 32bit value for rate correction with 100ns resolution WORD wControllerStatus Current FlexRay controller state 0 reset UCI_FLXCTRLSTATE_RESET 1 stopped initialized UCI...

Страница 46: ...XSTSINFO_ MAXSYNCFRAMES DETECTED Max sync frames detected error bit 13 0x2000 UCI_FLXSTSINFO_ CLOCKCORREC TIONLIMITREACHED Clock correction limit reached error bit 14 0x4000 UCI_FLXSTSINFO_ CHIERROR C...

Страница 47: ...ion and chip For Freescale MFR4200 FlexRay Version 9 0 Word 0 PSR 4 bit SISR 4 bit CCFCR 4 bit EHLR 4 bit Word 1 ISR0 Word 2 CHIER Word 3 LostRxMsgCounter Word 4 LostStatusMsgCounter For Freescale MFR...

Страница 48: ...cle number can only be set if explicitly allowed in UCI_FLXTXMSGINFO structure Set the cycle number to UCI_FLX_CYCLE_NUMBER_DONT_ CARE to transmit the message in any cycle BYTE bDataLength Data length...

Страница 49: ...11 0x0800 UCI_FLXHDRINFO_ SELFRECEPTION Self reception resp TX acknowledge RX bit 12 0x1000 UCI_FLXHDRINFO_ BOTHCHANNELS Indicates that the message is transmit ted on FlexRay channel A and B if set bi...

Страница 50: ...10 x Word 0 FLAGS_FID Word 1 MBSS Word 2 MBSS2 WORD awData 127 FlexRay data RX TX 5 1 6 7 UCI_FLXCONTROLMSG Internal union structure of UCI_FLXMSG that is used for special control purposes by transmit...

Страница 51: ...t The buffer cannot be disabled if a transmission for this buffer is pending and UCI_CTRLMSG_ TXBUF FER_TXABORT is not set The buffer can also not be disabled if a Trigger is using this message buffer...

Страница 52: ...ssage bit 0 0x0001 UCI_FLXTXMSGINFO_ CHANGEABLE_ IDENTIFIER Identifier is changeable bit 1 0x0002 UCI_FLXTXMSGINFO_ CHANGEABLE_ CYCLENUMBER Cycle number is changeable bit 2 0x0004 UCI_FLXTXMSGINFO_ CH...

Страница 53: ...lic transmission is enabled the transmission will go on with same data until the communi cation controller is stopped Data can be changed by sending a new mes sage MFR43x0 only bit 8 13 0x3f00 UCI_FLX...

Страница 54: ...D of the last dynamic slot Remark This ID is only valid if no oth er dynamic messages are on the bus in one cycle WORD wMaxDynamicData Length Maximum data length in WORDS of a dynamic message UCI_ FLX...

Страница 55: ...t Signal on which shall be triggered for wI dentifier 0x07FF e g Start of Cycle UCI_FLXTRIGGER_START_OF_CYCLE WORD wChannelMask Channel mask 0x0000 0x0001 0x0000 don t care 0x0001 channel fixed don t...

Страница 56: ...care for wIdentifier 0x07FF WORD wDataCode Data code 0x0000 0xFFFF don t care for wIdentifier 0x07FF 5 1 6 11UCI_FLXMSGINTRIGGER Structure that contains a Trigger In reaction used by IUciFlxMsgTrigge...

Страница 57: ...e Header 2 CYCCNT_PLDLEN bit 0 6 PLDLEN wHeaderCrc Active FIFO Buffer AFBCRCR bit 0 10 HCRC Frame Header 4 HDCRC bit 0 10 HDCRC UCI_FLXHDRINFO_ CHANNELID Active FIFO Buffer AFBMBSSVR bit 8 CH FIFO Slo...

Страница 58: ...VA CH A bit 9 BVB CH B UCI_FLXHDRINFO_ TXCONFLICT Active Transmit Buffer ATBMBSSVR bit 0 TXCON Transmit Buffer Slot Status MBSS bit 0 TCA CH A bit 8 TCB CH B UCI_FLXHDRINFO_ FRAMETYPE from UCI INI Fil...

Страница 59: ...ion of the AFBMBSSVR 2 The asynchronous mode flag is not provided by MFR43x0 but from the asynchronous receiver The flag is mapped into MBSS2 3 The invalid header CRC flag is not provided by the hardw...

Страница 60: ...tus 0 ISR0 bit 4 RFOIF CHI Error Flags CHIERFR bit 11 FOVA_EF or bit 12 FOVB_EF UCI_FLXSTSINFO_ ILLEGAL CONFIGURATION Interrupt Status 0 ISR0 bit 15 FATAL Protocol Interrupt 0 PIFR0 bit 13 ILCF_IF UCI...

Страница 61: ...UCI_FLXCTRLSTATE_STARTED_STARTUP 07 0x07 Coldstart Collision Resolution 24 0x18 1 2 UCI_FLXCTRLSTATE_STARTED_STARTUP 08 0x08 Coldstart Consistency Check 25 0x19 1 2 UCI_FLXCTRLSTATE_STARTED_STARTUP 0...

Страница 62: ...e system The functions provided cover the following areas Listing enumeration of all registered PC CAN interfaces and the assigned pa rameters Search for a certain PC CAN interface Call up of a hardwa...

Страница 63: ...R XAT_SelectHardware HWND hwndOwner XAT_BoardCFG pConfig Description Shows a dialogue for selection of the PC CAN interfaces The configuration selected by the user is deposited in a structure in dicat...

Страница 64: ...ich is regis tered with the system under the unique index number dw_key The configuration is deposited in the structure indicated by the pointer pConfig Parameter dw_key in Unique index number under w...

Страница 65: ...the Call back function which is called up for each en try vp_context in Optional context Is passed on to the Call back function Return value ERROR_SUCCESS success HRESULT errorcode otherwise Example s...

Страница 66: ...he board type related index of a board by the given uinque board index XATREG_FIND_ADDRESS Serach for a board by it s given board address This is reasonable only for ISA cards XATREG_FIND_ENTRY_WITH_V...

Страница 67: ...entryname in This parameter is used for XATREG_FIND_ENTRY_WITH_VALUE and specifies the name of the parameter which value is con signed by dw_arg dw_arg in XATREG_FIND_BOARD_AT_RELATIVE_POSITION in Boa...

Страница 68: ...ue board index now which can be used to open the found board XAT_BoardCFG sConfig hr XAT_GetConfig dwBrdKey sConfig if ERROR_SUCCESS hr INT32 hBrd VCI2_PrepareBoard sConfig board_type sConfig board_no...

Страница 69: ...ALUE Search for the installed tinCAN with IRQ 15 DWORD dwBrdKey DWORD dwBrdType VCI_PCMCIA char caEntryName 255 IRQ DWORD dwEntryValue 15 HRESULT hr XAT_FindHwEntry XATREG_FIND_ENTRY_WITH_VALUE dwBrdK...

Страница 70: ...Key XAT_BoardCFG sConfig HRESULT hr hr XAT_GetDefaultHwEntry dwBrdKey if ERROR_SUCCESS hr hr XAT_GetConfig dwBrdKey sConfig if ERROR_SUCCESS hr INT32 hBrd VCI2_PrepareBoard sConfig board_type sConfig...

Страница 71: ...6 2 2 8 HRESULT errorcodes The functions within XATxxReg DLL are mainly based on the registry access func tions from Microsoft Because of this they the error codes are returned directly You can use th...

Отзывы: