LPC2103 Flash Verification

Started by bfang, March 12, 2007, 05:51:21 AM

Previous topic - Next topic

bfang

Flash Magic is a great tool! I've been using it for half a year and love it very much.  currently, I'm using it (command line) to program LPC2103. It always running smoothly. However, I have a few question and look forwad to a response ASAP?

1) VERIFY:
    I am using VERIFY command right after HEXFILE command. In this case, do you verify the code in RAM before it's written to Flash or read it out from Flash and compare to the data in hex file?

2) CRP:
    For code read protection, how do I know the code is read protected? If my code (hex file) already includes CRP code in 0x1FC (12345678), do I still need to set CODEREADPROCTECTION option when using Flash Magic?

3) SECURITY:
    How to use this command? I am using SECURITY comand right after VERIFY, and it shows CODEREADPROCTECTION: DISABLED. does that mean it's not CRPed or CRP code (12345678) is not in 0x1FC location? Do I need reset the chip to check the security status after flash programming and writing CRP location? Does ENABLED means CRP code is in 0x1FC or all code just cannot be read out?

Any help for these questions will be greatly appreciated!

Andy Ayre

Sorry I didn't reply earlier - in general we don't work on weekends.

1. Verify always reads the contents of flash.

2. If you don't pass the CODEREADPROTECTION option to Flash Magic, then it won't do anything special with that location in flash. Therefore your method should work as long as the value and byte ordering is correct. However I have never tried it or come across anyone doing it that way. If anyone has please post to the forum.

3. To test if the code read protection is enabled (by using the READSECURITY directive for example), Flash Magic sends the 'R' command to the bootloader. If it reponds with CODE_READ_PROTECTION_ENABLED then it returns the result that the protection is enabled. Therefore Flash Magic doesn't look at the contents of location 1FCH to find out what is there. Instead it relies on the device to indicate if CRP is enabled or not.

I am not sure if a reset is required to enable CRP. It probably is but the information should be in the user manual for the device.
Embedded Systems Academy, Inc.
support at esacademy dot com

bfang

Thanks a lot for you reply Andy! Now I understand the way you work on verification and CRP. Great help! I believe a reset is needed to enable CRP (if it is enabled without reset, there is no way to verify the flash after write CRP).

By the way, I won't disturb you on the weekends anymore!

Cheers!