Hi,
I am trying to mount Fat FS using pm_static.yml instead of devicetree overlay fixed partition. I can generate a memory report, but when I try to mount file system I get the following mount errors.
Errors:
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
winbondw25q02@0 SPI flash testing
==========================
Perform test on single sector
Test 1: Flash erase
*** Booting nRF Connect SDK v2.7.0-5cb85570ca43 ***
*** Using Zephyr OS v3.6.99-100befc70c74 ***
[00:00:00.257,232] <err> usb_msc: Storage init ERROR !!!! - Aborting USB init
Flash erase succeeded!
Test 2: Flash write
Attempting to write zu bytes
Data read matches data written. Good!!
[00:00:00.380,065] <err> fs: fs mount error (-5)
Error mounting FATFS: -5. Formatting now...
[00:00:00.380,126] <err> fs: fs not mounted (mp == 0x200000d0)
Error unmounting FATFS: -22
Error formatting FATFS: 3
[00:00:00.380,218] <err> fs: fs mount error (-5)
Error mounting FATFS after formatting: -5
[00:00:00.380,249] <err> fs: mount point not found!!
Prj.Conf
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# Copyright (c) 2018 Nordic Semiconductor
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#
# Enable the UART driver
CONFIG_UART_ASYNC_API=y
CONFIG_NRFX_UARTE0=y
# print
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
# I2C
CONFIG_I2C=y
CONFIG_I2C_NRFX=y
CONFIG_NRFX_TWIM1=y
CONFIG_NFCT_PINS_AS_GPIOS=y
#SPI
CONFIG_SPI=y
overlay file:
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/ {
chosen {
nordic,pm-ext-flash = &winbond;
};
};
/* Disable conflicting buttons and UART */
&button2 {
status = "disabled";
};
&button3 {
status = "disabled";
};
&gpio_fwd {
status = "disabled";
};
&pinctrl {
spi_master_default: spi_master_default {
pm_static.yml and memory report
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
app:
address: 0x00010200
end_address: 0x00E4000
region: flash_primary
size: 0x00D3E00
external_flash:
address: 0x00000000
device: DT_CHOSEN(nordic_pm_ext_flash)
end_address: 0x10000000 # 256MB
region: external_flash
size: 0x10000000
mcuboot:
address: 0x00000000
end_address: 0x00010000
region: flash_primary
size: 0x00010000
mcuboot_pad:
address: 0x00010000
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
external_flash (0x10000000 - 262144kB):
+----------------------------------------------------+
| 0x0: external_flash (0x10000000 - 262144kB) |
| 0x0: mcuboot_secondary (0xd4000 - 848kB) |
| 0xd4000: mcuboot_secondary_1 (0x40000 - 256kB) |
| 0x114000: EMPTY_1 (0xc000 - 48kB) |
| 0x120000: mcuboot_primary_2 (0x40000 - 256kB) |
| 0x160000: mcuboot_secondary_2 (0x40000 - 256kB) |
| 0x1a0000: storage_partition (0xfe50000 - 260416kB) |
+----------------------------------------------------+
flash_primary (0x100000 - 1024kB):
+----------------------------------------------+
| 0x0: mcuboot (0x10000 - 64kB) |
+---0x10000: mcuboot_primary (0xd4000 - 848kB)-+
| 0x10000: mcuboot_pad (0x200 - 512B) |
| 0x10200: app (0xefe00 - 959kB) |
+----------------------------------------------+
otp (0x2fc - 764B):
+------------------------------+
main.c
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <sample_usbd.h>
#include <zephyr/kernel.h>
#include <zephyr/drivers/flash.h>
#include <zephyr/device.h>
#include <zephyr/devicetree.h>
#include <stdio.h>
#include <string.h>
#include <zephyr/fs/fs.h>
#include <zephyr/storage/disk_access.h>
#include <zephyr/logging/log.h>
#include <ff.h> // FATFS definition
#include <zephyr/usb/usb_device.h>
#include <zephyr/usb/usbd.h>
#include <zephyr/usb/class/usbd_msc.h>
#define STORAGE_PARTITION storage_partition
#define STORAGE_PARTITION_ID DEVICE_DT_GET(DT_CHOSEN_nordic_pm_ext_flash)
LOG_MODULE_REGISTER(flash_test, LOG_LEVEL_DBG);
#if defined(CONFIG_BOARD_ADAFRUIT_FEATHER_STM32F405)
regards,
Barsha