I got the Zephyr littlefs sample on the nRF5340 DK to build, but never gets to main().

I attempted to port the littlefs sample to the nRF5340 Developer Kit. I've gotten it to build but when I flash it there is no log output. When I try to debug it the startup process looks normal but I never hit a breakpoint I set in main().

After searching, I found this post ( littlefs sample on nrf5340dk not running) and tried building and running the modified example "littlefs2" from that thread. Same result: it never seems to get to main().

I succeeded in getting the flash_jesd216 built and running correctly on the nRF5340 DK, as well as my own app to write to the external flash and do a read back to verify. So I know the hardware and my development environment are basically good.

I'm using nRF Connect SDK v2.1.0 installed from the Toolchain Manager (v1.2.0). I'm running Ubuntu 20.04.5 LTS. I have nRF5340 DK hardware rev 2.0.0. I've attached zip archives of both of my attempts at getting this working.

7142.littlefs2.zip1581.littlefs.zip

Parents
  • Hello Mark,

    Thank you for contacting DevZone at NordicSemi.

    Your query is regarding running a littlefs sample on nRF5340-DK.

    I started with littlefs (/zephyr/samples/subsys/fs/littlefs) sample project, and the build was successful as yours. Then I connected output terminal with the COM port. I flashed the application on the nRF5340-DK. I was not able to see the output on terminal and looked like nothing has happened. Actually, I was connected to the wrong COM port. I changed my COM port and reset the device. I was able to see the output and the complete execution of the main().

    I am on Windows 10 platform using NCS v2.1.0.

    I am attaching terminal output here:

    Connected via Serial Port with settings COM13 115200 8n1 rtscts:off
    
    *** Booting Zephyr OS build v3.1.99-ncs1-rc1  ***
    Sample program to r/w files on littlefs
    Area 6 at 0xfa000 on flash-controller@39000 for 24576 bytes
    I: LittleFS version 2.4, disk version 2.0
    I: FS at flash-controller@39000:0xfa000 is 6 0x1000-byte blocks with 512 cycle
    I: sizes: rd 16 ; pr 16 ; ca 64 ; la 32
    E: WEST_TOPDIR/modules/fs/littlefs/lfs.c:1077: Corrupted dir pair at {0x0, 0x1}
    W: can't mount (LFS -84); formatting
    I: /lfs mounted
    /lfs mount: 0
    /lfs: bsize = 16 ; frsize = 4096 ; blocks = 6 ; bfree = 4
    
    Listing dir /lfs ...
    /lfs/boot_count read count:0 (bytes: 0)
    /lfs/boot_count write new boot count 1: [wr:1]
    I: Test file: /lfs/pattern.bin not found, create one!
    ------ FILE: /lfs/pattern.bin ------
    01 55 55 55 55 55 55 55 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 aa
    I: /lfs unmounted
    /lfs unmount: 0

    And the complete application folder (in zip format) for reference.

    1462.littlefs.zip

    Regards,

    Naeem

Reply
  • Hello Mark,

    Thank you for contacting DevZone at NordicSemi.

    Your query is regarding running a littlefs sample on nRF5340-DK.

    I started with littlefs (/zephyr/samples/subsys/fs/littlefs) sample project, and the build was successful as yours. Then I connected output terminal with the COM port. I flashed the application on the nRF5340-DK. I was not able to see the output on terminal and looked like nothing has happened. Actually, I was connected to the wrong COM port. I changed my COM port and reset the device. I was able to see the output and the complete execution of the main().

    I am on Windows 10 platform using NCS v2.1.0.

    I am attaching terminal output here:

    Connected via Serial Port with settings COM13 115200 8n1 rtscts:off
    
    *** Booting Zephyr OS build v3.1.99-ncs1-rc1  ***
    Sample program to r/w files on littlefs
    Area 6 at 0xfa000 on flash-controller@39000 for 24576 bytes
    I: LittleFS version 2.4, disk version 2.0
    I: FS at flash-controller@39000:0xfa000 is 6 0x1000-byte blocks with 512 cycle
    I: sizes: rd 16 ; pr 16 ; ca 64 ; la 32
    E: WEST_TOPDIR/modules/fs/littlefs/lfs.c:1077: Corrupted dir pair at {0x0, 0x1}
    W: can't mount (LFS -84); formatting
    I: /lfs mounted
    /lfs mount: 0
    /lfs: bsize = 16 ; frsize = 4096 ; blocks = 6 ; bfree = 4
    
    Listing dir /lfs ...
    /lfs/boot_count read count:0 (bytes: 0)
    /lfs/boot_count write new boot count 1: [wr:1]
    I: Test file: /lfs/pattern.bin not found, create one!
    ------ FILE: /lfs/pattern.bin ------
    01 55 55 55 55 55 55 55 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 aa
    I: /lfs unmounted
    /lfs unmount: 0

    And the complete application folder (in zip format) for reference.

    1462.littlefs.zip

    Regards,

    Naeem

Children
No Data
Related