This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Can I do pstorage store whit S120 scan start?

static void ble_evt_dispatch(ble_evt_t * p_ble_evt)
{
    uint32_t           err_code;
    const               ble_gap_evt_t   * p_gap_evt = &p_ble_evt->evt.gap_evt;
    switch (p_ble_evt->header.evt_id)
    {
        case BLE_GAP_EVT_ADV_REPORT:
        {
	      pstorage_handle_t 		flash_handle;	
	      pstorage_block_identifier_get(&flash_base_handle,pstorage_block_id, &flash_handle);
	      err_code = pstorage_store(&flash_handle, (uint8_t * )&tx_data, 32, 0);
	      pstorage_block_id++ ;
        }
Parents
  • uploaded a file in my answer, note that I have modified this beacon app to use S120 but not as central. It is initialized as pheripheral. It should not really matter in our case which role it is, agree?

    to make life easy, i have commented out sd_flash_page_erase inside pstorage_init function. What this will do is that when you connect to this device and when the app get CONNECTED event, the pstorage store function we want to test is the first flash operation. You can set a breakpoint in sys_evt_dispatch function and it should hit (with pstorage success return) after you get connected.you can use master control panel to connect to this app.

Reply
  • uploaded a file in my answer, note that I have modified this beacon app to use S120 but not as central. It is initialized as pheripheral. It should not really matter in our case which role it is, agree?

    to make life easy, i have commented out sd_flash_page_erase inside pstorage_init function. What this will do is that when you connect to this device and when the app get CONNECTED event, the pstorage store function we want to test is the first flash operation. You can set a breakpoint in sys_evt_dispatch function and it should hit (with pstorage success return) after you get connected.you can use master control panel to connect to this app.

Children
No Data
Related