Used your settings to be sure were the same (cool override in the target)

JLinkExe -if SWD -device nRF51822 -speed 1000
erase all
q

newt size shows were under 112238
 110532   1276  10664 122472  1de68
/Users/jacobrosenthal/Downloads/mynewt-hr-observer/bin/targets/split-nrf51dk/loader/apps/bleprph/bleprph.elf


newt build nordic_boot && newt load nordic_boot
newt run split-nrf51dk 0
just quit after loading since we gdb cant survive reset anyway
plug and unplug usb so it starts code


Jacobs-MacBook-Air:mynewt-hr-observer jacobrosenthal$ newtmgr image list -c
serial1
Images:
 slot=0
    version: 0.0.0
    bootable: true
    flags: active confirmed
    hash: 0fb87218d68acf905c646473b1c8361aa3d6236187368ec9862ed8d021e89197
 slot=1
    version: 0.0.0
    bootable: false
    flags:
    hash: 6645241f6e639d9a3d30ca31691736c7d981397c16947247c56f75b76ec140ba
Split status: matching
Jacobs-MacBook-Air:mynewt-hr-observer jacobrosenthal$

Jacobs-MacBook-Air:mynewt-hr-observer jacobrosenthal$ newtmgr image test
6645241f6e639d9a3d30ca31691736c7d981397c16947247c56f75b76ec140ba -cserial1
Images:
 slot=0
    version: 0.0.0
    bootable: true
    flags: active confirmed
    hash: 0fb87218d68acf905c646473b1c8361aa3d6236187368ec9862ed8d021e89197
 slot=1
    version: 0.0.0
    bootable: false
    flags: pending
    hash: 6645241f6e639d9a3d30ca31691736c7d981397c16947247c56f75b76ec140ba
Split status: matching
Jacobs-MacBook-Air:mynewt-hr-observer jacobrosenthal$ newtmgr reset
-cserial1
Done
Jacobs-MacBook-Air:mynewt-hr-observer jacobrosenthal$ newtmgr image confirm
-cserial1
Images:
 slot=0
    version: 0.0.0
    bootable: true
    flags: active confirmed
    hash: 0fb87218d68acf905c646473b1c8361aa3d6236187368ec9862ed8d021e89197
 slot=1
    version: 0.0.0
    bootable: false
    flags:
    hash: 6645241f6e639d9a3d30ca31691736c7d981397c16947247c56f75b76ec140ba
Split status: matching
Jacobs-MacBook-Air:mynewt-hr-observer jacobrosenthal$


As you can see, I cant seem to get slot1 active and confirmed

On Tue, Jan 17, 2017 at 6:43 PM, Christopher Collins <[email protected]>
wrote:

> On Tue, Jan 17, 2017 at 05:47:49PM -0700, Jacob Rosenthal wrote:
> > Thanks Chris!  Tried some more with the new upstreamed code but a few
> > more issues...
> >
> >
> > Still had to add the serial transport to bleprph, not sure if you left
> > that out of there on purpose for code size..  -
> > mgmt/newtmgr/transport/nmgr_shell
>
> Yes, you guessed right.  I was reluctant to add serial newtmgr support
> to bleprph because I think most people would appreciate the extra flash.
>
> > newt run split-nrf51dk 0
> >
> >
> > and it responds to newtmgr serial commands now..  But never blinks..
>
> bleprph doesn't blink the LED. We should change this :).
>
> > Looks like its hitting os_start in the loader because rc =
> > split_app_go(&entry, true); returns -1
> >
> > because (gdb) p split_mode_cur $6 = 0 '\000'
> >
> > which is SPLIT_MODE_LOADER I think it should be SPLIT_MODE_APP??
> > maybe?
>
> SPLIT_MODE_LOADER is the default state.  You need to activate the
> application image using newtmgr if you want it to run (see the "Enabling
> a Split Application" section of
> https://mynewt.apache.org/latest/os/modules/split/split/).
>
> > Also I just decided to go through with newtmgr upload commands, but they
> > crash:
>
> Hmm, I wasn't able to reproduce that.  I am attaching my target's yml
> files so we can compare.
>
> There is one possibility I can think of: Your images might be too big.
> I am using a LOG_LEVEL setting of 255, while I believe you are using 1.
> This will make your images quite a bit larger.  There are a few things
> you need to watch out for with large images:
>
> 1. When building a split image loader, the newt tool doesn't apply the
> correct flash size restrictions from the BSP linker script, so your
> loader can end up being too large.  What should happen instead is the
> link step should fail due to flash overflow.  This is a nasty bug;
> hopefully we'll have it fixed soon
> (https://issues.apache.org/jira/browse/MYNEWT-545).
>
> 2. If an image barely fits in the image slot, this will cause problems
> for the boot loader and image management.  The end of each slot is used
> for keeping track of the current image management state.  If the end of
> an image is written here, it will be wrongly interpreted as image state,
> likely causing a crash.  I think once we get the format of the image
> trailers formalized, we should be able to prevent this issue from
> happening.
>
> For now, be aware that each image slot needs room for a 402 byte
> trailer.  This means that on the 256kB flash nRF51dk, the absolute
> largest an image can be is: 112238 bytes.  If your loader is bigger than
> this, then you'll run into problems.
>
> Finally, if either of these issues occurred, then you'll need to erase
> the overfilled image slot before proceding.  Otherwise, the garbage data
> will remain and continue to confuse the boot loader.  You may already
> know a good way to do this... I erase the entire flash as follows:
>
>     JLinkExe -device nRF51 -speed 4000 -if SWD
>     erase
>
> Then quit JLinkExe.  You'll need to re-upload the boot loader after
> doing this.  Sorry, I know this is a major hassle.
>
> Chris
>

Reply via email to