This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi MSP430 Gang,
How do I verify the device checksum after programming an MSP430 w/ MSP-GANG using MSP430 dll? I see this API (VerifyPSAImageBlock) but it seems that this API is verifying that the image on the programmer is correct, not the image programmed into the device. Looking for the equivalent of the "Verify" button/step in the GUI.
Reference (http://e2e.ti.com/support/microcontrollers/msp430/f/166/t/332342 )
Thanks, Merril
JD Crutchfield said:Hey Merril,
I believe the MSPGANG_Get_Code_Info(WHOLE_CODE_CHECK_SUM) API will return what you are looking for. Can you test and confirm?
Thanks,
JD
The MSPGang_Get_Code_Info seems to calculate the checksum of the file that I load into the programmer, and not the contents of the device programmed. I can use the MSPGANG_Read_Code_File and then the MSPGang_Get_Code_Info, and it provides the checksum of the code, and the checksum matches the checksum shown in the MSP-Gang GUI. However, when I did this, I did not have any device connected to the programmer, so it could not have read out the device.
FYI - I am using a MSP430F2001.
So what I then tried was to use the MSPGANG_Interactive_Open_Target_Device, read the target using the MSPGANG_Interactive_DefReadTargets (Mask: 0x01,Start_addr: 0xFC00,End_addr: 0xFFFF), and then the MSPGang_Get_Code_Info. But this always returns a checksum of 0. I am not sure how to point the MSPGang_Get_Code_Info to the code read from the device, vs the Code loaded from the Read_Code_File.
Is the internal data buffer different than the internal buffer? (see bold text in the description of the two API functions below)
MSPGANG_Interactive_DefReadTargets
MSPGANG_Interactive_DefReadTargets reads the contents of the selected target devices (one to eight targets) simultaneously from Start_addr to the End_addr and saves it in the internal data buffer
MSPGANG_Read_Code_File
MSPGANG_Read_Code_File reads or appends a code file or reads a password file and saves it in its internal buffer.
Hey Kenny,
I've been communicating with some of our tools experts. You are correct, MSPGang_Get_Code_info only checks the firmware image on the Gang Programmer, not the target. I'm still checking if there is a way to determine the flash Check Sum in an interactive mode similar to the flow you suggested.
I did find out that to run only the verify process using MSPGANG_MainProcess(), you have to configure the Gang with the MSPGANG_SetTmpGANG_Config() function as so:
MSPGANG_SetTmpGANG_Config(CFG_TMP_TASK_MASK, (VERIFY_TASK_BIT + CONNECT_TASK_BIT)); Error = MSPGANG_MainProcess(20);
Thanks,
JD
The Verify task bit seems to be equivalent to "All Memory" within the MSP-Grang GUI.
There are memory options for just the Main memory when doing a verify via the GUI, but I cannot seem to locate the bit/mask that will enable this in the interactive process.
Hi,
The check sum can be read in the target using function
MSPGANG_Interactive_CS( LONG StartAddr, LONG EndAddr );
It should be specified the start address and end address where the CS is calculated. That CS can be not the same as the CS calculated from the code using function
MSPGANG_Get_Code_Info( parameter ) e.g. parameter -> WHOLE_CODE_CHECK_SUM -> 8., because MSPGANG_Get_Code_Info is calculating the specified data in the code file ignoring all empty spaces. In Flash usually that empty spaces are programmed as 0xFF.
The best way to verify the contents of the flash with code is to open the code file as the valid code (the same as was used for programming the MCU) and use the function VERIFY (similar to GO). That function will compare the used CS part of the code with the same parts of the code taken from the flash. The empty contents in code (empty - means not specified in the code file, not just the contents 0xFF) is not verified in the flash. That means - if some data like calibration, fix tables was saved and not erased during programming, would not be verified.
Without code file it is not possible to verify CS with code, because the gap in the code file is unknown. So - it is possible to read the CS in the defined range using the MSPGANG_Interactive_CS( LONG StartAddr, LONG EndAddr ); and check if the CS is the same on other units.
Let me know if you have any questions.
Best regards,
Gregory Czajkowski
Elprotronic Inc.
gregory@elprotronic.com
**Attention** This is a public forum