Hi,
I have written a BSL for MSP4305529 which is used to program the main application of the MCU over UART. In BSL I am not making use of any interrupt vectors and everything is done using the polling mechanism.
Here I am not making use of the BSL memory in the flash as I need to implement this system on MSP430G2403 (which does not have the BSL memory). So My BSL sits at the location 0xF800 .
I am sending the TI-txt file's bytes through UART and receiving the same on the MCU's BSL and writing the same on the flash's memory that I have allocated for the main application i.e 0x4400-0xF7FF (This I am configuring through the linker file lnk430f5529.xcl). I am writing the interrupt vectors of the main application in the corresponding locations except the reset vector (It always remains the BSL's).
On boot up I am handing over the control from the BSL to main applicatoin using a simple branch operation,
i.e asm("br #0x4400");
But the main application is not working as expected. If I take the memory dump after programming I can see the data in the flash is exactly same as that of TI-txt file.
what could be the problem with this. (For smaller programs like UART checking program and flashing LED program its working fine)
Thanks & Regards,
cbn
Hi chethu,
As I mentioned before, if you don't mind triggering a mass-erase if someone enters the wrong password, you can still use the ROM BSL as-is. Or you can set it up so that the flash is not erase if someone enters the wrong password.
Also I believe there is a "loadable" BSL available from TI somewhere where you can perform a more controlled load of the BSL.
Cheers,
Tony
Hi Chethu,
You have basically two options for securing your code.
Option 1: program in your code, disable the BSL, and blow the fuse. There is no way anyone (even you) can get into the part for read or write.
Cons: hard to debug issues if they arise in production - can't get into the part to see what data is saved there, and, no possibility of field updates or patches.
Option 2: Program in your code and blow the fuse, or just blow the fuse, and set your password on the BSL. Now you can load code through the BSL, read it out if there is some problem in production and you want to check things or change your code, and provide field updates/patches to your code in the future. No one can get in unless they know the password you set, and they won't get in by brute force because after the first bad password the part will be mass erased.
Cons: have to provide access to BSL pins with proper hardware.
I usually recommend Option 2 - being able to do field updates to your code or being able to fix code on boards already produced when you discover a coding issue is usually a pretty valuable feature.
Regards,
Katie
Please click the Verify Answer button on this post if it answers your question.
Hi TonyKao,
TonyKaoOr you can set it up so that the flash is not erase if someone enters the wrong password.
Yes, this option is useful but as Katie Enderle mentioned, this can be broken easily with a brute force. Since the data stored in the flash is quite sensitive in nature I should opt for the other option with BSL security password setting where the flash will be mass erased in case of wrong password.
Katie Enderle I usually recommend Option 2 - being able to do field updates to your code or being able to fix code on boards already produced when you discover a coding issue is usually a pretty valuable feature.
Thanks for your explaination Katie Enderlie. I should go with your Option 2.
For security, I would worry about the TI-txt file too. It can be encrypted and the BSL inside the MSP chip should do the decryption. (Not the PC.)
Hi old_cow_yellow,
I am only concerned about the integrity of BSL and the security data required by the BSL. The application to be programmed using my BSL is a third party firmware, so I shall supply the controllers to third party with "BSL programmed + ROM BSL is password protected + JTAG is blown. The vendor/third party will take care of programming his firmware using my BSL.
Please let me know if this scenario excepts your suggestion.