I tried following your instructions with my ARM host connected to the MIMEW board so I decided to flash the bootloader directly to the Nordic SDK and use Jimmy Wong's C++ program by the SDK's USB interface.
I also did not succeed.
Here is what I did.
Thanks You.
1) Bootloader
a) Copied pca10056_uart_debug_266089 zip to E:\Nordic\nRF5_SDK_17.0.2_d674dde\examples\dfu\secure_bootloader
b) Cleared button and hardware flow control
//==========================================================
// <e> NRF_BL_DFU_ENTER_METHOD_BUTTON - Enter DFU mode on button press.
//==========================================================
#ifndef NRF_BL_DFU_ENTER_METHOD_BUTTON
#define NRF_BL_DFU_ENTER_METHOD_BUTTON 0
#endif
// <o> NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN - Button for entering DFU mode.
//==========================================================
// <q> NRF_DFU_SERIAL_UART_USES_HWFC - HWFC configuration
#ifndef NRF_DFU_SERIAL_UART_USES_HWFC
#define NRF_DFU_SERIAL_UART_USES_HWFC 0
#endif
c) Added to Preprocessor
RX_PIN_NUMBER=8
TX_PIN_NUMBER=6
CTS_PIN_NUMBER=7
RTS_PIN_NUMBER=5
d) Remarked as no leds
static void dfu_observer(nrf_dfu_evt_type_t evt_type)
{
switch (evt_type)
{
case NRF_DFU_EVT_DFU_FAILED:
case NRF_DFU_EVT_DFU_ABORTED:
case NRF_DFU_EVT_DFU_INITIALIZED:
#if LEDS_NUMBER > 0
bsp_board_init(BSP_INIT_LEDS);
bsp_board_led_on(BSP_BOARD_LED_0);
bsp_board_led_on(BSP_BOARD_LED_1);
bsp_board_led_off(BSP_BOARD_LED_2);
#endif
break;
case NRF_DFU_EVT_TRANSPORT_ACTIVATED:
#if LEDS_NUMBER > 0
bsp_board_led_off(BSP_BOARD_LED_1);
bsp_board_led_on(BSP_BOARD_LED_2);
#endif
break;
case NRF_DFU_EVT_DFU_STARTED:
break;
default:
break;
}
}
e) Flashed the built secure_bootloader_uart_mbr_pca10056_debug.hex and s140_nrf52_7.2.0_softdevice.hex (for my program use).
Now the DFU bootloader runs since there is no application.
2) Build my application package app_dfu_package.zip
nrfutil pkg generate --hw-version 52 --application-version 1 --application E:\Projects\Nordic\alfa_laval_gateway\pca10056\s140\ses\Output\Debug\Exe\alfa_laval_gateway_pca10056_s140.hex --sd-req 0x0100 --key-file E:\Projects\Nordic\alfalval_gateway_keys\priv.pem E:\Projects\Nordic\AlfaLavalFlashfiles\app_dfu_package.zip
pause
3) I built Jimmy Wong's c++ program that my ARM host's code is built upon and ran it on my PC connected to the Nordic SDK, since something might have gotten messed up in my conversion code.
In the end I will perform an application update recived by a cellular modem on our ARM host and update the MIMEW board serially.
Jimmy's C++ program also failed when trying to program the data part before it sends the application code.
In dfu_serial_execute_obj() the dfu_serial_get_rsp() returns an error.
jimmywongbluetooth.wordpress.com/.../
Sending Application image.
SLIP: --> [9, 1]
SLIP: <-- [96, 9, 1, 1]
Set Packet Receipt Notification 0
SLIP: --> [2, 0, 0]
SLIP: <-- [96, 2, 1]
SLIP: --> [7]
SLIP: <-- [96, 7, 1, 131, 0]
Sending init packet...
Selecting Object: type:1
SLIP: --> [6, 1]
SLIP: <-- [96, 6, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
Object selected: max_size:512 offset:0 crc:0x00000000
SLIP: --> [1, 1, 141, 0, 0, 0]
SLIP: <-- [96, 1, 1]
Streaming Data: len:141 offset:0 crc:0x00000000
SLIP: --> [8, 18, 138, 1, 10, 68, 8, 1, 18, 64, 8, 1, 16, 52, 26, 2, 128, 2, 32, 0, 40, 0, 48, 0, 56, 140, 175, 9, 66, 36, 8, 3, 18, 32, 212, 176, 254, 147, 100, 224, 60, 28, 43, 210, 13, 155, 200, 58, 136, 167, 98, 55, 196, 194, 68, 233, 177, 134, 127, 163, 183, 171, 47, 30, 252]
SLIP: --> [8, 147, 72, 0, 82, 4, 8, 1, 18, 0, 16, 0, 26, 64, 191, 204, 125, 154, 71, 87, 252, 12, 223, 86, 90, 21, 50, 67, 33, 114, 149, 210, 212, 134, 102, 233, 32, 13, 115, 212, 214, 80, 143, 187, 128, 2, 123, 76, 156, 183, 137, 129, 62, 134, 1, 75, 75, 0, 130, 172, 198, 62, 157, 235, 79]
SLIP: --> [8, 192, 112, 57, 190, 116, 143, 0, 214, 130, 56, 229, 181, 185]
SLIP: --> [3]
SLIP: <-- [96, 3, 1, 141, 0, 0, 0, 115, 111, 140, 185]
SLIP: --> [4]
SLIP: <-- [96, 4, 5]
Bad result code (0x5)!
E:\Nordic\nRF5_SDK_17.0.2_d674dde\examples\nrf-slim-serial-uart-dfu-host-c-code-master\Debug\UartSecureDFU.exe (process 21456) exited with code 1.
To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops.
Press any key to close this window . . .
Hi,
DavidKaplan said:use Jimmy Wong's C++ program by the SDK's USB interface.
Are you using the USB interface? Since Jimmy's example is based on the Serial (UART) DFU, you might need some modifications.
-Amanda H.
Hi,
DavidKaplan said:use Jimmy Wong's C++ program by the SDK's USB interface.
Are you using the USB interface? Since Jimmy's example is based on the Serial (UART) DFU, you might need some modifications.
-Amanda H.
Shalom!
I am using the uart interface of an Arm processor in my project connected to a MIMEW Nordic boardMS88F2.
I also tried to run the bootloader on the nRF52840-DK using the nrf-slim-serial-uart-dfu-host-c-code c++ project code.
I am thinking that maybe I missed a step in preparing the app_dfu_package.zip file.
I tried creating it with my application's debug version and then with its release version with the same results.
Does the debug version change its start address or is it just with more debug information?
Is there documentation of the bootloader and its error codes?
I need to get this working as our customer is waiting and the prototype working.
Thanks