Home
21APPN012 E1 Application Note - University of Manchester
Contents
1. rootQvccl rootQvccl exit Here the PP4 is visible to the CPU on PCI bus 5 device ID 5 shown in red These values are important for the system dsc file The PCI vendor ID is from Altera 0x1172 and the device ID given by MEN is 0x000C MEN Mikro Elektronik GmbH 22 21APPNO12 E1 2008 04 03 Example MDIS Projects 2 3 2 Descriptor File system dsc The system dsc file contains the necessary mapping so the MDIS kernel can find the PP4 in the system properly The important lines here for the dump above are within the descriptor pci_ that describes the men_bb_pci pseudo PCI carrier board driver PCI BUS NUMBER U_INT32 0x5 equal to the PCI bus number from Ispci PCI DEVICE NUMBER U INT32 0x5 the PCI Device ID from Ispci DEVICE SLOT O U_INT32 0x5 same PCI Device ID These tags provide MDIS with the necessary information since MDIS for Linux does not seek for PCI devices in a plug and play manner but addresses them exactly with the given bus and device ID numbers The DEVICE SLOT 0 tag refers to the same device ID In this first example the PCI bus number and device ID were equal by random If for example the spci dump on your machine shows the PP4 like this root vccl lspci Eee eral 03 05 0 Bridge Altera Corporation Unknown device 000c root vccl root vccl exit then the matching entries in the system dsc file would look as follows PCI_BUS_NUMBER U_INT32 0x3 PCI DEV
2. Test tool for MSCAN driver in loopback mode Test tool for MSCAN driver against CANalyzer Application interface for MSCAN driver Common User Space Util Library User Space Operation System Services Library Testing M write function Testing M setstat function blockwise Testing M setstat function Testing M setblock function Print software revision ids Testing M read function Open and close a MDIS device Print or program module id Testing M getstat function blockwise Testing M getstat function Testing M getblock function Convert a MDIS error code to a human readable string Apply Cancel When the project is saved the Makefile and the system description file system dsc are generated and stored MEN Mikro Elektronik GmbH 21APPN012 E1 2008 04 03 Example MDIS Projects tslinux2 ho STARTING ELI 2 1 2 Building the Project and Installing Driver Files When the project was created the build can be started either from within MDIS Wizard or at the command line which was used for this example Mind that in the following build log examples many lines are omitted so the log does not fill numerous pages in this document When lines of output are skipped this is marked through The build logs are also available in the example project s ZIP archive See note on page 3 for hints on download of the example projects M First source the ELINOS sh file created by ELinOS to set environment vari able
3. INI shel done for to done for MEN Mikro Elektronik GmbH 17 21APPN012 E1 2008 04 03 Example MDIS Projects mk_ioct is 2 2 5 Accessing the Driver Now the driver modules can be loaded using the modprobe command and an m_open call can be done home limbo mdisprojects fl4bc wdog modprobe men 11 fl4bc home limbo mdisprojects fl4bc wdog m open fl4bc 1 open fl4bc 1 path 3 opened Please keep in mind that this m_open call consumes a noticable amount of time This results from the kernel s SMBus core driver scanning all SMBus addresses for devices and passing them to the men bb smb2 driver In the kernel log var log messages this is shown You can use the dmesg command to display it cmd 0x40604d05 arg 0xbfbce348 E MDIS OPEN DEVICE dev fl4bc 1 rtMode 0 persist 0 devdata 0804b170 devlen 244 brddata 00000000 brdlen 0 board name smb2bb mk ioctl exit md 0x40604d05 ret 0 0x0 mk ioctl cmd 0x40604d05 arg 0xbfbce348 MDIS OPEN DEVICE dev fl4bc 1 rtMode 0 persist 0 devdata 0804b170 devlen 244 brddata 0804b3d0 brdlen 180 K InitialOpen dev fl4bc 1 brd smb2bb rtMode 0 info device fl4bc 1 driver men ll fl4bc slot 0 Adapter Nr 0 SMBus I801 adapter at 0500 probe SMBus client 0x08 Adapter Nr 0 SMBus 1801 adapter at 0500 probe SMBus client 0x37 Adapter Nr 0 SMBus I801 adapter at 0500 probe SMBus client 0x44 Adap
4. and specifically disclaims any and all liability including without limitation consequential or incidental damages Typical parameters can and do vary in different applications All operating parameters including Typicals must be validated for each customer application by customer s technical experts MEN does not convey any license under its patent rights nor the rights of others Unless agreed otherwise MEN products are not designed intended or authorized for use as components in systems intended for surgical implant into the body or other applications intended to support or sustain life or for any other application in which the failure of the MEN product could create a situation where personal injury or death may occur Should Buyer purchase or use MEN products for any such unintended or unauthorized application Buyer shall indemnify and hold MEN and its officers employees subsidiaries affiliates and distributors harmless against all claims costs damages and expenses and reasonable attorney fees arising out of directly or indirectly any claim of personal injury or death associated with such unintended or unauthorized use even if such claim alleges that MEN was negligent regarding the design or manufacture of the part Unless agreed otherwise the products of MEN Mikro Elektronik are not suited for use in nuclear reactors and for application in medical appliances used for therapeutical purposes Application of MEN products in such p
5. 1 Example MDIS Projects 2 1 4 Troubleshooting This example was tested using ELinOS 4 1 CD Release 1317 and an EM1A CPU board It should be possible to do an m_open can 1 or m_open can_2 command as in the dump above However if you are unable to perform the commands shown above or the m_open call returns with an error some prerequisites should be checked right after booting from the shell Did the make install command integrate the driver files correctly into the root file system Check if folder lib modules kernelversion misc is filled with the previously compiled driver kernel modules such as men_Il_canodin ko etc Execute the following command to check this 1s la lib modules 2 6 15 7 295 misc The kernel version is the one that can also be retrieved from the command uname r Are the descriptor files located in folder etc mdis Execute the following command to check this 1s la etc mdis There have to be some files with extension bin like can l bin and can_2 bin Was device node dev mdis created properly Execute the following command to check this 1s la dev mdis The device node with major number 252 and minor O must exist It is the device node through which the MDIS API communicates with MDIS device drivers If it does not exist it can be created with a call of mdis createdev or directly through command mknod dev mdis c 252 0 MEN Mikro Elektronik GmbH 13 21APP
6. MDIS Projects mdiswiz Add a device to the slot oae Deserpton MSCAN 5200 MSCA 5200 M Do this for both CAN controllers so the configuration looks as shown below MDIS project wizard hometschnuer work LINUX ELINOS PROJECTS ELINOS 41_5131 em01img srci mdis Project Build Edit Package Help D amp amp gs re ix Cy Ca N E MEN EM1 Embedded System N Local Bus IO f0000900 MEN MSCANS200 BBIS Pseudo device for tr pseudo slot for MSCAN MEN MSCAN 5200 MSCAN controller ir Local Bus IO f0000980 MEN MSCANS200 BBIS Pseudo device for tr pseudo slot for MSCAN MEN MSCAN 5200 MSCAN controller ir PCI Bus 0 Dev 23 MEN CHAMELEON_PCITBL Container device for n modified MEN Mikro Elektronik GmbH 5 21APPNO12 E1 2008 04 03 mdiswiz Example MDIS Projects Project Settings Software Modules Select the software modules you want to include in your project D BBIS Drivers i ISA CHAMELEON_PCITBLBBIS driver for CHAMELEON_PCITBL D Dri Eam mscan qstest mscan menu mscan loopb mscan alyzer ser Libraries D Common Tools m write m setstat blk m setstat m setblock m rev id m read m open m mod id m getstat blk m getstat m getblock m errstr ative Drivers ative Libraries ative Tools ver Specific Tools Driver for MPCSx00 MSCAN implementation BBIS driver for MSCANS200 BBIS Test tool for two MSCAN controllers Menu driven test tool for MSCAN driver
7. are copied into etc mdis and the userspace tools to usr bin or any other directory given in the MDIS Wizard The directory is assigned to environment variable BIN_INSTALL_DIR in ELINOS_PROJECT src mdis Makefile See the following lines in the Makefile The directory in which the user state programs are to be installed Often something like usr local bin relative to the target s root tree BIN INSTALL DIR ELINOS PROJECT app rootfs usr bin Therefore on the used test system the files were installed to SELINOS PROJECT app rootfs tschnuerQtslinux2 work LINUX ELINOS PROJECI tschnuerQtslinux2 work LINUX ELINOS PROJECI rmx etc m etc m etc m etc m etc m Ac vA etc m etc m lem jJ boy a 3A o a jJ ovr Ua 3 Moy a s Jl USAD usr bi s USAD usr bi USE MOT is bbmscan l bin is bbmscan 2 bin is cpu bin is fpga bin is uart l bin is uart 2 bin i S Cem M c oTi is can 2 bin Gt e fon ex e e e fe busr oss so busr utl so bmdis api so bmscan api so n mdis createdev n mscan alyzer n mscan loopb n mscan menu n mscan qstest MEN Mikro Elektronik GmbH 21APPNO12 E1 2008 04 03 S ELINOS_41_S1317 em0limg gt cd app rootfs S ELINOS_41_S1317 em01limg app rootfs gt find Example MDIS Projects So after the generated files were installed into ELinOS s project tree directories it is necessary to have them on the running target as well The easiest way to
8. do this is to either execute Create Files in the graphical ELK configurator or to execute make boot in the ELinOS project s top directory in this example Avork LINUX ELINOS PROJECTS ELINOS 41 S1317 emO0limg v ELK hometschnueriworkLINUXELINOS_PROJECTS LINOS_41_51317 em01img S Project Options View Help D u hoje M Create Files Clean Files Validate Log validation Preparing for uboot_multi Bootstrap Image Name Multi File Image Created Mon Jan 14 10 48 24 2008 Image Type PowerPC Linux Multi File Image gzip compressed Data Size 7652287 Bytes 7472 94 kB 7 30 MB Load Address Ox00000000 Entry Point 0Ox00000000 Contents Image 0 1105082 Bytes 1079 kB 1 MB Image 1 6547191 Bytes 6393 kB 6 MB Your image file enOling img has been created in the directory nvformation ix home tschnuer work LINUX ELINOS PROJECTS ELINOS 41 S1317 em limg boot i do Building the project succeeded NOTE at the firmware prompt gt setenv bootargs console ttyS rw rootfstype tmpfs root dev ram ip bootp NOTE You may want to customise this script to meet any special requirements of your target hardware For instance you could add the commands neccessary to copy the boot files to a floppy disk or to the download directory of your tftp server The script is located here fhone tschnuer work LINUX ELINOS PROJECTS ELINOS 41 S1317 em limg custom boot Edit the final
9. the target too With the previous step the generated files were only more or less copied into the ELinOS project s subfolders app rootfs and kernel rootfs as shown in the example dump below The compiled kernel modules are installed in ELINOS_PROJECT kernel rootfs tschnuer tslinux2 work LINUX ELINOS_PROJECTS ELINOS_41_S1317 em0limg kernel rootfs gt find ecu lib modules 2 6 15 7 ELin0S 387 misc men mdis kernel ko lib modules 2 6 15 7 ELin0S 387 misc men bbis kernel ko lib modules 2 6 15 7 ELin0S 387 misc men oss ko lib modules 2 6 15 7 ELin0S 387 misc men dbg ko lib modules 2 6 15 7 ELin0S 387 misc men desc ko lib modules 2 6 15 7 ELin0S 387 misc men pld ko lib modules 2 6 15 7 ELin0S 387 misc men pld sw ko lib modules 2 6 15 7 ELin0S 387 misc men id ko lib modules 2 6 15 7 ELin0S 387 misc men id sw ko lib modules 2 6 15 7 ELin0S 387 misc men mbuf ko lib modules 2 6 15 7 ELin0S 387 misc men smb port ko lib modules 2 6 15 7 ELin0S 387 misc men smb port io ko lib modules 2 6 15 7 ELin0S 387 misc men chameleon ko lib modules 2 6 15 7 ELin0S 387 misc men 11 canodin ko lib modules 2 6 15 7 ELin0S 387 misc men bb chameleon pcitbl ko lib modules 2 6 15 7 ELin0S 387 misc men bb isa ko lib modules 2 6 15 7 ELin0S 387 misc men 1x frodo sw ko tschnuer tslinux2 work LINUX ELINOS_PROJECTS ELINOS_41_S1317 em01limg kernel rootfs gt The binary MDIS descriptor files
10. 0 rx LOEEMEPICSS 10 Filles Q BJ ie EX txbUsed 0 txNxtPrio 4 txSentPrio 3 COLEMErIeSS 100 Fillecds 0 OBU 23 X totEntries 100 filled 0 Test b ok Performing test c Rx filter Run 1 1 Waiting transmit complete Verifying frames Test c ok Performing test d Rx Tx signals Run 1 1 Test d ok Performing test e Rx FIFO overrun Run 1 1 Jesi es Ox LESSE EESTI eirirairs Max irqtime 0 internal ticks MEN Mikro Elektronik GmbH Il 21APPNO12 E1 2008 04 03 mscan_loopb can_2 Performing test a Test a Performing test b Tx chronological DRIVER txbUsed 0 txNxtPrio 4 txSentPrio 3 fillede 0 ok INTERNALS UL C Basic Vx X Id mscan drv c v 1 10 2005 03 24 10 18 28 kp Exp SCAN REGS CTLO 10 CTL1 a0 RFLG 00 TFLG 07 TIER 00 Hess 10 rille 0 tolles Rx filter SCAN DRIVER EXPRO cil sil sal ESSAGE OBJECTS OB Om Os 95x totEn OBd Ibs ix totEntries 100 BJ 22 Px totEntries 100 Test b ok Performing tes Waiting transmit complete Verifying frames Test c ok Performing test d Jesi as ok Performing test e Test e ok TEST RESULTS 0 eres Max irqtime 0 internal ticks MEN Mikro Elektronik GmbH 21APPNO12 E1 2008 04 03 Rx Tx signals Rx FIFO overrun Example MDIS Projects Run 1 1 Run 1 1 Run 1 1 Run 1 1 Run 1
11. 00ms so some fractions of a second after the interval exceeded 3000 msec the screen turns black and BIOS shows up proving watchdog functionality MEN Mikro Elektronik GmbH 21APPNO12 E1 2008 04 03 Example MDIS Projects 2 3 PP4 MVB Slave Board on F207 Carrier and F14 CPU The PP4 PCI 104 card contains an MVB slave device which can be used in train applications The typical use is to communicate with other MVB participants under control of a Master device To communicate with the host the PP4 has a PCI interface See the PP4 user manual for details 2 3 1 Used Carrier Hardware In this example the PP4 is plugged on an F207 CompactPCI carrier board This carrier contains just a PCI2050 PCI to PCI bridge from Texas Instruments In terms of software this bridge is transparent meaning that the only difference visible to software is the different PCI bus and device number for the PP4 depending e g which CompactPCI slot the F207 is plugged into To see where the PP4 is located in your system use the spci command as in this example dump from an F14 root vccl lspci 00 00 0 Host bridge Intel Corp Mobile Memory Controller Hub rev 04 00 01 0 PCI bridge Intel Corp Mobile Memory Controller Hub PCI Express Port rev 04 00 02 0 VGA compatible controller Intel Corp Mobile Graphics Controller rev 04 Loool 04 0f 0 PCI bridge Texas Instruments PCI2050 PCI to PCI Bridge 05 05 0 Bridge Altera Corporation Unknown device 000c
12. 21APPNOT12 E1 2008 04 03 MDIS Examples under Linux MDIS4 2004 System Package for Linux Edition Comments Technical Content Date of Issue E1 First edition T Schn rer 2008 04 03 Application Note man mikro elektronik gmbh n rnberg Contents Contents 1 Duroguclol eas std x a CER XR Aot ADR ewes QR RUD PREX 3 2 Example MDIS Projects 03 cere o rr rry ese 4 2 1 EMI CAN eR RR iita ume ae O REES ROWS OS 2 11 Creating the Project in MDIS Wizard 4 2 1 2 Building the Project and Installing Driver Files 7 2 1 3 Running the MSCAN Examples 11 2 14 Troubleshooting iua esi ane TATER RK E 13 2 2 Watchdog Board Controller on F14 0 0 0 0 0005 15 2 2 SPRETEQUISILES 26 5a boned Pb I rien a bte aqnis 15 2 2 2 Copying the Files csse tere t rb 16 2 23 Building the Driver Files sep DESIRED 16 224 Installing the Driver Files 225r caus 17 22 5 ACcessme the DEIVeE eese se teris beer hr ees 18 2 2 6 Testing the Watchdog Functionality 20 2 3 PP4 MVB Slave Board on F207 Carrier and F14 CPU 22 2 3 Used Carrier Hardware is eo rrr rer he Ret x es 22 2 3 2 Descriptor File system dse sisse esos Ree 23 MEN Mikro Elektronik GmbH 2 21APPNO12 E1 2008 04 03 Introduction 1 Introduction The various possibilities of combining MEN hardware and s
13. 6 18 2 34 default misc installing men id sw debug version in lib modules 2 6 18 2 34 default misc installing men mbuf debug version in lib modules 2 6 18 2 34 default misc installing men smb port debug version in lib modules 2 6 18 2 34 default misc installing men smb port io debug version in lib modules 2 6 18 2 34 default misc installing men chameleon debug version in lib modules 2 6 18 2 34 default misc make 1 Nothing to be done for all raw installing men 11 smb2 debug version in lib modules 2 6 18 2 34 default misc installing men ll f14bc debug version in lib modules 2 6 18 2 34 default misc installing men bb smb2 debug version in lib modules 2 6 18 2 34 default misc Updating module dependencies sbin depmod installing libusr oss so in usr local lib installing libusr utl so in usr local lib installing libsmb2 api so in usr local lib installing libmdis api so in usr local lib installstaticlibs installstaticlibs to done for installstaticlibs to done for installstaticlibs Nothing to done for all rtaik usr libs installing smb2 ctrl in usr local bin installing m open in usr local bin installing m read in usr local bin installing m rev id in usr local bin installing m setblock in usr local bin installing m setstat in usr local bin installing m setstat blk in usr local bin installing m write in usr local bin installing smbZ simp in usr local bin installing smb2_f601 in usr local bin
14. Aloe MK Fi MK Fi deinit dev SE irq install LIE nalCl nalCl 15 cmd 0x40604d05 ret 0 0x0 fi le e404dbc0 1 useCount was 1 OSe OSe 4BC Exit deinit brd close e CICER CE CL CE CL C O D D D DOS GDCDAECD de tachin tachin tachin tachin m i i tach tachi tachi tachi tachi tach in board g co Co CO Co Co CO CO CO CO S CONCI MC CY COD COD E CE CODEC limbobox ho limbobox ho MEN Mikro Elektronik GmbH 21APPNO12 E1 2008 04 03 e UJ UJU2U2U2U2 U20 UJ UJ UJ al UT CO 7907 U 09 Ur GE 09 0A S e limbo mdisprojects fl4bc wdog e limbo mdisprojects fl4bc wdog ORE GOST GONE GNE GONE GREG E GE CD C device fl4bc 1 STE PN Tom ient isnt enr int Ten ed ient 0x08 amp QS 0x44 Ox4c Ox4d 3 0X50 BR O52 8 0X56 2 OB 0x69 Example MDIS Projects So in this F14 board used for the test the 10 addressable SMBus locations were found Often SMBus devices like EEPROMs consist of subsequent pages of 256 bytes whose addresses follow one by one like 0x56 and 0x57 The PIC controller used on the F14 has device address 0x4D sometimes written as shifted by 1 2 0x94 Linux uses 7 bit adresses internally Example MDIS Projects 2 2 6 Testing the Watchdog Functionality Finally the watchdog functionality shall be demonstrated A Warning No files important data
15. Hd1 gt 11Hd1 gt mvbIMRODefaultMask Oxf0cO 11Hd1 gt 11Hd1 gt mvbIMR1IDefaultMask 0x00e0 MVB PerformDiagnose dprtest Oxfffc reading test sink adr Ox3ce0 lt gt TST port 0xa55a Loopback test ok B SetInitializationLevel lvl 1 read SCR 0x0701 write SCR 0x0701 VB SetupMemConfiguration VB FormatT L PPO4 GetStat ch 0x00000000 code 0x1101 LL PP04 SetStat ch 0x00000000 ode 0x1005 value 0x0 VB Enablelrq irqFlag Oxf0cO imrReg 0x00000fb8 en 0 V o V V V B_EnableIrq irqFlag 0x00e0 imrReg 0x00000fbc en 0 LL PP04 SetStat ch 0x00000000 de 0x1005 value 0x0 B_EnableIrq irqFlag Oxf0cO imrReg 0x00000fb8 en 0 B_EnableIrq irqFlag 0x00e0 imrReg 0x00000fbc en 0 LL PP04 Exit B SetInitializationLevel lvl 0 read SCR 0x0741 PP04 LL Cleanup By doing an m open the PP4 performs already some internal testing e g an internal loopback test With a result as the one above the PP4 proves to be ready for usage as an MVB Slave together with an MVB Master MEN Mikro Elektronik GmbH 24 21APPNO12 E1 2008 04 03 Example MDIS Projects Legal Information MEN Mikro Elektronik reserves the right to make changes without further notice to any products herein MEN makes no warranty representation or guarantee regarding the suitability of its products for any particular purpose nor does MEN assume any liability arising out of the application or use of any product or circuit
16. ICE NUMBER U_INT32 0x5 DEVICE SLOT O0 U_INT32 0x5 This example can be built solely from the Makefile and system dsc file contained in the example s ZIP file After the files are copied into a folder e g mdis_pp04 the build can be done using make and make install For example gt mkdir pp 4_mdis gt cd pp04 mdis pp04 mdis gt cp xxx Makefile xxx system dsc xxxis the original location pp04 mdis gt make 5d pp04 mdis gt make install eset If building and installing was successful the kernel modules can be loaded using modprobe modprobe men 11 pp 4 modprobe men bb pci And a first open command using the MDIS tool m open can be done which should result in the following dump mdis_pp04 gt m_open pp94 1 open pp04 1 path 3 opened close path MEN Mikro Elektronik GmbH 23 21APPNO12 E1 2008 04 03 Example MDIS Projects More internals can be displayed using the dmesg command dbg init_module ME en_oss init_module desc init_module e BIS Kernel init module ME en bb pci init module D e n S Kernel init module n 1l pp04 init module gned Mem Mapping MCM4 laPitStart 0x00000000 laPitLen 0x00002000 laPcsStart 0x00030000 laPcsLen 0x00008000 laDatStart 0x00010000 laDatLen 0x00010000 daPitStart 0x00002000 daPitLen 0x00002000 daPcsStart 0x00038000 daPcsLen 0x00008000 daDatStart 0x00040000 daDatLen 0x00010000 liHdl ma 0xf9700000 11Hd1 gt mvbMcm 4 11
17. NO12 E1 2008 04 03 Example MDIS Projects Were the kernel modules loaded using modprobe This is necessary prior to the call of m open can 1 because otherwise there is no driver available to handle the m_open call The commands should result in the module loading and initialization as shown here modprobe men 11 canodin EN men oss init module EN men desc init module EN men dbg init module EN BBIS Kernel init module EN MDIS Kernel init module EN men 1l canodin init module modprobe men bb chameleon pcitbl EN men chameleon init module EN men bb chameleon pcitbl init module When all these prerequisites are fulfilled it should be possible without any problem to do a basic access to the can 7 and can 2 devices ttm open can 1 open can 1 MEN men bb isa init module path 3 opened close path By the way in this example the MDIS kernel driver automatically loads another module men_bb_isa ko first The kernel has to be compiled with support for kernel modules and automatic kernel module loading Basically the access to every MDIS device should be tested with m_open first before trying to start a more complex application MEN Mikro Elektronik GmbH 14 21APPNO12 E1 2008 04 03 Example MDIS Projects 2 2 Watchdog Board Controller on F14 This project demonstrates how to build an MDIS project with a ready to use system dsc and Makefile delivered In the case of MDIS SMBus support this i
18. T DEFINITELY s lt msec gt set watchdog time to lt time gt msec g get watchdog time get watchdog status o check if watchdog had shot off the system none c 1999 by MEN mikro elektronik GmbH limbobox home limbo mdisprojects f14bc wdog wdog test f14bc 1 s 2000 w 1000 Watchdog time set to 2000msec Watchdog started trigger all 1000msec 1 Trigger watchdog Press any key to abort 2 Trigger watchdog Press any key to abort 3 Trigger watchdog Press any key to abort 4 Trigger watchdog Press any key to abort 5 Trigger watchdog Press any key to abort 6 Trigger watchdog Press any key to abort 7 Trigger watchdog Press any key to abort 8 Trigger watchdog Press any key to abort 9 Trigger watchdog Press any key to abort 10 Trigger watchdog Press any key to abort 11 Trigger watchdog Press any key to abort 42 Trigger watchdog Press any key to abort 43 Trigger watchdog Press any key to abort 14 Trigger watchdog Press any key to abort 45 Trigger watchdog Press any key to abort 16 Trigger watchdog Press any key to abort 47 Trigger watchdog Press any key to abort 18 Trigger watchdog Press any key to abort 49 Trigger watchdog Press any key to abort 20 Trigger watchdog Press any key to abort Ii shel MEN Mikro Elektronik GmbH 20 21APPNO12 E1 2008 04 03 Example MDIS Projects This will repeat forever until the program is stopped Now we try to set a watchdog time and increase the trigger i
19. bo users 4096 Dec mE root root 513 Dec kernelsettings root root 262 Dec kernelsubdirs root root 4096 Dec BIN root root 4096 Dec H DESC root root 4096 Dec LIB limbo root 3866 Dec Makefile root root 4096 Dec OBJ rw n r limbo root 3846 Dec system dsc limbobox home limbo mdisprojects fi14bc wdog Ir dal Shel MEN Mikro Elektronik GmbH 16 21APPNO12 E1 2008 04 03 Example MDIS Projects 2 2 4 Installing the Driver Files Now simply execute make install The kernel modules and configuration files are copied to their appropriate locations The kernel modules are installed to lib modules lt kernelversion gt misc and the user utilities and test programs go to usr local bin see the snapshot below T Shell Konsole S Session Edit View Bookmarks Settings Help limbobox home limbo mdisprojects f14bc wdog make install installing men mdis kernel debug version in lib modules 2 6 18 2 34 default misc installing men bbis kernel debug version in lib modules 2 6 18 2 34 default misc installing men oss debug version in lib modules 2 6 18 2 34 default misc installing men dbg debug version in lib modules 2 6 18 2 34 default misc installing men desc debug version in lib modules 2 6 18 2 34 default misc installing men pld debug version in lib modules 2 6 18 2 34 default misc installing men pld sw debug version in lib modules 2 6 18 2 34 default misc installing men id debug version in lib modules 2
20. etc should be left open or unsaved when you try this The wdog_test tool is used now It serves as an example how to configure the watchdog CZ Shell Konsole 5 Session Edit View Bookmarks Settings Help limbobox home limbo mdisprojects f14bc_wdog wdog test Usage wdog_test lt opts gt lt device gt lt opts gt Function Configure and serve Watchdog Options device device name w lt msec gt Start watchdog and trigger all msec On keypress the trigger will be aborted and the watchdog be stopped if supported by the used driver 11 CAUTION THE SYSTEM WILL BE RESET IF THE SPECIFIED TRIGGER TIME IS LONGER THAN LLI THE WATCHDOG TIME OR IF THE WATCHDOG CANNOT BE STOPPED Mme t lt msec gt Test watchdog time none The watchdog will be started and triggered The time between the triggers will be increasing from msec up to x msec on which the watchdog causes a system reset 1 CAUTION 11 THE SYSTEM WILL BE RESET DEFINITELY s lt msec gt set watchdog time to lt time gt msec g get watchdog time i get watchdog status a check if watchdog had shot off the system none c 1999 by MEN mikro elektronik GmbH limbobox home limbo mdisprojects fidbc_wdog M aA i shel CZ Shell Konsole 5 Session Edit View Bookmarks Settings Help increasing from msec up to x msec on which the watchdog causes a system reset 111 CAUTION Lud THE SYSTEM WILL BE RESE
21. he products described in this document Copyright 2008 MEN Mikro Elektronik GmbH All rights reserved eS Please recycle Germany France USA MEN Mikro Elektronik GmbH MEN Mikro Elektronik SA MEN Micro Inc Neuwieder Stra e 5 7 18 rue Ren Cassin 24 North Main Street 90411 Nuremberg ZA de la Ch telaine Ambler PA 19002 Phone 49 911 99 33 5 0 74240 Gaillard Phone 215 542 9575 Fax 49 911 99 33 5 901 Phone 33 0 450 955 312 Fax 215 542 9577 E mail info men de Fax 33 0 450 955 211 E mail sales menmicro com www men de E mail info men france fr www menmicro com www men france fr MEN Mikro Elektronik GmbH 25 21APPNO12 E1 2008 04 03
22. lants is only possible after the user has precisely specified the operation environment and after MEN Mikro Elektronik has consequently adapted and released the product ESM MDIS MDIS4 MENMON M Module M Modules SA Adapter SA Adapters UBox and USM are trademarks of MEN Mikro Elektronik GmbH PC MIP is a registered trademark of MEN Micro Inc and SBS Technologies Inc MEN Mikro Elektronik ESMexpress and the MEN logo are registered trademarks of MEN Mikro Elektronik GmbH All other products or services mentioned in this publication are identified by the trademarks service marks or product names as designated by the companies who market those products The trademarks and registered trademarks are held by the companies producing them Inquiries concerning such trademarks should be made directly to those companies All other brand or product names are trademarks or registered trademarks of their respective holders Information in this document has been carefully checked and is believed to be accurate as of the date of publication however no responsibility is assumed for inaccuracies MEN Mikro Elektronik accepts no liability for consequential or incidental damages arising from the use of its products and reserves the right to make changes on the products herein without notice to improve reliability function or design MEN Mikro Elektronik does not assume any liability arising out of the application or use of t
23. men_dbg ar Directory 0BJ dbg men_dbg created dip Preparing debug version of module men desc cata Directory OBJ dbg men_desc created t Preparing debug version of module men pld Directory OBJ dbg men pld created dbi Preparing debug version of module men pld sw Paar Directory OBJ dbg men pld sw created MEN Mikro Elektronik GmbH 7 21APPNO12 E1 2008 04 03 ap P Direc P Ht Direc B cat home kernel sub LD OBJ dbg me Ce EMI OBJ dbg me CC M OBJ dbg me LD M OBJ dbg me LD de p Directory Compi Linki make ng all d B make 4 a B processing system dsc creating creating D creating D creating D D D SI creating creating reparin in repar reparin uilding tschn dirs home t loo home t n bb chameleon pc home t n bb ch home t n b 0BJ mdi ev tool othing ESC cpu ESC fpg ESC bb ESC can g deb Directory OBJ dbg men_ g deb g deb kern uer work LINUX ELI gt gt 0BJ sch sch ame schn n schn n b chameleon pc li mee ug version of ug version of tory 0BJ dbg men_bb_chameleon_ ug version of tory 0BJ dbg men_bb_isa created pcitbl created odul el modules akefile er work LINU itbl bu er work LINU i
24. ntervals until they exceed the watchdog time C Shell Konsole lt 3 Session Edit View Bookmarks Settings Help t zimse sz amp mse 8 i o c 1999 limbobox limbobox limbobox Watchdog Watchdog Trigger Trigger Trigger Trigger Trigger Trigger Trigger Trigger Trigger Trigger Trigger THE SYSTEM WILL BE RESET IF THE SPECIFIED TRIGGER TIME IS LONGER THAN THE WATCHDOG TIME OR IF THE WATCHDOG CANNOT BE STOPPED c gt Test watchdog time The watchdog will be started and triggered The time between the triggers will be increasing from msec up to x msec on which the watchdog causes a system reset 11 CAUTION THE SYSTEM WILL BE RESET DEFINITELY c set watchdog time to lt time gt msec get watchdog time get watchdog status check if watchdog had shot off the system none by MEN mikro elektronik GmbH home limbo mdisprojects f14bc wdog home limbo mdisprojects f14bc wdog t home limbo mdisprojects f14bc wdog wdog test f14bc 1 s 3000 t 1000 time set to 3000msec started watchdog watchdog watchdog watchdog watchdog watchdog watchdog watchdog watchdog watchdog watchdog force system reset after after after after after after after after after after after O00msec 1100msec 1200msec 1300msec 1400msec 1500msec 1600msec 1700msec 1800msec 1900msec 2000msec eis I shel Option t increases the trigger time every 1
25. oftware products sometimes makes it difficult to decide which packages are needed for a certain system or how the drivers can be built Although the MDIS Wizard is taking a lot of difficult configuration tasks away from customers there are some driver and board related configurations which currently cannot be configured in the MDIS Wizard This application note tries to show some examples of regular MDIS Wizard configured projects and also projects where manually predefined MDIS descriptor files and Makefiles are necessary It shall help customers together with the MDIS under Linux user manual to get their MDIS projects up and running in short time You can find all available downloads around the MDIS4 2004 system package for Linux including project examples discussed in this document on MEN s website Article no 18M000 13 MEN Mikro Elektronik GmbH 3 21APPNO12 E1 2008 04 03 2 Example MDIS Projects Example MDIS Projects In this chapter the demo projects are introduced and built If driver packages other than the MDIS system package are needed this is mentioned under headline Prerequisites 2 1 EM1 CAN This project demonstrates how to access the MPC5200 on chip CAN controllers The driver is the MSCAN driver that supports the 16Z029_CAN FPGA IP core The driver is used in two flavors within MDIS as a driver for the on chip CAN controllers and also as a driver for the 16Z029_CAN FPGA IP core
26. ontroller driver usually i2c i801 on the F14 must be loaded MEN Mikro Elektronik GmbH 15 21APPNO12 E1 2008 04 03 Example MDIS Projects 2 2 2 Copying the Files Copy files Makefile and system dsc from the example tgz file subfolder 14_example into a folder under your home directory This example was tested with a SuSE 10 2 Installation G Shell Konsole Session Edit View Bookmarks Settings Help limbobox home limbo mdisprojects fi4bc_wdog uname a Linux limbobox 2 6 18 2 34 default 1 SMP Mon Nov 27 11 46 27 UTC 2006 i686 i686 i386 GNU Linux limbobox home limbo mdisprojects fi4bc wdog ls la 2 root root 4096 Dec 18 14 30 12 limbo users 4096 Dec 18 13 40 1 limbo root 3866 Dec 18 12 19 Makefile 1 limbo root 3846 Dec 18 13 01 system dsc limbobox home limbo mdisprojects f14bc wdog D 2 2 3 Building the Driver Files Now simply execute make It is assumed that the necessary development packages with kernel headers for kernel development were installed The dump below shows the last lines of the build process and the directory contents after the make call T Shell Konsole 5 Session Edit View Bookmarks Settings Help Building mdis_createdey make 2 Nothing to be done for build make all dev tools Building descgen make 4 Nothing to be done for build Building descriptor system root root 4096 Dec E E lim
27. s necessary since the SMB2 library which is needed for this is not supported as a component in the MDIS Wizard yet The block diagram below shows the basic interaction between the user program and SMBus hardware and how the different kernel modules relate to each other The driver module men_bb_smb2 ko acts as the primary layer between the hardware drivers delivered by the Linux distribution i2c i 01 ko i2c core ko and i2c dev ko and MEN s driver modules which use the MEN SMB2 library This library offers regular SMBus access functionality byte word reads and writes The men bb smb2 ko module is basically a wrapper for the kernels smbus read write xxx functions and handles these SMB2 calls Details about SMBus support in the Linux kernel can be found e g in linux Documentation i2c Figure 1 Relation of kernel drivers for SMBus access on F14 wdog test Userspace men bb smb2 Intel ICH801 SMBus Host Controller SMBus 0 Pie er address 0x4D Hardware 2 2 1 Prerequisites For this example the standard MEN driver package 13Y007 06 was already included in the example projects archive From this package the driver module men_ll_fl4bc ko is built and also the wdog_test program is part of the package The installation of this package can be done in the MDIS Wizard or the ZIP file can simply be unzipped in MDIS installation folder opt menlinux Also the running kernel must of course have built in SMBus support and the SMBus c
28. s by calling it with a leading as in the example below me tschnuer work LINUX ELINOS PROJECTS ELINOS 41 S1317 emOlimg ELINOS sh 0S SESSION Setting up C ELINOS PREF ELINOS BOAR ELINOS_BIN_ ELINOS_PROJ CG CXX AS GDB IX D ELINOS BOOT SI ELINOS_KERNELPATH EC ELINOS_DOSNAME PREFIX RAT DK ppc 60x for glibc 2 3 4 opt elinos 4 1 meneml ppc_60x uboot_mul ti men5200 linux 2 6 15 home tschnuer work LINUX ELINOS_PROJECTS ELINOS_41_ 1317 em01img em01limg ppc_60x gcc ppc_60x g ppc_60x as ppc_60x gdb M Then change into subdirectory src mdis and execute make tslinux2 home tschnuer work LINUX ELINOS_PROJECTS ELINOS_41_S1317 em0limg cd src mdis tslinux2 home tschnuer work LINUX ELINOS PROJECTS ELINOS 41 S1317 emOlimg src mdis make Getting Compiler Linker settings from Linux Kernel Makefile Cleaning kernelsubdirs arr Preparing debug version of module men mdis kernel db Directory OBJ dbg men mdis kernel created are Preparing debug version of module men bbis kernel dP Directory OBJ dbg men_bbis_kernel created arp Preparing debug version of module men_oss ty Directory OBJ dbg men_oss created apap Preparing debug version of module
29. steps part where you currently find this note menem uboot mutt pec sox gibc z34 emotimg The screen shot shows how the root file system creation step looks like when successfully finished The complete build log file can be found in the MDIS example ZIP file under EM1_onchipCan completeBuildLog See note on page 3 for hints on download of the example projects MEN Mikro Elektronik GmbH 10 21APPNO12 E1 2008 04 03 Example MDIS Projects 2 1 3 Running the MSCAN Examples When the root file system is equipped with the driver modules here a RAM image using boot strategy uboot_multi is used it is necessary to ensure the target s root file system is the modules can be loaded and accessed modprobe men 11 canodin E en oss init module en desc init module en dbg init module BBIS Kernel init module DIS Kernel init module en 1l canodin init module modprobe men bb chameleon pcitbl en chameleon init module en bb chameleon pcitbl init module Ss ml aq ake See pup pub imal pel eet ini m_open can 1 open can 1 MEN men bb isa init module path 3 opened close path mscan_loopb can 1 Performing test a Basic Tx Rx Run 1 1 Test a ok Performing test b Tx chronological Run 1 1 DRIVER INTERNALS S REGS 0210 CTL1 a0 RFLG 00 TFLG 07 TIER 00 DRIVER txPri s l i si ESSAGE OBJECTS OBJ
30. tbl bb er work LINU _pcitbl bb er work LINU itbl me TEE 0S PROJECTS E X ELINOS PROJECTS ilt in o X ELINOS PROJECTS _chameleon o X ELINOS_PROJECTS _module o X ELINOS PROJECTS n bb chameleon pci sewer UT Cling MES CIPIT AHAAA S createdev created mdis S to be bin a bin Sail NEU ESC bb scan ESC can II M Finally the compiled driver files have to be installed in the root file system that is generated by ELinOS Execute command make install at subdirectory src ling mdis_createdev c Hoof Bil _createdev uilding descgen done for b l bin n 2 bin n wu el s WIIGCHAG eese SVS SARARAN home tschnuer work LINUX ELINOS PROJECTS ELINOS 41 S1317 emO1img src mdis EL gll elk EL tb Example MDIS Projects mem Il 96 erra LINOS_41_S1317 em0 NOS Ab Sis NOS_41_S13 NOS_41_S13 NOS AT SIS ZO odule men 1l canodin 4 4 reated odule men bb chameleon pcitbl img src mdis 7 e 7 e 7 e 7 e 01i 01i 01i 01i g src mdis g src mdis g src mdis g src mdis mdis or click on the Install Project button in the MDIS Wizard MEN Mikro Elektronik GmbH 21APPNO12 E1 2008 04 03 Example MDIS Projects Furthermore it is necessary to make sure that the created files run on the root file system on
31. ter Nr 0 SMBus 1801 adapter at 0500 probe SMBus client Ox4c Adapter Nr 0 SMBus 1801 adapter at 0500 probe SMBus client Ox4d Adapter Nr 0 SMBus I801 adapter at 0500 probe SMBus client 0x50 Adapter Nr 0 SMBus I801 adapter at 0500 probe SMBus client 0x52 Adapter Nr 0 SMBus 1801 adapter at 0500 probe SMBus client 0x56 Adapter Nr 0 SMBus 1801 adapter at 0500 probe SMBus client 0x57 Adapter Nr 0 SMBus I801 adapter at 0500 probe SMBus client 0x69 device addr spaces 0 addr spaces device interrupt not required device characteristic AddrMode 0x0001 DataMode 0x000c process locking lockMode 2 board bustype 6 dev bustype 6 addrSpacelype 0 board irq info 0 ILE PLAC ine SMB2BB ReadByteData addr Ox4d cmdAddr 0x80 lt 6 gt read data 46 SMB2BB ReadByteData addr Ox4d cmdAddr 0x81 lt 6 gt read data 50 SMB2BB ReadByteData addr Ox4d cmdAddr 0x82 lt 6 gt read data 46 SMB2BB ReadByteData addr Ox4d cmdAddr 0x83 lt 6 gt read data 46 SMB2BB ReadByteData addr Ox4d cmdAddr 0x84 lt 6 gt read data 46 SMB2BB ReadByteData addr Ox4d cmdAddr 0x85 lt 6 gt read data 46 PIC firmware revision for rev 2 0 and later 6 bytes lt gt f734e41e 0000 46 50 46 46 46 46 PPI ETE first PIC firmware revision gt restricted functionality LL F14BC GetStat ch 0 code 0x1101 device channels 7 channels prepare lockMode LL LOCK CALL MEN Mikro Elektronik GmbH 18 21APPNO12 E1 2008 04 03 mk_ioctl ex mk_release T
32. that can be built into the EM1 s on board FPGA 2 1 1 Creating the Project in MDIS Wizard V Start the MDIS Wizard with command opt menlinux BIN mdiswiz M Select an EMI CPU board MDIS project wizard homeftschnuer workK LINUX ELINOS PROJECTS ELINOS 41_5131 em01img src mdis Project Build Edit Package Help D amp gm x cg Component tocation Mode Functionatty MEN EM1 bbmscan 1 Local Bus IO 70000900 MEN MSCANS200 BBIS bbmscan 2 Local Bus IO f0000960 MEN MSCANS200 BBIS mpga PCI Bus 0 Dev 23 MEN CHAMELEON PCITBL Embedded System Module with MPCS200 Pseudo device for memory mapped hardware Pseudo device for memory mapped hardware Container device for chameleon FPGA units modified Vl Add the CAN driver to the two on chip CAN ports MDIS project wizard homefschnuer work LINUXELINOS PROJECTS ELINOS 41_5131 em01img src mdis Project Build Edit Package Help D 6a See Cp Component tocation Model Functinalty MEN EM1 bbmscan 1 Local Bus IO f0000900 MEN MSCANS200 BBIS bbmscan 2 Local Bus IO f0000980 MEN MSCANS200 BBIS ieiiipga PCI Bus 0 Dev 23 MEN CHAMELEON_PCITBL Properties Delete Add Component to pseudo slot for MSCAN on MPC5200 MEN Mikro Elektronik GmbH 21APPNO12 E1 2008 04 03 Embedded System Module with MPC5200 Pseudo device for memory mapped hardware Pseudo device for memory mapped hardware Container device for chameleon FPGA units modified Example
Download Pdf Manuals
Related Search
Related Contents
LG LWHD1200FR User's Manual ATMOS® Aspiration des voies respiratoires Manuel Utilisateur Vitanadh Opas SMC EZ-Stream Universal Wireless Router (smc2304wbr-ag) Bedienungsanleitung LokoHelp Gangtrainer - Stand PSM-003 Micro Scrambler/Controller User Manual Copyright © All rights reserved.
Failed to retrieve file