[Cryptech Tech] DFU of Alpha bootloader does not work

Fredrik Thulin fredrik at thulin.net
Tue Dec 20 09:18:25 UTC 2016

On tisdag 20 december 2016 kl. 00:17:33 CET Paul Selkirk wrote:
> On 12/19/2016 04:17 PM, Rob Austein wrote:
> > At Mon, 19 Dec 2016 14:26:35 +0100, Fredrik Thulin wrote:
> >> I suspect (hope) the issue is that you are missing this commit in your
> >> ksng
> >> branch. Try merging masster into the branch or cherry-picking this
> >> commit:
> >> 
> >> commit ae8ebceb7c47d38949a92a2f495c990e772d4e51
> >> Author: Fredrik Thulin <fredrik at thulin.net>
> >> Date:   Mon Aug 15 15:24:50 2016 +0200
> >> 
> >>     cli_receive_data: re-enable UART DMA before returning
> >>     
> >>     Bugfix after new port of libcli where this enabling doesn't happen
> >>     after
> >>     every command anymore.
> > 
> > Sorry, no.  That commit predates the sw/stm32 ksng branch, so ksng
> > already had it.  For completeness, I merged master => ksng in both
> > sw/stm32 and sw/libhal so that ksng would be fully up-to-date with
> > respect to master, then pushed the result and re-tested.  No change.
> Umm, that commit is only for the cli-test project, and we're talking
> about the hsm project. (We'll leave aside for the moment the question of
> why the cli-test project still exists.)

Ah, good catch =). FWIW, the cli-test project is actually used when 
bootstraping the boards.

> Applying the patch to the hsm project works, in the sense that it
> returns to the CLI. It doesn't reboot the board (unlike DFU on the hsm
> firmware), but that can be solved by adding a reboot command to the
> upload script.

That's progress.

> However, the biggest, realest problem is that the board doesn't actually
> work after uploading the new bootloader. Programming the same bootloader
> via ST-LINK does work, so it's not a build error. So either the
> flash-writing code has the wrong address (it doesn't look like it, but I
> haven't verified it), or the flash-writing code is somehow Wrong. More
> debugging required.

Yes, more debugging needed. The code writing the flash ought to be the very 
same code writing the flash when uploading main firmware using the bootloader, 
no? And that process clearly does work.


More information about the Tech mailing list