Sysbuild example nRF5340DK UART output

Hi Community,

I'm learning the sysbuild stuffs, try to upgrade my code to sdk v2.9.0.

Exercise 2 - Adding custom image - Nordic Developer Academy

I'm using nRF5340DK to run this exercise code, but I can't find the so called "UART30 " for output.

Could you please give me more instructions? thanks!

Regards

Danny

Parents
  • Hi,

    Only the nRF54L15 uses the FLPR core. The nRF5340 uses the Network core, which is on UART0.

    The COM port settings in Windows does not match to UART name

    Regards,
    Sigurd Hellesvik

  • Hi  

    I want to upgrade my code to sdk v2.9.0.

    Exercise 4 – DFU over USB 

    Exercise 5 – FOTA over Bluetooth Low Energy

    these two features I need for my use case, I know they are currently only supported for nRF5340DK. I tried to compile DFU over USB for thingy53, seems not working.

    could you please share me how to make them also working for thingy53? because my board is similar as thingy53.

    Regards

    Danny

  • yes,

    I need to upload two bin files separately and give them a number 0 and 1:

    it works in this way.

    is it somehow possible to use the dfu_application.zip directly? 

  • Hi  

    build the FOTA ncs-inter/l9/l9_e5_nrf5340_both_sol at main · NordicDeveloperAcademy/ncs-inter for Thingy53

    Cannot find any discussion regarding this kind of error, maybe nobody tried this, could you please have a look:

    ---- Reopened serial port COM28 ----
    *** Booting My Application v3.0.0-b901c3efa989 ***
    *** Using nRF Connect SDK v3.0.0-3bfc46578e42 ***
    *** Using Zephyr OS v4.0.99-3e0ce7636fa6 ***
    Starting Bluetooth Peripheral LBS sample
    I: 8 Sectors of 4096 bytes
    I: alloc wra: 0, fe8
    I: data wra: 0, 0
    E: Endpoint binding failed with -11
    E: HCI driver open failed (-11)
    Bluetooth init failed (err -11)

    Thanks and Regards

    Danny

  • danny0007 said:
    is it somehow possible to use the dfu_application.zip directly? 

    It is not. The nRF SoC can not handle the .zip file. This is required by the app that sends the update.
    When you select dfu_application.zip in the Android app, the nrf Android app will unzip it automatically and send the images in order.

    danny0007 said:

    Cannot find any discussion regarding this kind of error, maybe nobody tried this, could you please have a look:

    ---- Reopened serial port COM28 ----
    *** Booting My Application v3.0.0-b901c3efa989 ***
    *** Using nRF Connect SDK v3.0.0-3bfc46578e42 ***
    *** Using Zephyr OS v4.0.99-3e0ce7636fa6 ***
    Starting Bluetooth Peripheral LBS sample
    I: 8 Sectors of 4096 bytes
    I: alloc wra: 0, fe8
    I: data wra: 0, 0
    E: Endpoint binding failed with -11
    E: HCI driver open failed (-11)
    Bluetooth init failed (err -11)

    My guess is that this error is because the radio core fails, and therefore, the application core can not communicate with it over HCI.

  • Hi  

    I compared the board files of nRF5340DK and Thingy53 one by one, still cannot make it working.

    could you please compile the FOTA code for Thingy53 and take a look? thanks.

    Regards

    Danny

  • Hi @ 

    after changing the code in thingy53_nrf5340_common.dtsi to this:

        chosen {
            //zephyr,bt-hci-ipc = &ipc0;
            zephyr,bt-hci = &bt_hci_ipc0;
            //nordic,802154-spinel-ipc = &ipc0;
            //zephyr,ieee802154 = &ieee802154;
            //nordic,pm-ext-flash = &mx25r64;
        };
    changing the code in thingy53_nrf5340_cpunet.dts to this:
        chosen {
            //zephyr,console = &uart0;
            //zephyr,shell-uart = &uart0;
            //zephyr,uart-mcumgr = &uart0;
            //zephyr,bt-mon-uart = &uart0;
            //zephyr,bt-c2h-uart = &uart0;
            zephyr,bt-hci-ipc = &ipc0;
            //nordic,802154-spinel-ipc = &ipc0;
            zephyr,sram = &sram1;
            zephyr,flash = &flash1;
            zephyr,code-partition = &slot0_partition;
            zephyr,ieee802154 = &ieee802154;
        };
    the FOTA code for both cores is running, the HCI error is gone, but I'm not sure if it's a reliable solution, please double check it.
    **********************************************************************************
    Additionally, since I only have USB on my board, for debugging I want to redirect the logging and output of printk to USB, so I add following code in app.overlay 
    /* Step 1.1  - Add external flash to applciation */
    / {
        chosen {
            nordic,pm-ext-flash = &mx25r64;
            zephyr,console = &cdc_acm_uart0; //for printk in app
        };
    };
     
    &usbd {
        cdc_acm_uart0: cdc_acm_uart0 {
            compatible = "zephyr,cdc-acm-uart";
            status = "okay";
        };
    };
    and this in prj.conf:
    # Enable USB subsystem
    CONFIG_USB_DEVICE_STACK=y
    CONFIG_UART_LINE_CTRL=y
    CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=y
    CONFIG_USB_DEVICE_PRODUCT="TEST_USB"
    CONFIG_STDOUT_CONSOLE=y
    CONFIG_LOG=y
     
    but this crashes the system often, the chip get rebooted very often, how can I make a reliable USB logging? 
    Regards
    Danny
