SPI clock-frequency not allowed to go to 125kHz in

I'm testing the spi communication protocol with the nRF54L15 DK. At that moment, I'm testing the lesson5-exercise 1 solution of the intermediate course.

The problem appears when I try to decrease the clock frequency to 125kHz.


[00:00:00.000,671] <inf> Lesson5_Exercise1: -------------------------------------------------------------
[00:00:00.000,675] <inf> Lesson5_Exercise1: bme_read_calibrationdata: Reading from calibration registers:
[00:00:00.000,687] <err> spi_nrfx_spim: Failed to initialize nrfx driver: 0bad0004
[00:00:00.000,693] <err> Lesson5_Exercise1: spi_transceive_dt() failed, err: -5
[00:00:00.000,702] <inf> Lesson5_Exercise1: Reg[0x88] 2 Bytes read: Param T1 = 0

There is my overlay:

/* STEP 2.1 - Add the SPI peripheral to spi21. uart20 is being used, so use spi21 as you cannot use same instance of spi/i2c/uart */
&spi21 {
    compatible = "nordic,nrf-spim";
    status = "okay";
    pinctrl-0 = <&spi21_default>;
    pinctrl-1 = <&spi21_sleep>;
    pinctrl-names = "default", "sleep";
    cs-gpios = <&gpio1 8 GPIO_ACTIVE_LOW>;
    bme280: bme280@0 {
        compatible = "bosch,bme280";
        reg = <0>;
        spi-max-frequency = <250000>;
    };
};

/* STEP 2.2 - Change the pin configuration */

/*  */
&pinctrl {
    spi21_default: spi21_default {
        group1 {
                psels = <NRF_PSEL(SPIM_SCK, 1, 11)>,
                        <NRF_PSEL(SPIM_MOSI, 1, 13)>,
                        <NRF_PSEL(SPIM_MISO, 1, 14)>;
        };
    };

    spi21_sleep: spi21_sleep {
        group1 {
                psels = <NRF_PSEL(SPIM_SCK, 1, 11)>,
                        <NRF_PSEL(SPIM_MOSI, 1, 13)>,
                        <NRF_PSEL(SPIM_MISO, 1, 14)>;
                low-power-enable;
        };
    };
};
Parents
  • Hi

    We are aware of this and have an internal investigation ongoing on this. We're seeing this whenever setting the SPI frequency lower than 1MHz. For now, using frequencies between 1MHz and 4MHz should be fine. I'll let you know if the internal ticket comes to some resolution any time soon. Is there a specific reason you need the device to run at 125kHz?

    Best regards,

    Simon

  • Hi,

    I also try to use SPI on a NRF54L15-DK with a frequency below 200kHz. I use the SPI as a workaround that prevents me from doing bit-banging to configure a microphone. But the microphone need to have a clock between 50 to 200kHz. By configuring the spi-max-frequency to 200kHz or lower, I also get the following error : 

    spi_write_dt() failed, err: -5

    I would like to know if your internal investigation yielded any results and if there was a solution to this problem.

    Thank's

    arey

  • Hi

    I'm sorry, but this has been down-prioritized on our side and we have not yet come to a resolution in the internal ticket. 

    For your issue. Error message -5 points to an EIO (input/output error), so the spi_write_dt() is not able to write as it has input/output errors.

    Best regards,

    Simon

Reply Children
No Data
Related