• MSP430 procedure promotion way discussion

        Carries on the programming to the MSP430 series monolithic integrated circuit the way to have the following 3 kinds: Using the JTAG connection, uses the BSL firmware and the use user from the definition promotion firmware. Because uses carries on the way which from the definition promotion firmware the procedure promotes to be quite nimble, and versatility, therefore this article will make the key introduction to it.

    1 using the JTAG connection
        The MSP430 series’s monolithic integrated circuit integrated the JTAG connection, this connection realized has followed IEEE the STD1149.1 stipulation the test visit port state machine (TAP Controller). It uses 4 serial interfaces (TEST to use in pin few chips). The data or the instruction (test data input) move from TDI; The serial data (test data output) emigrates from TDO; TCK (tests clock) to take the clock signal input; TMS (test pattern choice) signal control TAP controller’s condition. May move in the instruction and the data using this connection, thus the control objective chip’s address wire and the data line, achieves reads/writes goal chip Flash and the simulation debugging goal. Moreover, TI Corporation has promoted new debugging connection - - SPY-BI-WIRE. It uses two systems, for data line (bidirectional), another for clock line.

        Using this connection’s merit is, does not need to design the extra electric circuit and the procedure, uses the simulator then to download the procedure. The shortcoming is once user to guarantee that the code the security, has burnt out the JTAG fuse, then on permanently destroyed this connection, could also not use this connection again.

    2 using the BSL firmware
        BSL is the Bootstrap Loader abbreviation, Chinese name is “the procedure loading bin”. Its essence is the solidification (takes OC00h~1000h in a chip section of signal procedure the address space), uses it to be possible to realize to the Flash cleaning and reads/writes. Because it is the solidification in the chip, therefore does not need to worry that is changed or the loss.

        This connection uses 5 lines: GND, TX(P1.1/P1.0), RX(P2.2/P1.1), RST and TCK(TEST). Adds the specific level succession signal on RST and TCK(TEST), then starts the BSL procedure, thus realizes with the goal chip correspondence. The correspondence character format is 8 data positions, 1 stop position and 1 partner verifies the position. The outset baudrate is 9 600 bps (the BSL 1.6 editions may change is 38 40O bps). The BSL agreement request first receives a 80h character to use in the synchronized clock; Then transmission reply character 90h; Finally receives 8 characters, and skips according to the order to the corresponding processing routine. BSL the procedure C language description is as follows:
       

        It possibly realizes the detail different to have the change because of the edition. If the user wants to use it to realize the procedure to promote, then may see reference [2] and [3]. Carries on the promotion using the BSL procedure, the merit is saves the code space, the user does not need to realize own promotion firmware, moreover the present had the ready-made BSL promotion tool; The shortcoming is must reserve the BSL connection, and needs the scene wiring.

    3 using user from definition promotion firmware
        MSP430 the series monolithic integrated circuit’s Flash memory module is physics memory cell which may operate independently. The complete module arrangement in the identical linear address space, the memory is divided into many 512 byte sections (information section size is 128/64 byte). Each section may clean alone, and may carry on the normal work voltage farewell gift of food foreword to Flash scratches writes the operation, therefore the especially qualify online procedure promotes (In Systerrl Programming).

        Is the built-in section uses from the definition promotion firmware in the procedure promoting the application procedure code, then uses the existing correspondence connection to carry on the long-distance code the promotion. It realizes the principle is lays aside two sections of codes in the goal chip: A section for application procedure; Another section as promotion procedure. Both’s address section does not overlap, like this may use the promotion procedure cleaning application procedure, and reads in the new code.

    3.1 vectoring procedures
        After the replacement, enters the vectoring procedure advanced, by it decided that enters the promotion procedure or the application procedure. Vectoring procedure’s significance lies, when the application procedure does not have or presents the mistake can enter the promotion procedure directly, thus guaranteed, if the promotion is not successful may carry on promotes once more.

        Vectoring procedure’s description is as follows:

       
        And: The ResetVectorvalid() function uses in examining the application procedure whether to exist or whether effective. Realizes may examine EnterApplication the entry point address to be whether legitimate, one kind of simple realization is:
    #define ResetVectorValid() (RcsctVector! =FFFF)
    And: ResetVetor is the application procedure entry point address, this address usually places in a fixed address, after promotion procedure, revises this entry point address again. Application() is the application procedure, if it will carry out normally will not return, only then after receiving the promotion instruction only will then return with. May use the return sentence in Application() to enter the promotion procedure.

        Updata() is the promotion procedure, its entrance must add the sense command, confirmed that enters the promotion procedure normally. After entering the promotion procedure, the correspondence end should transmit the cleaning instruction first, the cleaning original code; Then the transmission promotion code renews Flash. If has the exterior expanded memory unit or the user program is small, then may receive the entire segment first, if verifies correctly reads in again, such reliability can be higher.

        Here has a strategy is, cleans first contains ResetVector the block, finally reads in Resetvector the value, like this may guarantee as far as possible cannot enter the incomplete application procedure.

    3.2 application procedure compilation
        The application procedure’s compilation throws has the big change, only need join in the communication protocol from a definition promotion order, enters the promotion procedure. Moreover, must change the chained file (*.XCL), assigns the application procedure the address range. (What the address range is the 2500h~F7DCh application procedure as follows falls with // annotation is default setting):
       

        After the revision finished, increased this document to the project. After translation code then as promotion code.

    3.3 promotion procedure compilation
        The newly built project, will promote according to the above method the code to locate to with the application procedure not overlap region (for example F800h~FFFFh), this time does not revise: Z(CONST)INTVEC=FFE0-FFFF

        In the promotion procedure, will map in the application procedure besides replacement interrupt’s all interrupts. One method inserts the assembly, uses the assembly localization instruction ORG; Another kind writes 15 interrupt mapping function. For example:

    // maps the interrupt vector address


        Moreover may also use the dynamic determination interrupt entry point address the method, soon the interrupt vector address puts in agrees in good RAM. For example:

       
        Then carries on the interrupt vector in the application procedure the mapping, for example: mtvecl[TIMERA0_VECTOR/2]=Timer_A_O; Namely when the TIMERA0 interrupt carries out Timer_A_0() function. Does the merit is may when the movement dynamic decision interrupt function entrance, like in higher order language empty function (Virtual Function).
        After these two function block compilation finished, then carried on the project test.

    3.4 application procedures and the promotion procedure also complete
        If needs two functions to complete in a project, then besides the revision chained file, still needs to pay attention to the following several points:
        ①Will promote procedure all functions to locate to rises to give the procedure space, namely adds the following localization instruction in front of the Ningpo number:
        #pragma locanon= ” UPDATECODE “
                        //UPDATECODE as promotion procedure in section name

        ②The revision function returns transfers routine. When function returns will transfer springs register’s default routine, but these routines possibly not in the promotion procedure’s address will ask spatially. One solution is uses the translation environment production the LST document (assembly code), revises when one by one function returns transfers springs the register routine, then guaranteed that both code is independent. Does this after the shortcoming is each time changes the C language code, must revise the assembly code, is quite tedious. Another method is considered the promotion procedure the work is the receive and the transmission data, generally does not need to use the interrupt. This may before promoting the function to join a monitor compilation order. Indicates this function for the atom manipulation. This class function entrance presses in SR and the disable interrupt first, when the returns uses RETI to return. This time the compiler does not transfer the routine to spring preserved the register, but according to enters the stack situation to spring the register one by one.

        ③Changes the switch sentence. Uses when the switch sentence the compiler will also have the default routine transfer. Very difficult to shield, therefore only then revises switch for many judgment sentences.

    Conclusion
        This article carried on to the MSP430 series monolithic integrated circuit’s promotion plan introduced in detail that the reader only need defer to certain step, then with ease realized the long-distance procedure to promote, this had the important meaning in the practical application; Not only moreover this article promotion method and is restricted in the MSP430 series, may also apply in the similar monolithic integrated circuit series.

    Share/Save/Bookmark

    Thursday, September 25th, 2008 at 23:24
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