Hi Alfred,

On Mon, Sep 18, 2017 at 06:26:32PM +0200, Alfred Schilken wrote:
> The mynewt documentaion says it supports also a single image setup without a 
> bootloader.
> 
> I would like to use more flash in apps on calliope or microbit but without 
> the complication of split images.
> 
> How can I do that?
> 
> Can I still use a flash-map like this:
> 
> bsp.flash_map:
>     areas:
>         # User areas.
>         FLASH_AREA_NFFS:
>             user_id: 0
>             device: 0
>             offset: 0x00037000
>             size: 32kB
>         FLASH_AREA_FCB_CONF:
>             user_id: 1
>             device: 0
>             offset: 0x0003f000
>             size: 2kB
>         FLASH_AREA_FCB_LOG:
>             user_id: 3
>             device: 0
>             offset: 0x0003f800
>             size: 2kB

Yes, that portion of the flash map looks good.  Unfortunately, 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. Remove the `FLASH_AREA_BOOTLOADER`, `FLASH_AREA_IMAGE_1`, and
`FLASH_AREA_IMAGE_SCRATCH` areas from your BSP's flash map.

2. Adjust the offset of the `FLASH_AREA_IMAGE_0` area to 0, and increase
its size such that it fills the gaps you just created in step 1.

3. 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