how to connnect external flash(w25qxx) to nrf52833dk board and validate that it the spi communication has been enabled

hi i'm new to developing nrf applications i have practised the sampled examples from https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/ but i'm unable to connect using the spi interface. I am currently using nrf connect sdk v2.2.0. It would be really helpful if you can help me establish spi communication with my external flash. 

Parents
  • Hello,

    When it comes to NCS v2.0.0 and higher you need to use the pinctrl for mapping the pin configuration. Please see this page and also go through  Devacdemy lesson2 which explains this with an example.

    Kind Regards,

    Abhijith

  • here is my new updated overlay file 

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    spi_flash0:&spi2
    {
    compatible = "nordic,nrf-spim";
    pinctrl-0 = <&spi2_default_alt>;
    pinctrl-1 = <&spi2_sleep_alt>;
    pinctrl-names = "default", "sleep";
    status = "okay";
    // cs-gpios = <&gpio0 31 GPIO_ACTIVE_LOW>;
    };
    spi2_default_alt: spi2_default_alt {
    group1 {
    psels = <NRF_PSEL(SPIM_MOSI, 0, 9)>,
    <NRF_PSEL(SPIM_SCK, 0, 8)>,
    <NRF_PSEL(SPIM_MISO, 0, 10)>;
    };
    // group2 {
    // psels = <NRF_PSEL(SPIM_MISO, 0, 7)>;
    // bias-pull-down;
    // };
    };
    spi2_sleep_alt: spi2_sleep_alt {
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Reply
  • here is my new updated overlay file 

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    spi_flash0:&spi2
    {
    compatible = "nordic,nrf-spim";
    pinctrl-0 = <&spi2_default_alt>;
    pinctrl-1 = <&spi2_sleep_alt>;
    pinctrl-names = "default", "sleep";
    status = "okay";
    // cs-gpios = <&gpio0 31 GPIO_ACTIVE_LOW>;
    };
    spi2_default_alt: spi2_default_alt {
    group1 {
    psels = <NRF_PSEL(SPIM_MOSI, 0, 9)>,
    <NRF_PSEL(SPIM_SCK, 0, 8)>,
    <NRF_PSEL(SPIM_MISO, 0, 10)>;
    };
    // group2 {
    // psels = <NRF_PSEL(SPIM_MISO, 0, 7)>;
    // bias-pull-down;
    // };
    };
    spi2_sleep_alt: spi2_sleep_alt {
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Children
No Data