
16
Netra CP3010 Board Programming Guide
• January
2006
uflash_blockerase() {
/* erase 2 blocks starting from block 1 of user flash */
uf0.blk_num = 1;
uf0.num_of_blks = 2;
if (ufd0 && ioctl(ufd0, UIOCEBLK, &ufif0) == -1 ) {
perror("ioctl(ufd0, UIOCEBLK): ");
return(-1);
}
printf("\nblockerase successful on %s\n", uflash0);
return(0);
}
main() {
int ret;
module = argv[0];
ret = uflash_init();
if (!ret)
uflash_blockerase();
uflash_uninit();
}
CODE
EXAMPLE
2-5
Block Erase Action on Flash Device
(Continued)