nRF52833 DK UART Bootloader

I updated the `pca10040_uart` bootloader to work for the nRF52833 DK following the linked instructions.  The only additional change I made was to disable UART flow-control - pca10100.h, HWFC.

 RE: nRF52833 uart bootloader 

Everything works correctly when I perform a bootloader update using the DK USB virtual COM port interface.  I'm now attempting to connect a USB-to-TTL serial cable to pin headers (P0.06, P0.08, GND), but I'm not able to get this working.

I came to realize that I can get the USB-to-TTL interface to work for a bit, but only after I perform a VCP interface communication.  Attached is my terminal output identifying this behavior - this is very repeatable for me with the USB-to-TTL interface failure always occurring at the same point.  For my setup COM11 if by USB-to-TTL interface while COM19 is the VCP interface.

nrfutil terminal output.txt

Parents
  • Hi, 

    I'm now attempting to connect a USB-to-TTL serial cable to pin headers (P0.06, P0.08, GND), but I'm not able to get this working.

    Try to use other pins because P0.06 and P0.08 are for the UART connections on nRF52833 and interface MCU. See Virtual COM port. 

    Regards,
    Amanda H.

  • Hmm, I thought this would work as the reference you linked states:

    "The UART pins connected to the interface MCU are tri-stated when no terminal is connected to the virtual COM port on the computer."

    Anyway, I update the bootloader UART pins to ones I believe are only mapped to headers (P1.01 & P1.02).  Here's my updated `pca10100.h` file:

    #define RX_PIN_NUMBER NRF_GPIO_PIN_MAP(1,1)
    #define TX_PIN_NUMBER NRF_GPIO_PIN_MAP(1,2)
    #define CTS_PIN_NUMBER 7
    #define RTS_PIN_NUMBER 5
    #define HWFC false

    The behavior is similar to what was occurring previously.  In this case a bootloader update attempted on the VCP (COM19 in my case) now fails, as I've moved the bootloader UART pins.  But, it's still the case that a bootloader update on the USB-to-TTL (COM11) is only successful once the VCP communication is attempted.  Here's my console output showing this:

    C:\Users\Jon\Desktop\tmp>nrfutil nrf5sdk-tools -v -v -v -v dfu serial -pkg image.zip -p COM11 -b 115200 -fc 0 -t 5
    2023-01-09 09:13:30,342 Using board at serial port: COM11
    2023-01-09 09:13:30,342 Sending SoftDevice image...
    2023-01-09 09:13:38,464 SLIP: --> [9, 1]
    2023-01-09 09:13:39,465 Serial: No ping response
    2023-01-09 09:13:39,465 SLIP: --> [9, 2]
    2023-01-09 09:13:40,479 Serial: No ping response
    2023-01-09 09:13:40,479 SLIP: --> [9, 3]
    2023-01-09 09:13:41,479 Serial: No ping response
    2023-01-09 09:13:41,479 SLIP: --> [9, 4]
    2023-01-09 09:13:42,483 Serial: No ping response
    2023-01-09 09:13:42,483 SLIP: --> [9, 5]
    2023-01-09 09:13:43,489 Serial: No ping response
    Traceback (most recent call last):
      File "nordicsemi\__main__.py", line 1555, in <module>
      File "click\core.py", line 1137, in __call__
      File "click\core.py", line 1062, in main
      File "click\core.py", line 1668, in invoke
      File "click\core.py", line 1668, in invoke
      File "click\core.py", line 1404, in invoke
      File "click\core.py", line 763, in invoke
      File "nordicsemi\__main__.py", line 1073, in serial
      File "nordicsemi\__main__.py", line 990, in do_serial
      File "nordicsemi\dfu\dfu.py", line 119, in dfu_send_images
      File "nordicsemi\dfu\dfu.py", line 88, in _dfu_send_image
      File "nordicsemi\dfu\dfu_transport_serial.py", line 214, in open
    pc_ble_driver_py.exceptions.NordicSemiException: No ping response after opening COM port
    [7760] Failed to execute script '__main__' due to unhandled exception!
    
    C:\Users\Jon\Desktop\tmp>nrfutil nrf5sdk-tools -v -v -v -v dfu serial -pkg image.zip -p COM19 -b 115200 -fc 0 -t 5
    2023-01-09 09:13:56,775 Using board at serial port: COM19
    2023-01-09 09:13:56,775 Sending SoftDevice image...
    2023-01-09 09:14:00,291 SLIP: --> [9, 1]
    2023-01-09 09:14:01,312 Serial: No ping response
    2023-01-09 09:14:01,312 SLIP: --> [9, 2]
    2023-01-09 09:14:02,340 Serial: No ping response
    2023-01-09 09:14:02,340 SLIP: --> [9, 3]
    2023-01-09 09:14:03,356 Serial: No ping response
    2023-01-09 09:14:03,356 SLIP: --> [9, 4]
    2023-01-09 09:14:04,377 Serial: No ping response
    2023-01-09 09:14:04,377 SLIP: --> [9, 5]
    2023-01-09 09:14:05,419 Serial: No ping response
    Traceback (most recent call last):
      File "nordicsemi\__main__.py", line 1555, in <module>
      File "click\core.py", line 1137, in __call__
      File "click\core.py", line 1062, in main
      File "click\core.py", line 1668, in invoke
      File "click\core.py", line 1668, in invoke
      File "click\core.py", line 1404, in invoke
      File "click\core.py", line 763, in invoke
      File "nordicsemi\__main__.py", line 1073, in serial
      File "nordicsemi\__main__.py", line 990, in do_serial
      File "nordicsemi\dfu\dfu.py", line 119, in dfu_send_images
      File "nordicsemi\dfu\dfu.py", line 88, in _dfu_send_image
      File "nordicsemi\dfu\dfu_transport_serial.py", line 214, in open
    pc_ble_driver_py.exceptions.NordicSemiException: No ping response after opening COM port
    [13396] Failed to execute script '__main__' due to unhandled exception!
    
    C:\Users\Jon\Desktop\tmp>nrfutil nrf5sdk-tools -v -v -v -v dfu serial -pkg image.zip -p COM11 -b 115200 -fc 0 -t 5
    2023-01-09 09:14:19,493 Using board at serial port: COM11
    2023-01-09 09:14:19,508 Sending SoftDevice image...
    2023-01-09 09:14:27,632 SLIP: --> [9, 1]
    2023-01-09 09:14:27,648 SLIP: <-- [96, 9, 1, 1]
    2023-01-09 09:14:27,648 Serial: Set Packet Receipt Notification 0
    2023-01-09 09:14:27,648 SLIP: --> [2, 0, 0]
    2023-01-09 09:14:27,664 SLIP: <-- [96, 2, 1]
    2023-01-09 09:14:27,664 SLIP: --> [7]
    2023-01-09 09:14:27,680 SLIP: <-- [96, 7, 1, 131, 0]
    2023-01-09 09:14:27,680 Sending init packet...
    2023-01-09 09:14:27,680 Serial: Selecting Object: type:1
    2023-01-09 09:14:27,680 SLIP: --> [6, 1]
    2023-01-09 09:14:27,695 SLIP: <-- [96, 6, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
    2023-01-09 09:14:27,695 Serial: Object selected:  max_size:512 offset:0 crc:0
    2023-01-09 09:14:27,695 SLIP: --> [1, 1, 76, 0, 0, 0]
    2023-01-09 09:14:27,711 SLIP: <-- [96, 1, 1]
    2023-01-09 09:14:27,711 Serial: Streaming Data: len:76 offset:0 crc:0x00000000
    2023-01-09 09:14:27,711 SLIP: --> [8, 10, 74, 8, 1, 18, 70, 8, 255, 255, 255, 255, 15, 16, 52, 26, 4, 128, 2, 202, 1, 32, 1, 40, 180, 172, 9, 48, 0, 56, 0, 66, 36, 8, 3, 18, 32, 210, 175, 14, 247, 28, 107, 0, 155, 114, 124, 206, 197, 128, 249, 73, 193, 154, 247, 2, 76, 100, 78, 225, 17, 33, 202, 197, 208]
    2023-01-09 09:14:27,711 SLIP: --> [8, 16, 240, 42, 25, 72, 0, 82, 4, 8, 1, 18, 0]
    2023-01-09 09:14:27,711 SLIP: --> [3]
    2023-01-09 09:14:27,726 SLIP: <-- [96, 3, 1, 76, 0, 0, 0, 81, 196, 170, 55]
    2023-01-09 09:14:27,726 SLIP: --> [4]
    2023-01-09 09:14:27,742 SLIP: <-- [96, 4, 11, 8]
    Traceback (most recent call last):
      File "nordicsemi\__main__.py", line 1555, in <module>
      File "click\core.py", line 1137, in __call__
      File "click\core.py", line 1062, in main
      File "click\core.py", line 1668, in invoke
      File "click\core.py", line 1668, in invoke
      File "click\core.py", line 1404, in invoke
      File "click\core.py", line 763, in invoke
      File "nordicsemi\__main__.py", line 1073, in serial
      File "nordicsemi\__main__.py", line 990, in do_serial
      File "nordicsemi\dfu\dfu.py", line 119, in dfu_send_images
      File "nordicsemi\dfu\dfu.py", line 95, in _dfu_send_image
      File "nordicsemi\dfu\dfu_transport_serial.py", line 256, in send_init_packet
      File "nordicsemi\dfu\dfu_transport_serial.py", line 421, in __execute
      File "nordicsemi\dfu\dfu_transport_serial.py", line 502, in __get_response
    pc_ble_driver_py.exceptions.NordicSemiException: Extended Error 0x08: The init packet does not contain a signature, but this bootloader requires all updates to have one.
    [14256] Failed to execute script '__main__' due to unhandled exception!
    
    C:\Users\Jon\Desktop\tmp>

    It seems like there's something "additional" being performed by the VCP update process, that's allowing for valid UART communication, which isn't being performed by my direction UART communication (i.e., my USB-to-TTL interface).

  • Hi, 

    We are not sure what could be wrong here, but it's more likely that it may have something to do with HWFC. As far as I remember UART DFU uses HWFC. And you only use 2 pins with the USB-TTL cable. This may explain why when you open the virtual comport it works for you. Note that even though HWFC is defined as false in the board config, it's still defined as NRF_DFU_SERIAL_UART_USES_HWFC 1 in the sdk_config.h in the DFU. You could try to disable it in the sdk_config.h.

    As far as I remember UART DFU only works at very slow speed if you don't use HWFC. 

    -Amanda H.

Reply
  • Hi, 

    We are not sure what could be wrong here, but it's more likely that it may have something to do with HWFC. As far as I remember UART DFU uses HWFC. And you only use 2 pins with the USB-TTL cable. This may explain why when you open the virtual comport it works for you. Note that even though HWFC is defined as false in the board config, it's still defined as NRF_DFU_SERIAL_UART_USES_HWFC 1 in the sdk_config.h in the DFU. You could try to disable it in the sdk_config.h.

    As far as I remember UART DFU only works at very slow speed if you don't use HWFC. 

    -Amanda H.

Children
Related