Skip to content

Conversation

@danieldegrasse
Copy link
Contributor

Add support for testing SDMMC devices to the fatfs API test. This also requires wiping the beginning of the disk at the start of the test, in order to make sure a filesystem partition is not present on the SD card from a previous run of the test

@danieldegrasse
Copy link
Contributor Author

@sylvioalves sorry for the ping here, I don't fully understand the twister error here:

Generating files from /__w/zephyr/zephyr/twister-out/m5stack_core2_esp32_procpu/tests/subsys/fs/fat_fs_api/filesystem.fat.api.sdmmc/zephyr/zephyr.elf for board: m5stack_core2
esptool.py v4.7.0
Creating esp32 image...
ROM segments hidden - only RAM segments are visible to the ROM loader!
Merged 17 ELF sections
Traceback (most recent call last):
  File "/__w/zephyr/modules/hal/espressif/tools/esptool_py/esptool.py", line 37, in <module>
    esptool._main()
  File "/__w/zephyr/modules/hal/espressif/tools/esptool_py/esptool/__init__.py", line 1166, in _main
    main()
  File "/__w/zephyr/modules/hal/espressif/tools/esptool_py/esptool/__init__.py", line 979, in main
    operation_func(args)
  File "/__w/zephyr/modules/hal/espressif/tools/esptool_py/esptool/cmds.py", line 1037, in elf2image
    image.save(args.output)
  File "/__w/zephyr/modules/hal/espressif/tools/esptool_py/esptool/bin_image.py", line 781, in save
    assert (f.tell() + 8 + self.ROM_LOADER.BOOTLOADER_FLASH_OFFSET) % (
AssertionError
ninja: build stopped: subcommand failed.

I can't reproduce this locally with west build -p -b m5stack_core2/esp32/procpu tests/subsys/fs/fat_fs_api -T filesystem.fat.api.sdmmc -DCONF_FILE=prj_sdmmc.conf, but I can reproduce it with twister: west twister -p m5stack_core2/esp32/procpu -s tests/subsys/fs/fat_fs_api/filesystem.fat.api.sdmmc. Looking at the outputs, the image sizes seem different, but it isn't clear why:

Working example with west build:

Memory region         Used Size  Region Size  %age Used
           FLASH:      196580 B   16776960 B      1.17%
     iram0_0_seg:       50432 B       224 KB     21.99%
     dram0_0_seg:       36560 B       192 KB     18.60%
  dram0_shm0_seg:          0 GB         2 KB      0.00%
  dram0_sem0_seg:          0 GB          8 B      0.00%
     dram0_1_seg:          0 GB         0 GB
     irom0_0_seg:       65508 B     16380 KB      0.39%
     drom0_0_seg:         64 KB     16380 KB      0.39%
    rtc_iram_seg:          0 GB         8 KB      0.00%
    rtc_slow_seg:          0 GB         4 KB      0.00%
        IDT_LIST:          0 GB         8 KB      0.00%

Broken example with twister:

            FLASH:      196596 B   16776960 B      1.17%
     iram0_0_seg:       50432 B       224 KB     21.99%
     dram0_0_seg:       36560 B       192 KB     18.60%
  dram0_shm0_seg:          0 GB         2 KB      0.00%
  dram0_sem0_seg:          0 GB          8 B      0.00%
     dram0_1_seg:          0 GB         0 GB
     irom0_0_seg:       65524 B     16380 KB      0.39%
     drom0_0_seg:         64 KB     16380 KB      0.39%
    rtc_iram_seg:          0 GB         8 KB      0.00%
    rtc_slow_seg:          0 GB         4 KB      0.00%
        IDT_LIST:          0 GB         8 KB      0.00%

Any idea why the twister image would be a different size?

@sylvioalves
Copy link
Contributor

@danieldegrasse, the issue is already known in our side and we have a fix already for it. However, west build and twister output having different values is something new. I will check it. Let me rebuild this locally with the fix we created. Ping you back soon.

@danieldegrasse
Copy link
Contributor Author

@danieldegrasse, the issue is already known in our side and we have a fix already for it. However, west build and twister output having different values is something new. I will check it. Let me rebuild this locally with the fix we created. Ping you back soon.

@sylvioalves any news here?

@sylvioalves
Copy link
Contributor

@danieldegrasse, the issue is already known in our side and we have a fix already for it. However, west build and twister output having different values is something new. I will check it. Let me rebuild this locally with the fix we created. Ping you back soon.

@sylvioalves any news here?

@danieldegrasse, sorry for taking that long. Will submit a fix tomorrow.

@sylvioalves
Copy link
Contributor

@danieldegrasse would you rebase this?

Wipe partition header prior to fatfs testsuite starting. This insures
that the disk will be in an unformatted state at the start of the test,
so the first fs_mount() calls will fail as expected.

Signed-off-by: Daniel DeGrasse <[email protected]>
Add support for testings SDMMC devices using the fat_fs_api test.

Signed-off-by: Daniel DeGrasse <[email protected]>
@sylvioalves
Copy link
Contributor

@danieldegrasse do you need this to be merged within v3.7.0?

@danieldegrasse
Copy link
Contributor Author

@danieldegrasse do you need this to be merged within v3.7.0?

Not particularly, no. The additional test coverage would be a nice to have though

@de-nordic de-nordic added this to the v4.0.0 milestone Jun 18, 2024
@github-actions
Copy link

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the Stale label Aug 18, 2024
@danieldegrasse
Copy link
Contributor Author

@de-nordic ping, could you take a look at this change?

@henrikbrixandersen henrikbrixandersen merged commit 744f67c into zephyrproject-rtos:main Aug 20, 2024
@danieldegrasse danieldegrasse deleted the feature/fs-sd-tests branch August 20, 2024 15:00
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.

5 participants