I am trying to implement DFU for nrf51822 qfaa module
I have used sdk secure boot-loader example.
Its working on nrf51DK
but not working on nrf51822 qfaa module
sdk : 12.3.0
I am trying to implement DFU for nrf51822 qfaa module
I have used sdk secure boot-loader example.
Its working on nrf51DK
but not working on nrf51822 qfaa module
sdk : 12.3.0
HI Dhaval,
does the nRF51822 module have an external 32kHz crystal? If not, then you need to change the LFCLK configuration to use the internal RC Oscillator, i.e.
#define NRF_CLOCK_LFCLKSRC {.source = NRF_CLOCK_LF_SRC_RC, \ .rc_ctiv = 16, \ .rc_temp_ctiv = 2, \ .xtal_accuracy = NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM}
Best regards
Bjørn
It worked with my module when I changed ram as below
FLASH (rx) : ORIGIN = 0x35C00, LENGTH = 0xA000
/** RAM Region for bootloader. This setting is suitable when used with s110, s120, s130, s310. */
RAM (rwx) : ORIGIN = 0x200025e0, LENGTH = 0x1a02
/** Location of non initialized RAM. Non initialized RAM is used for exchanging bond information
* from application to bootloader when using buttonluss DFU OTA.
*/
NOINIT (rwx) : ORIGIN = 0x20003fe2, LENGTH = 0x80
/** Location of bootloader setting in at the last flash page. */
BOOTLOADER_SETTINGS (rw) : ORIGIN = 0x0003FC00, LENGTH = 0x0400
/** Location in UICR where bootloader start address is stored. */
UICR_BOOTLOADER (r) : ORIGIN = 0x10001014, LENGTH = 0x04
but on OTA inrf toolbox giving me error upload failed gatt error
I have generated package using application hex and private key using following command
nrfutil pkg generate --hw-version 51 --application-version 1 --application testFirmware\mainApp.hex --sd-req 0x87 --key-file keys\private.pem OTATest.zip
It worked with my module when I changed ram as below
FLASH (rx) : ORIGIN = 0x35C00, LENGTH = 0xA000
/** RAM Region for bootloader. This setting is suitable when used with s110, s120, s130, s310. */
RAM (rwx) : ORIGIN = 0x200025e0, LENGTH = 0x1a02
/** Location of non initialized RAM. Non initialized RAM is used for exchanging bond information
* from application to bootloader when using buttonluss DFU OTA.
*/
NOINIT (rwx) : ORIGIN = 0x20003fe2, LENGTH = 0x80
/** Location of bootloader setting in at the last flash page. */
BOOTLOADER_SETTINGS (rw) : ORIGIN = 0x0003FC00, LENGTH = 0x0400
/** Location in UICR where bootloader start address is stored. */
UICR_BOOTLOADER (r) : ORIGIN = 0x10001014, LENGTH = 0x04
but on OTA inrf toolbox giving me error upload failed gatt error
I have generated package using application hex and private key using following command
nrfutil pkg generate --hw-version 51 --application-version 1 --application testFirmware\mainApp.hex --sd-req 0x87 --key-file keys\private.pem OTATest.zip
Please use the nRF Connect app instead of the nRF Toolbox and provide the log files from the nRF Connect app.
INFO:Inside main
0> :INFO:In nrf_bootloader_init
0> :INFO:In real nrf_dfu_init
0> :INFO:running nrf_dfu_settings_init
0> :INFO:Enter nrf_dfu_continue
0> :INFO:Valid App
0> :INFO:Application sent bootloader request
0> :INFO:In nrf_dfu_transports_init
0> :INFO:num transports: 1
0> :INFO:vector table: 0x00035c00
0> :INFO:After nrf_dfu_transports_init
0> :INFO:------- nrf_dfu_flash_init-------
0> :INFO:Waiting for events
this is getting on dfu start via RTT
Here is log from nrf connect app
nRF Connect, 2020-01-27 DfuTarg (CA:1A:F2:51:65:B7) V 15:21:15.600 Connecting to CA:1A:F2:51:65:B7... D 15:21:15.600 gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M) D 15:21:15.970 [Callback] Connection state changed with status: 0 and new state: CONNECTED (2) I 15:21:15.970 Connected to CA:1A:F2:51:65:B7 D 15:21:15.973 [Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED V 15:21:16.009 Discovering services... D 15:21:16.012 gatt.discoverServices() I 15:21:16.413 Connection parameters updated (interval: 7.5ms, latency: 0, timeout: 5000ms) D 15:21:46.373 [Callback] Connection state changed with status: 22 and new state: DISCONNECTED (0) E 15:21:46.373 Error 22 (0x16): GATT CONN TERMINATE LOCAL HOST I 15:21:46.373 Disconnected D 15:21:46.411 [Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
Ok, so the nrf51822 is advertising as Nordic_Buttonless, when you try to connect, then you're not able to connect with the application?
Best regards
bjørn
Its advertising as DFUTARG
Ok, can you place breakpoints in app_error_handler_bare() and app_error_fault_handler() in main.c and then try to connect? Do you end up in one of these handlers? If so, please look at the call stack and see which function that caused the error.
Best regards
Bjørn