You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mynewt.apache.org by Alan Graves <ag...@deltacontrols.com> on 2021/01/18 23:39:02 UTC

HCI mode firmware upgrading

Hi all,

Just wondering if anyone has insights they could share on how I might be able to implement an upgrade procedure for a BLE Device running HCI mode firmware?

The following is basically what I have to work with:

*         The Device programmed during manufacturing with a JTAG programmer.

*         The nRF52832 based Device I'm using will be running the HCI mode firmware and connected to an embedded Alpine Linux Host over a UART connection with full hardware RTS/CTS handshaking support.

*         Once the Device is out in the field I need to be able to reprogram from the Host side via the same UART the HCI mode protocol is using.

Also there a few caveats that I have to adhere to:

*         Obviously the JTAG on the Device is not available out in the field.

*         Here is no HOST hardware GPIO signal available to signal to the Device that it should wait for new firmware.

*         OTA upgrades to the Device are not permitted.


I believe that this only leaves a few UART options open to the Host to initiate the Device firmware upgrade:

1.       Host issues a custom HCI command to write a 'magic' number to a special Nordic chip register, then does a software reset of the Device.

2.       Host does a software reset of the Device and sends a trigger string over the UART during the Bootloader startup.

3.       There is no Device Bootloader used and the HCI mode firmware has the firmware upgrade support built-in.

4.       ...

Any help on this problem would be much appreciated.

Thanks,
ALan



RE: HCI mode firmware upgrading

Posted by Alan Graves <ag...@deltacontrols.com>.
Hi Andrzej,

Thanks, I think you pretty much confirmed things for me.

 Looks like I'll be focusing my efforts on 1. as that seems like that would be the most straight forward. 

I'll implement a custom HCI vendor command to actually reset the chip after writing a magic pattern in a register that the Bootloader will see. This will allow newtmgr protocol to be used over the UART connection to do the firmware upgrade.

Cheers,
ALan

-----Original Message-----
From: Andrzej Kaczmarek <an...@codecoup.pl> 
Sent: Wednesday, January 20, 2021 2:23 AM
To: dev@mynewt.apache.org
Subject: Re: HCI mode firmware upgrading

Hi Alan,

On Tue, Jan 19, 2021 at 12:39 AM Alan Graves <ag...@deltacontrols.com>
wrote:

> Hi all,
>
> Just wondering if anyone has insights they could share on how I might 
> be able to implement an upgrade procedure for a BLE Device running HCI 
> mode firmware?
>
> The following is basically what I have to work with:
>
> *         The Device programmed during manufacturing with a JTAG
> programmer.
>
> *         The nRF52832 based Device I'm using will be running the HCI mode
> firmware and connected to an embedded Alpine Linux Host over a UART 
> connection with full hardware RTS/CTS handshaking support.
>
> *         Once the Device is out in the field I need to be able to
> reprogram from the Host side via the same UART the HCI mode protocol 
> is using.
>
> Also there a few caveats that I have to adhere to:
>
> *         Obviously the JTAG on the Device is not available out in the
> field.
>
> *         Here is no HOST hardware GPIO signal available to signal to the
> Device that it should wait for new firmware.
>
> *         OTA upgrades to the Device are not permitted.
>
>
> I believe that this only leaves a few UART options open to the Host to 
> initiate the Device firmware upgrade:
>
> 1.       Host issues a custom HCI command to write a 'magic' number to a
> special Nordic chip register, then does a software reset of the Device.
>
> 2.       Host does a software reset of the Device and sends a trigger
> string over the UART during the Bootloader startup.
>

Those would be probably easiest to implement. If you use bootloader then there's already support for upgrade over serial so all you need is a way to do a soft reset of a device (HCI Reset does only restart LL). This can be done by implementing vendor specific command which is quite simple. Then, after reset bootloader can either wait for some predefined string to appear on UART or NV registers can be used to enter DFU mode - IIRC MCUBoot supports both.


> 3.       There is no Device Bootloader used and the HCI mode firmware has
> the firmware upgrade support built-in.
>

That is also possible, although we do not have any code to do this so you'd need to write it from scratch, i.e. add some vendor specific HCI commands to transfer new firmware and then restart.


> 4.       ...
>
> Any help on this problem would be much appreciated.
>
> Thanks,
> ALan
>
>
Best,
Andrzej

Re: HCI mode firmware upgrading

Posted by Andrzej Kaczmarek <an...@codecoup.pl>.
Hi Alan,

On Tue, Jan 19, 2021 at 12:39 AM Alan Graves <ag...@deltacontrols.com>
wrote:

> Hi all,
>
> Just wondering if anyone has insights they could share on how I might be
> able to implement an upgrade procedure for a BLE Device running HCI mode
> firmware?
>
> The following is basically what I have to work with:
>
> *         The Device programmed during manufacturing with a JTAG
> programmer.
>
> *         The nRF52832 based Device I'm using will be running the HCI mode
> firmware and connected to an embedded Alpine Linux Host over a UART
> connection with full hardware RTS/CTS handshaking support.
>
> *         Once the Device is out in the field I need to be able to
> reprogram from the Host side via the same UART the HCI mode protocol is
> using.
>
> Also there a few caveats that I have to adhere to:
>
> *         Obviously the JTAG on the Device is not available out in the
> field.
>
> *         Here is no HOST hardware GPIO signal available to signal to the
> Device that it should wait for new firmware.
>
> *         OTA upgrades to the Device are not permitted.
>
>
> I believe that this only leaves a few UART options open to the Host to
> initiate the Device firmware upgrade:
>
> 1.       Host issues a custom HCI command to write a 'magic' number to a
> special Nordic chip register, then does a software reset of the Device.
>
> 2.       Host does a software reset of the Device and sends a trigger
> string over the UART during the Bootloader startup.
>

Those would be probably easiest to implement. If you use bootloader then
there's already support for upgrade over serial so all you need is a way to
do a soft reset of a device (HCI Reset does only restart LL). This can be
done by implementing vendor specific command which is quite simple. Then,
after reset bootloader can either wait for some predefined string to appear
on UART or NV registers can be used to enter DFU mode - IIRC MCUBoot
supports both.


> 3.       There is no Device Bootloader used and the HCI mode firmware has
> the firmware upgrade support built-in.
>

That is also possible, although we do not have any code to do this so you'd
need to write it from scratch, i.e. add some vendor specific HCI commands
to transfer new firmware and then restart.


> 4.       ...
>
> Any help on this problem would be much appreciated.
>
> Thanks,
> ALan
>
>
Best,
Andrzej