About DataFlash Library and Stop Mode of RL78/G12

 Hi, everyone.

My device is R5F10277 of RL78/G12.

The code memory is 4KB.

The flash memory is 2KB.

The RAM size is 512 Byte.

 

My state is below:

I need to read flash data before entering stop mode.

When device is enabled, below step is executed: 

1. FDL_initial

2. read flash data

3. FDL_close

4. execute STOP mode

 

After firmware is programmed and executed, my device become two state:

State 1:

After turn on the power supply, device don't enter stop mode and can't do anything.

 

State 2:

After turn on power supply, device enter stop mode and can wake up and return to stop mode by push SW operation.

But after above describe, if turn off the power supply more than 10 seconds, and turn on power supply again, the device become the state of "State 1".

 

If device is working in debug of CS+ IDE, there is no problem of above state describe.

 

This problem is trouble to me some days. 

Could anybody give some suggest ?

 

 

Best Regards.

Sheng.

 

  • Dear All,

    I fine the stop point when firmware executed abnormally.
    It's R_FDL_Init.

    But why to execute R_FDL_Init() in debug can operate normally?
    Why that when turn off the power supply more than 10 seconds, and turn on power supply again, execute R_FDL_Init can't operate normally?

    And, how can I do to solve this issue?

    Best Regards.
    Sheng.
  • In reply to Sheng:

    Dear All,

    I have solved this issue.
    The way is below:
    when FDL initial, don't call the sub-main of R_FDL_Init(), and move the content of sub-main of R_FDL_Init() to main.

    And, it's working normally.

    But I really don't know why call the sub-main of R_FDL_Init() is executed abnormally.
    Who can tell me the reason?
    Is it RAM size is nearly fulled?

    Best Regards.
    Sheng.