This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2650片上flash读写问题

Other Parts Discussed in Thread: CC2650, CC2640R2F

CC2650片上flash读写,为什么有时候能正常读写有时候不行呢?

硬件:CC2650LaunchPad

	uint8_t bBuf[4] = {0};
	uint_least32_t dstAddr = 0x10000;
	uint32_t word = 0x12345678;
	FlashSectorErase(16 * BASELOADER_IPAGESIZE);
	
	FlashProgram((uint8_t *) &word, dstAddr, 4);
	memcpy(bBuf, (uint8_t *)(dstAddr), 4);
	Display_print1(dispHandle, 0, 0, "0x10000 = %x", bBuf[0]);
	Display_print1(dispHandle, 0, 0, "0x10001 = %x", bBuf[1]);
	Display_print1(dispHandle, 0, 0, "0x10002 = %x", bBuf[2]);
	Display_print1(dispHandle, 0, 0, "0x10003 = %x", bBuf[3]);
	
	CPUdelay(800000*50);
	dstAddr = 0x10004;
	word = 0x99999999;
	FlashProgram((uint8_t *) &word, dstAddr, 4);
	memcpy(bBuf, (uint8_t *)(dstAddr), 4);
	Display_print1(dispHandle, 0, 0, "0x10004 = %x", bBuf[0]);
	Display_print1(dispHandle, 0, 0, "0x10005 = %x", bBuf[1]);
	Display_print1(dispHandle, 0, 0, "0x10006 = %x", bBuf[2]);
	Display_print1(dispHandle, 0, 0, "0x10007 = %x", bBuf[3]);

下面是打印出来的结果:

// 烧写后第一次单步执行结果:
APP init
0x10000 = 78
0x10001 = 56
0x10002 = 34
0x10003 = 12
0x10004 = 99
0x10005 = 99
0x10006 = 99
0x10007 = 99
--------------
// F5直接跑或硬件复位的执行结果:
APP init
0x10000 = 78
0x10001 = 56
0x10002 = 34
0x10003 = 12
0x10004 = ff
0x10005 = ff
0x10006 = ff
0x10007 = ff
--------------