DAPLink icon indicating copy to clipboard operation
DAPLink copied to clipboard

Not able to Drag-and-Drop with BIN Files

Open SamECU opened this issue 3 years ago • 5 comments

Hello,

I'm using the LPC55S69 (MCU-Link Hardware) as HIC which I've attempted to port to the MIMXRT1010-EVB as Target.

With the hardware and software and I can debug the target in IDE (MCUXpresso) and the drag-and-drop functionality works with HEX files.

When I try and program using BIN files I receive "FAIL.TXT : Transfer timeout".

My first thought is that it doesn't recognise the BIN files.

I'm not sure what I need to change in the code to resolve the issue.

Thought / Issues

  1. When I generate c_blob.c for flash_blob.c from "MIMXRT1011_QuadSPI_4KB_SEC.FLM" it generates the data below for "Verify": image

When compiling, "0x120000003, // Verify" isn't a valid value. Should this be deleted or set to "0x00000000, // Verify"?

  1. When I generate c_blob.c for flash_blob.c from "MIMXRT1011_QuadSPI_4KB_SEC.FLM" it generates the data below for "sectors_info": image

When compiling there are errors as "sector_info_t sectors_info" is expected. Should it be changed to as below: image

  1. When populating "Target.c" I can find the information supplied with MIMXRT1011_QuadSPI_4KB_SEC.FLM as below: image

Have I populated "Target.c" correctly or is this issue here: image

(I ask as there's 3x RAM-Start addresses.)

Thanks for any help, I really appreciate it. Data.zip

SamECU avatar Jun 27 '22 20:06 SamECU

  1. When I generate c_blob.c for flash_blob.c from "MIMXRT1011_QuadSPI_4KB_SEC.FLM" it generates the data below for "Verify": When compiling, "0x120000003, // Verify" isn't a valid value. Should this be deleted or set to "0x00000000, // Verify"?

Yes, that is correct.

  1. When I generate c_blob.c for flash_blob.c from "MIMXRT1011_QuadSPI_4KB_SEC.FLM" it generates the data below for "sectors_info": When compiling there are errors as "sector_info_t sectors_info" is expected.

tools/generate_flash_algo.py in main branch should generate sectors_info with the sector_info_t type.

  1. When populating "Target.c" I can find the information supplied with MIMXRT1011_QuadSPI_4KB_SEC.FLM as below: [...] (I ask as there's 3x RAM-Start addresses.)

The flash algo is using 0x20000000 adddress and other i.MXRT targets as well.

Have a look at validate_bin_nvic in source/family/freescale/target_reset_mimxrt.c. If the MIMXRT1011 also expects a "Flash Configuration Block" at the start of the .bin image, you should define DAPLINK_MIMXRT_TARGET macro for your board. Otherwise you should look at the initial stack pointer (first 4 bytes in .bin file) and check that it properly fits in the RAM region defined.

mathias-arm avatar Jun 28 '22 06:06 mathias-arm

Hello Mattias, Thanks a lot, I'll look into each of the comments.

Cheers, Sam

SamECU avatar Jun 28 '22 17:06 SamECU

Hello Mattias,

I've attempted to work through each of your suggestions:

  1. You should define DAPLINK_MIMXRT_TARGET macro for your board From the start I attempted to define / call the macro in "mimxrt1010_evk_qspi.yaml" image I've attempted to call it in a header file etc. but the issue remains the same. Am I defining "DAPLINK_MIMXRT_TARGET" incorrectly

  2. Fitting within defined RAM region

  • With the OpenSDA supplied with the iMXRT1010-EVB the bin files work with drag and drop.
  • I played with the memory maps in the bin and also checked that the code fits within the available RAM, that appears to be ok image
  • I've tried differently compiled bin files, same issue.

Any further ideas or suggestions?

Regards, Sam

SamECU avatar Jun 29 '22 19:06 SamECU

  1. You should define DAPLINK_MIMXRT_TARGET macro for your board Am I defining "DAPLINK_MIMXRT_TARGET" incorrectly

That looks correct.

  1. Fitting within defined RAM region

You should add all RAM regions to ram_regions[] in target_device.

Does your .bin files start with 0xFCFB (to satisfy the test in validate_bin_nvic()? I am not sure if there needs to be an else clause with the proper offset; there was a trick in #712 for MIMXRT1170-EVK for target_reset_mimxrt.c, which I ended up not including in #912.

mathias-arm avatar Jun 29 '22 20:06 mathias-arm

Hallo Mathias

  1. RAM Regions I extended the definition of the RAM regions to reflect my memory map: image image Works without issue for HEX Files that are with this memory configuration. Changes to the memory map require an update to the target_device. I'm not sure why the other iMXRT only need to define one address (or perhaps they'll run into similar issues as myself --> change in memory map must be reflected in detail).

  2. BIN Files My BIN files were starting with an offset (generated from an SDK and MBDT). image After making the changes below I am successfully able to flash with BIN files. image

Thanks a lot for the help and sorry for misspelling your name.

Regards, Sam

SamECU avatar Jul 03 '22 08:07 SamECU