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.
Tool/software:
We are having some problems with password CRC verification when programming the MSP430F67791A using UniFlash in BSL (Bootloader) mode.
This is very similar to the following ticket:
MSP430FR2433: Trouble programming memory through BSL using Uniflash
Tools/Equipment Used
Description
Hopefully the following example highlights the issue:
Passwords
V1.0 password data is as follows:
@FFE0
E0 C0 DE C0 FF FF FF FF DC C2 7E C2 DC C0 B0 C1
84 C0 38 C0 FF FF 20 C2 FF FF FF FF FF FF 00 C0
q
V1.1 password data is as follows:
@FFE0
E0 C0 DE C0 FF FF FF FF E0 C2 82 C2 DC C0 B0 C1
84 C0 38 C0 FF FF 24 C2 FF FF FF FF FF FF 00 C0
q
As expected, some bytes are different between the 2 passwords.
UniFlash Settings
"test_V1.0.txt" was already loaded at this point and we select the password file for V1.0 software.
"test_V1.1.txt" is selected to be loaded into the device, which will overwrite V1.0 software.
My understanding is that the selected Password file must match the password data currently programmed into the device - so in this case the password data for V1.0 software.
CRC Failure
When the device is programmed with V1.1 software and verified, there is a failure at address 0xFFE0, which is the password address:
UniFlash expects the password CRC to be 0xA366, but the device's Bootloader calculates and returns 0xFB55.
I decoded the transfer to/from the device using the MSP430 Flash Devices Bootloader (BSL) document, which shows the command and response as follows:
So, UniFlash uses the password file for "test_V1.0.txt" software (which is currently loaded into the MSP430) and verifies that the password matches the currently loaded software (PASS).
Then the new software "test_V1.1.txt" is programmed into the MSP430 (PASS).
Then the verification (memory check) stage happens (FAIL), where the password check fails.
CRC Calculation
I used the the online crccalc tool to calculate the expected CCITT CRC for the old and new passwords.
V1.0 (old) password = 0xA366
V1.1 (new) password = 0xFB55
Conclusion
I think that the UniFlash tool uses the provided password file data to check against the currently loaded software (OK), but also uses it to check against the new software being loaded (not OK).
This is partly based on the console output from UniFlash when in "verbose" mode:
[2/10/2025, 6:55:02 PM] [ERROR] MSP430: CRC check at 0xFFE0 does not match; expected value: 0xA366 obtained from BSL: 0xFB55
When verifying the new code, it expects the CRC to be 0xA366 (but this is the old password CRC) and obtains 0xFB55 from the device (this is the correct, new CRC).
Is UniFlash using the old password's CRC to check against the new programmed password data?
Hopefully that all makes sense,
Thanks
Hi Eric,
I will check internally about the Uniflash password CRC verification logic. A question about your application:
Is it a necessary requirement that the old image and new image use different password?
Best Regards,
Pengfei
Hi Pengfei,
Thank you for your quick response.
It depends on what the differences are between the old and new software versions.
Because the password data is effectively the addresses of the interrupt vectors in the software, the password data often changes, depending on what has been modified in the new software release.
To ensure the password is always the same, I think we would have to hard-code the addresses of each interrupt vector, which is not our preferred option.
Best Regards,
Eric
Hi Eric,
Thanks for your information. I will check internally.
Best Regards,
Pengfei
Then the verification (memory check) stage happens (FAIL), where the password check fails.
Have you change the password of test_V1.1.txt when you try to download at the second time?
Due do the password is located at the address of the interrupt table if a new firmware be downloaded for the interrupt table normally changed, so you need different password to access the BSL
Hi Gary,
Thanks for your question.
I think the only way UniFlash will indicate a successful "verification" of programmed software into an MSP430 is either:
For the first point, we can't really assume that that interrupt vector data never changes, and therefore we can't assume the password never changes.
For the second point, programming the software twice (firstly using the password for the old file, secondly using the password for the new file) will finally result in UniFlash providing no verification errors (the first time it will provide an error), but this seems very much like a workaround. Based on my analysis (original post), UniFlash programs the software into the device correctly, but the "verification" check fails, and I believe it fails because it's not verifying against the correct 32 bytes of data (old vs new).
I believe the process should be this:
Anyway, that's my understanding of the current UniFlash behaviour versus what I think it should do.
But I could be wrong - I hope the post made sense.
Best Regards,
Eric
I think you are right, for a more reliable way is that you can capture the wave form directly by a logic analyzer like saleae that will be more clear.
**Attention** This is a public forum