[En-Nut-Discussion] At91EfcRegionUnlock et al lockup

Coleman Brumley cbrumley at polarsoft.biz
Tue Sep 8 15:28:23 CEST 2015


I've come across a peculiar issue with
At91EfcRegionUnlock/At91EfcRegionLock/At91EfcSectorWrite on the

When my board is "fresh" out of flash from SAM-BA, I'm able to use the
At91Efc functions to write a new firmware image to flash. However, once that
process is complete, that same process will freeze upon either a call to
At91EfcRegionUnlock or At91EfcSectorWrite. It seems as if the EFC is locked
out completely. 

Here is the code I'm using. IMAGE_OFFSET is 0x00, and offset and pos are
calculated accordingly. 

if (At91EfcRegionUnlock(IMAGE_OFFSET + offset + pos) == 0)	{
	rc = At91EfcSectorWrite(IMAGE_OFFSET + offset + pos, &buffer[pos],
	At91EfcRegionLock(IMAGE_OFFSET + offset + pos);

Does anyone have any ideas about what state SAM-BA leaves the EFC in after
it's used to flash the board? And, if so, how can I emulate that in code?

Thanks in advance.

Best Regards,

More information about the En-Nut-Discussion mailing list