Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to use usb_msh example with custom external flash memory chip?

Hi,

I would like adjust usb_msc to work with flash memory different than in example. I created nrf_serial_flash_params_t structure with it's data. When I trying to change  erase_size field to 

262144 (my flash has 256-kbyte erase sectors) I get NRF_ERROR_NOT_SUPPORTED inside disk_initialize function. 

I tried solve the problem by increasing NRF_BLOCK_DEV_QSPI_ERASE_UNIT_SIZE const in nrf_block_dev_qspi.h, but it resoults  region `RAM' overflowed by 6988 bytes error.

I Used nRF52840 with SDK14.0

Is it possible to adjust this example with such external flash chip?

Parents Reply
  • I've reproduced your issue. The nrf_block_dev_qspi library creates a buffer the size of an flash page, that is used when erasing parts of a page. When you only want to erase a part, the whole page gets loaded in to RAM, followed by a page erase, and a re-flashing of the page with the content stored in the RAM buffer. At 256KB page size, you will have filled the entire RAM with only this buffer. You will need to re-write some of the QSPI implementation of the Block device library so that you do not use a RAM buffer.

     

     

Children
No Data
Related