Successful Implementation on nRF52832dk, but Crash on nRF52840_dongle

Hello everyone,

I have developed a program that utilizes UART communication, Bluetooth Mesh, and TWI/I²C functionalities, all within the framework of the Zephyr project. 

The program runs flawlessly on an nRF52832 Development Kit, where I am able to receive log outputs correctly and process UART inputs. The build configuration for the nRF52832 DK has worked as expected.

I encounter a problem when attempting to run the same program on an nRF52840 Dongle. After adjusting the corresponding build configuration for the nRF52840 Dongle, I experience the device crashing and not even shows a COM port.  Is it possible to obtain an output or diagnosis of my error without relying on the COM port?

I'm uncertain whether this issue stems from hardware, software, or compatibility problems. Has anyone encountered similar issues or can offer assistance in troubleshooting?

To provide some context, I utilize Visual Studio Code with the nRF Connect plugin for both developing and programming the nRF52832 DK. Additionally, I use the nRF Connect Programmer for flashing the nRF52840 Dongle.

My prj.conf :

CONFIG_NCS_SAMPLES_DEFAULTS=y

# Deffered logging helps improve LPN power consumption
# when friendship is established.
CONFIG_LOG_MODE_DEFERRED=y

# General configuration
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
CONFIG_FLASH=y
CONFIG_FLASH_MAP=y
CONFIG_NVS=y
CONFIG_SETTINGS=y
CONFIG_HWINFO=y
CONFIG_DK_LIBRARY=y
CONFIG_PM_SINGLE_IMAGE=y
CONFIG_PM_PARTITION_SIZE_SETTINGS_STORAGE=0x8000
CONFIG_SOC_FLASH_NRF_PARTIAL_ERASE=y

# Bluetooth configuration
CONFIG_BT=y
CONFIG_BT_COMPANY_ID=0x0059
CONFIG_BT_DEVICE_NAME="Mesh UART"
CONFIG_BT_L2CAP_TX_MTU=69
CONFIG_BT_L2CAP_TX_BUF_COUNT=8
CONFIG_BT_CTLR_DATA_LENGTH_MAX=37
CONFIG_BT_BUF_ACL_TX_SIZE=37
CONFIG_BT_OBSERVER=y
CONFIG_BT_PERIPHERAL=y
CONFIG_BT_SETTINGS=y

# Disable unused Bluetooth features
CONFIG_BT_CTLR_DUP_FILTER_LEN=0
CONFIG_BT_CTLR_LE_ENC=n
CONFIG_BT_PHY_UPDATE=n
CONFIG_BT_CTLR_CHAN_SEL_2=n
CONFIG_BT_CTLR_MIN_USED_CHAN=n
CONFIG_BT_CTLR_PRIVACY=n

# Bluetooth Mesh configuration
CONFIG_BT_MESH=y
CONFIG_BT_MESH_RELAY=y
CONFIG_BT_MESH_FRIEND=y
CONFIG_BT_MESH_ADV_BUF_COUNT=13
CONFIG_BT_MESH_RX_SEG_MAX=10
CONFIG_BT_MESH_TX_SEG_MAX=10
CONFIG_BT_MESH_PB_GATT=y
CONFIG_BT_MESH_GATT_PROXY=y
CONFIG_BT_MESH_DK_PROV=y

# Enable Bluetooth mesh models debug logs
CONFIG_BT_DEBUG_LOG=n
CONFIG_BT_MESH_LOG_LEVEL_DBG=n

# Disabled for UART MESH NODE
# Enable Shell module and use UART as a backend
#CONFIG_SHELL=y
#CONFIG_SHELL_BACKEND_SERIAL=y

# UART configuration
CONFIG_GPIO=y
#CONFIG_I2C=y

CONFIG_SERIAL=y
CONFIG_UART_INTERRUPT_DRIVEN=y


#CONFIG_NEWLIB_LIBC=y

CONFIG_HEAP_MEM_POOL_SIZE=4096



#logging stuff
CONFIG_LOG=y
# CONFIG_LOG_MODE_DEFERRED=y #default
CONFIG_LOG_RUNTIME_FILTERING=y
CONFIG_LOG_BUFFER_SIZE=2048
CONFIG_LOG_PRINTK=y
CONFIG_LOG_PROCESS_TRIGGER_THRESHOLD=0
CONFIG_COVERAGE=n
CONFIG_LOG_TAG_MAX_LEN=8

 

Greetings Grin

  • Hello,

    Most of the staff is away for a long weekend in Norway, so there will be some delays in response time. Thanks for your patience.

  • Hi, 

    You might need the device overlay like this nrf52840dongle_nrf52840.overlay, config like this nrf52840dongle_nrf52840.conf and pm_static_nrf52840dongle_nrf52840.yml for nRF52840 Dongle. 

    Regards,
    Amanda H.

  • Thanks for the fast answer, Amanda

    I added the config from nrf52840dongle_nrf52840.overlay and only use UART in my code. Besides i complement the nrf52840dongle_nrf52840.conf parts in my prj.conf

    no change

    Regards,
    Marc N.

    Behind serial is the basic sample Code -> and works on nRF52832 Development Kit

    /*Mesh Node UART
    * Created: 01.02.2024
    * Author: Mia, Marc
    */
    
    /** @file
     *  @brief This is a special BT Mesh Node that acts as the bridge between a computer and the BT Mesh.
     */
    
    // BT Mesh
    #include <zephyr/bluetooth/bluetooth.h>
    #include <bluetooth/mesh/models.h>
    #include <bluetooth/mesh/dk_prov.h>
    #include "model_handler.h"
    
    // TODO Remove this
    #include <dk_buttons_and_leds.h>
    
    // UART
    #include <zephyr/kernel.h>          // Zephyr kernel headers.
    #include "serial.h"                 // Custom serial communication header.
    #include <zephyr/drivers/uart.h>    // UART driver functions from Zephyr.
    #include <string.h>                 // Standard string handling functions.
    
    #define UART_DEVICE_NODE DT_CHOSEN(zephyr_shell_uart)
    
    
    // TODO Remove DK_BUTTONS
    static void bt_ready(int err)
    {
    	if (err) {
    		printk("Bluetooth init failed (err %d)\n", err);
    		return;
    	}
    
    	printk("Bluetooth initialized\n");
    
    	dk_leds_init();
    	dk_buttons_init(NULL);
    
    	err = bt_mesh_init(bt_mesh_dk_prov_init(), model_handler_init());
    	if (err) {
    		printk("Initializing mesh failed (err %d)\n", err);
    		return;
    	}
    
    	if (IS_ENABLED(CONFIG_BT_MESH_LOW_POWER)) {
    		bt_mesh_lpn_set(true);
    	}
    
    	if (IS_ENABLED(CONFIG_SETTINGS)) {
    		settings_load();
    	}
    
    	/* This will be a no-op if settings_load() loaded provisioning info */
    	bt_mesh_prov_enable(BT_MESH_PROV_ADV | BT_MESH_PROV_GATT);
    
    	printk("Mesh initialized\n");
    }
    
    int main(void)
    {
    	// printk("Initializing...\n");
    	// int err = 0;
    	// err = bt_enable(bt_ready);
    	// if (err) {
    	// 	printk("Bluetooth init failed (err %d)\n", err);
    	// }
    
    	init_serial(); 
    
    	print_uart("INIT DONE\n");
    
    	while (1)
    	{
    	 	read_uart();
    	}
    }

  • Hi!

    Amanda is out of office, so I'm replying instead.

    What nRF Connect SDK version are you using?

    Could you zip and upload a small sample that reproduces the issue to this ticket? 

    BR,

    Sigurd

Related