BLE no compatible with SPI

Hi, in our project we use nRF5340 to control some externanal peripherals as flash mem through SPI and also we need BLE comunication.

The case is if whe allow the config for the BLE the sistems fall down.

And if set the BLE config in "n" works fine.

This is al the prj.config:

#
# Copyright (c) 2022 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
#
CONFIG_WIFI=y
CONFIG_WIFI_NRF700X=y
CONFIG_NET_L2_WIFI_MGMT=y
CONFIG_HEAP_MEM_POOL_SIZE=25000

CONFIG_NET_PKT_RX_COUNT=1
CONFIG_NET_PKT_TX_COUNT=1

# System settings
CONFIG_NEWLIB_LIBC=y
CONFIG_NEWLIB_LIBC_NANO=n

# Networking
CONFIG_NETWORKING=y
CONFIG_NET_L2_ETHERNET=y
# TODO: Debug why DHCP is needed to scan
CONFIG_NET_DHCPV4=y
CONFIG_NET_IPV4=y
CONFIG_NET_UDP=y
CONFIG_INIT_STACKS=y

# Memories
CONFIG_MAIN_STACK_SIZE=8192
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
CONFIG_NET_TX_STACK_SIZE=4096
CONFIG_NET_RX_STACK_SIZE=4096

# Debugging
CONFIG_STACK_SENTINEL=y
CONFIG_DEBUG_COREDUMP=y
CONFIG_DEBUG_COREDUMP_BACKEND_LOGGING=y
CONFIG_DEBUG_COREDUMP_MEMORY_DUMP_MIN=y

# Logging
CONFIG_LOG=y
CONFIG_PRINTK=y

# Peripherals
CONFIG_GPIO=y
CONFIG_ADC=y
CONFIG_ADC_ASYNC=y
CONFIG_ADC_NRFX_SAADC=y
CONFIG_PINCTRL=y

# I2C
CONFIG_I2C=y
CONFIG_NRFX_TWIM1=y

# SPI
CONFIG_SPI=y
CONFIG_NRFX_SPIM3=y

# UARTE
CONFIG_NRFX_UARTE0=y
CONFIG_NRFX_UARTE2=y

# Reboot
CONFIG_REBOOT=y

# BLE configuration
CONFIG_BT=y
CONFIG_SETTINGS=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_GATT_DYNAMIC_DB=y
CONFIG_BT_DEVICE_NAME="name"
CONFIG_BT_L2CAP_TX_MTU=252
CONFIG_BT_BUF_ACL_TX_SIZE=251
CONFIG_BT_BUF_ACL_RX_SIZE=502

# USB
CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_DEVICE_PRODUCT="name"
CONFIG_USB_DEVICE_PID=0x0009
CONFIG_LOG=y
CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y
CONFIG_USB_DEVICE_LOOPBACK=y
CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y
CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=n

# Low Power
CONFIG_PM_DEVICE=y
CONFIG_POWEROFF=y

#NFC Tag pins as GPIO
CONFIG_NFCT_PINS_AS_GPIOS=y

Why doesn't work the system with this configuration when is set "y" in "CONFIG_BT"?

Thanks in advance, regards.

Parents
  • Hello,

    So when it does not work, what happens? Do you see any error messages? Are the callbacks not triggering? Do you receive garbage data instead of "HelloWorld"?

    Best regards,

    Edvin

  • Hi Edvin.

    Whith the CONFIG_BT=y when I try to program the page on the flash memory the system still waiting the bit write enable latch (WEL) and this bit doesn't change never.

    I don't know why happens this only when the CONFIG_BT is set on "y" and is initialized the BLE.

    To add more info the flash mem is conected on these pins:

    /* SPI definition */
    //! SPI MOSI PORT
    #define HARDWARE_INIT_SPI_MOSI_PORT_NUMBER      1
    //! SPI MOSI pin
    #define HARDWARE_INIT_SPI_MOSI_PIN_NUMBER       5
    //! SPI MISO PORT
    #define HARDWARE_INIT_SPI_MISO_PORT_NUMBER      1
    //! SPI MISO pin
    #define HARDWARE_INIT_SPI_MISO_PIN_NUMBER       8
    //! SPI SCLK PORT
    #define HARDWARE_INIT_SPI_SCLK_PORT_NUMBER      1
    //! SPI SCLK pin
    #define HARDWARE_INIT_SPI_SCLK_PIN_NUMBER       6
    //! SPI CS PORT
    #define HARDWARE_INIT_SPI_CS_PORT_NUMBER        1
    //! SPI CS pin
    #define HARDWARE_INIT_SPI_CS_PIN_NUMBER         9

Reply
  • Hi Edvin.

    Whith the CONFIG_BT=y when I try to program the page on the flash memory the system still waiting the bit write enable latch (WEL) and this bit doesn't change never.

    I don't know why happens this only when the CONFIG_BT is set on "y" and is initialized the BLE.

    To add more info the flash mem is conected on these pins:

    /* SPI definition */
    //! SPI MOSI PORT
    #define HARDWARE_INIT_SPI_MOSI_PORT_NUMBER      1
    //! SPI MOSI pin
    #define HARDWARE_INIT_SPI_MOSI_PIN_NUMBER       5
    //! SPI MISO PORT
    #define HARDWARE_INIT_SPI_MISO_PORT_NUMBER      1
    //! SPI MISO pin
    #define HARDWARE_INIT_SPI_MISO_PIN_NUMBER       8
    //! SPI SCLK PORT
    #define HARDWARE_INIT_SPI_SCLK_PORT_NUMBER      1
    //! SPI SCLK pin
    #define HARDWARE_INIT_SPI_SCLK_PIN_NUMBER       6
    //! SPI CS PORT
    #define HARDWARE_INIT_SPI_CS_PORT_NUMBER        1
    //! SPI CS pin
    #define HARDWARE_INIT_SPI_CS_PIN_NUMBER         9

Children
Related