how to enable GPIO+SPI mode on ble application

Hi,

I am using NCS v2.4.2 and nRF5340DK + nRF21540EK but I can not enable GPIO+SPI mode.

for example, I use nrf/samples/bluetooth/central_and_peripheral_hr application.

I built the following.

Fullscreen
1
2
west build -p -b nrf5340dk_nrf5340_cpuapp -d build-ble-hrs nrf/samples/bluetooth/central_and_peripheral_hr -- \
-DSHIELD=nrf21540_ek_fwd -Dhci_rpmsg_SHIELD=nrf21540_ek
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

I checked netcpu config but GPIO+SPI mode was not enabled. I did not modify NCS code.

what should I do?

 

also, I tried to add child/hci_rpmsg.conf and add the folloing in the conf file.

Fullscreen
1
CONFIG_MPSL_FEM_NRF21540_GPIO_SPI=y
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

I could enable GPIO+SPI mode by the conf file but the following error output.

It seems netcpu side is crushed. Please help me.

Parents
  • Have you enabled MPSL and FEM also like below? 

    Fullscreen
    1
    2
    3
    4
    # Enable MPSL and FEM
    CONFIG_MPSL=y
    CONFIG_MPSL_FEM=y
    CONFIG_MPSL_FEM_NRF21540_GPIO_SPI=y
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

    Can you attach your full compiled .config file here?

  • MPSL and FEM, no need. it is ok only CONFIG_MPSL_FEM_NRF21540_GPIO_SPI. the following is net cpu .config.

    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    # CONFIG_NETWORKING is not set
    # CONFIG_MODEM_ALT1250 is not set
    # CONFIG_WIFI is not set
    # CONFIG_MBEDTLS is not set
    # CONFIG_NORDIC_SECURITY_BACKEND is not set
    # CONFIG_INIT_STACKS is not set
    CONFIG_ENTROPY_GENERATOR=y
    # CONFIG_TEST_RANDOM_GENERATOR is not set
    # CONFIG_ELTRES_CXM150X is not set
    # CONFIG_SPI is not set
    CONFIG_GPIO=y
    # CONFIG_KSCAN is not set
    # CONFIG_INPUT is not set
    CONFIG_GPIO_INIT_PRIORITY=40
    # CONFIG_UHC_DRIVER is not set
    # CONFIG_REGULATOR is not set
    # CONFIG_SENSOR is not set
    # CONFIG_WATCHDOG is not set
    # CONFIG_MODEM is not set
    # CONFIG_UART_INTERRUPT_DRIVEN is not set
    # CONFIG_DISPLAY is not set
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Hi, the cofigs

    CONFIG_MPSL_FEM_NRF21540_GPIO_SPI and CONFIG_MPSL_FEM_NRF21540_GPIO_SPI_SUPPORT are both enabled in the .config you have sent

  • Hmm, please check my above message.

    already I know I could enable CONFIG_MPSL_FEM_NRF21540_GPIO_SPI by creating child/hci_rpmsg.conf.

    but it do not work. this way, is it correct ? 

  • Hi,

    Yes that is the correct way to set configs for the cpunet.

    I can see that CONFIG_MPSL_FEM_NRF21540_GPIO_SPI gets set correctly for using the FEM module, but the application crashes in the HCI driver. I will discuss with Bluetooth experts.

Reply
  • Hi,

    Yes that is the correct way to set configs for the cpunet.

    I can see that CONFIG_MPSL_FEM_NRF21540_GPIO_SPI gets set correctly for using the FEM module, but the application crashes in the HCI driver. I will discuss with Bluetooth experts.

Children
  • I found to avoid the crash by increasing CONFIG_MAIN_STACK_SIZE but it seems we could NOT control MODE by SPI. please investigate.