• Based on a LPC2124 remote system software promotion plan

    The abstract in view of intelligent terminal’s system software long-distance promotion and the maintenance difficult question, proposed that one kind the design proposal which promotes based on the LPC2124 remote system software. Introduced that LPC2124 the main performance and the characteristic, on the piece the Flash constitution and ISP, IAP and JTAG and so on many kinds of programming method’s principle of work, and elaborated systematically long-distance IAP in uses electricity in the scene monitor terminal application. Finally discussion to long-distance IAP promotion plan reliability. The practice proved that this design proposal has solved the terminal software long-distance promotion and the maintenance difficult question well, reduced the terminal software system’s development cycle.
    Key word LPC2124 the long-distance IAP software promotes the GPRS monitor terminal

    Introduction
        Uses electricity the scene monitor terminal is one kind uses electricity the condition intellectualized equipment with the multi-purpose rationing equipment synchronization measurement and the omni-directional monitoring, in the present national electric power scarce situation, played the peak clipping to fill in the valley, raised the electrical network operating efficiency the role, especially suited to uses electricity the wealthy and powerful family to use electricity the monitoring.

        The market demand and the applied technology mature often are contradictory, the user always hoped that uses the function to consummate, the technological advance as soon as possible the product, but anew always has a process the technology to the application. In this process’s length greatest degree has decided the product market prospect, if must grasp the market well, can not but on the one hand develop on the other hand frequently the market the perfect technology. The practice is verifies the truth the sole criterion, must make the good product, must form interactive with the user the relations, consummates unceasingly using user’s feedback information to the product. Moreover, after product long time use, the terminal programming flaw also slowly emerges the water surface, this requests to the terminal system procedure to carry on the promotion. If carries on scene ISP to several hundred terminals to promote, not only then wastes the massive manpower, the financial resource, has wasted the precious time more importantly, delayed has developed the market the opportunity, reduced the user to the product creditworthiness.

        In the Internet swift development’s time, turns on the terminal Internet is solves reliably the above question, the reality plan. This design proposal applies in using electricity the scene monitor terminal, uses high performance Philips ARM MCULPC2124, unifies the GPRS technology to realize the terminal system procedure long-distance promotion.

    1 LPC2124 chip synopsis
    1.1 function introductions
        LPC2124 based on a support real-time emulation and track 16/32 ARM7TDMI-SCPU, and has 236 KB the inserting high speed Flash memory and 16 KB RAM. Inlays the Flash memory regarding to support JTAG, ISP, IAP and so on many kinds of programming ways.

        LPC2124 has the very small 64 foot seal, the extremely low power loss, many 32 timers, 4 group 10 ADC, the PWM output, 46 GPIO as well as reaches 9 external interrupt, and the built-in wide scope’s serial communication connection, has caused them to be suitable specially in the industrial control. Because uses electricity the monitor terminal to request high to the hardware source, the software function is complex, timely, therefore uses LPC2124 to be possible to enhance the product the performance-to-price ratio.

    1.2 Flash memory system
        The LPC2124 memory system contains 256 KB 17 sectors. The Flash memory starts from the O address and increases upwardly, 17 sector’s size continuous distributions, 17 sector aggregate capacities are 248 KB, is left over 8 KB storage space is the Boot sector. The Boot sector located at the Flash memory system’s peak part, the address space is 0×0003 EO00~0×0003FFFF. LPC2124 memory system’s allocation as shown in Figure 1.

        Boot Block takes the 17th sector, namely Boot sector. This sector’s storage space special-purpose deposits the B00t loading operation, after the control replacement initialization operation, and provides Flash the programming method (code). The B00t loading bin may start the ground-to-air unsilvered glass the programming, to program component’s cleaning and to program again as well as carries on the programming in the movement system by the application procedure to the Flash memory.

    1.3 Flash memory system’s programming
        LPC2124 supports many kinds of ways to carry on the programming to Flash, uses for to read in the user code or the data. The first kind passes the built-in serial JTAG connection; The second kind is carries on through UART0 in the system programs (ISP); The third kind is through programs (IAP) in the application to realize.

    1.3.1 JTAG programming
        LPC2124 JTAG the Flash programming may facilitate the downloading procedure to internal Flash, what but the JTAG connection is main provides the hardware system debugging function, such as realizes software’s break point, on foot. JTAG the Flash programming must interrupt application software’s normal operation, the segment are many, the signal distance is short, moreover wants the scene programming, only adapts in the product in the development period debugging use.

    1.3.2 program in the system
        ISP (In-Svstam Programming) the technology, namely in the system programmable technology, is refers to the circuit wafer the blank component to be possible to program reads in the end-user code, but does not need from the circuit wafer to take down the component; Has programmed the component also available ISP way cleaning or programs again. LPC2124 supports ISP the Flash programming, but wants the turban to stop application software’s normal operation, and needs to provide certain hardware source including the UARTO mouth, the RS232 actuation and the CPU special pin condition; The programming requests the scene operation, is suitable for the portable smart instrument’s promotion, but is not suitable obviously in uses electricity monitors terminal this kind to install the environment special equipment. The ISP programming principle for details sees the reference.

    1.3.3 in application programming
        Programs IAP in the application (In-Application Programming) is the application in the F1ash program memory’s one kind of programming pattern. Puts briefly is under the application programmed control, carries on the read, the cleaning or the write operation to the procedure some section of storage space. Is similar with the ISP operation. Has the online programming function, and has overcome the ISP deficiency. It may carry on in the application procedure normal operation situation to other section of procedure Flash reads/writes the operation, even may control to some section, some page of even some byte reads/writes the operation. This has brought the enormous flexibility for the data storage and firmware’s field upgrade.

    2 IAP function hardware design
        Based on the LPC2124 above 3 kind of programming method’s analysis, IAP realizes to the terminal procedure promotes is the best selection scheme naturally. Following introduced that one kind based on the GPRS long-distance IAP system plan, system diagram as shown in Figure 2.

        AT45DB08081B,8Mb serial Flash memory, has at the same time ROM the power failure data storage and RAM reads/writes the speed, supports 20MHz most quickly the clock rate, scratches writes the number of times to reach 10000 times, the built-in 2 264 byte SRAM buffer, causes to the main storage medium’s programming to be possible to carry on continuously, omits the programming standby period. AT45DB081B uses the CASON-8 seal, supports 2.5~3.6 V low voltages, the operation power loss is low, supports pattern O and 3 SPI bus interface, is simple with the MCU connection, stable reliable, is suitable for the digital pronunciation, the image, the procedure code and in the data memory application. Uses the pattern in this design 0 with the LPC2124 correspondence, the speed may reach the MCU basic frequency 1/8.

        The GPRS module uses Q2406B which Wavecom Corporation produces, the dual-frequency GPRS/GSM module (EGSM900/1800 MHz or EGSM900/l900 MHz), built-in TCP/IP, is completely compatible with the standard AT instruction; Its design development conforms to ETSI GSM the Phase 2 standards.

    3 IAP function software design
    3.1 IAP programming connection
        LPC2124 IAP procedure located at the Boot sector, after the replacement, the entire Bool sector is mapped memory address Ox7FFFFE000~Ox7FFFFFFF place; But the IAP entry point address is 0×7FFFFFFFo, the procedure is the Thumb code. The IAP programming order uses RAM the most high-end 32 bytes, therefore the application procedure should retain this part of RAM. In uses in the IAP cleaning/programming operating process, the internal Flash memory cannot visit. When user application program run, the user F1ash region’s interrupt vector is effective, therefore before transferring the Flash cleaning/writes IAP, the user must the disable interrupt or guarantees the user interrupt vector in: In RAM effective and interrupt handling routine located at RAM. The IAP code does not use or the disable interrupt.

    3.2 IAP programs the C language to realize
        Regarding in the application programming, LPC2124 is the order code which and the parameter contains through register R0 in character indicator direction memory (RAM) transfers the IAP procedure. The IAP order’s result returns to memory (RAM) which aims to register R1.

        Transfers LPC2124 IAP to be possible to use the following C language code:
        ◆ defines the IAP procedure entry point address
        #definc lAP_LOCATl0N Ox7FFFFFFFl
        ◆ the definition construction of data transmits the IAP order table and gives the IAP procedure finally
        unslgned long Command[5];
        unsigncd long Result[2];
        ◆ defining function type indicator, function including two parameters, non-returns value
        typcdef void(*IAP) (unsigned int[], unsigncdim int[]);
        IAP iap_entry; // defining function indicator
        ◆ establishment function indicator
        iap_entry=(IAP)IAP_LOCATION;
        ◆ uses the following sentence to transfer IAP
        iap_entry(command, result);

        This system is carries on the transplant based on the LPC2124 project template, in the ADSl.2 embedded software develops in the platform, transfers the IAP procedure code with the C language to realize the IAP programming directly. The IAP order code, the condition code and the order explain in detail as well as the IAP function detailed application see the reference.

    4 long-distance promotion are using electricity the scene monitor terminal application
        The terminal software system’s design (has difference including the user vectoring procedure design with Boot loading operation, the former designs by user, the latter by chip producer design and solidification) and application procedure design. They are different in the LPC2124 entry point address, after terminal replacement, if has not entered the ISP programming condition, then first carries out the user vectoring procedure, by the user vectoring procedure decided that carries out IAP to promote the normal operation; The application procedure realizes terminal each kind of function, promotes a package of downloading including the new edition application procedure.

    4.1 terminal user vectoring procedure design
        The terminal user vectoring procedure is designs based on filing system’s thought. The terminal application procedure code deposits in the LPC2124 Flash memory, when terminal normal operation, MCU does not stop reads the instruction from Flash. If promotes to the application procedure, namely the Flash memory sector which takes to the application procedure carries on the cleaning and programs again, obviously carries out the Flash sector which the Flash programming’s code takes not to be able to clean, then the promotion procedure’s code can only use independent sector depositing, the promotion procedure’s execution may transfer by the application procedure, may also take the independent program execution. Because the LPC2124 IAP code uses 16 Thumb sets of instructions, carries out in the IAP process to forbid or the closure interrupt. If will promote the procedure to select the method which the application procedure transfers to design, will increase the application programming the complexity, the promotion reliability is bad. After LPC2124 replacement, as a result of the Boot procedure always from Flash 0 address read instruction, therefore the promotion procedure code places in the outset sector, designs for a user vectoring procedure part, but the user vectoring procedure is not always revised. If promotion process defeat, after MCU replacement, the application procedure might promote, strengthened the promotion reliability.

        Terminal user vectoring procedure after system electricity carries out. First it inspects the application procedure promotion symbol and the edition number. When inspects the promotion symbol setting, and presents time update our company, reads the application procedure promotion package from AT45DB081B, then carries out the LPC2124 Flash programming movement, realizes to the application procedure promotion. After promotion end of mission, eliminates the promotion to symbolize and to renew the application procedure edition, finally shifts to the application procedure entrance and carries out the application procedure code. Guidance process flow as shown in Figure 3.

    4.2 terminal application programming
        The terminal application procedure completes the terminal responsibly the data acquisition, the renewal, the scanning, and reports the warning event, controls the scene implementing agency, the execution pretage machine long-distance order and preserves each kind of historical data and so on. The pretage machine long-distance order including reads/writes the station command, the relaying order and the long-distance promotion order. After the terminal receives the pretage machine long-distance promotion order, the terminal analysis promotion order frame, the read promotes package of information, including a package of total length, the package verification code, the frame serial number and the frame verification code, then the reply pretage machine and requested that the transmission successor data frame, the terminal carries on the verification to the successor data frame, the verification is correct, then replies successful and the receive next data, otherwise replies is defeated and requests the terminal reproduction. Continual 5 reproduction defeat, then thought that the network service quality bad cancels the current promotion operation, preserves the frame number which and the data check receives successfully and prepare continue the biography. The application procedure promotes Bao Anzheng the way through GPRS Modem, from the pretage machine downloading terminal, and preserves the terminal AT45DB081B the Flash memory. After downloading successfully, the setting promotion symbolizes and records promotes the package of edition number, prepares the user vectoring procedure promotion.

        The promotion package of downloading process may regard as is the data transmission process, the application procedure may the synchronization realize terminal other each kind of function, does not affect the terminal the normal operation. After the application procedure promotion package downloads successfully, the terminal carries on the essential scene preservation and the initiative replacement, thus the execution user vectoring procedure promotes last step - - Flash programming. Moreover, may also dispose the promotion time in the terminal, avoids the terminal duty heavy load stage, causes the promotion process to reduce to the terminal normal work influence to is smallest.

        The application procedure promotes package of downloading flow as shown in Figure 4.

    4.3 communication protocol design
        After GPRS and Internet connection establishment, data input transparent transmission stage. This system designs the user application layer agreement in the perfect TCP/IP machine-made foundation. In order to realize the system some terminal system software to promote, pretage machine is going to promote the procedure code transforms to write the terminal promotion code frame, turns on Internet to the GPRS network, the transparent transmission downloads to the goal terminal. Uses electricity the scene service according to Jiangxi Province and the management system management system communication protocol, will write the terminal promotion code frame to divide into 3 kinds: Pretage machine promotion request frame, promotion code data frame and terminal response frame. The frame form has detailed showing in the reference.

    5 long-distance IAP application reliable discussion
        The terminal application procedure’s promotion process needs to receive the environment unavoidably the disturbance, like breakdowns and so on terminal power failure, unusual terminal replacement and network service blocking, can cause terminal long-distance IAP the defeat, must therefore provide a set of reliable software and hardware mechanism to guarantee the terminal IAP process the normal work. The following is the measure which in this system adopts:

        ◆ the terminal power failure and exceptionally repositions processing. Because disturbances and so on terminal power cut and electrical network fluctuation cause the terminal replacement, will stop the terminal the promotion process, causes the promotion defeat. This system selects the promotion method which downloading and the IAP process separate completely. IAP located at the user vectoring procedure part, is not cleaned. At45DB08lB always backup newest edition terminal application procedure, therefore any stage operation defeat can guarantee the terminal the normal work. Moreover, provides the accumulator cell and the charging circuit in the terminal, comes the electricity when the terminal main power source also to the battery charging, causes the terminal power failure when to be possible the normal operation, the long-distance IAP process is more reliable.

        ◆ long-distance correspondence error code processing. Error code which produces to the data transmission process, general, effective solution, is with the CRC cyclical redundancy check and the re-transmit mechanism. After data check code verification correct, stores AT45DB081B, when the mistake returns to the wrong code to send with the frame serial number request reproduction, until examined the conclusion frame. The conclusion frame data length was insufficient, with 00 filled.

        ◆ network congestion, failure processing. As a result of the terrain and environmental factor’s influence, the GPRS network possibly presents blocking or the separation situation in the long-distance IAP course of communications. By now the terminal and pretage machine to did not have the response frame to use the time delay reproduction the mechanism, the continual 5 times were not successful separate the GPRS net and connect, the terminal preservation promoted the downloading break point information, after waiting for the network recovery, continued to pass on the data.

    Conclusion
        This design proposal basic solution this system’s long-distance code promoted the question, strengthened the conveniences which the system software maintains, reduced the new product going on the market time, also has provided safely, the quick service for the user. Takes the transmission path with the GPRS network, to turn on the Internet difficult remote districts the scene to use electricity the monitor terminal long-distance maintenance, proposed one kind brand-new, the reliable design proposal.

    Share/Save/Bookmark

No comments yet.

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

TOP
Copyright © 2008-2009 51 Research and Design, Electronic Engineers website - Embedded Systems, MCU, DSP, EDA, Test and Measurement, Components, Communications, Power, Microelectronics, Semiconductors
Powered by WordPress | Theme by mg12 | Valid XHTML 1.1 and CSS 3