Menu

#188 samg55 start of debug speedup

0.9.0
new
nobody
samg (1)
2018-07-21
2018-06-05
Filip
No

Hello,

I'm using SAMG55 xplained board with Eclipse. I made it debugging but the behaviour is weird. The main problem is speed. It takes about 25 seconds to start the debug session when I use default 500 kHz adaprer speed!! I tried to raise it to 5 MHz and it results in aprox 12 seconds. Its still damn slow for development.

I'm using gcc-arm-none-eabi-7-2017-q4-major and openocd 0.10.0-8-20180512-1921. In Eclipse I set paths to openocd and gdb executables and used -f board/atmel_samg55_xplained_pro.cfg and my .bin file is 460248 B long.

What happenes is it erases 0x00 - 0x38 flash sectors (57 sectors * 16 pages * 512 bytes = 466944 B), afterwards it outputs some spilled tea and starts to write 899 sectors. The full output of openocd with -d is attached. I am not familiar with the write procedure but it takes most of the time so I assume it also erases the flash before writing.

Could this time be reduced somehow?

7 Attachments

Discussion

  • Spencer Oliver

    Spencer Oliver - 2018-06-05
    • labels: --> samg
     
  • Tomas Vanek

    Tomas Vanek - 2018-07-21

    No, erase takes place just once.

    However I spotted some inefficient operation during write in the at91sam4.c:
    1) FMR register is set before every page write and it is read-modify-write operation. It should be done just once per flash write.
    2) EFC_StartCommand checks status before every EFC command

    With adapter_khz 50000 I get:

    erased sectors 3 through 59 on flash bank 0 in 2.206685s
    wrote 460800 bytes from file rand450k.bin in 7.673722s (58.642 KiB/s)

    and with removed inefficient commands:

    wrote 460800 bytes from file rand450k.bin in 5.231433s (86.019 KiB/s)

    Even faster flashing would require implementation of a async flash loader on the target.

    Tom

     
  • Tomas Vanek

    Tomas Vanek - 2018-07-21
     

Log in to post a comment.

Monday.com Logo