上海交通大学硕士学位论文基于ARM-Linux的小区智能监控系统设计姓名:夏宏波申请学位级别:硕士专业:通信与信息系统指导教师:黄佩伟20071201IARM-LinuxARMNTTARM-Linux/RS485EthernetInternetWebIIARM-LinuxWebABSTRACTIIIDESIGNOFMONITOR/CONTROLSYSTEMININTELLIGENTCOMMUNITYBASEDONARM-LINUXABSTRACTAlongwiththedevelopmentofeconomyandtechnologypeopleexpandtheirrequirementsonintelligentcommunity.Tenementsneedtorealizeremotemonitoringandcontrolonthedevicesintheirhouses,districtadministratorneedstorealizetheuniformmanagementonthecommunityaffairs.Computer,communicationandARMembeddedsystemtechnologiessupporttherealizationofcommunityintelligence.ThispaperoriginatesfromthecooperatingprojectoflabandNTTonsmarthouse.ItpresentsadesignschemeofcommunityintelligentmonitoringandcontrolbasedonARM-Linuxplatform.Thesystemmainlycontainsthreeparts:communitygateway,homerelayandsensors/switches.Inthetenements’houses,weusehomerelaytoconnectthesensorsandswitchesthroughRS485bustoformahomenetwork.Relaycouldcollectthesensors’dataandcontroltheswitches.Inthecommunity,communitygatewayconnectshomerelaysthroughEthernettobuildupthecommunityLAN.Communitygatewaycoulduniformlymanagerelaysanddevices.ThetenementsandcommunityABSTRACTIVadministratorcouldaccessdataofrelayanddevicesandcouldsendinstructionstodevicesthroughtheWebserverofcommunitygatewayonInternet.ThemaintaskofthispaperisthedesignofARM-Linuxbasedhomerelay,includinghardwaredesign,systemsoftwaretransplantandapplicationsoftwaredesign;softwaredesignofcommunitygateway;organizationofhomecommunicationnetworkandcommunityLANandthedesignofcommunicationprotocol.Systemisprovedworkingwellthroughtheexperimentanddebugonthedemosysteminlab.Keywords:ARM-Linux,database,communicationprotocol,Webserver20071230200712302007123011.1[1]()IC“”CJ/T17422003[2][3,4](1)(2)(3)2(4),()(5),,(6)1.2[5]1984()2080“”33598000162200“”209031998ECHELON“”(1)NEYWELL(2)STARGATE(3)NI(4)ALDELUXE(5)Vantage1999()2000211.3ADSL(4)/()()InternetHTTPWeb1-1Internet1-1Fig.1-1Applicationenvironmentofintelligentcommunitymonitoring/controlsystem5InternetWeb(1)ARM-Linux(2)InternetWeb(3)1.4ARM-LinuxWebARM-LinuxWeb62.12-11n2-1Fig.2-1LayersofsystemInternetWeb2-2RS485[6]/(Ethernet)[7](Internet)7Internet2-2Fig.2-2NetworkofsystemRS485EthernetInternetHTTP(Bus)(Star)A/D()0/1MCURS485A/DMCU()1bit8bits1bit8bits1bit8bitIPTCPSocketTCP/IP82.2[8](1)(2)(3)EthernetInternet/Intranet(4)(5)(6)/(7)(8)(9)92.3IPIDIDWebWeb……2.410/Internet/113.1ARM-Linux[9]890[10]ARM-LinuxARMLinuxARM-Linux[11]3-1ARMLinux3-1ARM-LinuxFig.3-1FrameworkofARM-Linuxsystem12(API)3.23.2.1ARM-LinuxPowerPCMIPSARMX86ARMRISC32[12]ARMARM7ARM9ARM9EARM10ESecurCoreIntelStrongARMXscaleARMARMARM9[13]ARM9SamsungS3C2410ARM9T16/32203MHzS3C2410ARM1GBBank128MBI/O8/16/32Bank(8)ROMNOR/NANDFlashEEPROM[14]3.2.2MCU13[15]VxWorksPalmOSWinCEPDA(1)(2)(3)[16]Linux[17](1)Linux(2)LinuxLinux(3)Linux(4)TCP/IPLinux(5)Linux(6)LinuxLinuxLinuxLinuxLinuxLinux2.6ARM9S3C2410Linux2.6Linux32ARM3.2.3ST2410[18]ST2410SAMSUNGS3C241014ARM920T(1)64M2MNorFlash64MNANDFlash(2)UART115200bps(3)CS8900Q310M(4)USBHOSTDevice(5)IRDA(6)IISUDA1341(7)SD256MSD(8)LCD(9)20Multi-ICEJTAGST2410ST2410Linux2.6.83.3S3C2410(UART)RS485USBHOST20JTAG3-2S3C421064MSDRAM64MNANDFLASHRS485MAX3232/3488CS8900Q3JTAGUSBHOST2MNORFLASH3-2Fig.2Structureofhardware15SDRAMFLASHUSBHOSTJTAGLinuxARMARM/3.3.1S3C2410S3C2410SAMSUNGARM920T(1)16MBCache16MBCache(2)(MMU)(3)(SDRAMControlandChipSelectlogic)(4)LCD(DMA)(5)810ADC(6)4DMA(7)DMA(8)3UART(IrDA1.016-ByteTxFIFOand16-ByteRxFIFO)(9)2SPI(10)IICIIS(11)SDv1.0v2.11(12)2USB(13)1USB(v1.1)(14)4PWM(15)Watchdog(16)RTC(17)(PPL)(18)117I/O24S3C24103-3[19]163-3S3C2410Fig.3-3FrameworkofS3C2410173.3.2S3C24101.8V3.3VI/O3.3V5V3-4S3C24101.8V3.3VLM1117-1.8VLM1117-3.3V3-4Fig.3-4Powersupplycircuitofsystem3.3.3MAX3232RS-232MAX32323-5MAX3488RS232/RS485RS4853-5MAX3232Fig.3-5MAX3232modulecircuit183.3.4CS8900S3C2410CS8900Q33-6CS8900Q33-6CS8900Q3Fig.3-6ConnectivecircuitofCS8900Q33.4ARM-LinuxFlash(Bootloader)3-7Flash[20]3-7FlashFig.3-7ArrangementofmodulesinFlashARM-LinuxLinux19ARM93-8[17]BootLoaderzImageRamdiskCramfsJffs2Linuxramdisk0x010000000x010400000x011400000x015400000x019400000x300080000x300000000x308000003-8ARM9Fig.3-8StoragemapofARM9systemLinux3.4.1BootLoaderARM0x00000000BootloaderBootloaderBootloaderRAMBootloaderstage1stage2CPUstage1stage2CBootloaderBootloaderBootloaderBootloaderBootloaderU-bootU-bootARM20(1)U-boot1.1.4(2)FlashFlash/board/smdk2410/flash.cs3c2410.hFlash(3)Makefile3.4.1CROSS_COMPILE=/usr/local/arm/3.4.1/arm-linux-(4)U-bootmakesmdk2410_configmakeall(5)U-bootu-boot.binARMJTAGBootloader3.4.2LinuxBootloaderLinuxLinux2.6CRAMFSBootloaderLinuxLinuxFlashLinuxFlashLinuxLinuxLinux2.62.42.6[21]LinuxARM(1)Linux2.6.8(2)PATH/usr/local/arm/3.4.1/binPATHMakefile(3)Linux2.6.8S3C24l0s3c24l0_deconfigmakemenuconfig21(4)makemakezImage(5)BootloaderUSBJTAGLinuxLinuxROMFSCRAMFSRAMFSJFFS2EXT2CRAMFSCRAMFS16MBCRAMFSCRAMFS(1)/bin(2)/sbin(3)/lib(4)/proc(5)/dev(6)/etc(7)/mnt(8)/usr/Linuxrcinit/etc/ini.d/rcSmount/usr/etc/profilemkcramfscramfsCRAMFSJFFS2ARM-LinuxPC()()223.5ARM-Linux3.5.1RS48510/100Base-TEthernet3-93-9Fig.3.9Tasksketchofhomerela