General description:
Based on the configuration of BOOT pins, the DaVinci series chip can read its operating instructions from multiple sources. In particular, the source can be NAND chip on the board (which is normal operation for DJI devices), or a serial connection (which is achieved by shorting the BOOT0 pin as many instructions require without explaining..).
When the BOOT is set to serial/uart, it uses a simple text-based protocol to allow talking to internal bootloader (1st stage bootloader) which is built into the DaVinci chip. Besides booting, this protocol has a few instructions which allow to write to the NAND. The `sfh_DM36x` binary, which you can run from your PC, uses that simple protocol to write 2nd stage bootloader (u-boot) there.
The `sfh` tool, then, is quite simple:
* If it receives something from DaVinci, it displays it on screen preceded by "Target:".
* In the meantime, it loads provided binaries from disk and sends it to DaVinci with instructions to write that to the NAND at the place where 2nd stage bootloader is expected to be.
You can connect to the DaVinci serial using a terminal emulator, like PuTTY. Then you will see directly the text answers from the chip, and be able to issue commands directly.
* If the chip boots Linux, this will be a Linux console accepting shell commands.
* If it will be u-boot, (because booting kernel failed but the 2nd stage bootloader is functional), this will be u-boot simple shell.
* If it will be the 1st stage bootloader (because BOOT pin configuration enabled it), you will see the correct prompt for that protocol, which is "BOOTME" repeating every second. In the bootloader protocol, this means "Ready for commands".
When in BOOTME mode, you can use `sfh` tool instead of console emulator to connect to DaVinci serial interface. Then the `sfh` tool will then send the commands to flash the bootloader.
When a proper command is entered to 1st stage bootloader, it should change mode and start answering in different ways rather than spewing "BOOTME". If the `sfh` tool is sending commands, but the chip is still repeating "BOOTME", then this means the commands were not received, or not recognized.
Possible causes:
* There were characters already received by the DaVinci, and the command sent by `sfh` added to it, instead of issuing a new command. Therefore the command was not recognized.
* Your PC OS is caching / interfering with the transmission.
* The Transmit (TX) line is not working - has broken/floating connection; but RX line is working, because you see the BOOTME.
Solutions:
* Interrupt the PC program and run it again (Ctrl-Break or Ctrl-C typically sends interrupt singnal (SIGINT) to a program).
* Check the lines resistance with multimeter.
* Resolder the lines, use different, shorter cables.
---
I hope this description can now be linked to if someone has issues with the `sfh` tool. It should be enough to give anyone understanding of what's going on.