Reply
  • Hi @ 

    after changing the code in thingy53_nrf5340_common.dtsi to this:

        chosen {
            //zephyr,bt-hci-ipc = &ipc0;
            zephyr,bt-hci = &bt_hci_ipc0;
            //nordic,802154-spinel-ipc = &ipc0;
            //zephyr,ieee802154 = &ieee802154;
            //nordic,pm-ext-flash = &mx25r64;
        };
    changing the code in thingy53_nrf5340_cpunet.dts to this:
        chosen {
            //zephyr,console = &uart0;
            //zephyr,shell-uart = &uart0;
            //zephyr,uart-mcumgr = &uart0;
            //zephyr,bt-mon-uart = &uart0;
            //zephyr,bt-c2h-uart = &uart0;
            zephyr,bt-hci-ipc = &ipc0;
            //nordic,802154-spinel-ipc = &ipc0;
            zephyr,sram = &sram1;
            zephyr,flash = &flash1;
            zephyr,code-partition = &slot0_partition;
            zephyr,ieee802154 = &ieee802154;
        };
    the FOTA code for both cores is running, the HCI error is gone, but I'm not sure if it's a reliable solution, please double check it.
    **********************************************************************************
    Additionally, since I only have USB on my board, for debugging I want to redirect the logging and output of printk to USB, so I add following code in app.overlay 
    /* Step 1.1  - Add external flash to applciation */
    / {
        chosen {
            nordic,pm-ext-flash = &mx25r64;
            zephyr,console = &cdc_acm_uart0; //for printk in app
        };
    };
     
    &usbd {
        cdc_acm_uart0: cdc_acm_uart0 {
            compatible = "zephyr,cdc-acm-uart";
            status = "okay";
        };
    };
    and this in prj.conf:
    # Enable USB subsystem
    CONFIG_USB_DEVICE_STACK=y
    CONFIG_UART_LINE_CTRL=y
    CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=y
    CONFIG_USB_DEVICE_PRODUCT="TEST_USB"
    CONFIG_STDOUT_CONSOLE=y
    CONFIG_LOG=y
     
    but this crashes the system often, the chip get rebooted very often, how can I make a reliable USB logging? 
    Regards
    Danny
Children
  • danny0007 said:
    the FOTA code for both cores is running, the HCI error is gone, but I'm not sure if it's a reliable solution, please double check it.

    Good job!

    Looks like you just had to make sure hci matches. So yes, in that case, the changes seem reasonable to me.

    danny0007 said:
    but this crashes the system often, the chip get rebooted very often, how can I make a reliable USB logging? 

    For USB:

    How often do you log?
    Does it improve if you log a bit less?

    Try to set CONFIG_USB_CDC_ACM_RINGBUF_SIZE=16384

  • Regardless of the USB issue.

    the HCI issue happens again, it seems not a stable solution, it happens randomly.

    Actually during the debugging, I also found it's working only sometimes, even the same code doesn't work after another flash.

  • Hi  

    I finally fixed it and it's stable.

    1. first of all, the board files of thingy53 has no issue.

    2. the configuration in ipc_radio.conf causes the issue, because here the UART is enabled, but in the  *_cpunet.dts of boards file uart0 is disabled. this causes conflict and HCI issue. So I just commented these out:

    #CONFIG_SERIAL=y
    #CONFIG_UART_CONSOLE=y
    #CONFIG_LOG=y
    no HCI issue happens again.
    please verify it and update the code for thingy53.
    3. last but lease, in the sdk v3.0.0/bootloader/mcuboot/boot/zephyr/boards these is a file named "thingy53_nrf5340_cpuapp.conf", which is also called during the building:

    if the code is compiled for a custom board, a similar file shall be added also, otherwise there will be lots of usb related "k_work* " errors.
    my question here is: how can I put this file under my project and make the building call it from my project? since it's a custom board related file, I dont want to put it into sdk source code.
    Regards
    Danny
  • danny0007 said:
    I finally fixed it and it's stable.

    Good job!

    danny0007 said:
    my question here is: how can I put this file under my project and make the building call it from my project? since it's a custom board related file, I dont want to put it into sdk source code.

    You can use sysbuild to add it.
    For example as project/sysbuild/mcuboot/boards/board_name.conf or as project/sysbuild/ipc_radio/boards/board_name.conf.

    See Lesson 8 – Sysbuild to learn more about Sysbuild.

  • You can use sysbuild to add it.
    For example as project/sysbuild/mcuboot/boards/board_name.conf or as project/sysbuild/ipc_radio/boards/board_name.conf.

    both give similar errors as here:

Related