From f9532acaf808fbad9b63cdac4b400f556ba71c8c Mon Sep 17 00:00:00 2001 From: hathach Date: Fri, 28 Sep 2018 23:43:27 +0700 Subject: [PATCH] figure the line causing timeout issue --- src/flash_nrf5x.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/flash_nrf5x.c b/src/flash_nrf5x.c index 8d7efee..72fab35 100644 --- a/src/flash_nrf5x.c +++ b/src/flash_nrf5x.c @@ -53,11 +53,11 @@ void flash_flush(void) if ( memcmp(_fl_buf, (void *) _fl_addr, FLASH_PAGE_SIZE) != 0 ) { - // nrf_nvmc_page_erase(_fl_addr); - //nrf_nvmc_write_words(_fl_addr, (uint32_t *) _fl_buf, FLASH_PAGE_SIZE/4); + nrf_nvmc_page_erase(_fl_addr); // FIXME nrf_nvmc causes timeout upload large file sd_flash_page_erase does not +// sd_flash_page_erase(_fl_addr / FLASH_PAGE_SIZE); - sd_flash_page_erase(_fl_addr/FLASH_PAGE_SIZE); - sd_flash_write((uint32_t*) _fl_addr, (uint32_t *) _fl_buf, FLASH_PAGE_SIZE/4); + nrf_nvmc_write_words(_fl_addr, (uint32_t *) _fl_buf, FLASH_PAGE_SIZE / 4); +// sd_flash_write((uint32_t*) _fl_addr, (uint32_t *) _fl_buf, FLASH_PAGE_SIZE/4); }