problem with UART update on nRF52840

Good morning,

in our project we would like to implement a DFU system of our Nordic 52840 through UART. In the final version of the board the 52840 will be connected to another MCU through serial, but for the moment we are updating the Nordic through a USB serial adapted connected to the rx/tx pins of the Nordic MCU and using the nrfutil.

What we observe is the following:

1) If I upload the fw through nrfutil after having loaded the SD and the BL itself, the procedure is successful in about 25 seconds

2) If I cancel the DFU procedure while it is ongoing and then I repeat it, only the first SLIP packets are exchanged and the first 4k data batch is sent. When the CRC is requested to the Nordic, no answer is apparently received and the program exits. Please see the attached log, obtained with the -v-v-v-v nrfutil option. The command I use is: 

nrfutil -v -v -v -v dfu serial -cd 1 -p COM36 -fc 0 -b 115200 -pkg NordicPackage.zip

the used zip has been signed with a proprietary private key (.pem file) and of course the bootloader has been compiled with the related public key. I believe I am safe on the public/private key side cause otherwise the first update would not be successful. We also tried the procedure with the usb-serial option, but the behaviour seems to be the same.

Can you please tell me if you have any idea on what the problem is? I would (naively?) expect that if I interrupt the UART DFU procedure in the middle I should then be able to safely repeat it.

Please find attached:

