Hi Kevin,
I think (and I’ll let Marko chime in here), you can use the
boot_serial package to achieve this
(apache-mynewt-core/libs/boot_serial.)
It speaks the newtmgr protocol, but doesn’t require the shell task or
an image to be programmed. I think it will slightly explode the size of
your boot loader, but that shouldn’t be a huge issue on the NRF52.
apps/boot/ has the following options.
#
# Define BOOT_SERIAL in target features to include serial downloader.
# And uncomment 'libs/console/stub' from pkg.deps.
#
pkg.deps.BOOT_SERIAL.OVERWRITE:
- libs/console/full
- libs/boot_serial
pkg.cflags.BOOT_SERIAL:
- -DBOOT_SERIAL
It’s (unfortunately) been awhile since I’ve tested this, but we’ll
take a look today and make sure it’s still functioning (it should be.)
Sterling
On 23 Sep 2016, at 2:46, Kevin Townsend wrote:
Hi Will (and company),
Sorry to recycle an old thread, but I was just doing some testing with
the bootloader on the latest release, and wanted to come back to the
issue of having a purely serial option for flashing images in the
bootloader. From my perspective there are a number of valid use cases
around uploading an image on an empty device (other than the
bootloader) over UART or USB CDC, but others may disagree.
This would provide an inexpensive mechanism to debrick boards, for
example, as well as a useful tool for production environments where
you don´t have the financial or practical means to send a half dozen
commercially licensed JLink to your assembly house or somewhere in
China for testing then flashing.
Being able to run something like this with ONLY the bootloader present
would be a big plus I think:
$ newtmgr -c serial image upload
bin/bleuart/apps/bleuart/bleuart.elf.bin
As things stand today, you can only do this (I think, please correct
me if I´m wrong) if you already have a valid image flashed and shell
support enabled for newtmgr.
Is there an obstacle anyone can see about why this wouldn't be
practical to implement with only the bootloader present? We've been
focused on application level code and the peripheral side of nimble so
I haven't looked at the bootloader code at all, but will have a look
to try to get a better sense of the requirements here to use it with
serial without any sort of shell support on the application side.
K.
On 08/06/16 23:59, will sanfilippo wrote:
+1
Guess that is my one cent opinion :-) Wouldnt be hard to do and is
definitely a handy option for a certain group of folks. BTW, and this
is a minor detail, I am not so much for polling a pin; the bootloader
can look at the serial port for a certain sequence of characters. If
it sees them it enters download mode. If it doesnt see anything it
likes after that (or doesnt see that sequence), it tries to boot an
image. If it cant, it just cycles back. If it boots a valid image,
all good. If it boots a bricked image, you just gotta power cycle it.
Shouldnt increase boot time too much (which is something to keep in
mind imo).
On Jun 8, 2016, at 12:42 PM, marko kiiskila <[email protected]>
wrote:
I’m convinced that we should have an option for using standalone
boot loader
with which you can upload images. These are valid use cases.
We should make that happen.