我用的是H-jtag,我和H-jtag的作者21大侠确认过他的代码,如下:
U32 func1_read_id(U32 sysbase)
{
U32 id;
U16 mid;
U16 did;
*SysAddr16(0x0, 0x5555) = 0x00F0; //将值0x00F0写到FLASH的地址0x5555
*SysAddr16(sysbase, 0x5555) = 0x00AA;
*SysAddr16(sysbase, 0x2AAA) = 0x0055;
*SysAddr16(sysbase, 0x5555) = 0x0090;
mid = *SysAddr16(0x0, 0x0);
did = *SysAddr16(0x0, 0x1);
id = mid | (did