MS430G2755 Code transplantation process for MSPBoot
[Copy link]
1 Generation of MS430G2755 CMD file
First, use the Per tool to generate CMD files (Generating Linker Files). The Per tool will generate two CMD files, one for the MSP430G2755 Bootloader and the other for the MSP430G2755 application. The operation instructions are as follows:
C:\Users\a0223791\Desktop\MSP430-BSL-IAP\MSPBoot_1_01_00_00\linkerGen>perl MSPBo
otLinkerGen.pl -file lnk_msp430G2755_Uart_1KB -devMSP430G2755-params 0x8000 0x
FFE0 0xFC00 48 6 0x1100 0x20FF 0x80 0x1000 0x10BF
There are several important parameters described as follows:
<0x8000> = Start address of Flash/FRAM
For MSP430G2553 , the address is 0xC000 , while the address of MSP430G2755 needs to be modified to 0x8000
<0xFFE0 > = Address of interrupt vector table
The interrupt vector table address is 0xFFE0 , which is the same for MSP430G2553 and MSP430G2755
<0xFC00> = Start address of Bootloader
The starting address of the bootloader is 0xFC00 , which is the same for both
<48 > =Size of the proxy table
The 48 here corresponds to 12 interrupt vectors, each of which occupies 4Byte
<6> = Size of shared vectors
There are 3 interrupt vectors ( P1/Time/Dummy ) in the application , each interrupt vector occupies 2Bytes, and the corresponding parameter is 6
<0x1100> = Start address of RAM
The starting address of RAM also needs to be modified to 0x1100 of MSP430G2755
<0x20FF > = End address of RAM
The end address of the RAM also needs to be modified to 0x20FF of the MSP430G2755
= Size of the stack
The default stack size of MSP430G2755 is 0x80
<0x1000> = Start address of info memory used for bootloader
The start and end addresses of information are the same for MSP430G2553 and MSP430G2755 , so no modification is required.
<0x10BF > = End address of info memory used for bootloader
The start and end addresses of Information are the same for MSP430G2553 and MSP430G2755 , so no modification is required.
Note the modified parameter 6 and the number of interrupt vectors. The interrupt vectors in the Bootloader do not need to be modified. Only the interrupt vectors in the MSP430G2755 application App need to be modified. The following figure shows the distribution of interrupt vectors in the Bin file.
Figure 2 MSP430G2755 interrupt vector
Figure 3 MSP430G2755 Bin file corresponding to the virtual interrupt vector table
Note that 809C and 80E2 here correspond to P1_Isr and Timer_A, GPIO interrupt and timer interrupt in the MSP430G2755 application. The figure below shows the distribution of the virtual interrupt vector table in the MSP430G2755 Bootloader.
Figure 4 MSP430G2755 Bootloader Virtual Interrupt Vector Table
2. Add the project CMD file
Add the CMD file generated in step 2.1 to the MSP430G2755 Bootloader and application App projects, as shown in the following figure.
Figure 5 MSP540G2755 CMD file
Please note that if you are using the TI default MSP430G2553 project, you need to select the device model of the original project as MSP430G2755 , delete the G2553 CMD file that comes with the MSP430G2755 , and use the CMD file generated for MSP430G2755 .
3 Application txt conversion c file
Compile the MSP430G2755 application using the CCS compiler . After the compilation is completed, a txt file will be generated for download. We need to convert this generated txt file into a .c file so that this .c file can be used by the main control MCU and downloaded to the MSP430G2755 through the Bootloader . The conversion and running instructions are as follows:
C:\Users\ a0223791\Desktop\MSP430-BSL-IAP\G2755_Porting\MSPBoot_1_01_00_00\430txt
_converter>430txt2C.pl App1_MSPBoot.txt AppForHostG2755.c App1
Through this step, the generated .c file is added to the main function file path in the main MCU. Here, the main MCU we tested is MSP430G2553 . The program after adding is shown in the figure below.
Figure 6 Host MCU adds upgrade program
4 Write CRC check address information
In the previous step, we added the application that needs to be upgraded in the main control MSP430G2553 . At the same time, we also need to modify the CRC address information of the target upgrade chip ( MSP430G2755 ) in the main MCU. The modification reference is as follows:
Figure 7 MSP430G2553 adds CRC address information
Note that the CRC generation tool in the MSPBoot User Guide is no longer needed to perform the CRC check. We can see that the CRC check is actually calculated directly in the main MCU and the CRC value is placed in the specified location.
Figure 8 MSP430G2553 calculates CRC value
5 Modify the MSP430G2755 application
Here we tested changing the default UART ports P1.1 and P1.2 of MSP430G2553 to the UART ports P3.4 and P3.5 of MSP430G2755 . The actual reference code is as follows:
Figure 9 MSP430G2755 UART port modification
Special attention should be paid to the fact that in the MSP430G2755 application App, there are two interrupts used by default, namely, the P1 port and the timer interrupt. The P1 port and the timer interrupt cannot be directly shielded, which will cause the MSP430G2553 to fail to start the application normally after the host master MSP430G2553 successfully upgrades the MSP430G2553 . If these two interrupt vectors are not needed in the application, the parameter <6> = Size of shared vectors needs to be modified in the first step of generating the CMD file.
|