Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

samples/littlefs: Fix rcar boards selecting Flash API #72594

Merged

Conversation

de-nordic
Copy link
Collaborator

The rcar boards use block variant of LittleFS and Disk Access API, but have been using proj.conf for Flash API based access. The commit adds section building boards with pro_blk.conf into sample.yaml, where rcar boards will now be allowed, and removes redundant configuration lines from board specific conf files.

@xakep-amatop
Copy link
Contributor

xakep-amatop commented May 13, 2024

with these changes sample doesn't work:

Starting kernel ...                                                                                                                                                                                                                                                                                                                                                                          
                                                                                                                                                                                                                                                                                                                                                                                             
I: mmc@ee140000: initialize driver, MMC version 0x10                                                                                                                                                                                                                                                                                                                                         
*** Booting Zephyr OS build v3.6.0-3798-g39b873223877 ***                                                                                                                                                                                                                                                                                                                                    
Sample program to r/w files on littlefs                                                                                                                                                                                                                                                                                                                                                      
I: LittleFS version 2.8, disk version 2.1                                                                                                                                                                                                                                                                                                                                                    
E: Storage init ERROR!                                                                                                                                                                                                                                                                                                                                                                       
E: fs mount error (-22)

results without your commit:

Starting kernel ...

I: mmc@ee140000: initialize driver, MMC version 0x10
*** Booting Zephyr OS build v3.6.0-3797-gff58bd02047c ***
Sample program to r/w files on littlefs
I: LittleFS version 2.8, disk version 2.1
I: Legacy card detected, no CMD8 support
I: Legacy card detected, no CMD8 support
I: Legacy card detected, no CMD8 support
I: Legacy card detected, no CMD8 support
I: Legacy card detected, no CMD8 support
I: Legacy card detected, no CMD8 support
I: Legacy card detected, no CMD8 support
I: Legacy card detected, no CMD8 support
I: Legacy card detected, no CMD8 support
I: Legacy card detected, no CMD8 support
I: Legacy card detected, no CMD8 support
I: Card does not support CMD8, assuming legacy card
I: Card switched to 1.8V signaling
I: CID decoding not supported for MMC
I: Card block count is 249954304, block size is 512
E: mmc@ee140000: interrupt signal timeout error -11
I: FS at MMC: is 249954304 0x200-byte blocks with 512 cycle
I: sizes: rd 512 ; pr 512 ; ca 512 ; la 2048
/MMC:: bsize = 512 ; frsize = 512 ; blocks = 249954304 ; bfree = 249954300

Listing dir /MMC: ...
[FILE] boot_count (size = 1)
[FILE] pattern.bin (size = 547)
/MMC:/boot_count read count:1 (bytes: 1)
/MMC:/boot_count write new boot count 2: [wr:1]
------ FILE: /MMC:/pattern.bin ------
02 55 55 55 55 55 55 55 03 55 55 55 55 55 55 55
04 55 55 55 55 55 55 55 05 55 55 55 55 55 55 55
06 55 55 55 55 55 55 55 07 55 55 55 55 55 55 55
08 55 55 55 55 55 55 55 09 55 55 55 55 55 55 55
0a 55 55 55 55 55 55 55 0b 55 55 55 55 55 55 55
0c 55 55 55 55 55 55 55 0d 55 55 55 55 55 55 55
0e 55 55 55 55 55 55 55 0f 55 55 55 55 55 55 55
10 55 55 55 55 55 55 55 11 55 55 55 55 55 55 55
12 55 55 55 55 55 55 55 13 55 55 55 55 55 55 55
14 55 55 55 55 55 55 55 15 55 55 55 55 55 55 55
16 55 55 55 55 55 55 55 17 55 55 55 55 55 55 55
18 55 55 55 55 55 55 55 19 55 55 55 55 55 55 55
1a 55 55 55 55 55 55 55 1b 55 55 55 55 55 55 55
1c 55 55 55 55 55 55 55 1d 55 55 55 55 55 55 55
1e 55 55 55 55 55 55 55 1f 55 55 55 55 55 55 55
20 55 55 55 55 55 55 55 21 55 55 55 55 55 55 55
22 55 55 55 55 55 55 55 23 55 55 55 55 55 55 55
24 55 55 55 55 55 55 55 25 55 55 55 55 55 55 55
26 55 55 55 55 55 55 55 27 55 55 55 55 55 55 55
28 55 55 55 55 55 55 55 29 55 55 55 55 55 55 55
2a 55 55 55 55 55 55 55 2b 55 55 55 55 55 55 55
2c 55 55 55 55 55 55 55 2d 55 55 55 55 55 55 55
2e 55 55 55 55 55 55 55 2f 55 55 55 55 55 55 55
30 55 55 55 55 55 55 55 31 55 55 55 55 55 55 55
32 55 55 55 55 55 55 55 33 55 55 55 55 55 55 55
34 55 55 55 55 55 55 55 35 55 55 55 55 55 55 55
36 55 55 55 55 55 55 55 37 55 55 55 55 55 55 55
38 55 55 55 55 55 55 55 39 55 55 55 55 55 55 55
3a 55 55 55 55 55 55 55 3b 55 55 55 55 55 55 55
3c 55 55 55 55 55 55 55 3d 55 55 55 55 55 55 55
3e 55 55 55 55 55 55 55 3f 55 55 55 55 55 55 55
40 55 55 55 55 55 55 55 41 55 55 55 55 55 55 55

42 55 55 55 55 55 55 55 43 55 55 55 55 55 55 55
44 55 55 55 55 55 55 55 45 55 55 55 55 55 55 55
46 55 ab 
I: /MMC: unmounted
/MMC: unmount: 0

maybe I've used wrong command for building, here what I've used:

west build -p always -b rcar_h3ulcb/r8a77951/a57 samples/subsys/fs/littlefs -- -DCONF_FILE=prj_blk.conf


CONFIG_DISK_ACCESS=y
CONFIG_DISK_DRIVERS=y
CONFIG_DISK_DRIVER_MMC=y
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after these changes we use CONFIG_DISK_DRIVER_SDMMC + CONFIG_DISK_DRIVER_MMC (enabled by disk mmc node) and this produces issue

I: LittleFS version 2.8, disk version 2.1
E: Storage init ERROR!
E: fs mount error (-22)

@@ -6,12 +6,3 @@
CONFIG_MAIN_STACK_SIZE=4096
CONFIG_COMMON_LIBC_MALLOC_ARENA_SIZE=8192
CONFIG_FS_LITTLEFS_FC_HEAP_SIZE=8192
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these configs aren't applied at all with build command:

west build -p always -b rcar_h3ulcb/r8a77951/a57 samples/subsys/fs/littlefs -- -DCONF_FILE=prj_blk.conf

@xakep-amatop
Copy link
Contributor

Review finished.

The rcar boards use block variant of LittleFS and Disk Access API,
but have been using proj.conf for Flash API based access.
The commit adds section building boards with pro_blk.conf
into sample.yaml, where rcar boards will now be allowed,
and removes redundant configuration lines from board specific
conf files.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
@de-nordic
Copy link
Collaborator Author

Review finished.

I have reworked configurations for your boards. Now they also enabled MMC and disable SDMCC Disk Access Drivers, the diff now, for , looks like this:
image

@de-nordic de-nordic reopened this May 14, 2024
@xakep-amatop
Copy link
Contributor

Checked changes, everything works nicely.

@carlescufi carlescufi merged commit 6c2e661 into zephyrproject-rtos:main May 14, 2024
27 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants