Example code

I have been forced to upgrade to the nRF54L15 from the nRF52840 DK.  The example code in the SDK  for the nRF52840 the 'ble-peripheral' had example code for 'ble_app_uart' which was perfect for me.  All I need to do is receive a string of characters from a smart phone, and then do what I need to do with it. 

In the 'ble_app_uart' example there is a routine called 'nus_data_handler'  which had an array called 'ble_data[]'  which received the string of data from the phone.

I have just installed the SDK for the nRF52840 Development Kit and I can not find anything comparable with the 'ble_app_uart' for nRF52840.

It must be in there somewhere, but I have looked, but can not find it.  I am hoping that you can point me in the right direction.

Cheers,

Brian Fleming

Parents Reply Children
  • Hello. could you take a look at the attached notepad file.  

    I have documented as well as I can about my inability to compile due to a Python error.

    Cheers,

    Brian Fleming

    My problem is that I can not compile (Build) a program like I could with Kiel because it says there is a problem with missing Python.

    I have selected the peripheral_uart from the SDK as it seems that

    static void bt_receive_cb (struct bt_conn *conn, const uint8_t *const data, uint16_t len)

    has the functionality the I require.

    I open the peripheral_uart in the VS Code development environment and without any changes to the code if I click the Build button to compile I receive the following in OUTPUT

    [main] Building folder: c:/ncs/v3.1.1/nrf/samples/bluetooth/peripheral_uart/build

    [main] Configuring project: peripheral_uart

    [proc] Executing command: C:\ncs\toolchains\c1a76fddb2\opt\bin\cmake.exe -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE --no-warn-unused-cli -S C:/ncs/v3.1.1/nrf/samples/bluetooth/peripheral_uart -B c:/ncs/v3.1.1/nrf/samples/bluetooth/peripheral_uart/build

    [cmake] Not searching for unused variables given on the command line.

    [cmake] Loading Zephyr default modules (Zephyr base (cached)).

    [cmake] -- Application: C:/ncs/v3.1.1/nrf/samples/bluetooth/peripheral_uart

    [cmake] -- CMake version: 3.21.0

    [cmake] CMake Error at C:/ncs/toolchains/c1a76fddb2/opt/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:230 (message):

    [cmake] Could NOT find Python3 (missing: Python3_EXECUTABLE Interpreter) (Required

    [cmake] is at least version "3.10")

    [cmake] Call Stack (most recent call first):

    [cmake] C:/ncs/toolchains/c1a76fddb2/opt/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE)

    [cmake] C:/ncs/toolchains/c1a76fddb2/opt/share/cmake-3.21/Modules/FindPython/Support.cmake:3165 (find_package_handle_standard_args)

    [cmake] C:/ncs/toolchains/c1a76fddb2/opt/share/cmake-3.21/Modules/FindPython3.cmake:485 (include)

    [cmake] C:/ncs/v3.1.1/zephyr/cmake/modules/python.cmake:41 (find_package)

    [cmake] C:/ncs/v3.1.1/zephyr/cmake/modules/zephyr_default.cmake:131 (include)

    [cmake] C:/ncs/v3.1.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)

    [cmake] C:/ncs/v3.1.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:97 (include_boilerplate)

    [cmake] CMakeLists.txt:8 (find_package)

    [cmake]

    [cmake]

    [cmake] -- Configuring incomplete, errors occurred!

    [proc] The command: C:\ncs\toolchains\c1a76fddb2\opt\bin\cmake.exe -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE --no-warn-unused-cli -S C:/ncs/v3.1.1/nrf/samples/bluetooth/peripheral_uart -B c:/ncs/v3.1.1/nrf/samples/bluetooth/peripheral_uart/build exited with code: 1

    And the following in PROBLEMS

    CMake Error at C:/ncs/toolchains/c1a76fddb2/opt/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:230 (message):Could NOT find Python3 (missing: Python3_EXECUTABLE Interpreter) (Required

    is at least version "3.10")

    Obviously, it is not finding Python which is installed on my machine. The where and version are returning the following values.

    C:\>where python

    C:\Users\Brian\AppData\Local\Microsoft\WindowsApps\python.exe

    C:\>python --version

    Python 3.13.9

    C:\>

    Here are all the Python executables

    C:\>where pyth*.exe

    C:\Users\Brian\AppData\Local\Microsoft\WindowsApps\python.exe

    C:\Users\Brian\AppData\Local\Microsoft\WindowsApps\python3.13.exe

    C:\Users\Brian\AppData\Local\Microsoft\WindowsApps\python3.exe

    C:\Users\Brian\AppData\Local\Microsoft\WindowsApps\pythonw.exe

    C:\Users\Brian\AppData\Local\Microsoft\WindowsApps\pythonw3.13.exe

    C:\Users\Brian\AppData\Local\Microsoft\WindowsApps\pythonw3.exe

    C:\>

    In the VS Code environment if I click the Gear (Manage) and select the Settings options and search for pyth I find a field which I enter as per below.

    C:\Users\Brian\AppData\Local\Microsoft\WindowsApps\pythonw3.13.exe

    In the VS Code environment in the Extensions the nRF Connect for VS Code and the nRF Connect for VS Code Extension Pack are both installed.

    I have watched the nRF Connect for VS Code, part 1: Installation video in the internet and it does not say anything about configuring Python.

Related