[SOLVED] Slow programming on i.MX RT1051

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] Slow programming on i.MX RT1051

    We are facing some issues with slow download rates on our custom board based on RT1051 uC. Downloading ~1,6Mbytes of data into ext SDRAM can take as long as ~45s.

    Current hardware configuration:
    - Manjaro Linux
    - NXP RT1051
    - exe code and data are mostly located in ext SDRAM
    - some data is located in internal RAM

    Memory region Used Size Region Size %age Used
    SRAM_OC: 0 GB 64 KB 0.00%
    SRAM_DTC_TEXT: 0 GB 24 KB 0.00%
    SRAM_DTC: 380436 B 424 KB 87.62%
    BOARD_SDRAM_TEXT: 1589652 B 4 MB 37.90%
    BOARD_SDRAM_HEAP: 10629762 B 13 MB 77.98%

    Below is log from Jlink/GDB server confiuration:

    SEGGER J-Link GDB Server V6.44d Command Line Version

    JLinkARM.dll V6.44d (DLL compiled Mar 27 2019 17:11:41)

    Command line: -if SWD -device MCIMXRT1051 -speed 4000 -jlinkscriptfile evkbimxrt1050_sdram_init.jlinkscript
    -----GDB Server start settings-----
    GDBInit file: none
    GDB Server Listening port: 2331
    SWO raw output listening port: 2332
    Terminal I/O port: 2333
    Accept remote connection: yes
    Generate logfile: off
    Verify download: off
    Init regs on start: off
    Silent mode: off
    Single run mode: off
    Target connection timeout: 0 ms
    ------J-Link related settings------
    J-Link Host interface: USB
    J-Link script: evkbimxrt1050_sdram_init.jlinkscript
    J-Link settings file: none
    ------Target related settings------
    Target device: MCIMXRT1051
    Target interface: SWD
    Target interface speed: 4000kHz
    Target endian: little

    Connecting to J-Link...
    J-Link is connected.
    Firmware: J-Link V10 compiled Mar 21 2019 15:43:57
    Hardware: V10.10

    "evkbimxrt1050_sdram_init.jlinkscript" contains init procedure for external SDRAM.

    We've noticed that jlink is downloading firmware in very small pieces i.e:



    Downloading 30 bytes @ address 0x80022798
    Downloading 22 bytes @ address 0x800227B6
    Downloading 22 bytes @ address 0x800227CC
    Downloading 28 bytes @ address 0x800227E2
    Downloading 38 bytes @ address 0x800227FE
    Downloading 40 bytes @ address 0x80022824

    I wonder if there are any conf options which will force jlink to download bigger chunks of firmware as I believe it will speed up downloading process. I also don't understand why firmware is splitted like this ? As you can see programming process is linear i.e jlink doesn't have to jump to different memory addresses. Maybe this has something to do with linker script ?

    I'd be very grateful for any tips or info.

    Thanks in advance
    Mateusz Piesta
  • Hello Mateusz,

    Thank you for your inquiry.
    Such an issue is not known to us.

    Could you try using our latest J-Link software to make sure we are not looking for something that has already been improved?
    segger.com/downloads/jlink/

    Could you also try to bump up connection speed. 4 MHz is rather slow and a higher interface speed means more data can be transfered in the same amount of time.

    Is the SDRAM script compatible to a MIMXRT1050-EVK ?

    If yes could you provide us with the SDRAM script and an example image for reproduction purposes?

    Best regards,
    Nino
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hello,

    As you suggested I updated J-Link software to the newest one, 6.48b, unfortunately upgrading did not change anything.

    I also bumped up interface speed to 16MHz which indeed made programming process a little bit faster. J-link still splits firmware to small chunks, though.

    I've attached SDRAM init script, it was taken from RT1051 SDK and slightly modified for SDRAM that we are using: AS4C8M16MSA-6BIN.

    I've info that init script that I provided was successfully used on RT1051EVK hence I assume you can use it for test purposes.

    I also attached simple test image, it jumps to empty main. Sorry for using external file sharing platform but .elf file was too big to upload it directly here.
    filebin.net/88i5dvmtx9eetzs2/testImage.elf?t=eo8d5sof

    Best regards,
    Mateusz Piesta
    Files
  • Hello,

    Thank you for providing the init script.
    The chunking of writes you see in GDB Server is done by the GDB client you are using. GDB Server will simply execute whatever the GDB Client sends him.
    Please understand that we have no influence over this so it would need to be fixed from GDB Client perspective.

    For reference you can try downloading your image with J-Link Commander instead using the loadfile command.
    This will download the image in larger chunks so the bottleneck is on the target device side. Which file types are supported can be found in the J-Link user manual.
    Attached you can find the 1.5 MB image that I used for testing.

    Here are some results:
    SWD 4 MHz: 24s Downloadtime
    SWD 20 MHz: 13s Downloadtime
    SWD 50 MHz: 12s Downloadtime

    As you can see at some point J-Link is waiting most of the time for the target device to finish writing a chunk so increasing the debug interface speed makes no difference after a certain point.

    So we are programming as fast as the target device is capable of.


    Best regards,

    Nino
    Files
    • test.7z

      (114.97 kB, downloaded 43 times, last: )
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.
  • Hello,

    You are welcome.
    We will consider this thread as solved now.

    Best regards,
    Nino
    Please read the forum rules before posting: Forum Rules

    Keep in mind, this is not a support forum. Its main purpose is user to user interaction.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.