/* **测试关机写功能, 需要重新出版本将NV 0xD007的优先级设置为1~6 */ u32 nv_flush_test_00(void) { u32 ret = 0; u32 nvid = 0xD007; u32 data = 0; u32 new_data = 0; ret = bsp_nvm_read(nvid, (u8 *)&data, sizeof(u32)); if(ret) { printf("1111 ret = 0x%x\n", ret); return ret; } data+=2; ret = bsp_nvm_write(nvid, (u8 *)&data, sizeof(u32)); if(ret) { printf("2222 ret = 0x%x\n", ret); return ret; } /*关机写接口*/ ret = bsp_nvm_flush(); if(ret) { printf("3333 ret = 0x%x\n",__func__,ret); return ret; } ret = nv_resume_ddr_from_img(); if(ret) { printf("4444 ret = 0x%x\n", ret); return ret; } ret = bsp_nvm_read(nvid, (u8 *)&new_data, sizeof(u32)); if(ret) { printf("5555 ret = 0x%x\n", ret); return ret; } if(new_data != data) { printf("6666 new_data = 0x%x, data = 0x%x\n", new_data, data); } return NV_OK; }
BSP_U32 NV_Flush(BSP_VOID) { return bsp_nvm_flush() & NV_RESULT_CODE; }