Hi, I use
-
IAR EWARM 7.20
-
Custom Board that has nRF51822-QFAA Revision 2
-
SDK 7.2 + S110 7.1 / SDK 10.0 + S110 8.0
-
ble_app_hrs example with Dual Bank DFU OTA
Hi, thanks to Vidar Berg's answer,
I realized that the dfu_ble_svc_peer_data_set
function sets these variables at the bootloader.
// at the HRS app, dfu_app_set_peer_data.c
static void dfu_app_set_peer_data(void){ // ...
m_peer_data.addr = key_set.keys_central.p_id_key->id_addr_info;
m_peer_data.enc_info = *key_set.keys_central.enc_key.p_enc_info;
m_peer_data.irk = key_set.keys_central.p_id_key->id_info;
err_code = dfu_ble_svc_set_peer_data(&m_peer_data);
APP_ERROR_CHECK(err_code);
}
#elif defined ( __ICCARM__ ) // at bootloader, dfu_ble_svc.c
__no_init static dfu_ble_peer_data_t m_peer_data @ 0x20003F80;
__no_init static uint16_t m_peer_data_crc @ 0x20003F80 + sizeof(dfu_ble_peer_data_t);
// sizeof(dfu_ble_peer_data_t) == 44 at SDK 7.2
#endif
Similar to this, I want to set my own data.
Like at the App, I have to run my own state 1
at the bootloader.
Or I want to set the number of blinks of LED at the app,
so the bootloader reads the value and blink that much.
So I want to set a global variable like that.
Or do I have to use pstorage
functions at the bootloader?'
I hope the app and the bootloader can read the same pstorage page.
-Regards, Mango