This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Error uploading app thru optiboot-ble and NRF toolbox

I am trying to use optiboot-ble with the nRF8001 and an atmega328p to allow application update over bluetooth. I have successfully compiled the bootloader and flashed it to the microcontroller. I have loaded the uart project with dfu from the SDK onto the microcontroller and it appears to work fine. I have been unsuccessful however in uploading an app via bluetooth using either the nRF toolbox app (ios Version 4.4.1) or the nRF Connect app (ios Version 1.7.5). Both connect fine and start the upload process but then get a disconnect error (disconnected by remote device). I have tried changing the number of packets down to 1 in the toolbox app but no change in result. Attached is the log file from the connect app.dfu log.txt

Also attached is the serial output from the debugger.debugger output.txt

Parents
  • Suggestions: Use the bootloader hex file as attached in the release in github. nRF toolbox android version (I used only the Android version):

    Settings:

    • Set the MBR size to zero
    • External MCU DFU to ON

    Additional comments, I have never used the iOS app for testing this so I suggest that the android one is use for verifying that it works.

  • Android version not working for me either with those settings. Once in the bootloader I never receive any aci events or command and so always return imediately from ble_update here: if (!lib_aci_event_get(&aci_state, &aci_data)) { return; }

    Also it appears rdyn is always high because radio never gets reset in lib_aci_init here: if (!hal_aci_tl_rdyn()) { lib_aci_radio_reset(); }

    Any idea why this would be?

    FYI I think I did find a small error in ble_optiboot with the clock division setting:

    In m_spi_init() of hal_ac_tl.c the spi control register is set as follows: SPCR |= _BV(SPE) | _BV(DORD) | _BV(MSTR) | _BV(SPI2X) | _BV(SPR0);

    SPI2X is in the SPSR register and both SPI2X and SPR0 are defined as 0 so it's redundant to include them both anyway. SPSR register should have the SPI2X bit set to to achieve div 8. As set it is div 16 which probably isn't a problem for most people.

Reply
  • Android version not working for me either with those settings. Once in the bootloader I never receive any aci events or command and so always return imediately from ble_update here: if (!lib_aci_event_get(&aci_state, &aci_data)) { return; }

    Also it appears rdyn is always high because radio never gets reset in lib_aci_init here: if (!hal_aci_tl_rdyn()) { lib_aci_radio_reset(); }

    Any idea why this would be?

    FYI I think I did find a small error in ble_optiboot with the clock division setting:

    In m_spi_init() of hal_ac_tl.c the spi control register is set as follows: SPCR |= _BV(SPE) | _BV(DORD) | _BV(MSTR) | _BV(SPI2X) | _BV(SPR0);

    SPI2X is in the SPSR register and both SPI2X and SPR0 are defined as 0 so it's redundant to include them both anyway. SPSR register should have the SPI2X bit set to to achieve div 8. As set it is div 16 which probably isn't a problem for most people.

Children
No Data
Related