slau358q.pdf - 第94页

MSP-GANG.dll Description www.ti.com 94 SLAU358Q – September 2011 – Revised October 2019 Submit Documentation Feedback Copyright © 2011–2019, Texas Instruments Incorporated Dynamic Link Library for MSP-GANG Programmer 4.2…

100%1 / 142
www.ti.com
MSP-GANG.dll Description
93
SLAU358QSeptember 2011Revised October 2019
Submit Documentation Feedback
Copyright © 2011–2019, Texas Instruments Incorporated
Dynamic Link Library for MSP-GANG Programmer
4.2.26 MSPGANG_SelectImage
MSPGANG_SelectImage sets the active image to work with. MSP-GANG supports up to 96 images
images. Image numbers (image size 64 kB each) are compatible with the old image numbering (0-15) that
are 512 kB each. New image numbering style:
b7=1 - new numbering: force the new standard; for example, set b7=1 when subimage number = 0
b6-b4 - subimage number
b3-b0 - image number (0-15 = image 1-16)
Examples:
b7 b6-b4 b3-b0
1 2 4 (image 5.2) (new numbering - when erased: one sector, 64kB)
0 0 4 (image 5) (old numbering - when erased: eight sectors, 512kB)
0 2 4 (image 5.2) (even without b7=1, new numbering; when erased, one sector, 64kB)
Old image New image numbering In GUI
numbering
0 0x80 or 0, 0x90, 0xA0, 0xB0, 0xC0, 0xD0, 0xE0, 0xF0 1.0, 1.1, 1.2, 1.3,...
1 0x81 or 1, 0x91, 0xA1, 0xB1, 0xC1, 0xD1, 0xE1, 0xF1 2.0, 2.1, 2.2, 2.3,...
2 0x82 or 2, 0x92, 0xA2, 0xB2, 0xC2, 0xD2, 0xE2, 0xF2 3.0, 3.1, 3.2, 3.3,...
3 0x83 or 3, 0x93, 0xA3, 0xB3, 0xC3, 0xD3, 0xE3, 0xF3 4.0, 4.1, 4.2, 4.3,...
4 0x84 or 4, 0x94, 0xA4, 0xB4, 0xC4, 0xD4, 0xE4, 0xF4 5.0, 5.1, 5.2, 5.3,...
5 0x85 or 5, 0x95, 0xA5, 0xB5, 0xC5, 0xD5, 0xE5, 0xF5 6.0, 6.1, 6.2, 6.3,...
6 0x86 or 6, 0x96, 0xA6, 0xB6, 0xC6, 0xD6, 0xE6, 0xF6 7.0, 7.1, 7.2, 7.3,...
7 0x87 or 7, 0x97, 0xA7, 0xB7, 0xC7, 0xD7, 0xE7, 0xF7 8.0, 8.1, 8.2, 8.3,...
8 0x88 or 8, 0x98, 0xA8, 0xB8, 0xC8, 0xD8, 0xE8, 0xF8 9.0, 9.1, 9.2, 9.3,...
9 0x89 or 9, 0x99, 0xA9, 0xB9, 0xC9, 0xD9, 0xE9, 0xF9 10.0, 10.1, 10.2, 10.3,...
10 0x8A or 10, 0x9A, 0xAA, 0xBA, 0xCA, 0xDA, 0xEA, 0xFA 11.0, 11.1, 11.2, 11.3,...
11 0x8B or 11, 0x9B, 0xAB, 0xBB, 0xCB, 0xDB, 0xEB, 0xFB 12.0, 12.1, 12.2, 12.3,...
12 - used for read only if the flash image is not used for internal firmware
13 (transition time)
14 --,,,---
15 --,,,---
Syntax
LONG MSPGANG_SelectImage(LONG lImage)
Arguments
LONG lImage Image number (0 to 0xFB)
Result
LONG Error code
MSP-GANG.dll Description
www.ti.com
94
SLAU358QSeptember 2011Revised October 2019
Submit Documentation Feedback
Copyright © 2011–2019, Texas Instruments Incorporated
Dynamic Link Library for MSP-GANG Programmer
4.2.27 MSPGANG_EraseImage
MSPGANG_EraseImage clears (presets with 0xFF) active image memory. Use the
MSPGANG_SelectImage function to select desired image memory.
Syntax
LONG MSPGANG_EraseImage(void)
Result
LONG Error code
4.2.28 MSPGANG_CreateGangImage
MSPGANG_CreateGangImage creates a command script and the data to be written to target devices
according to current MSP-GANG configuration. After the image data is prepared, then it can be saved in
the selected image memory by calling the MSPGANG_LoadImageBlock function.
Syntax
LONG MSPGANG_CreateGangImage(LPTSTR name)
Arguments
LPTSTR name Image name; maximum of 16 characters. Image name is displayed on the LCD display.
Result
LONG Error code
www.ti.com
MSP-GANG.dll Description
95
SLAU358QSeptember 2011Revised October 2019
Submit Documentation Feedback
Copyright © 2011–2019, Texas Instruments Incorporated
Dynamic Link Library for MSP-GANG Programmer
4.2.29 MSPGANG_LoadImageBlock
MSPGANG_LoadImageBlock saves the previously prepared image contents into the selected image
memory. The selected image memory is automatically erased first (MSPGANG_EraseImage is called
automatically, your application code does NOT need to call it explicitly). Use the following sequence for
preparing and saving an image into image memory:
MSPGANG_CreateGangImage(name);
MSPGANG_SelectImage(lImage);
MSPGANG_EraseImage();
MSPGANG_LoadImageBlock();
MSPGANG_VerifyPSAImageBlock();
Syntax
LONG MSPGANG_LoadImageBlock(void)
Arguments
None
Result
LONG Error code
NOTE: Do not overwrite images unnecessarily during production
The image flash memory has a specified 10000 endurance cycles. Therefore, over the
lifetime of the product, each image can be reliably reprogrammed 10000 times.
Reprogramming images should be done once per production setup, rather than per
programming run. Reprogramming the image per programming run will quickly exhaust flash
endurance cycles and result in errant behavior.
//Ideally, load image once per setup. Reduce programming time and save flash endurance cycles.
//Loading an image usually takes longer than full target device programming.
MSPGANG_CreateGangImage(...);
MSPGANG_LoadImageBlock();
...
do
{
...
MSPGANG_MainProcess(...);
...
} while(...);
//Avoid loading image inside loop if possible.
//Loading image per programming cycle wastes time and quickly uses up flash endurance cycles.
do
{
MSPGANG_CreateGangImage(...);
MSPGANG_LoadImageBlock();
MSPGANG_MainProcess(...);
} while(...);