Hi,
I am using K70 Microcontroller - MK70FN1MOVMJ12.
I want to write DDR to Flash. I am using Flash driver - flash_kinetis.c (I tried latest driver , but it is not writing to the flash at all, so I have used old driver -atleast it writes into flash)
If I mention my flash start address 0x8000 and the length is 256 . It is writing the all the locations(every 0x100) except
0x80F00,0x81F00,0x82F00 etc
I dont know why the flash driver is not writing to the specific location 0x80F00 (next 256 data is only 0xFFFFFFFF),0x81F00 etc (I see AccErr when I debug).
My code is this:
***********************************************************************
length = 256;
ram_data = (unsigned long*)0x70000000;
for(mn=0;mn<256;mn++)
{
ram_data[mn] = mn;
}
length >>= 2;
for(original_address.complete = 0x80000;original_address.complete < 0x90000;original_address.complete = original_address.complete+0x100)
{
write_flash_ret = WRITE_FLASH_FUNC(original_address.complete, (LWord*)ram_data, length);
}
*****************************************************************************
Please have a look on the above and let me know your response.
Thanks,
Regards,
Kotteeswaran G S
Hi Kotteeswaran G S,
I have some validation code for your reference, if you think demo_normal is a little bit complicated , you may try the validation code, which is based on TWr-K70F120M.
Hope that helps,
Have a great day,
Kan
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hi,
Please note that I am using bare metal code and the observations are:
1.If length is 256, it is writing exactly 256 long words except for the address 0x80F00,801F00,802F00 etc (up to 256 long words)
2. If we add any lines (after flash write – kind of delay), it makes to write beyond 256 long words – say next 30-40 long words.
3. If the length is 128 ..it is writing up to 256 long words.(first 128 long words are correct , other locations just junk data)
Thanks,
Regards,
Kotteeswaran G S