nrf5340 ble full stack in network core

hello there was a problem configuring the project.

i want build uart central, peripheral project with rpc_host.

The uart peripheral project built fine with -DCONFIG_BT_RPC_STACK=y, but the uart central project failed to build even with DCONFIG_BT_RPC_STACK=y added.

Is there something wrong with this? Or is this not supported for all projects yet?

this is build error log.

it looks like flash memory overflow.

[278/291] Linking C static library zephyr\kernel\libkernel.a

[279/291] Linking C executable zephyr\zephyr_pre0.elf

FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map

cmd.exe /C "cd . && C:\Users\jaesun\Desktop\work\NORDIC\toolchains\v2.3.0\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe  -gdwarf-4 @CMakeFiles\zephyr_pre0.rsp -o zephyr\zephyr_pre0.elf  && cmd.exe /C "cd /D C:\Users\jaesun\Desktop\work\NORDIC\ble_full_stack\central_uart\build\rpc_host\zephyr && C:\Users\jaesun\Desktop\work\NORDIC\toolchains\v2.3.0\opt\bin\cmake.exe -E echo ""

c:/users/jaesun/desktop/work/nordic/toolchains/v2.3.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.exe: zephyr\zephyr_pre0.elf section `rodata' will not fit in region `FLASH'

c:/users/jaesun/desktop/work/nordic/toolchains/v2.3.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.exe: region `FLASH' overflowed by 19289 bytes

collect2.exe: error: ld returned 1 exit status

ninja: build stopped: subcommand failed.

[6/286] Generating include/generated/version.h

-- Zephyr version: 3.2.99 (C:/Users/jaesun/Desktop/work/NORDIC/v2.3.0/zephyr), build: v3.2.99-ncs2

[271/286] Linking C executable zephyr\zephyr_pre0.elf

FAILED: modules/nrf/samples/rpc_host_subimage-prefix/src/rpc_host_subimage-stamp/rpc_host_subimage-build rpc_host/zephyr/zephyr.hex rpc_host/zephyr/zephyr.elf rpc_host/zephyr/merged_CPUNET.hex

cmd.exe /C "cd /D C:\Users\jaesun\Desktop\work\NORDIC\ble_full_stack\central_uart\build\rpc_host && C:\Users\jaesun\Desktop\work\NORDIC\toolchains\v2.3.0\opt\bin\cmake.exe --build . --"

[273/286] Generating dev_handles.c

ninja: build stopped: subcommand failed.

FATAL ERROR: command exited with status 1: 'c:\Users\jaesun\Desktop\work\NORDIC\toolchains\v2.3.0\opt\bin\cmake.EXE' --build 'c:\Users\jaesun\Desktop\work\NORDIC\ble_full_stack\central_uart\build'

*  The terminal process terminated with exit code: 1.

*  Terminal will be reused by tasks, press any key to close it.

  • i can't upload my log.

    An error occurred. Please try again or contact your administrator.

    this message shown

  • Hi,

    I have reproduced your issue with flash overflow. 

    I have successfully tested central_uart sample in NCS v2.3.0 with argument -DCONFIG_BT_RPC_STACK=y. The solution for me was to copy the content of prj.conf into rpc_host.conf and disable all options related to logging which are found under "# Config logger" in prj.conf (and rpc_host.conf). Could you please provide information if this works for you as well?

    Best regards,
    Dejan

  • hello dejans build failed

    this is my prj.conf child_image/rpc_host.conf.

    # Enable the UART driver
    CONFIG_UART_ASYNC_API=y
    CONFIG_NRFX_UARTE0=y
    CONFIG_SERIAL=y
    CONFIG_CONSOLE=y
    CONFIG_UART_CONSOLE=y
    
    # Enable the BLE stack with GATT Client configuration
    CONFIG_BT=y
    CONFIG_BT_CENTRAL=y
    CONFIG_BT_SMP=y
    CONFIG_BT_GATT_CLIENT=y
    
    # Enable the BLE modules from NCS
    CONFIG_BT_NUS_CLIENT=y
    CONFIG_BT_SCAN=y
    CONFIG_BT_SCAN_FILTER_ENABLE=y
    CONFIG_BT_SCAN_UUID_CNT=1
    CONFIG_BT_GATT_DM=y
    CONFIG_HEAP_MEM_POOL_SIZE=2048
    
    # This example requires more workqueue stack
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
    
    # Enable bonding
    CONFIG_BT_SETTINGS=y
    CONFIG_FLASH=y
    CONFIG_FLASH_PAGE_LAYOUT=y
    CONFIG_FLASH_MAP=y
    CONFIG_NVS=y
    CONFIG_SETTINGS=y
    
    # Config logger
    # CONFIG_LOG=y
    # CONFIG_USE_SEGGER_RTT=y
    # CONFIG_LOG_BACKEND_RTT=y
    # CONFIG_LOG_BACKEND_UART=n
    # CONFIG_LOG_PRINTK=n
    
    # CONFIG_ASSERT=y

    build failed log

    warning: BT_MAX_CONN (defined at
    C:/Users/jaesun/Desktop/work/NORDIC/v2.3.0/nrf\subsys\bluetooth/Kconfig:14,
    C:/Users/jaesun/Desktop/work/NORDIC/v2.3.0/nrf\subsys\bluetooth\rpc/Kconfig:170,
    subsys/bluetooth/Kconfig:115) was assigned the value '1' but got the value '2'. See
    docs.zephyrproject.org/.../kconfig.html and/or look up BT_MAX_CONN in
    the menuconfig/guiconfig interface. The Application Development Primer, Setting Configuration
    Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful too.


    warning: Experimental symbol BT_RPC is enabled.


    warning: user value 1 on the int symbol BT_MAX_CONN (defined at C:/Users/jaesun/Desktop/work/NORDIC/v2.3.0/nrf\subsys\bluetooth/Kconfig:14, C:/Users/jaesun/Desktop/work/NORDIC/v2.3.0/nrf\subsys\bluetooth\rpc/Kconfig:170, subsys/bluetooth/Kconfig:115) ignored due to being outside the active range ([2, 20]) -- falling back on defaults

    error: Aborting due to Kconfig warnings

    Parsing C:/Users/jaesun/Desktop/work/NORDIC/v2.3.0/zephyr/Kconfig
    Loaded configuration 'C:/Users/jaesun/Desktop/work/NORDIC/v2.3.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpunet_defconfig'
    Merged configuration 'C:/Users/jaesun/Desktop/work/NORDIC/v2.3.0/nrf/samples/bluetooth/rpc_host/prj.conf'
    Merged configuration 'C:/Users/jaesun/Desktop/work/NORDIC/v2.3.0/nrf/subsys/partition_manager/partition_manager_enabled.conf'
    Merged configuration 'C:/Users/jaesun/Desktop/work/NORDIC/ble_full_stack/central_uart/child_image/rpc_host.conf'
    CMake Error at C:/Users/jaesun/Desktop/work/NORDIC/v2.3.0/zephyr/cmake/modules/kconfig.cmake:328 (message):
    command failed with return code: 1
    Call Stack (most recent call first):
    C:/Users/jaesun/Desktop/work/NORDIC/v2.3.0/nrf/cmake/modules/kconfig.cmake:29 (include)
    C:/Users/jaesun/Desktop/work/NORDIC/v2.3.0/zephyr/cmake/modules/zephyr_default.cmake:108 (include)
    C:/Users/jaesun/Desktop/work/NORDIC/v2.3.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
    C:/Users/jaesun/Desktop/work/NORDIC/v2.3.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:97 (include_boilerplate)
    CMakeLists.txt:8 (find_package)


    -- Configuring incomplete, errors occurred!
    See also "C:/Users/jaesun/Desktop/work/NORDIC/ble_full_stack/central_uart/build/rpc_host/CMakeFiles/CMakeOutput.log".
    See also "C:/Users/jaesun/Desktop/work/NORDIC/ble_full_stack/central_uart/build/rpc_host/CMakeFiles/CMakeError.log".
    CMake Error at C:/Users/jaesun/Desktop/work/NORDIC/v2.3.0/nrf/cmake/multi_image.cmake:433 (message):
    CMake generation for rpc_host failed, aborting. Command: 1
    Call Stack (most recent call first):
    C:/Users/jaesun/Desktop/work/NORDIC/v2.3.0/nrf/cmake/multi_image.cmake:163 (add_child_image_from_source)
    C:/Users/jaesun/Desktop/work/NORDIC/v2.3.0/nrf/samples/CMakeLists.txt:120 (add_child_image)


    -- Configuring incomplete, errors occurred!
    See also "C:/Users/jaesun/Desktop/work/NORDIC/ble_full_stack/central_uart/build/CMakeFiles/CMakeOutput.log".
    See also "C:/Users/jaesun/Desktop/work/NORDIC/ble_full_stack/central_uart/build/CMakeFiles/CMakeError.log".
    FAILED: build.ninja
    C:\Users\jaesun\Desktop\work\NORDIC\toolchains\v2.3.0\opt\bin\cmake.exe --regenerate-during-build -SC:\Users\jaesun\Desktop\work\NORDIC\ble_full_stack\central_uart -BC:\Users\jaesun\Desktop\work\NORDIC\ble_full_stack\central_uart\build
    ninja: error: rebuilding 'build.ninja': subcommand failed
    FATAL ERROR: command exited with status 1: 'C:\Users\jaesun\Desktop\work\NORDIC\toolchains\v2.3.0\opt\bin\cmake.EXE' --build 'c:\Users\jaesun\Desktop\work\NORDIC\ble_full_stack\central_uart\build'

  • i tried another way.

    this is my prj.conf.

    CONFIG_BT=y
    CONFIG_BT_PERIPHERAL=n
    CONFIG_BT_CENTRAL=y
    CONFIG_BT_OBSERVER=y
    CONFIG_BT_DEVICE_NAME="Zephyr"
    CONFIG_BT_SMP=y
    CONFIG_BT_GATT_CLIENT=y
    CONFIG_BT_GATT_DM=y
    CONFIG_HEAP_MEM_POOL_SIZE=2048
    # CONFIG_BT_DEBUG_LOG=y
    CONFIG_BT_GATT_DM_DATA_PRINT=y
    CONFIG_SETTINGS=y
    CONFIG_BT_SETTINGS=y
    CONFIG_NRF_RPC_THREAD_STACK_SIZE=2048
    

    it is compiled well.

    When I run an application, it starts infinitely.

    ble central not working.

    this is my ble central logs

    Starting nRF RPC bluetooth host
    *** Booting Zephyr OS build v3.2.99-ncs2 ***
    Starting nRF RPC bluetooth host
    *** Booting Zephyr OS build v3.2.99-ncs2 ***
    Starting nRF RPC bluetooth host
    *** Booting Zephyr OS build v3.2.99-ncs2 ***
    Starting nRF RPC bluetooth host
    *** Booting Zephyr OS build v3.2.99-ncs2 ***
    Starting nRF RPC bluetooth host
    *** Booting Zephyr OS build v3.2.99-ncs2 ***
    Starting nRF RPC bluetooth host
    *** Booting Zephyr OS build v3.2.99-ncs2 ***
    Starting nRF RPC bluetooth host
    *** Booting Zephyr OS build v3.2.99-ncs2 ***
    Starting nRF RPC bluetooth host
    *** Booting Zephyr OS build v3.2.99-ncs2 ***
    Starting nRF RPC bluetooth host
    *** Booting Zephyr OS build v3.2.99-ncs2 ***
    Starting nRF RPC bluetooth host
    *** Booting Zephyr OS build v3.2.99-ncs2 ***
    Starting nRF RPC bluetooth host
    *** Booting Zephyr OS build v3.2.99-ncs2 ***
    Starting nRF RPC bluetooth host

    *** Booting Zephyr OS build v3.2.99-ncs2 ***
    *** Booting Zephyr OS build v3.2.99-ncs2 ***
    *** Booting Zephyr OS build v3.2.99-ncs2 ***
    *** Booting Zephyr OS build v3.2.99-ncs2 ***
    *** Booting Zephyr OS build v3.2.99-ncs2 ***
    *** Booting Zephyr OS build v3.2.99-ncs2 ***
    *** Booting Zephyr OS build v3.2.99-ncs2 ***
    *** Booting Zephyr OS build v3.2.99-ncs2 ***
    *** Booting Zephyr OS build v3.2.99-ncs2 ***
    *** Booting Zephyr OS build v3.2.99-ncs2 ***
    *** Booting Zephyr OS build v3.2.99-ncs2 ***
    *** Booting Zephyr OS build v3.2.99-ncs2 ***
    *** Booting Zephyr OS build v3.2.99-ncs2 ***
    *** Booting Zephyr OS build v3.2.99-ncs2 ***
    *** Booting Zephyr OS build v3.2.99-ncs2 ***
    *** Booting Zephyr OS build v3.2.99-ncs2 ***
    *** Booting Zephyr OS build v3.2.99-ncs2 ***
    *** Booting Zephyr OS build v3.2.99-ncs2 ***

  • Hi,

    In my tests, I have seen the same error as you if I omit CONFIG_BT_PERIPHERAL=n. It seems that in your previous configuration (based on my previous reply), you forgot to include CONFIG_BT_PERIPHERAL=n. 
    Could you include this configuration option and try building again? Do you get the same result after programming the device?

    Best regards,
    Dejan

Related