NFC and FOTA does not work

Hi

SDK: nRF Connect v2.6.1
uP: nRF52832

In my project I try to compbine NFC and FOTA (DFU over BLE). First I did setup a NFC project from the example "writable_ndef_msg". This is running. Then I did setup a demo project based on that example: https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-8-bootloaders-and-dfu-fota/

But after combining those two example project, FOTA does not run. In the "Device Manager" App on my mobile phone I received a "GATT CONN TIMEOUT" error, after starting a firmware upgrade. To speed up the start time, CONFIG_BOOT_VALIDATE_SLOT0=n is set to no in child_image/mcuboot.conf

I think I missed to set a configuration in the prj.conf file but I have no idea what could be wrong.

Further could that be a problem that NFC is allowed to write to the flash?

CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_FLASH=y
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_NVS=y

Attached you find my project.

Thanks and best regards
Markus

Parents
  • Hello Markus,

    From the shared log, I can see a stack overflow error. The GATT timeout error you are receiving from the mobile app indicates no response from the nRF52832 in time. I guess the stack overflow might be crashing the BLE thread, causing the timeout. Could you try increasing the stack size? See CONFIG_MAIN_STACK_SIZECONFIG_SYSTEM_WORKQUEUE_STACK_SIZE

    I haven't checked the sniffer logs. Please see if resolving the stack overflow resolves the issue you are seeing.

    Kind Regards,

    Abhijith

  • Hi Abhijith

    I changed the stack size of those two setting, but stack overflow still does happens as soon as trying to read some infos from the nRF52832 over BLE. Wich values would you suggest for those two stack sizes?

    #
    # Copyright (c) 2019 Nordic Semiconductor ASA
    #
    # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
    #
    CONFIG_NCS_SAMPLES_DEFAULTS=y
    
    CONFIG_NFC_T4T_NRFXLIB=y
    
    CONFIG_NFC_NDEF=y
    CONFIG_NFC_NDEF_MSG=y
    CONFIG_NFC_NDEF_RECORD=y
    CONFIG_NFC_NDEF_URI_REC=y
    CONFIG_NFC_NDEF_URI_MSG=y
    
    CONFIG_MPU_ALLOW_FLASH_WRITE=y
    CONFIG_FLASH=y
    CONFIG_FLASH_PAGE_LAYOUT=y
    CONFIG_NVS=y
    CONFIG_DK_LIBRARY=y
    
    
    # Enable Bluetooth for FOTA (DFU)
    CONFIG_BT=y
    CONFIG_BT_PERIPHERAL=y
    CONFIG_BT_DEVICE_NAME="NFC+DFU"
    
    # Enable MCUboot and FOTA
    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y
    
    #use LFRC instead of LFXO --> decrease start up time
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
    
    
    #stack size
    CONFIG_MAIN_STACK_SIZE=4096
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=8192

    thanks and best regards
    Markus

Reply
  • Hi Abhijith

    I changed the stack size of those two setting, but stack overflow still does happens as soon as trying to read some infos from the nRF52832 over BLE. Wich values would you suggest for those two stack sizes?

    #
    # Copyright (c) 2019 Nordic Semiconductor ASA
    #
    # SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
    #
    CONFIG_NCS_SAMPLES_DEFAULTS=y
    
    CONFIG_NFC_T4T_NRFXLIB=y
    
    CONFIG_NFC_NDEF=y
    CONFIG_NFC_NDEF_MSG=y
    CONFIG_NFC_NDEF_RECORD=y
    CONFIG_NFC_NDEF_URI_REC=y
    CONFIG_NFC_NDEF_URI_MSG=y
    
    CONFIG_MPU_ALLOW_FLASH_WRITE=y
    CONFIG_FLASH=y
    CONFIG_FLASH_PAGE_LAYOUT=y
    CONFIG_NVS=y
    CONFIG_DK_LIBRARY=y
    
    
    # Enable Bluetooth for FOTA (DFU)
    CONFIG_BT=y
    CONFIG_BT_PERIPHERAL=y
    CONFIG_BT_DEVICE_NAME="NFC+DFU"
    
    # Enable MCUboot and FOTA
    CONFIG_BOOTLOADER_MCUBOOT=y
    CONFIG_NCS_SAMPLE_MCUMGR_BT_OTA_DFU=y
    
    #use LFRC instead of LFXO --> decrease start up time
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
    
    
    #stack size
    CONFIG_MAIN_STACK_SIZE=4096
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=8192

    thanks and best regards
    Markus

Children
No Data
Related