Hi there!

On Fri, Feb 17, 2017 at 5:45 PM, marko kiiskila <[email protected]> wrote:
>
>
> You could try removing the memory areas which are marked as flash, and then 
> use
> restore.
> I.e.
> delete mem 0
> delete mem 1
> mem 0 0xffffffff rw nocache
> info mem
> restore <filename> binary <location>
>
> Depending on the gdb remote implementation, aka your black magic probe, this 
> might
> or might not work.
>

It seems like I could use all the gdb commands accordingly, even "restore" is
accepted now but when I tried running the app, it behaves like nothing
was written...
I may be still missing something (or maybe it doesn't work at all with my bmp).
But it's ok, the process below seems to work better overall.

>
> I don’t know what the flash map is like on your bsp.yml, but this is how you’d
> convert binary into srecord so I can’t give the correct start address.
> This is how you’d do it if you were to set the load address to 0x8000.
>
> arm-none-eabi-objcopy --adjust-vma=0x8000 -O srec -I binary blinky.img 
> blinky.srec
> After this you should be able to do ‘load blinky.srec’ in gdb.
>

So, that worked very well, now I can load the bootloader at 0x0 using the .elf
file, just like the newt j-link scripts do, and then "load
<file>.srec" in gdb to the proper
bsp flash areas.

With that and setting some syscfg.yml - with some feedback I got from Jacob back
in January - I got bleprph example to work which is the one I was looking for.

Now that it worked, it's up to mess around with the app code itself. =)

Since the mcu it's the same as nrf51dk-16kbram (the nrf51822xxaa), I just cloned
everything from nrf51dk-16kbram bsp and made two minor tweaks like changing
UART TX/RX pins and LED_BLINK_PIN.

>
> Ah, my bad! I remembered the symbol name for end-of-heap incorrect.
> Instead, say:
>
> p/d sbrkLimit - brk
>
>
There you go, for some examples I tried with a few syscfg as follows:

the outputs of "p/d sbrkLimit - brk" are:
  blinky: 6996 (runs ok)
  blehci: 2332 (runs ok)
  bletest: 452 (runs ok)
  bleprph: 332 (fail)
  bleprph with syscfg: 3212 (runs ok)
  blecent: 748 (fail)
  blecent with syscfg: 72 (fail)


syscfg.vals:
    BLE_LL_CFG_FEAT_LE_ENCRYPTION: 0
    BLE_LL_NUM_SCAN_DUP_ADVS: 0
    BLE_SM_LEGACY: 0
    CONFIG_NEWTMGR: 0
    LOG_CLI: 0
    LOG_LEVEL: 255
    LOG_NEWTMGR: 0
    MSYS_1_BLOCK_COUNT: 8
    MSYS_1_BLOCK_SIZE: 76
    SHELL_TASK: 1
    STATS_NAMES: 0
    STATS_NEWTMGR: 0


>
> I’m pretty certain not all of those have been tried. Others on the list might 
> have
> more data on this.
>

Thanks a lot for the help for now! I'll let you know for any progress
here that may be
useful for others on the community.
Hopefully I can get some debugger scripts to support the black magic
probe.. still
tweaking and working on these.


Thanks,
Marcos

Reply via email to