This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Using UART1 for SDK and UART0 for Mesh

Hi,

I am trying to integrate UART and DFU serial from the mesh example.

What I did is:

1. Adding uart drivers and libraries into the DFU project.

2. Adding codes of uart into DFU codes. I changed the priority of the art to "LOW".

3. Editing the sdk_config to enable uart1.

4. Programming an nrf52840 devkit by softdevice, dfu application, device page, and a bootloader as the board connected to the pc.

5. Programing an nrf52840 dongle by softdevice, dfu application, device page, and a bootloader as the target device.

Once I enter the command to send a file it returns:

Upgrading target on COM3 with DFU package D:\Behine Niroo\Nordic\NRF Mesh\nRF5_SDK_17.0.2_d674dde\examples\ble_peripheral\ble_app_blinky\pca10059\s140\ses\Output\Release\Exe\dfu_test.zip. Flow control is enabled.


Failed to upgrade target. Error is: Failed to establish connection

Possible causes:
- bootloader, SoftDevice or application on target does not match the requirements in the DFU package.
- baud rate or flow control is not the same as in the target bootloader.
- target is not in DFU mode. If using the SDK examples, press Button 4 and RESET and release both to enter DFU mode.
- if the error is ERROR_BUSY at the beginning of the DFU process,increase the value of PAGE_ERASE_TIME_MAX by few milliseconds.

What does make this problem? May this relate to the art codes I added?

I appreciate it if you advise me on this issue.

Br,

Sama

  • Hi Hung,

    Thank you for your reply.

    Here is the log you needed.

    <t: 4>, main.c, 1026, ----- BLE Mesh Light Switch Client Demo -----
    <t: 12562>, main.c, 641, Initializing and adding models
    <t: 17497>, main.c, 442, Node Address: 0x000A
    <t: 17499>, main.c, 1074, Enabling serial interface...
    <t: 17503>, mesh_app_utils.c, 66, Device UUID (raw): 137FF47B11294702B381A62F60654E45
    <t: 17506>, mesh_app_utils.c, 67, Device UUID : 137FF47B-1129-4702-B381-A62F60654E45
    <t: 17511>, bearer_event.c, 419, ----- active_irq is -16 -----
    <t: 17527>, bearer_event.c, 419, ----- active_irq is -16 -----
    <t: 17530>, bearer_event.c, 419, ----- active_irq is -16 -----
    <t: 17536>, bearer_event.c, 419, ----- active_irq is -16 -----
    <t: 17548>, main.c, 1084,
    ------------------------------------------------------------------------------------
    Button/RTT 1) Send a message to the odd group (address: 0xC003) to turn on LED 1.
    Button/RTT 2) Send a message to the odd group (address: 0xC003) to turn off LED 1.
    Button/RTT 3) Send a message to the even group (address: 0xC002) to turn on LED 1.
    Button/RTT 4) Send a message to the even group (address: 0xC002) to turn off LED 1.
    ------------------------------------------------------------------------------------
    <t: 17622>, bearer_event.c, 419, ----- active_irq is 18 -----
    <t: 17625>, bearer_event.c, 428, ----- prio is 6 -----
    <t: 17628>, bearer_event.c, 419, ----- active_irq is 18 -----
    <t: 17631>, bearer_event.c, 428, ----- prio is 6 -----
    <t: 18888>, bearer_event.c, 419, ----- active_irq is 18 -----


    when I send my command through the USB and call the "send message" function the log is:

    <t: 1648319>, main.c, 545, Button 1 pressed
    <t: 1648321>, main.c, 568, Sending msg: ONOFF SET 1
    <t: 1648335>, bearer_event.c, 419, ----- active_irq is -16 -----
    <t: 1648338>, app_error_weak.c, 105, Mesh assert at 0x0002CDE4 (:0)

    Any solution?


    I look forward to hearing from you.

    Br,
    Sama

  • Hi,

    Could you please advise me to solve this problem?

    I am struggling with that too much time.

    Br,

    Sama

  • Hi Sama, 
    Sorry for late response, I was on vacation. 
    From what I can see it seems that you were calling the send message from a Thread level. Could you show how you call send message in your code ? 
    Can you send a minimal code that show the issue so that I can test here ? Please try to keep it as minimal as possible so I can run on a DK here. 

Related