Skip to content

[FR] read function of bootloader #4

Open

Description

@ildar

So that we could backup the stock FW and other data the device has

Activity

  1. goddade commented on Aug 16, 2020

    @goddade

    +1

  2. atc1441 commented on Aug 16, 2020

    @atc1441
    Owner

    This is not possible to archive right now. The stock bootloader does not support read.
    And to install a new bootloader the flash and bootloader gets erased. So after flashing it there is nothing to dump anymore.

    The only thing possible to backup it the stock Bootloader. That one is already known and same for many DaFit devices.

  3. suphammer commented on Aug 16, 2020

    @suphammer

    Hi atc1441,

    But what about reading the stock boot loader using openocd (or gdb with Black Magic?):
    When I try to dump I get Unknown device. Maybe newer P8 watches has read protection bit set ?:

    flash read_bank 0 flash-bank0.bin
    Unknown device: nRF51xxx (HWID 0x00000000) 0kB Flash, 0kB RAM
    wrote 0 bytes to file flash-bank0.bin from flash bank 0 at offset 0x00000000 in 7.190152s (0.000 KiB/s)

    Do you happen to have a dump of the stock boot loader ? And will it be possible to recover original firmware using Da Fit software if we re-install the stock boot loader ?

  4. atc1441 commented on Aug 16, 2020

    @atc1441
    Owner

    Every Smartwatch from DaFit has the Read Protection bit set so it is needed to recovery the nRF wich also does erase the flash.

    I have the stock bootloader and used it to have a way to go simply back and retry while developing, i can not share it.

    The Stock Bootloader does not have any BLE functions included so it relies on the Firmware that will download the new Firmware to external flash, that means it is not possible to go back to stock with only the Bootloader flashed.

  5. suphammer commented on Aug 17, 2020

    @suphammer

    You are right, ATC1441. Once I flashed your hacked boot loader, the flash was accessible.

    I assume the only way to get the boot loader is to craft a special image with a firmware dumper that is loaded by the existing firmware. I was only thinking about this to be able to compare when debugging. But since most of the hardware is already identified, I's not strictly necessary.

  6. atc1441 commented on Aug 17, 2020

    @atc1441
    Owner

    The Flash is unlocked after the Hacked bootloader as it clears the UICR registers while flashing.

    The idea with the special firmware dumper is possible but not needed anymore as this is already done :) and only the bootloader can be dumped that way.

  7. ildar commented on Sep 28, 2020

    @ildar
    Author
  8. atc1441 commented on Sep 28, 2020

    @atc1441
    Owner

    Hey.

    So the stock bootloader needs the new firmware on external flash.

    When already on the custom bootloader and you want to go back to stock you need to flash it to 0x23000 internaly. That is what the stock bootloader does as well.

    Just mentioning when going back to stock on a closed watch you can not flash anything else every again ota. You need to open the watch then

  9. ildar commented on Sep 29, 2020

    @ildar
    Author
  10. ildar commented on Sep 30, 2020

    @ildar
    Author
  11. ildar commented on Dec 28, 2020

    @ildar
    Author
  12. luke-jr commented on Nov 19, 2021

    @luke-jr

    The Stock Bootloader does not have any BLE functions included so it relies on the Firmware that will download the new Firmware to external flash, that means it is not possible to go back to stock with only the Bootloader flashed.

    Can't the stock firmware be populated in the external flash before the stock bootloader is flashed, and then the stock bootloader will finish the job? Thereby returning to a factory-like state where firmware updates remain possible...

  13. atc1441 commented on Nov 19, 2021

    @atc1441
    Owner

    Yes this does work.
    "Only" needs to be imolemented

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions