Skip to content

Commit c846714

Browse files
committed
zephyr: Read block_size for zephyr_flash_area from device tree.
The block_size parameter needs to be read from the device tree rather than hard-coding to 4096. Signed-off-by: Detlev Zundel <dzu@member.fsf.org>
1 parent 043ec8a commit c846714

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ports/zephyr/main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ static void vfs_init(void) {
107107
bdev = MP_OBJ_TYPE_GET_SLOT(&zephyr_disk_access_type, make_new)(&zephyr_disk_access_type, ARRAY_SIZE(args), 0, args);
108108
mount_point_str = "/sd";
109109
#elif defined(CONFIG_FLASH_MAP) && FIXED_PARTITION_EXISTS(storage_partition)
110-
mp_obj_t args[] = { MP_OBJ_NEW_SMALL_INT(FIXED_PARTITION_ID(storage_partition)), MP_OBJ_NEW_SMALL_INT(4096) };
110+
#define DT_DRV_COMPAT zephyr_flash_disk
111+
mp_obj_t args[] = { MP_OBJ_NEW_SMALL_INT(FIXED_PARTITION_ID(storage_partition)), MP_OBJ_NEW_SMALL_INT(DT_INST_PROP(0, cache_size)) };
111112
bdev = MP_OBJ_TYPE_GET_SLOT(&zephyr_flash_area_type, make_new)(&zephyr_flash_area_type, ARRAY_SIZE(args), 0, args);
112113
mount_point_str = "/flash";
113114
#endif

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy