Hi Nicola,

On Fri, Sep 27, 2019 at 04:48:18PM +0200, Nicola Bizzotto wrote:
> Hi,
> I'm currently using an Espruino Puck.js device. I'm programming it with a
> Segger J-Link programmer. I have already experience with mynewt OS (I used
> it with a Bluefruit nRF52 Feather) and now I want to use it also with the
> Puck.js. I also would like to use 'Single' image setup, which is described
> here: https://mynewt.apache.org/latest/os/modules/split/split.html.
> By now I've always used 'Split' mode.
> I searched on your site but failed to find some information about the setup
> and use of 'Single' mode. Can you give me some help, or point me to some
> useful resources?

Mynewt doesn't offer any "direct" support for the single image setup,
but I believe it is still possible to use (it definitely used to work).

I don't believe there is any documentation for the single-image setup,
so here are some (untested) thoughts on how you should proceed:

1. (bsp.yml): In your BSP's flash map, shrink the
`FLASH_AREA_BOOTLOADER`, `FLASH_AREA_IMAGE_1`, and
`FLASH_AREA_IMAGE_SCRATCH` flash areas down to one sector each.  You
might be able to remove the "image 1" and "image scratch" areas entirely
(I'm not sure), but you definitely need to keep the bootloader area.

2. (bsp.yml): Set the `FLASH_AREA_IMAGE_0` area's offset to 0 and increase
its size as needed.  Your single image will reside in this area.

3. (bsp.yml): Set the `FLASH_AREA_BOOTLOADER` area's offset to something
other than 0.  Make sure it doesn't overlap any other areas.

4. Fix up the BSP linker script.  Copy the normal linker script and
modify its `FLASH` memory region so that it matches the
`FLASH_AREA_IMAGE_0` flash area (set `ORIGIN` to 0; set `LENGTH` to the
size of the flash area).

That should be it.  You might run into issues if some of your target's
dependencies expect all these flash areas to exist.  For example, you
will have to ensure you aren't pulling in `mgmt/imgmgr`.

Chris

Reply via email to