Fat FS on Xiao BLE (nRF52840) based board

Good day! I want to use Fat FS to connect to a micro SD Card on the Xiao BLE board. Is it possible to configure the board without the help of the expansion module? The main problem I see is configuring the &flash0 partition. From what I have read, I need to allocate partitions for the Fat FS and the SD Card.

This is what the xiao_ble_common_dtsi looks like on the partitions.

&flash0 {
	partitions {
		compatible = "fixed-partitions";
		#address-cells = <1>;
		#size-cells = <1>;

		sd_partition: partition@0 {
			label = "softdevice";
			reg = <0x00000000 0x00027000>;
		};

		code_partition: partition@27000 {
			label = "code_partition";
			reg = <0x00027000 0x000c5000>;
		};

		/*
		 * The flash starting at 0x000ec000 and ending at
		 * 0x000f3fff is reserved for use by the application.
		 *
		 * Storage partition will be used by FCB/LittleFS/NVS
		 * if enabled.
		 */
		storage_partition: partition@ec000 {
			label = "storage";
			reg = <0x000ec000 0x00008000>;
		};

		boot_partition: partition@f4000 {
			label = "adafruit_boot";
			reg = <0x000f4000 0x0000c000>;
		};
	};
};

Is there any other way to use Fat FS. I am not very knowledge-able in the File Systems code yet. Thank you!

Parents
  • The sd card won't be mapped to the addressable space in flash, thus you also don't assign a partition in DT.

    One example for the NRF53x using P1.12 as the CS signal:

    &spi4 {
    	status = "okay";
    	cs-gpios = < &gpio1 12 GPIO_ACTIVE_LOW >;
    	sdhc-spi-slot@0 {
    		compatible = "zephyr,sdhc-spi-slot";
    		reg = <0x0 >;
    		spi-max-frequency = <16000000>;
    		status = "okay";
    		mmc {
    			compatible = "zephyr,sdmmc-disk";
    			status = "okay";
    		};	
    	};
    };

Reply
  • The sd card won't be mapped to the addressable space in flash, thus you also don't assign a partition in DT.

    One example for the NRF53x using P1.12 as the CS signal:

    &spi4 {
    	status = "okay";
    	cs-gpios = < &gpio1 12 GPIO_ACTIVE_LOW >;
    	sdhc-spi-slot@0 {
    		compatible = "zephyr,sdhc-spi-slot";
    		reg = <0x0 >;
    		spi-max-frequency = <16000000>;
    		status = "okay";
    		mmc {
    			compatible = "zephyr,sdmmc-disk";
    			status = "okay";
    		};	
    	};
    };

Children
Related