AnsweredAssumed Answered

FlexNVM Dflash Read issue on K64FX512

Question asked by Andy Hsu on Mar 26, 2020
Latest reply on May 26, 2020 by Ian Chalinder

K64FX family includes a FLEXNVM and FLEXRAM. 

I tried to write and read the FLEXNVM flash, I assessed and programmed  the piece of space of flash, 

Before program it, I erase  a section space and assign it from address 0x1001f00 to 0x10020000.

Writing data values are 1, 2, 3,..., 32 and data size is 32 into flash. 

It should be address 0x1001f00 is 0x01, 0x1001f001 is 0x02,.., 0x1001f07c is 0x1f.

 

I read the flash directly and code is show below,

 

destAdrss  = 0x1001f00 ;

/* Verify programming by reading back from flash directly*/
for (uint32_t i = 0; i < 32; i++)
{
    s_buffer_rbc = *(volatile uint32_t *)(destAdrss + i * 4);

   PRINTF("addr: %x, s_buffer_rb: %x, s_buffer: %x\r\n", (destAdrss + i * 4), s_buffer_rbc, s_buffer[i]);
}

 

Unfortunately, I get wrong reading back ..... The top 8 bytes is correct, after  8rd is wrong and the value is 0xffffffff.

 

What is the wrong in my code?

 

 

************************************************
---- PROGRAM STARTing ----
************************************************
FLEXNVM Example Start
FlexNMV DFlash Information:
FLEXNVM DflashBlock Base Address: 0x10000000
FLEXNVM Dflash Size: 128 KB (0x20000)

nFLEXNVM Dflash Sector Size: 4 KB (0x1000)
Flash is UNSECURE!
Erase a sector from address: (0x1001f000)
Successfully Erased Sector 0x1001f000 -> 0x10020000
Program a buffer to a sector of flash
addr: 1001f000, s_buffer_rb: 0, s_buffer: 0
addr: 1001f004, s_buffer_rb: 1, s_buffer: 1
addr: 1001f008, s_buffer_rb: 2, s_buffer: 2
addr: 1001f00c, s_buffer_rb: 3, s_buffer: 3
addr: 1001f010, s_buffer_rb: 4, s_buffer: 4
addr: 1001f014, s_buffer_rb: 5, s_buffer: 5
addr: 1001f018, s_buffer_rb: 6, s_buffer: 6
addr: 1001f01c, s_buffer_rb: 7, s_buffer: 7
addr: 1001f020, s_buffer_rb: ffffffff, s_buffer: 8
addr: 1001f024, s_buffer_rb: ffffffff, s_buffer: 9
addr: 1001f028, s_buffer_rb: ffffffff, s_buffer: a
addr: 1001f02c, s_buffer_rb: ffffffff, s_buffer: b
addr: 1001f030, s_buffer_rb: ffffffff, s_buffer: c
addr: 1001f034, s_buffer_rb: ffffffff, s_buffer: d
addr: 1001f038, s_buffer_rb: ffffffff, s_buffer: e
addr: 1001f03c, s_buffer_rb: ffffffff, s_buffer: f
addr: 1001f040, s_buffer_rb: ffffffff, s_buffer: 10
addr: 1001f044, s_buffer_rb: ffffffff, s_buffer: 11
addr: 1001f048, s_buffer_rb: ffffffff, s_buffer: 12
addr: 1001f04c, s_buffer_rb: ffffffff, s_buffer: 13
addr: 1001f050, s_buffer_rb: ffffffff, s_buffer: 14
addr: 1001f054, s_buffer_rb: ffffffff, s_buffer: 15
addr: 1001f058, s_buffer_rb: ffffffff, s_buffer: 16
addr: 1001f05c, s_buffer_rb: ffffffff, s_buffer: 17
addr: 1001f060, s_buffer_rb: ffffffff, s_buffer: 18
addr: 1001f064, s_buffer_rb: ffffffff, s_buffer: 19
addr: 1001f068, s_buffer_rb: ffffffff, s_buffer: 1a
addr: 1001f06c, s_buffer_rb: ffffffff, s_buffer: 1b
addr: 1001f070, s_buffer_rb: ffffffff, s_buffer: 1c
addr: 1001f074, s_buffer_rb: ffffffff, s_buffer: 1d
addr: 1001f078, s_buffer_rb: ffffffff, s_buffer: 1e
addr: 1001f07c, s_buffer_rb: ffffffff, s_buffer: 1f

Outcomes