45 uint32_t buf[WRITE_NBYTES/4];
48 uart_init(INC, MOD, SAMP);
50 print_welcome(
"nvm-write");
54 putstr(
"Detecting internal nvm\n\r");
56 err = nvm_detect(gNvmInternalInterface_c, &type);
58 putstr(
"nvm_detect returned: 0x");
60 putstr(
" type is: 0x");
68 err = nvm_erase(gNvmInternalInterface_c, type, 0x40000000);
69 putstr(
"nvm_erase returned: 0x");
73 err = nvm_write(gNvmInternalInterface_c, type, (uint8_t *)buf, WRITE_ADDR, WRITE_NBYTES);
74 putstr(
"nvm_write returned: 0x");
77 putstr(
"writing\n\r");
78 for(i=0; i<WRITE_NBYTES/4; i++) {
85 err = nvm_read(gNvmInternalInterface_c, type, (uint8_t *)buf, WRITE_ADDR, WRITE_NBYTES);
86 putstr(
"nvm_read returned: 0x");
89 putstr(
"reading\n\r");
90 for(i=0; i<WRITE_NBYTES/4; i++) {