RL78/G13 R5F100ACA FDL problem

I completed my code using R5f100ACA and i am using FDL library and Store Data In two different memory Block..

Block 0==>One time Setting Data..i.e.Role Diameter Only One time or may be sometime when need to change Roll in Rolling Machine.When Power is On.

Block 1==>Data that which is change i.e. Production in meter Only During Power is Off(USING built in LVD interrupt.)

Now problem is that the data is successfully stored and instrument working Properly 10 out of 1 with same code but with different 20 ic Some are not functioning means not writing in FDL..Uptill Now i found 5 to 6 fault ics.

some of them get working properly when i add offset means..

1)Not working Properly with offset=0;

mem_offset=0;

write_byte(addr+mem_offset);

2)working Properly with offset=50;

mem_offset=0;

write_byte(addr+mem_offset);

but in some case only so what is problem i purchase ic from renesas officially.So what problem is there hardware or Software..

Right now i am using Capacitor Backup ...and ya it is provide enough backup time because it is successfully write down the contain but i feel you didn't understand my problem it is not when power off but it is time when chip is first time programmed or memory is first time written when power is on.

How do you distinguish between a PFDL_NG in the case of a failed blank check or erase vs. PFDL_NG in the case of a bad write? It seems things could fail at any point in the process and result in the same error.

Have you looked at the dataflash in the debugger after a failed write?

All memory contains became 0xFF....but it is happens when i am starting to write from location 1 or any others upto 50...but when i set offset mention earlier 200..all contains write properly without single fail...what is the reason behind this..?

second thing is there any polling method function when memory write is 100% successful no need to check..

Have you determined exactly where in your code the error is coming from? For instance, if the blank check returns anything other than OK or ERR_MARGIN, you'll drop to the bottom with the same error as everywhere else.

No it is not determined from where error is coming because in same code...if i started memory writing not from location 1 instead of location 80 or any other above 50 then same code works fine....so it is hard to find out error source.

It's important to find out exactly where in the code the failure is happening in order to narrow down possible causes. It is very unlikely that multiple parts will be defective in a manner that would cause what you are seeing, but it's possible that they have some attributes (still within specifications) that differ from those that work as expected.

Have you run the sample code associated with R01AN1362EJ0120 (modified to work with your board) to see if it works on the devices that are having problems?

The memory segments should be defined in accordance with the memory map of your device--the one in the app note is specific to the device being used in the example. So having a difference between yours and the example is not necessarily a problem.