flashw -f /var/image.rom /dev/rom0 写/dev/rom0 时
error: could not allocate 0 bytes for buffer, errno=2 !!!!???
netflash -r /dev/rom0 /var/image.rom 时
又出现insufficient memory for image!!!?
哪位大侠实现过uclinux 内核+bios在线升级,
多谢指点!
#define AM_START_ADDR 0x02000000 -------因运行uClinux时Flash地址被映射到0x02000000
int earaFlash()
{
printf("Start easraFlash!\n");
*((volatile UINT16 *)AM_START_ADDR+ AM_ADDR_UNLOCK1) = AM_DATA_UNLOCK1;
*((volatile UINT16 *)AM_START_ADDR+ AM_ADDR_UNLOCK2) = AM_DATA_UNLOCK2;
*((volatile UINT16 *)AM_START_ADDR+ AM_ADDR_UNLOCK1) = AM_SETUP_ERASE;
*((volatile UINT16 *)AM_START_ADDR+ AM_ADDR_UNLOCK1) = AM_DATA_UNLOCK1;
*((volatile UINT16 *)AM_START_ADDR+ AM_ADDR_UNLOCK2) = AM_DATA_UNLOCK2;
*((volatile UINT16 *)AM_START_ADDR+ AM_ADDR_UNLOCK1) = AM_CHIP_ERASE;
printf("End easraFlash!\n");
return(0);
}