Issue on SX128X using nRF Connect SDK 3.0.0

Hello everyone,

I'm developing an application using the SX128x radio with the LoRaWAN Basic Modem.

The project runs successfully on a custom board based on the nRF5340 using nRF Connect SDK v2.9.0.

Now, I'm migrating to use nRF Connect SDK v3.0.0.

However, when running the same code with SDK v3.0.0, no SPI activity is observed on the oscilloscope—it's completely silent.

I currently use SPI0. No LOG Erros from spi API or spi device was showed. The spi code:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*!
* \file smtc_hal_spi.c
*
* \brief SPI Hardware Abstraction Layer implementation
*
*/
#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include <soc.h>
#include <zephyr/kernel.h>
#include <zephyr/types.h>
#include <zephyr/device.h>
#include <zephyr/logging/log.h>
#include <zephyr/drivers/gpio.h>
#include <zephyr/drivers/spi.h>
#include "smtc_hal_spi.h"
#include "smtc_hal_mcu.h"
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

My pinctrl:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
&pinctrl {
i2c1_default: i2c1_default {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 1, 2)>,
<NRF_PSEL(TWIM_SCL, 1, 3)>;
bias-pull-up;
nordic,drive-mode = <NRF_DRIVE_E0E1>;
};
};
i2c1_sleep: i2c1_sleep {
group1 {
psels = <NRF_PSEL(TWIM_SDA, 1, 2)>,
<NRF_PSEL(TWIM_SCL, 1, 3)>;
low-power-enable;
};
};
pwm0_backlight_default: pwm0_backlight_default {
group1 {
psels = <NRF_PSEL(PWM_OUT0, 0, 31)>;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

My .dts:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
* Copyright (c) 2020 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
/dts-v1/;
#include <nordic/nrf5340_cpuapp_qkaa.dtsi>
#include "aura_nrf5340_cpuapp-pinctrl.dtsi"
#include <zephyr/dt-bindings/input/input-event-codes.h>
#include <zephyr/dt-bindings/mipi_dbi/mipi_dbi.h>
/ {
model = "Aura NRF5340 Application";
compatible = "nordic,nrf5340-dk-nrf5340-cpuapp";
chosen {
zephyr,sram = &sram0_image;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
zephyr,sram-secure-partition = &sram0_s;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Has anyone experienced a similar issue or can offer guidance on this behavior?

Thanks a lot in advance!

Parents
  • Hi

    Are you using a DK? If so then you need to set the config option CONFIG_NFCT_PINS_AS_GPIOS=Y as the pins are used for NFC on the DK

    Regards

    Runar

  • No. I'm using a custom board with SPI on:

    spi0_sx128x_default: spi0_sx128x_default {
    group1 {
    psels = <NRF_PSEL(SPIM_SCK, 0, 22)>,
    <NRF_PSEL(SPIM_MOSI, 0, 0)>,
    <NRF_PSEL(SPIM_MISO, 0, 4)>;
    bias-pull-down;
    };
    };

    spi0_sx128x_sleep: spi0_sx128x_sleep {
    group1 {
    psels = <NRF_PSEL(SPIM_SCK, 0, 22)>,
    <NRF_PSEL(SPIM_MOSI, 0, 0)>,
    <NRF_PSEL(SPIM_MISO, 0, 4)>;
    low-power-enable;
    };
    };
    I already using this macro CONFIG_NFCT_PINS_AS_GPIOS
  • My mistake. I was a bit to haste when looking at your pins. 

    Remember SPIM should use a dedicated clock pin pr Pin assignments

    I would like to see your overlay for the 54L15 and your prj.conf

    The atteched .dts shows has includes to the 5340 so I can't be sure regarding that file. 

    Also there is no spi0 on the 54l15. Are you refeering to SPIM00?

    Runar

Reply
  • My mistake. I was a bit to haste when looking at your pins. 

    Remember SPIM should use a dedicated clock pin pr Pin assignments

    I would like to see your overlay for the 54L15 and your prj.conf

    The atteched .dts shows has includes to the 5340 so I can't be sure regarding that file. 

    Also there is no spi0 on the 54l15. Are you refeering to SPIM00?

    Runar

Children
  • I apologize for the confusion. Although I plan to use the nRF54L15 in my future project, right now I’m adapting my existing code—originally developed for a custom nRF5340 board running nRF Connect SDK 2.9.0—to nRF Connect SDK 3.0.0. While the application works perfectly under SDK 2.9.0, after upgrading to SDK 3.0.0 I no longer see any SPI0 activity on the oscilloscope.

  • Haha no worries. I would still like the overlay and the prj.conf. 

    You can for the moment ignore everything I have written regarding pins as it would not be relevant for the 5340

    Regards

    Runar

  • haha ok.

    my custom _defconfig:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    # SPDX-License-Identifier: Apache-2.0
    # Enable MPU
    CONFIG_ARM_MPU=y
    # Enable hardware stack protection
    CONFIG_HW_STACK_PROTECTION=y
    # Enable TrustZone-M
    CONFIG_ARM_TRUSTZONE_M=y
    # enable GPIO
    CONFIG_GPIO=y
    CONFIG_SPI=y
    # Enable uart driver
    CONFIG_SERIAL=y
    # enable console
    CONFIG_CONSOLE=y
    CONFIG_UART_CONSOLE=y
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    my prj.conf:

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    # Enable logging and RTT DEBUG output
    CONFIG_LOG=y
    CONFIG_LOG_MODE_IMMEDIATE=y
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_LOG_BACKEND_RTT=y
    CONFIG_LOG_PRINTK=y
    CONFIG_LOG_MODE_DEFERRED=n
    CONFIG_SEGGER_RTT_BUFFER_SIZE_UP=64
    CONFIG_LOG_BUFFER_SIZE=4096
    CONFIG_LOG_BACKEND_RTT_BUFFER_SIZE=4096
    CONFIG_LOG_PROCESS_THREAD_STACK_SIZE=4096
    # LVGL
    CONFIG_MAIN_STACK_SIZE=4096
    CONFIG_LV_Z_MEM_POOL_SIZE=40000
    CONFIG_DISPLAY=y
    CONFIG_ST7789V=y
    CONFIG_ST7789V_RGB565=y
    CONFIG_LVGL=y
    # CONFIG_LV_CONF_MINIMAL=y
    # CONFIG_LV_USE_ARC=y
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    My custom .pinctrl and custom.dts was on first message.

  • Out of curriosty is there anything else that is not working in your application? For I don't see anything that stands out. 

    CONFIG_SOC_ENABLE_LFXO=n has been deprecated in NCS 3.0 and you should set this in the devicetree like you see here and here

    Regards

    Runar