In the past, you need modify rtc_api.c in mbed-dev source code. From this revision, you can just use RTC function all of conditions (Normal, Reset, Stand-by, Power OFF).
Kenji Arai
/
Nucleo_RTC_battery_bkup_pwr_off_okay