the sdk_config.h used (it has been changed wrt the original one to adapt it to the project's needs)

the aforementioned log file

Thank you.

Kind regards,

Stefano

C:\work\vdf_40170_ca\Prj\tools\App_Generator>nrfutil -v -v -v -v dfu serial -cd 1 -p COM36 -fc 0 -b 115200 -pkg P567_FPNFC_Mesh_App_0_0_0_JustNordic.zip
2023-02-17 09:03:42,181 Using board at serial port: COM36
2023-02-17 09:03:42,190 Sending Application image.
2023-02-17 09:04:13,673 SLIP: --> [9, 1]
2023-02-17 09:04:13,686 SLIP: <-- [96, 9, 1, 1]
2023-02-17 09:04:13,686 Serial: Set Packet Receipt Notification 0
2023-02-17 09:04:13,686 SLIP: --> [2, 0, 0]
2023-02-17 09:04:13,702 SLIP: <-- [96, 2, 1]
2023-02-17 09:04:13,702 SLIP: --> [7]
2023-02-17 09:04:13,718 SLIP: <-- [96, 7, 1, 131, 0]
2023-02-17 09:04:13,718 Sending init packet...
2023-02-17 09:04:13,718 Serial: Selecting Object: type:1
2023-02-17 09:04:13,719 SLIP: --> [6, 1]
2023-02-17 09:04:13,733 SLIP: <-- [96, 6, 1, 0, 2, 0, 0, 141, 0, 0, 0, 133, 3, 198, 153]
2023-02-17 09:04:13,733 Serial: Object selected:  max_size:512 offset:141 crc:2579891077
2023-02-17 09:04:13,734 SLIP: --> [4]
2023-02-17 09:04:13,749 SLIP: <-- [96, 4, 1]
2023-02-17 09:04:13,749 Sending firmware file...
2023-02-17 09:04:13,750 Serial: Selecting Object: type:2
2023-02-17 09:04:13,750 SLIP: --> [6, 2]
2023-02-17 09:04:13,766 SLIP: <-- [96, 6, 1, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
2023-02-17 09:04:13,766 Serial: Object selected:  max_size:4096 offset:0 crc:0
2023-02-17 09:04:13,766 SLIP: --> [1, 2, 0, 16, 0, 0]
2023-02-17 09:04:13,781 SLIP: <-- [96, 1, 1]
2023-02-17 09:04:13,781 Serial: Streaming Data: len:4096 offset:0 crc:0x00000000
2023-02-17 09:04:13,781 SLIP: --> [8, 0, 253, 3, 32, 9, 17, 4, 0, 49, 17, 4, 0, 51, 17, 4, 0, 53, 17, 4, 0, 55, 17, 4, 0, 57, 17, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 59, 17, 4, 0, 61, 17, 4, 0, 0, 0, 0, 0, 63, 17, 4, 0, 65, 17, 4, 0]
2023-02-17 09:04:13,783 SLIP: --> [8, 67, 17, 4, 0, 67, 17, 4, 0, 101, 34, 4, 0, 65, 40, 4, 0, 67, 17, 4, 0, 67, 17, 4, 0, 177, 32, 4, 0, 133, 35, 4, 0, 67, 17, 4, 0, 53, 37, 4, 0, 137, 207, 2, 0, 67, 17, 4, 0, 67, 17, 4, 0, 67, 17, 4, 0, 67, 17, 4, 0, 67, 17, 4, 0]
2023-02-17 09:04:13,788 SLIP: --> [8, 105, 53, 4, 0, 89, 178, 3, 0, 65, 12, 3, 0, 197, 28, 4, 0, 41, 179, 3, 0, 67, 17, 4, 0, 153, 24, 4, 0, 67, 17, 4, 0, 67, 17, 4, 0, 67, 17, 4, 0, 73, 37, 4, 0, 67, 17, 4, 0, 221, 34, 4, 0, 67, 17, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0]
2023-02-17 09:04:13,794 SLIP: --> [8, 67, 17, 4, 0, 67, 17, 4, 0, 67, 17, 4, 0, 67, 17, 4, 0, 67, 17, 4, 0, 67, 17, 4, 0, 67, 17, 4, 0, 67, 17, 4, 0, 67, 17, 4, 0, 67, 17, 4, 0, 41, 180, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 67, 17, 4, 0, 0, 0, 0, 0, 67, 17, 4, 0]
2023-02-17 09:04:13,800 SLIP: --> [8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
2023-02-17 09:04:13,805 SLIP: --> [8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
2023-02-17 09:04:13,811 SLIP: --> [8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
2023-02-17 09:04:13,816 SLIP: --> [8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
2023-02-17 09:04:13,823 SLIP: --> [8, 16, 181, 5, 76, 35, 120, 51, 185, 4, 75, 19, 177, 4, 72, 175, 243, 0, 128, 1, 35, 35, 112, 16, 189, 72, 57, 0, 32, 0, 0, 0, 0, 112, 93, 5, 0, 8, 181, 3, 75, 27, 177, 3, 73, 3, 72, 175, 243, 0, 128, 8, 189, 0, 0, 0, 0, 76, 57, 0, 32, 112, 93, 5, 0]
2023-02-17 09:04:13,828 SLIP: --> [8, 21, 75, 0, 43, 8, 191, 19, 75, 157, 70, 163, 245, 128, 58, 0, 33, 139, 70, 15, 70, 19, 72, 20, 74, 18, 26, 38, 240, 145, 252, 15, 75, 0, 43, 0, 208, 152, 71, 14, 75, 0, 43, 0, 208, 152, 71, 0, 32, 0, 33, 4, 0, 13, 0, 13, 72, 0, 40, 2, 208, 12, 72, 40, 240]
2023-02-17 09:04:13,834 SLIP: --> [8, 95, 254, 38, 240, 65, 248, 32, 0, 41, 0, 33, 240, 41, 254, 38, 240, 43, 248, 0, 191, 0, 0, 8, 0, 0, 253, 3, 32, 0, 0, 0, 0, 0, 0, 0, 0, 72, 57, 0, 32, 116, 205, 0, 32, 65, 239, 4, 0, 85, 255, 4, 0, 56, 181, 4, 70, 69, 24, 172, 66, 1, 209, 0, 32]
2023-02-17 09:04:13,840 SLIP: --> [8, 5, 224, 20, 248, 1, 11, 23, 240, 41, 254, 0, 40, 245, 208, 56, 189, 56, 181, 5, 70, 12, 70, 21, 240, 65, 250, 41, 70, 21, 240, 68, 250, 160, 66, 52, 191, 0, 32, 1, 32, 56, 189, 55, 181, 13, 70, 4, 70, 104, 185, 169, 178, 0, 34, 32, 70, 1, 240, 83, 253, 1, 33, 141, 248]
2023-02-17 09:04:13,846 SLIP: --> [8, 7, 0, 13, 241, 7, 0, 255, 247, 213, 255, 3, 176, 48, 189, 255, 247, 209, 255, 0, 40, 249, 209, 236, 231, 7, 181, 12, 72, 3, 33, 255, 247, 228, 255, 11, 75, 27, 104, 91, 4, 13, 213, 10, 75, 27, 104, 3, 43, 9, 221, 9, 75, 9, 74, 211, 248, 4, 53, 9, 73, 0, 146, 4, 32]
2023-02-17 09:04:13,851 SLIP: --> [8, 87, 34, 13, 240, 59, 249, 3, 176, 93, 248, 4, 251, 68, 18, 5, 0, 224, 45, 0, 32, 220, 45, 0, 32, 0, 16, 1, 64, 194, 17, 5, 0, 180, 17, 5, 0, 1, 72, 5, 33, 255, 247, 191, 191, 71, 18, 5, 0, 7, 181, 12, 72, 3, 33, 255, 247, 184, 255, 11, 75, 27, 104, 91, 4]
2023-02-17 09:04:13,857 SLIP: --> [8, 13, 213, 10, 75, 27, 104, 3, 43, 9, 221, 9, 75, 9, 74, 211, 248, 4, 53, 9, 73, 0, 146, 4, 32, 105, 34, 13, 240, 15, 249, 3, 176, 93, 248, 4, 251, 76, 18, 5, 0, 224, 45, 0, 32, 220, 45, 0, 32, 0, 16, 1, 64, 195, 17, 5, 0, 180, 17, 5, 0, 1, 72, 3, 33]
2023-02-17 09:04:13,862 SLIP: --> [8, 255, 247, 147, 191, 79, 18, 5, 0, 31, 181, 2, 35, 141, 248, 5, 0, 141, 248, 4, 48, 56, 34, 141, 248, 10, 48, 5, 33, 189, 248, 4, 48, 173, 248, 8, 32, 2, 168, 173, 248, 11, 48, 255, 247, 126, 255, 5, 176, 93, 248, 4, 251, 21, 240, 178, 185, 8, 181, 23, 240, 183, 253, 128, 178]
2023-02-17 09:04:13,868 SLIP: --> [8, 8, 189, 7, 181, 13, 241, 7, 0, 23, 240, 114, 253, 32, 185, 157, 248, 7, 0, 3, 176, 93, 248, 4, 251, 0, 32, 250, 231, 112, 181, 13, 70, 136, 176, 20, 70, 0, 42, 69, 208, 54, 41, 39, 208, 7, 216, 1, 41, 0, 240, 140, 128, 25, 41, 117, 208, 23, 240, 74, 253, 58, 224, 55, 41]
2023-02-17 09:04:13,874 SLIP: --> [8, 58, 208, 56, 41, 248, 209, 16, 70, 0, 240, 62, 254, 196, 178, 255, 44, 72, 78, 173, 248, 20, 0, 68, 209, 51, 104, 88, 4, 42, 213, 70, 75, 27, 104, 3, 43, 38, 221, 69, 75, 69, 74, 211, 248, 4, 53, 0, 146, 156, 34, 68, 73, 4, 32, 13, 240, 161, 248, 27, 224, 17, 70, 2, 32]
2023-02-17 09:04:13,879 SLIP: --> [8, 0, 240, 92, 251, 176, 185, 59, 75, 27, 104, 93, 4, 13, 213, 58, 75, 27, 104, 3, 43, 9, 221, 57, 75, 59, 74, 211, 248, 4, 53, 0, 146, 129, 34, 56, 73, 4, 32, 13, 240, 137, 248, 23, 240, 17, 253, 0, 32, 255, 247, 50, 255, 8, 176, 112, 189, 17, 70, 3, 32, 0, 240, 62, 251]
2023-02-17 09:04:13,885 SLIP: --> [8, 0, 40, 247, 209, 43, 75, 27, 104, 92, 4, 238, 213, 42, 75, 27, 104, 3, 43, 234, 221, 41, 75, 45, 74, 211, 248, 4, 53, 0, 146, 141, 34, 223, 231, 2, 35, 173, 248, 27, 0, 5, 33, 6, 168, 141, 248, 26, 48, 173, 248, 24, 80, 255, 247, 249, 254, 51, 104, 89, 4, 218, 213, 30, 75]
2023-02-17 09:04:13,891 SLIP: --> [8, 27, 104, 3, 43, 214, 221, 157, 248, 21, 32, 28, 75, 29, 73, 211, 248, 4, 53, 205, 233, 1, 66, 30, 74, 0, 146, 4, 32, 169, 34, 13, 240, 77, 248, 199, 231, 255, 247, 109, 255, 99, 120, 131, 66, 194, 209, 17, 75, 27, 104, 90, 4, 190, 213, 16, 75, 27, 104, 3, 43, 186, 221, 15, 75]
2023-02-17 09:04:13,896 SLIP: --> [8, 20, 74, 211, 248, 4, 53, 0, 146, 179, 34, 146, 231, 255, 247, 89, 255, 99, 120, 131, 66, 174, 209, 7, 75, 27, 104, 91, 4, 170, 213, 6, 75, 27, 104, 3, 43, 166, 221, 5, 75, 11, 74, 211, 248, 4, 53, 0, 146, 188, 34, 126, 231, 224, 45, 0, 32, 220, 45, 0, 32, 0, 16, 1, 64]
2023-02-17 09:04:13,903 SLIP: --> [8, 253, 17, 5, 0, 180, 17, 5, 0, 205, 17, 5, 0, 229, 17, 5, 0, 24, 18, 5, 0, 59, 18, 5, 0, 58, 18, 5, 0, 112, 181, 14, 70, 21, 70, 0, 36, 165, 66, 6, 235, 4, 0, 2, 208, 23, 240, 160, 252, 8, 177, 160, 178, 112, 189, 1, 52, 244, 231, 8, 70, 17, 70, 8, 177]
2023-02-17 09:04:13,909 SLIP: --> [8, 255, 247, 120, 190, 112, 71, 7, 181, 141, 248, 7, 16, 13, 241, 7, 0, 1, 33, 255, 247, 111, 254, 3, 176, 93, 248, 4, 251, 23, 240, 120, 188, 31, 40, 138, 191, 5, 75, 79, 240, 160, 67, 0, 240, 31, 0, 211, 248, 16, 53, 35, 250, 0, 240, 0, 240, 1, 0, 112, 71, 0, 3, 0, 80]
2023-02-17 09:04:13,914 SLIP: --> [8, 4, 75, 26, 120, 26, 177, 152, 120, 0, 240, 1, 0, 112, 71, 1, 32, 250, 231, 0, 191, 101, 57, 0, 32, 12, 75, 27, 104, 91, 4, 7, 181, 14, 213, 11, 75, 27, 104, 3, 43, 10, 221, 10, 75, 10, 74, 211, 248, 4, 53, 10, 73, 0, 146, 4, 32, 64, 242, 63, 18, 12, 240, 190, 255]
2023-02-17 09:04:13,919 SLIP: --> [8, 7, 75, 0, 34, 90, 112, 3, 176, 93, 248, 4, 251, 224, 45, 0, 32, 220, 45, 0, 32, 0, 16, 1, 64, 121, 18, 5, 0, 102, 18, 5, 0, 101, 57, 0, 32, 112, 181, 78, 77, 44, 120, 1, 44, 136, 176, 46, 70, 52, 208, 2, 44, 58, 208, 75, 78, 52, 120, 98, 30, 1, 42, 43, 216]
2023-02-17 09:04:13,926 SLIP: --> [8, 163, 30, 92, 66, 92, 65, 3, 37, 56, 35, 141, 248, 20, 80, 141, 248, 21, 64, 173, 248, 24, 48, 2, 35, 141, 248, 26, 48, 5, 33, 189, 248, 20, 48, 173, 248, 27, 48, 6, 168, 255, 247, 31, 254, 62, 75, 27, 104, 90, 4, 15, 213, 61, 75, 27, 104, 171, 66, 11, 221, 60, 75, 61, 74]
2023-02-17 09:04:13,931 SLIP: --> [8, 211, 248, 4, 53, 60, 73, 0, 146, 205, 233, 1, 84, 177, 34, 4, 32, 12, 240, 116, 255, 0, 35, 51, 112, 8, 176, 112, 189, 2, 32, 30, 240, 71, 252, 0, 40, 199, 209, 2, 35, 43, 112, 196, 231, 30, 240, 128, 252, 0, 40, 192, 209, 49, 75, 24, 104, 154, 136, 6, 144, 155, 121, 141, 248]
2023-02-17 09:04:13,937 SLIP: --> [8, 30, 48, 32, 70, 173, 248, 28, 32, 30, 240, 184, 252, 38, 75, 0, 40, 51, 209, 43, 74, 105, 120, 146, 120, 27, 104, 145, 66, 3, 244, 128, 67, 24, 209, 107, 177, 33, 75, 27, 104, 4, 43, 9, 221, 32, 75, 37, 74, 211, 248, 4, 53, 32, 73, 0, 146, 5, 32, 130, 34, 12, 240, 62, 255]
2023-02-17 09:04:13,943 SLIP: --> [8, 0, 35, 8, 33, 6, 168, 141, 248, 30, 48, 32, 240, 177, 252, 0, 35, 51, 112, 144, 231, 123, 177, 21, 75, 27, 104, 4, 43, 11, 221, 20, 75, 211, 248, 4, 53, 205, 233, 1, 33, 23, 74, 0, 146, 18, 73, 136, 34, 5, 32, 12, 240, 35, 255, 2, 35, 227, 231, 27, 104, 89, 4, 13, 213]
2023-02-17 09:04:13,948 SLIP: --> [8, 10, 75, 27, 104, 4, 43, 9, 221, 9, 75, 16, 74, 211, 248, 4, 53, 9, 73, 0, 146, 5, 32, 143, 34, 12, 240, 16, 255, 1, 35, 208, 231, 105, 57, 0, 32, 100, 57, 0, 32, 224, 45, 0, 32, 220, 45, 0, 32, 0, 16, 1, 64, 24, 18, 5, 0, 102, 18, 5, 0, 152, 22, 5, 0]
2023-02-17 09:04:13,954 SLIP: --> [8, 213, 200, 0, 32, 159, 18, 5, 0, 183, 18, 5, 0, 235, 18, 5, 0, 45, 233, 240, 65, 5, 70, 198, 176, 12, 70, 0, 41, 0, 240, 132, 128, 68, 75, 15, 136, 26, 104, 18, 244, 128, 79, 152, 70, 23, 208, 66, 75, 27, 104, 3, 43, 19, 221, 65, 75, 138, 120, 211, 248, 4, 53, 2, 146]
2023-02-17 09:04:13,960 SLIP: --> [8, 160, 241, 54, 2, 62, 73, 210, 178, 4, 32, 81, 248, 34, 32, 1, 146, 60, 74, 0, 146, 60, 73, 64, 242, 107, 18, 12, 240, 207, 254, 55, 45, 101, 209, 163, 120, 30, 70, 0, 43, 53, 208, 216, 248, 0, 32, 82, 4, 49, 213, 49, 74, 18, 104, 3, 42, 45, 221, 3, 51, 51, 74, 128, 43]
2023-02-17 09:04:13,965 SLIP: --> [8, 40, 191, 128, 35, 210, 248, 0, 192, 32, 70, 5, 170, 3, 235, 4, 14, 16, 248, 1, 27, 79, 234, 17, 24, 1, 240, 15, 1, 28, 249, 8, 128, 130, 248, 0, 128, 28, 249, 1, 16, 81, 112, 134, 69, 2, 241, 2, 2, 238, 209, 5, 169, 0, 34, 1, 248, 19, 32, 32, 75, 36, 74, 211, 248]
2023-02-17 09:04:13,971 SLIP: --> [8, 4, 53, 1, 146, 35, 74, 2, 145, 0, 146, 31, 73, 79, 244, 185, 114, 4, 32, 12, 240, 147, 254, 179, 28, 26, 10, 141, 248, 21, 32, 141, 248, 23, 112, 5, 34, 5, 169, 0, 32, 63, 10, 141, 248, 20, 80, 141, 248, 22, 48, 141, 248, 24, 112, 255, 247, 128, 254, 0, 34, 5, 33, 5, 168]
2023-02-17 09:04:13,976 SLIP: --> [8, 1, 240, 111, 250, 5, 70, 94, 177, 3, 52, 2, 70, 49, 70, 32, 70, 1, 240, 103, 250, 50, 70, 5, 70, 33, 70, 0, 32, 255, 247, 109, 254, 41, 70, 0, 32, 255, 247, 111, 254, 70, 176, 189, 232, 240, 129, 0, 38, 209, 231, 0, 191, 224, 45, 0, 32, 220, 45, 0, 32, 0, 16, 1, 64]
2023-02-17 09:04:13,982 SLIP: --> [8, 184, 22, 5, 0, 6, 19, 5, 0, 102, 18, 5, 0, 228, 45, 0, 32, 217, 25, 5, 0, 37, 19, 5, 0, 3, 120, 2, 43, 2, 209, 64, 104, 25, 240, 219, 185, 1, 43, 250, 208, 112, 71, 0, 0, 8, 181, 33, 240, 193, 250, 3, 75, 0, 40, 20, 191, 2, 34, 1, 34, 26, 112, 8, 189]
2023-02-17 09:04:13,989 SLIP: --> [8, 100, 57, 0, 32, 14, 74, 0, 35, 50, 248, 51, 16, 129, 66, 3, 209, 2, 235, 195, 3, 88, 104, 112, 71, 1, 51, 13, 43, 244, 209, 1, 40, 8, 208, 2, 40, 8, 208, 3, 40, 8, 209, 2, 34, 5, 75, 3, 235, 194, 3, 239, 231, 0, 34, 249, 231, 1, 34, 247, 231, 2, 72, 112, 71]
2023-02-17 09:04:13,994 SLIP: --> [8, 220, 22, 5, 0, 196, 22, 5, 0, 45, 19, 5, 0, 255, 247, 22, 189, 55, 181, 20, 77, 43, 120, 19, 187, 19, 76, 163, 120, 165, 43, 19, 75, 27, 104, 12, 191, 90, 34, 165, 34, 91, 4, 162, 112, 14, 213, 16, 75, 27, 104, 4, 43, 10, 221, 15, 75, 15, 73, 211, 248, 4, 53, 1, 146]
2023-02-17 09:04:14,000 SLIP: --> [8, 14, 74, 0, 146, 5, 32, 204, 34, 12, 240, 248, 253, 163, 120, 107, 112, 1, 36, 44, 112, 255, 247, 70, 254, 32, 70, 3, 176, 48, 189, 0, 32, 251, 231, 0, 191, 105, 57, 0, 32, 213, 200, 0, 32, 224, 45, 0, 32, 220, 45, 0, 32, 0, 16, 1, 64, 102, 18, 5, 0, 63, 19, 5, 0]
2023-02-17 09:04:14,006 SLIP: --> [8, 240, 181, 57, 76, 35, 120, 135, 176, 203, 185, 98, 120, 186, 185, 227, 120, 54, 78, 12, 43, 30, 217, 51, 104, 90, 4, 14, 213, 52, 75, 27, 104, 3, 43, 10, 221, 51, 75, 52, 74, 211, 248, 4, 53, 51, 73, 0, 146, 4, 32, 79, 244, 211, 114, 12, 240, 193, 253, 1, 35, 35, 112, 0, 32]
2023-02-17 09:04:14,012 SLIP: --> [8, 1, 240, 192, 249, 16, 177, 0, 32, 1, 240, 12, 250, 255, 247, 10, 254, 7, 176, 240, 189, 1, 35, 42, 72, 99, 112, 79, 244, 0, 65, 20, 240, 33, 254, 51, 104, 39, 77, 19, 244, 128, 79, 22, 208, 32, 75, 27, 104, 3, 43, 18, 221, 226, 120, 31, 75, 5, 235, 194, 1, 53, 248, 50, 32]
2023-02-17 09:04:14,017 SLIP: --> [8, 211, 248, 4, 53, 73, 104, 1, 146, 31, 74, 2, 145, 0, 146, 27, 73, 79, 244, 216, 114, 4, 32, 12, 240, 145, 253, 51, 104, 226, 120, 91, 4, 53, 248, 50, 112, 19, 213, 18, 75, 27, 104, 3, 43, 15, 221, 5, 235, 194, 5, 16, 75, 106, 104, 211, 248, 4, 53, 1, 146, 19, 74, 0, 146]
2023-02-17 09:04:14,023 SLIP: --> [8, 14, 73, 2, 151, 79, 244, 202, 114, 4, 32, 12, 240, 119, 253, 0, 35, 5, 169, 54, 32, 141, 248, 22, 48, 173, 248, 20, 112, 255, 247, 120, 254, 227, 120, 1, 51, 227, 112, 170, 231, 101, 57, 0, 32, 224, 45, 0, 32, 220, 45, 0, 32, 0, 16, 1, 64, 98, 19, 5, 0, 102, 18, 5, 0]
2023-02-17 09:04:14,029 SLIP: --> [8, 108, 57, 0, 32, 220, 22, 5, 0, 114, 19, 5, 0, 141, 19, 5, 0, 8, 181, 7, 75, 7, 74, 8, 72, 0, 33, 25, 112, 89, 112, 217, 112, 20, 240, 174, 253, 24, 177, 189, 232, 8, 64, 25, 240, 214, 184, 8, 189, 101, 57, 0, 32, 25, 102, 2, 0, 68, 23, 5, 0, 45, 233, 240, 79]
2023-02-17 09:04:14,034 SLIP: --> [8, 4, 70, 207, 176, 13, 70, 0, 41, 0, 240, 165, 130, 131, 30, 1, 43, 0, 242, 32, 130, 75, 136, 18, 43, 1, 217, 0, 36, 8, 225, 1, 43, 26, 217, 0, 32, 255, 247, 77, 252, 105, 120, 6, 70, 1, 240, 10, 249, 104, 112, 0, 32, 173, 248, 32, 96, 255, 247, 67, 252, 105, 120, 6, 70]
2023-02-17 09:04:14,039 SLIP: --> [8, 1, 240, 0, 249, 189, 248, 32, 48, 104, 112, 67, 234, 6, 32, 107, 136, 173, 248, 32, 0, 2, 59, 107, 128, 106, 136, 114, 177, 13, 241, 34, 1, 0, 32, 255, 247, 251, 252, 107, 136, 152, 66, 1, 70, 213, 209, 106, 120, 13, 241, 34, 0, 1, 240, 245, 248, 104, 112, 0, 32, 255, 247, 33, 252]
2023-02-17 09:04:14,046 SLIP: --> [8, 107, 120, 131, 66, 201, 209, 180, 79, 181, 248, 2, 128, 59, 104, 3, 44, 3, 244, 128, 67, 62, 70, 0, 240, 125, 129, 195, 177, 175, 75, 27, 104, 3, 43, 20, 221, 189, 248, 32, 64, 173, 75, 32, 70, 211, 248, 4, 53, 5, 147, 255, 247, 167, 254, 171, 74, 1, 144, 0, 146, 205, 233, 2, 72]
2023-02-17 09:04:14,052 SLIP: --> [8, 5, 155, 169, 73, 79, 244, 24, 114, 4, 32, 12, 240, 215, 252, 167, 76, 111, 136, 1, 35, 163, 112, 51, 104, 3, 244, 128, 67, 0, 47, 64, 240, 222, 128, 187, 177, 157, 75, 27, 104, 3, 43, 19, 221, 189, 248, 32, 80, 155, 75, 40, 70, 211, 248, 4, 53, 5, 147, 255, 247, 131, 254, 156, 74]
2023-02-17 09:04:14,057 SLIP: --> [8, 0, 146, 205, 233, 1, 5, 5, 155, 151, 73, 64, 242, 5, 34, 4, 32, 12, 240, 180, 252, 189, 248, 32, 0, 6, 169, 30, 240, 123, 248, 0, 40, 89, 209, 51, 104, 157, 248, 26, 128, 189, 248, 24, 80, 88, 4, 193, 70, 35, 213, 223, 248, 40, 162, 218, 248, 0, 48, 3, 43, 29, 221, 223, 248]
2023-02-17 09:04:14,063 SLIP: --> [8, 32, 178, 40, 70, 219, 248, 4, 53, 5, 147, 255, 247, 91, 254, 137, 74, 5, 155, 1, 144, 0, 146, 205, 233, 2, 88, 131, 73, 64, 242, 221, 18, 4, 32, 12, 240, 139, 252, 51, 104, 205, 248, 20, 176, 19, 244, 128, 79, 3, 208, 218, 248, 0, 48, 3, 43, 94, 220, 54, 35, 141, 248, 52, 48]
2023-02-17 09:04:14,069 SLIP: --> [8, 9, 241, 2, 3, 27, 10, 141, 248, 55, 80, 5, 34, 45, 10, 13, 169, 0, 32, 8, 241, 2, 8, 141, 248, 53, 48, 141, 248, 56, 80, 141, 248, 54, 128, 255, 247, 106, 252, 0, 34, 5, 33, 13, 168, 1, 240, 89, 248, 5, 70, 185, 241, 0, 15, 10, 208, 2, 70, 73, 70, 7, 152, 1, 240]
2023-02-17 09:04:14,075 SLIP: --> [8, 80, 248, 7, 153, 5, 70, 74, 70, 0, 32, 255, 247, 86, 252, 41, 70, 0, 32, 255, 247, 88, 252, 0, 37, 148, 248, 0, 128, 184, 241, 0, 15, 32, 209, 255, 177, 227, 120, 100, 74, 1, 59, 50, 248, 51, 32, 189, 248, 32, 48, 154, 66, 22, 209, 97, 72, 20, 240, 0, 253, 51, 104, 132, 248]
2023-02-17 09:04:14,080 SLIP: --> [8, 1, 128, 89, 4, 14, 213, 85, 75, 27, 104, 3, 43, 10, 221, 84, 75, 91, 74, 211, 248, 4, 53, 84, 73, 0, 146, 4, 32, 64, 242, 57, 18, 12, 240, 44, 252, 0, 45, 0, 240, 148, 128, 80, 75, 0, 36, 156, 112, 32, 70, 79, 176, 189, 232, 240, 143, 82, 75, 7, 154, 211, 248, 0, 224]
2023-02-17 09:04:14,085 SLIP: --> [8, 184, 241, 128, 15, 196, 70, 13, 171, 40, 191, 79, 240, 128, 12, 12, 235, 2, 10, 24, 70, 146, 69, 3, 241, 2, 3, 17, 209, 0, 35, 0, 248, 28, 48, 5, 155, 72, 74, 211, 248, 4, 53, 1, 146, 71, 74, 2, 144, 0, 146, 61, 73, 79, 244, 239, 114, 4, 32, 12, 240, 255, 251, 124, 231]
2023-02-17 09:04:14,092 SLIP: --> [8, 18, 248, 1, 27, 79, 234, 17, 27, 1, 240, 15, 1, 30, 249, 11, 176, 3, 248, 2, 188, 30, 249, 1, 16, 3, 248, 1, 28, 218, 231, 27, 179, 223, 248, 184, 144, 217, 248, 0, 48, 3, 43, 29, 221, 189, 248, 32, 128, 43, 77, 64, 70, 213, 248, 4, 53, 5, 147, 255, 247, 163, 253, 52, 74]
2023-02-17 09:04:14,097 SLIP: --> [8, 5, 155, 1, 144, 205, 233, 2, 135, 0, 146, 39, 73, 79, 244, 4, 114, 4, 32, 12, 240, 211, 251, 51, 104, 19, 244, 128, 79, 168, 70, 3, 208, 217, 248, 0, 48, 3, 43, 5, 220, 57, 70, 8, 168, 30, 240, 188, 251, 5, 70, 113, 231, 35, 75, 186, 28, 211, 248, 0, 192, 128, 42, 13, 171]
2023-02-17 09:04:14,103 SLIP: --> [8, 40, 191, 128, 34, 13, 241, 32, 14, 0, 32, 29, 70, 30, 248, 1, 27, 79, 234, 17, 25, 1, 240, 15, 1, 28, 249, 9, 144, 131, 248, 0, 144, 1, 48, 28, 249, 1, 16, 89, 112, 130, 66, 3, 241, 2, 3, 237, 209, 0, 35, 5, 248, 18, 48, 20, 74, 216, 248, 4, 53, 1, 146, 19, 74]
2023-02-17 09:04:14,109 SLIP: --> [8, 0, 146, 9, 73, 2, 149, 64, 242, 17, 34, 4, 32, 12, 240, 150, 251, 202, 231, 165, 112, 1, 36, 107, 231, 224, 45, 0, 32, 220, 45, 0, 32, 0, 16, 1, 64, 174, 19, 5, 0, 102, 18, 5, 0, 101, 57, 0, 32, 228, 19, 5, 0, 13, 20, 5, 0, 220, 22, 5, 0, 108, 57, 0, 32]
2023-02-17 09:04:14,114 SLIP: --> [8, 99, 20, 5, 0, 228, 45, 0, 32, 217, 25, 5, 0, 37, 19, 5, 0, 50, 20, 5, 0, 27, 179, 223, 248, 232, 145, 217, 248, 0, 48, 3, 43, 29, 221, 189, 248, 32, 64, 109, 78, 32, 70, 214, 248, 4, 53, 5, 147, 255, 247, 40, 253, 106, 74, 5, 155, 1, 144, 0, 146, 205, 233, 2, 72]
2023-02-17 09:04:14,120 SLIP: --> [8, 104, 73, 79, 244, 27, 114, 4, 32, 12, 240, 88, 251, 59, 104, 19, 244, 128, 79, 180, 70, 3, 208, 217, 248, 0, 48, 3, 43, 13, 220, 98, 78, 105, 136, 1, 36, 8, 168, 180, 112, 30, 240, 62, 251, 0, 40, 127, 244, 28, 175, 176, 112, 255, 247, 28, 250, 26, 231, 107, 136, 91, 74, 2, 51]
2023-02-17 09:04:14,126 SLIP: --> [8, 20, 104, 128, 43, 13, 170, 40, 191, 128, 35, 8, 174, 0, 32, 23, 70, 22, 248, 1, 27, 79, 234, 17, 30, 1, 240, 15, 1, 20, 249, 14, 224, 130, 248, 0, 224, 1, 48, 97, 86, 81, 112, 131, 66, 2, 241, 2, 2, 238, 209, 0, 34, 7, 248, 19, 32, 77, 74, 220, 248, 4, 53, 1, 146]
2023-02-17 09:04:14,131 SLIP: --> [8, 76, 74, 0, 146, 71, 73, 2, 151, 64, 242, 109, 34, 4, 32, 12, 240, 21, 251, 196, 231, 144, 179, 1, 40, 127, 244, 223, 173, 223, 248, 28, 129, 216, 248, 0, 48, 91, 4, 36, 213, 223, 248, 20, 145, 217, 248, 0, 48, 3, 43, 30, 221, 14, 136, 57, 79, 48, 70, 215, 248, 4, 53, 5, 147]
2023-02-17 09:04:14,137 SLIP: --> [8, 255, 247, 192, 252, 170, 120, 5, 155, 1, 144, 205, 233, 2, 98, 58, 74, 0, 146, 52, 73, 64, 242, 147, 34, 4, 32, 12, 240, 239, 250, 216, 248, 0, 48, 19, 244, 128, 79, 188, 70, 3, 208, 217, 248, 0, 48, 3, 43, 36, 220, 41, 70, 55, 32, 255, 247, 235, 251, 185, 230, 47, 75, 27, 104]
2023-02-17 09:04:14,144 SLIP: --> [3]
Traceback (most recent call last):
  File "C:\Users\uPD008\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\Scripts\nrfutil-script.py", line 33, in <module>
    sys.exit(load_entry_point('nrfutil==6.1.3', 'console_scripts', 'nrfutil')())
  File "C:\Users\uPD008\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\click\core.py", line 1128, in __call__
    return self.main(*args, **kwargs)
  File "C:\Users\uPD008\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\click\core.py", line 1053, in main
    rv = self.invoke(ctx)
  File "C:\Users\uPD008\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\click\core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Users\uPD008\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\click\core.py", line 1659, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "C:\Users\uPD008\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\click\core.py", line 1395, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Users\uPD008\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\click\core.py", line 754, in invoke
    return __callback(*args, **kwargs)
  File "C:\Users\uPD008\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\nordicsemi\__main__.py", line 1063, in serial
    do_serial(package, port, connect_delay, flow_control, packet_receipt_notification, baud_rate, serial_number, True,
  File "C:\Users\uPD008\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\nordicsemi\__main__.py", line 980, in do_serial
    dfu.dfu_send_images()
  File "C:\Users\uPD008\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\nordicsemi\dfu\dfu.py", line 127, in dfu_send_images
    self._dfu_send_image(self.manifest.application)
  File "C:\Users\uPD008\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\nordicsemi\dfu\dfu.py", line 100, in _dfu_send_image
    self.dfu_transport.send_firmware(data)
  File "C:\Users\uPD008\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\nordicsemi\dfu\dfu_transport_serial.py", line 301, in send_firmware
    response['crc'] = self.__stream_data(data=data, crc=response['crc'], offset=i)
  File "C:\Users\uPD008\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\nordicsemi\dfu\dfu_transport_serial.py", line 474, in __stream_data
    response = self.__calculate_checksum()
  File "C:\Users\uPD008\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\nordicsemi\dfu\dfu_transport_serial.py", line 412, in __calculate_checksum
    raise NordicSemiException('Did not receive checksum response from DFU target. '
pc_ble_driver_py.exceptions.NordicSemiException: Did not receive checksum response from DFU target. If MSD is enabled on the target device, try to disable it ref. https://wiki.segger.com/index.php?title=J-Link-OB_SAM3U

7282.sdk_config.h

Parents
  • Hi Stefano, 

    As far as I know nrfutil doesn't have the feature to continue DFU update after interrupted. The documentation here mentioned about that the DFU master can start by select the last object was sent and can determine that it should re-send the object or continue with the new object. 
    But this feature is not implemented in nrfutil. 

    From the log you provided nrfutil simply send a new init packet (initialize packet ) for a new DFU update. The problem here is that the bootloader is still in the process of the interrupted DFU update. I would assume that it wouldn't expect the init packet and didn't response to the init packet send request. 

    So in your case if you are planning to make your own DFU master then you can implement this feature to continue DFU update after interrupted (you can refer to our BLE DFU library on the phone that you can find inside nRF Toolbox or nRF Device Firmware Update. As far as I know the feature to continue after interrupted is implemented on the apps. 

    Another option is to send an abort command (0x0C) to reset the bootloader and start a new DFU update. I don't think we have the feature implemented on nrfutil neither. The solution is do a power/pin reset on the board after you have an interrupted DFU update. 

  • Dear Hung Bui,

    Thank you for your quick answer. Trying to understand which is the last unsent packet and restart the update from there can be tricky and we don't want to do that. However, the problem I described in my message takes place not only if I perform an update attempt (through nrfutil) immediately after I cancelled the ongoing one, but also if I stop the update, switch the board off/on and then perform the second DFU attempt. In our custom board we perform a board reset each time we attempt a DFU (because we need to send the board in DFU mode from the application fw) and the result is the same as the one observed on the Nordic updated through nrfutil and connected straight to a serial adapter
    Do you have some other ideas on why this happens? Could you do a quick test on your side (it takes justa  couple of minutes) to confirm if you see the same behaviour? 

    Thanks.

    Kind regards,

    Stefano

  • Dear Hung Bui,

    I will perform the test you advised tomorrow morning, could not do it today. Just one question in the meanwhile: I create the manipulated image by adding the additional firmware to the standard Nordic firmware with srecord and then I sign the resulting hex (with "nrf package generate") to be able to upload it to a secure bootloader. I guess what you said means that somewhere in the new hex there is still the value of the standalone nordic image (i.e. bank_0.image_size) in place of the Nordic+custom data size, and this somehow causes problems when the update is interrupted (but does not seem to prevent a "regular" update). Can you tell me exactly where this value is in the hex?
    Thank you.

    Kind regards,

    Stefano  

  • Hi Stefano, 

    The bank_0.image_size that you can find in the code is from the init data inside the .zip file that you use to DFU update the current firmware. If you have a look at a DFU .zip package you will find this (here is the test image in the SDK)



    The .dat file contain the information about the size of the image. It will be transmitted to the bootloader and the bootloader use the information to receive the image. Please take a look here: https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/lib_bootloader_dfu_validation.html?cp=9_1_3_5_1_1_0#lib_bootloader_dfu_init
    If you generate the .zip file after you manipulate with the hex I think the app_size should reflect the new size of the hex. I am not aware of anywhere in the hex we store the original size of the image. 

  • Dear Hung Bui,

    Thank you for your answer. I performed the test you advised yesterday. In the attached file _1 and _2 you can see Nordic MCU flash images where a successful update is performed respectively using the BLE nordic nrf connect app (starting with just the SD+bootloader onboard) and our update tool, which reproduces the Nordic update through the slip protocol via UART, including sending the nordic in bootloader by setting the related pin to active while rebooting. As you can see the two images are the same, except that in the UART version I see the cached copy of the new fw starting at 0x57000. Only Nordic fw is uploaded this time, no other hidden data.

    In file _3 you can see an interrupted update. The update started on a Nordic set up as in flash image _2. The  differences between _3 and _2, as you can see by comparing the two files, are the "0xff-set" 0x1000 bytes at address 0x05E000 (the starting address different from the one in my former email because of the randomicity of my ctrl+c update interruption) and a few bytes at address 0xFE000, which according to the linker script is where the mbr_params_range is. If I then try to repeat the update after the interruption (image _4) I see that the update process stops after sendin the first 0x1000 bytes. By comparing  images _3 and _4 the only difference is in the first 0x1000 bytes at 0x57000, which in _4 are set to 0xff. By looking at the oscilloscope during this update process I can confirm that only the first 0x1000 byte data is sent to the Nordic, but somehow not written, the CRC is not returned to the program updating the Nordic and thus the update process exits. As a comparison, in the successful update before the interruption I can see the whole firmware flowing on the serial link with the oscilloscope.

    Could the modified lines at 0xFE000 in _3 have something to do with the failing update? Or could somehow the flash enter a state where it is not writable after I interrupt the update, so that when I try the update again (_4 file) the first 0x1000 data batch is sent to the Nordic but not written? Or maybe this used to be a problem in old Nordic libraries which is now solved (I have to use 16.0.0 for legacy reasons)?

    Really running short of ideas here, any tip is very welcome!

    Kind regards,

    Stefano

    Nordic_Update_with_app_1.txtNordic_Update_from_serial_2.txtNordic_Update_from_serial_with_interruption_3.txtNordic_Update_from_serial_after_interruption_4.txt

  • Hi Stefano, 

    I think we need to align the test process before continue. 
    - I assume you haven't modified the bootloader ? 
    - In the test you described in your last reply, you used your own update tool, not nrfutil ? 
    If it's the case, have you tried to do exactly what I did of breaking nrfutil when updating a .zip test package  ? 
    If it doesn't work please try again with SDK v17.1 (just for testing). Then we know it must be something changed in the newer SDK. 

    If nrfutil works, then we will need to look into what's the different between your update tool and nrfutil. 

    It's quite strange to see the difference between hex #1 and hex #2. From what I can see it seems when you do BLE update the application goes straight into the primary bank, without storing in secondary bank. When with your update tool it does to the secondary bank before copied to primary bank. 

    Regarding the change at 0XFE000. It's normal to see that. It's because the MBR_Param page, when in bootloader mode, will be used as mp_dfu_settings_backup_buffer to back up the DFU settings. You can find that that page is identical to page 0xFF000, because it's a backup. It's normal that the bootloader setting change after you start/continue DFU process. It's where the progress of the DFU is stored. 

    The question here is that why the bootloader couldn't continue and calculate the CRC. I think at this point you would need to step into the bootloader and try to debug it to see why it works with nrfutil (at least on my side) but not with your dfu update tool. 
    I would suggest to test with the debug version of the bootloader. With the debug version you can put a breakpoint and step into the code. You can also add log and print the log out on RTT. 
    I assume you have turned on PRN (packet receive notification) when you start the DFU bootloader process ? 

    The main handling of the DFU process is inside nrf_dfu_req_handler.c. The nrf_dfu_command_req() function is where you should start. 

  • Dear Hung Bui,

    Thanks again for your answer. You are right when you say that we are using our own program to update the Nordic (as it is on a mezzanine board connected via UART to another MCU. It is the latter that updates the Nordic, i.e. replaces nrfutil). Anyway I am able to detach the Nordic mezzanine, connect tx/rx to a serial adapter and use nrfutil to update it. The result is what you see attached:
    1) If I erase the Nordic, upload the SD+bootloader and then update the Nordic with the signed zip packet through nrfutil, the update is successful and I see the Nordic fw starting at 0x26000 (as the flash is blank the start address of the cached image coincides with the application image I believe), see _1 images. Please note that I used -prn 200 as in your tests and that I cannot use flow control due to its absence in our board. Could this represent an issue?

    2) If I now erase again the Nordic, upload the SD+bootloader and then update the Nordic with the signed zip packet through nrfutil BUT stop the procedure with ctrl+c at about half, I see what I would expect, i.e. data till about half of the application fw size (0x3FC80) and then 0xffs, see _2 images.

    3) If I try the update from nrfutil again (without previously erasing the MCU this time) with the same parameters I see no change in the MCU image wrt point 2. On the oscilloscope one can see nrfutil pinging the MCU (whose bootloader should be active since the upload of the application in point 2 failed) but with no answer from the MCU. You might remember that when our proprietary update tool was used the behaviour was slightly different, with the first 1K of the applcation being sent before the CRC request was not served by the bootloader.

    As for your questions:
    - I haven't modified the bootloader but I enabled the relevant options in the sdk_config.h to operate DFU both through BLE and UART, which is what we need in our application.
    - As mentioned before, we use our update tool, but the behaviour with nrfutil is similar (not equal, see point 3)

    I still have to try with 17.1 (should check with other co-developers if this is feasible, as the project might not compile and/or produce unwanted behaviours) and debug the bootloader to see what is going on there. Will do the latter immediately after this, meanwhile any further tips based on this additional info would be great Slight smile
    Thanks.
    Kind regards,
    Stefano

    StefanoSuccessfulUpdate_1.txt InterruptedUpdate_2.txt UpdateAfterInterruptedUpdate_3.txt

Reply
  • Dear Hung Bui,

    Thanks again for your answer. You are right when you say that we are using our own program to update the Nordic (as it is on a mezzanine board connected via UART to another MCU. It is the latter that updates the Nordic, i.e. replaces nrfutil). Anyway I am able to detach the Nordic mezzanine, connect tx/rx to a serial adapter and use nrfutil to update it. The result is what you see attached:
    1) If I erase the Nordic, upload the SD+bootloader and then update the Nordic with the signed zip packet through nrfutil, the update is successful and I see the Nordic fw starting at 0x26000 (as the flash is blank the start address of the cached image coincides with the application image I believe), see _1 images. Please note that I used -prn 200 as in your tests and that I cannot use flow control due to its absence in our board. Could this represent an issue?

    2) If I now erase again the Nordic, upload the SD+bootloader and then update the Nordic with the signed zip packet through nrfutil BUT stop the procedure with ctrl+c at about half, I see what I would expect, i.e. data till about half of the application fw size (0x3FC80) and then 0xffs, see _2 images.

    3) If I try the update from nrfutil again (without previously erasing the MCU this time) with the same parameters I see no change in the MCU image wrt point 2. On the oscilloscope one can see nrfutil pinging the MCU (whose bootloader should be active since the upload of the application in point 2 failed) but with no answer from the MCU. You might remember that when our proprietary update tool was used the behaviour was slightly different, with the first 1K of the applcation being sent before the CRC request was not served by the bootloader.

    As for your questions:
    - I haven't modified the bootloader but I enabled the relevant options in the sdk_config.h to operate DFU both through BLE and UART, which is what we need in our application.
    - As mentioned before, we use our update tool, but the behaviour with nrfutil is similar (not equal, see point 3)

    I still have to try with 17.1 (should check with other co-developers if this is feasible, as the project might not compile and/or produce unwanted behaviours) and debug the bootloader to see what is going on there. Will do the latter immediately after this, meanwhile any further tips based on this additional info would be great Slight smile
    Thanks.
    Kind regards,
    Stefano

    StefanoSuccessfulUpdate_1.txt InterruptedUpdate_2.txt UpdateAfterInterruptedUpdate_3.txt

Children
  • Hi Stefano, 

    I did another test with SDK v16.0 and nrfutil 6.1.6 . I don't have an issue to continue update after aborting: 

    But I do find that if I trigger a reset in between the DFU update will start from 0 again. From what I understand, before the image is completely received,  the DFU progress is only stored in RAM. 

    It could be the case when you try to read flash in between the update. The Bootloader will be hung and won't be able to continue. You will need to do a reset, and it will clear the progress and it will start from 0. So in your next test, please don't read flash.

    I attached here the files I used. Please use them to test. 

    6371.DFU2.zip



  • Dear Hung Bui,

    I managed to test the files you sent me and here is the result. I uploaded the SD and the BL you sent me (in this order) and then I tried to update the board using your application and nrfutil version 6.1.7 (which should be equal to 6.1.6). As you see in the picture, the update does not event start. On the oscilloscope I see pings from the serial device but no response. The only difference I have wrt what you advised is the flow control, which in my case is set to 0 as I do not have the needed pins on my board.
    I do not really need the update to start from the point where it was interrupted, starting from scratch after an interruption would be just fine. Also, I read the flash image just to report the issue to you, it is not something I do sistematically and the result is the same with or without it.

  • Hi Stefano, 

    Could you let me know which hardware you were using for testing ? I was using nRF52840 DK for testing. And the COM port used was the COMPORT created by the debugger.  

  • In addition I am experiencing serious problems debugging the bootloader. I can start the debug session (breakpoint at the beginning of main) and I set a bp in the function you pointed out, but when I let the bl run and I start the update process the debug session sistematically returns a series of errors in reading registers and I have to restart it. Is there some register that I can read, e.g. using nrfjpog, whose value can shed some light on why the interrupted update is not working?
    Thanks.

    Regards,

    Stefano

  • Hi Stefano, 

    To be able to debug the bootloader, you should use the debug version of the bootloader, not the project  without "debug". The one without "debug" is optimized and you can't step in the code. Make sure you erase the chip before flashing the debug version because it needs to re-write the UICR. 


    Please let me know which hardware board you are using for testing my firmware.

Related