RL78/G14 Data flash memory rewrite problem

Hello All,

I am using R5F104GD (48K Code flash, 4K Data flash) microcontroller of RL78/G14 family, with e2studio + CC-RL compiler.

I need to write and rewrite a few bytes in data flash, so I'm considering the use of FDL Libraries Type T02 or Type T04.

Regarding the rewriting, I have encountered the same problem indicated in 'RL78/G14 Data flash memory rewrite problem' :

My program read and write operation works well when I write value to data flash.

But when I tried to rewrite at same address, it not rewritten to that address.


I have two question :

1. Is the need to erase the block before rewriting the data  the same for Type T02 and Type T04 FDL Libraries ?  

I ask this because the manual of Type T02 Library does not contain the same caution note about rewriting data in data flash memory that does contain the manual of Type T04 Library

2. Why do some devices, even from the same family, need a 'self ram area' reservation and other devices do not? E. g. R5F104GD and R5F104GA, from 'Self RAM list of Flash Self-Programming Library for RL78 Family'


Thank you very much for your assistance

  • 1. Yes. This is flash memory. So you always have to make sure memory is erased before writing a new value. It is NOT EEPROM.
    I don't know about the note for T02. Usually the T02 library is used with EEPROM library. I think this will take care of memory erase as it does not simply rewrite memory but uses variable addresses for data, mirror area et al to extend flash endurance.
    2. The self-RAM area is a hardware function at fixed addresses. In some devices this area is inside the user RAM area, in some devices it is not. Thus you have to exclude the self-RAM area in some devices and don't have to do this in other devices.
  • Thank you very much FrankL.
    All my questions have been resolved.