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

halt Flash write

Dear everyone:

Can you tell me Using built-in flash and use restrictions,

because it halt at ble_flash_page_write() function.

  • Sorry for my late reply!. I write to flash at the Time event handler (notif_timeout_handler) . and the B.L.E is not at connect. every time ,i write 512 B data to flash(top address,(NRF_FICR->CODESIZE-1)) and then the device into system_off() .

    follow is code :

    
    				err_code=sd_softdevice_disable ();
    				APP_ERROR_CHECK(err_code);
    				err_code=ble_flash_page_write(FLASH_PAGE_FLUSATION,data_array,0xFE);//error earse flash data												
    				//err_code=ble_flash_page_write(FLASH_PAGE_FLUSATION,data_array_test,1);//error earse flash data												
    				APP_ERROR_CHECK(err_code);
    				nrf_gpio_port_write(LED_OUTPORT_0,LED_OUTPORT_0_NONE);
    				nrf_gpio_port_write(LED_OUTPORT_1,LED_OUTPORT_1_NONE);				
    				// Go to system-off mode (this function will not return; wakeup will cause a reset)
    				GPIO_WAKEUP_BUTTON_CONFIG(WAKEUP_BUTTON_PIN);					
    				err_code=sd_softdevice_enable (NRF_CLOCK_LFCLKSRC_RC_250_PPM_8000MS_CALIBRATION,NULL);//ble_evt_dispatch
    				APP_ERROR_CHECK(err_code);
    				err_code = sd_power_system_off();    				
    
    
    

    Best regards steven

    ble_app_uart_hasbro_rel1_715.zip

  • Hi,

    Can you explain more about whats not working? What data are you reading out?

    From looking at the code, your timeout handler "notif_timeout_handler" will run 800 ms after you have called "timers_start" function. Is this wanted behavior? If you want to store information when link is diconnected, the proper way to do it is to call it in the event "BLE_GAP_EVT_DISCONNECTED" (line 580 in your main.c)

    The "data_array" that you are storing is defaulted to all "0", as I see it the whole flash page will then be blanked out.

    Best regards Håkon

  • To clean things up, I'd be happy if you could evaluate the answers you have received and accept one of them if you feel it's sufficient. If not, it might be useful to expand your question a little and provide further information.

  • Hi Håkon, i close the Discuss item now. i have not to try it ,so i may be create another question next time.

    Thank you for your help.

  • Hi,

    about the question, i find that is priorities issue. Because when i call sd_xx() function at the lower(prior 3,timer interrupt) that will hardfault error. so i have set that at high prior level(1).

    reference nRF51 reference nrF51_reference_manual.pdf p171 page

Related