|
I am not understanding how to unlock memory regions in sam7x.
Per data sheet:
• The Flash Command register must be written with the following value:
(0x5A << 24) | (lockPageNumber << 8 & PAGEN) | CLB
lockPageNumber is a page of the corresponding lock region.
OK, but the FCM register is laid out out as such per data sheet that the PAGEN is bits 8 -17 so should the instruction be more like this: (0x5A << 24) | (lockPageNumber << 8 & PAGEN<<8) | CLB So are the first 4 bits the region and the rest the page?
Do I need to unlock every page in the region to unlock the region or just one page? secondly; Instead of programming this in code, couldn't I do this via sam-ba script file. IF I run the sam-ba exe it prompts me to "unlock locked regions before programming". I tried to record the script file, but those commands it uses are not shown. I am already using a script file for production, so if I could figure out how sam-ba is doing this through its interface and then just do the same thing in my script it would be easier.
|