Hi! I'm trying to figure out how to use oc_storage_configuration function in Zephyr porting. In comment says following.
/** It expects the device name, flash sector size and maximum read/write size separated by comma: device_name,flash_sector_size,max_rw_size For arduino 101 internal flash it will be: W25QXXDV,4096,256 */ But, It seems that I need one more argument for initial_offset. If I just hand over "W25QXXDV,4096,256" as a argument, It doesn't configure the storage when doing following instructions. PARSE_VALUE_ALIGNED(memmap.sector_size); PARSE_VALUE_ALIGNED(memmap.max_rw_size); PARSE_VALUE(initial_offset); So, I thought this is gonna be start address of flash storage. Cause I'm working on Nrf52840_pca10056 board, I handed over "NRF_FLASH_DEV_NAME,0x4000,256,0xfc000". Sector size and start address of flash storage were found on dts file of the board. But I couldn't find the maximum rw size of the board, so I just write any value. But this leads error in storage_init function in oc_storage_config function at the line of flash_erase(memmap.flash, OC_MEMMAP_CLOSER_ERASABLE_SECTOR(initial_offset), memmap.sector_size); I really don't understand the role of OC_MEMMAP_CLOSER_ERASABLE_SECTOR macro. It looks like this. #define OC_MEMMAP_CLOSER_ERASABLE_SECTOR(_pos) \ (_pos * (_pos / memmap.sector_size)) Because of this macro's job, I got Invalid address error when executing flash_erase function. Please guide me how to properly configure the storage in Zephyr(Nrf52840_pca10056). Thanks. -Taehwa -=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#10013): https://lists.iotivity.org/g/iotivity-dev/message/10013 Mute This Topic: https://lists.iotivity.org/mt/28144727/21656 Group Owner: [email protected] Unsubscribe: https://lists.iotivity.org/g/iotivity-dev/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
