Hi,
I am working on a custom board using DA 14585 and flash winbond W25X20CL. The code is put into flash, and is required by the device to boot from flash. In the code, the device is advertising connectable packets, and after successful connection, and disconnection from phone, the device writes certain data into flash. The issue I am facing is that, the flash write happening in disconnect callback is not working. Whereas, if the flash write is called prior to calling app_easy_gap_undirected_advertise_start(), the flash write works.
Also, if the board is made to run from RAM directly, using debug mode, the flash write works fine at disconnect callback. The issue is only when the device boots from flash.
Please suggest the reasons for the same.
Thanks
Hi wisilica,
I am not able to identify a reason for that, practically there is no difference between booting from an SPI and downloading the image using JTAG as soon as the fw runs, made a quick test on the dev kit (uses the same flash as you do in the custome board) and wrote some data in the flash as soon as the device ended up in the disconnection indication. I run the same test from the JTAG and from via booting from flash, at all times the device was able to write the flash properly. What i can suggest is to make sure that the flash, when the device is about to write, is powered and not powered down, you can release the flash from power down using this function spi_flash_release_from_power_down();
Thanks MT_dialog