Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

OTA over serial failure| sdk 15.2

Hello Everyone,

I am using nrf52832 and sdk 15.2 for ota over serial. I have made bootloader for OTA over UART and tested same with nrfutil using my dfu package file. firmware is upgraded successfully and  working fine.

Now I need to upgrade firmware using host MCU. I tried sending dfu package file( .zip ) to nrf52832 over UART using slip librairy to upgrade firmware but it is not working.

Is there any compulsion to send Ping packet, PNR, MTU Packet, init packet, application and bootloader separately over UART?

Can we send directly dfu package created through nrfutil to nrf52832 from other MCU over UART?

Kindly suggest me right approach.

Parents Reply
  • Hi,

    I had written a code  for ping packet in python and connected nrf52 DK BOARD with my desktop using COM port. flashed softdevice and bootloader into it.

    getting response( `\t\x01\x01\xc0 ) from DK board. is it correct response?

    how can I communicate with DK board using Tx, Rx pins?

    I tried connecting P.06 and P.08 of nrf52 with usb to ttl converter using same code. not getting any response. please help me regarding same.

Children
  • Perhaps you should start with the UART example on the SDK, e.g. the SDK\examples\peripheral\uart, so that you can test that the echoing is working properly. This example will only echo back everything you write to the UART.

    On the nRF52832 DK pin P0.06 = UART TX, and pin P0.08 is the UART RX. This means that you have to connect your other MCU's UART TX to P0.08 and the other MCU's UART RX to P0.06. Is that what you did?

    NB, when you are testing this example, turn off the Flow control. It is set in:

    NRF_SERIAL_DRV_UART_CONFIG_DEF(m_uart0_drv_config,
                          RX_PIN_NUMBER, TX_PIN_NUMBER,
                          RTS_PIN_NUMBER, CTS_PIN_NUMBER,
                          NRF_UART_HWFC_ENABLED, NRF_UART_PARITY_EXCLUDED,
                          NRF_UART_BAUDRATE_115200,
                          UART_DEFAULT_CONFIG_IRQ_PRIORITY);

    Change NRF_UART_HWFC_ENABLED to NRF_UART_HWFC_DISABLED.

    Does your other MCU require flow control by the way?

  • Yes, I did same connections and no need of flow control to other MCU.

    Can we change Tx and Rx pins in bootloader settings?

  • Yes, you can.

    If you look in nrf_dfu_serial_uart.c, there is a function called uart_dfu_transport_init(). This one takes:

        uart_config.pseltxd   = TX_PIN_NUMBER;
        uart_config.pselrxd   = RX_PIN_NUMBER;
        uart_config.pselcts   = CTS_PIN_NUMBER;
        uart_config.pselrts   = RTS_PIN_NUMBER;
        uart_config.hwfc      = NRF_DFU_SERIAL_UART_USES_HWFC ?
                                    NRF_UART_HWFC_ENABLED : NRF_UART_HWFC_DISABLED;

    TX_PIN_NUMBER, RX_PIN_NUMBER, CTS_PIN_NUMBER, and RTS_PIN_NUMBER comes from pca10040.h by default, so if you have a custom board, or want to overwrite these, use your board file.

    The UART flow control is determined by whether NRF_DFU_SERIAL_UART_USES_HWFC is set to 0 or 1. This is set in the sdk_config.h file for the bootloader project.

    Do you know how UART flow control works? If your other device doesn't support it, then you should turn it off in this project.

  • Yes I got it.

    HWFC is enabled in bootloader by default. thats why response is coming from DK board not on custom board. Let me check with HWFC disabled. I;ll get back to you.

  • Hi Edvin.

    It works!! Thanks. after disbling flow control in bootloader. I have checked with python code and nrf 52.

    Now trying with custom board. other MCU may have some issue related to slip library.

    I'll work on it and get back to you again.

    Please tell me if you know any reference for slip lib.

Related