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

sd_flash_write error in sdk15.2.0

Hello, all 

I would like to ask about flash memory write errors.

When using version 12.1.0 of sdk, I was able to r/w to flash memory normally by using the sd_flash_write function.

However, after raising the sdk version to 15.2.0, the sd_flash_write function returns a busy(17) error.

Below is the code I wrote. Which part is wrong?

uint32_t  *addr;  
uint32_t   FlashID_Adr[4]= {0x7F000,0x7F200,0x7F400,0x7F600};

void flash_write_test_func(uint8_t RevId[])
{
    uint32_t test2=0xFF;
    uint32_t* test = &test2; 

    advertising_stop();
    scan_stop();
    nrf_delay_ms(500);
    sd_flash_page_erase(127);
    nrf_delay_ms(500);
    for(uint8_t i=0;i<4;i++)
    {
        *test = RevId[i];
        addr = (uint32_t *)(FlashID_Adr[i]);
        FlashWriteErr = sd_flash_write(addr,test,1);
    
        printf("FlashWriteErr = %d \r\n",FlashWriteErr);
        nrf_delay_ms(50);
    }
    m_beacon_info[M_BEACON_INFO_MAJOR_MSB] = RevId[0];
    m_beacon_info[M_BEACON_INFO_MAJOR_LSB] = RevId[1];
    m_beacon_info[M_BEACON_INFO_MINOR_MSB] = RevId[2];
    m_beacon_info[M_BEACON_INFO_MINOR_LSB] = RevId[3];
    
    ble_app_advertising_init();
    advertising_start();
    scan_start();
}

Related