Dana Echtner <firstname.lastname@example.org> wrote:
I’ve discussed this with Dana via email. If you can’t reload with RTP, one
way to restore the flash and eliminate any hardware problems is to use the
FlashFX utilities for QNX or DOS and reformat the flash. When she tried
this, she said it formatted fine. Take care that the total image you
create isn’t too large to fit onto the flash (ie. boot image < 512K, total
image < 8M).
Well, it sort of worked.
Under DOS it formats fine, looks file, works fine, but as soon as I boot
into QNX and use flashctl over qnet to erase the flash I get the “erase
protect error” again. I’ve tried
FXFMT 80 /p64k
FXRECLM and both worked fine, but it doesn’t fix my problem.
(the problem being that doing an erase with flashctl fails with “erase
protect error” and a cp of an image freezes at 70-some percent. (I assume
at the same place as the erase protect error))
I’m still futzing with it but not really getting anywhere.
Dana Echtner \ Real-Time Systems Administrator
email@example.com > / ECE, Concordia University, Montreal, Canada
What type of flash is on the Elan 104 board? If it’s Intel, I’ve seen other
situations where Intel flash somehow gets certain sectors locked, such that
they can’t be erased.
If it’s Intel, the following program will unlock the flash. It assumes
a single 16 bit, 8MB flash part, mapped to address 0xff000000.
You’ll need to change your defines accordingly.
Also, if your flash is interleaved, or a different bus width, you’ll need to
change the pointer size, etc.
#define REGION1 0xff000000
#define FLASHSIZE 0x800000
// function prototypes
void* Map_Physical(unsigned long, unsigned long);
void* Map_Physical(unsigned long region, unsigned long size)
// Open physical memory
fd = shm_open(“Physical”, O_RDWR | O_CREAT, 0777);
if (fd == -1)
fprintf(stderr, “Open failed:%s\n”, strerror(errno));
// Map specified region
addr = mmap_device_memory(0, (size_t)size, PROT_READ | PROT_WRITE | PROT_NOCACHE,
if (addr == (void *) -1)
fprintf(stderr, “mmap failed : %s\n”,strerror(errno));
void unlock_flash(void *addr)
unsigned short *s = (unsigned short *)addr;
s = 0x0060; // send unlock_device command to flash
s = 0x00d0;
Dave Green (firstname.lastname@example.org)
QNX Software Systems Ltd.