Xiao BLE Sense & Round Display - Zephyr+MicroSD

Hi there,

I am trying to develop a simple application that must write information within a micro SD card (nothing too fancy, it is just plain data read from the internal accelerometer sensor).

/*********************************/

First of all, let me summarize what I am using and what program I have uploaded to the device:

  • Hardware:
    • Xiao BLE Sense.
    • Round display expansion board.
    • A 16GB micro SD card.
  • Software:
    • Visual Studio Code.
    • nRF Connect for VS Code Extension Pack (latest version).
    • nRF Connect SDK Toolchain v2.5.2
    • nRF Connect SDK v2.5.2
    • Zephyr OS.

I have downloaded the FatFS example from the zephyr GitHub (including some additional new prints only), which compiles and loads to the devices without any issue... but the outcome I receive is not good at all:

Xiao output

It may be something wrong in either the app.overlay or prj.conf files (or somewhere else, I do not know, I am new using the Zephyr OS).

In any case, I attach those two so as you may take a look at them:

&spi2 {
    compatible = "nordic,nrf-spim";
    status = "okay";
    cs-gpios = <&gpio0 0x1C (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
    pinctrl-0 = <&spi2_default>;
    pinctrl-1 = <&spi2_sleep>;
    pinctrl-names = "default", "sleep";
    sdhc0: sdhc@0 {
            compatible = "zephyr,sdhc-spi-slot";
            reg = <0>;
            status = "okay";
            mmc {
                compatible = "zephyr,sdmmc-disk";
                status = "okay";
            };
            spi-max-frequency = <24000000>;//8000000 /24000000 //16000000
    };
};


&spi2_default {
    group1 {
        psels = <NRF_PSEL(SPIM_SCK, 1, 13)>,
            <NRF_PSEL(SPIM_MOSI, 1, 15)>,
            <NRF_PSEL(SPIM_MISO, 1, 14)>;
        bias-pull-up;
    };
};

&spi2_sleep {
    group1 {
        psels = <NRF_PSEL(SPIM_SCK, 1, 13)>,
            <NRF_PSEL(SPIM_MOSI, 1, 15)>,
            <NRF_PSEL(SPIM_MISO, 1, 14)>;
        bias-pull-up;
        low-power-enable;
    };
};

CONFIG_GPIO=y
CONFIG_STDOUT_CONSOLE=y
CONFIG_I2C=y
CONFIG_SPI=y
CONFIG_SENSOR=y
CONFIG_LSM6DSL_TRIGGER_GLOBAL_THREAD=y
CONFIG_CBPRINTF_FP_SUPPORT=y

CONFIG_BT=y
CONFIG_LOG=y
CONFIG_BT_SMP=y
CONFIG_BT_DEBUG_LOG=y
CONFIG_BT_MAX_CONN=1
CONFIG_BT_GATT_CLIENT=y
CONFIG_BT_L2CAP_TX_MTU=247
CONFIG_BT_L2CAP_TX_BUF_COUNT=5
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_DEVICE_NAME="ixi"
CONFIG_BT_DEVICE_APPEARANCE=962

CONFIG_HEAP_MEM_POOL_SIZE=2048

# This example requires more workqueue stack
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048

#USB
CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_DEVICE_PRODUCT="IXI Sample"
CONFIG_USB_DEVICE_PID=0x0004

CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=n
CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y
CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y

CONFIG_SERIAL=y
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
CONFIG_UART_LINE_CTRL=y

# Micro SD
CONFIG_DISK_ACCESS=y
CONFIG_FILE_SYSTEM=y
CONFIG_FAT_FILESYSTEM_ELM=y
CONFIG_FS_FATFS_MOUNT_MKFS=y
CONFIG_FS_FATFS_EXFAT=y
CONFIG_DISK_DRIVER_SDMMC=y
CONFIG_PRINTK=y
CONFIG_MAIN_STACK_SIZE=4096

/*********************************/

Additionally, for your information, I was able to write within the micro SD card by using the Arduino libraries and its examples, so I do not know whether I have something wrong configured in the Zephyr project, in the Visual Studio Code...

/*********************************/

Furthermore, I have seen that the Round Display has this caution message in the documentation:

Xiao expansion board caution

Could it be something related to this?

/*********************************/

Thanks beforehand, sorry for the inconveniences and looking forward to hearing from you.

Kind regards.

Daniel.

  • Hi Hieu,

    Thank you very much for your reply and your commitment, and you do not need to apologize, I completely understand Slight smile.

    Ok perfect, let's see if the Seeed community may give us some clues! In any case, I will keep trying it on my own (if it is any consolation, it is also my first time using Zephyr).

    Looking forward to hearing from you.

    Kind regards.

    Daniel.

Related