Building valid binaries for MIMXRT1064-EVK

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Building valid binaries for MIMXRT1064-EVK

1,129 Views
PMunch
Contributor I

Hi, I'm struggling a bit with creating binaries which I can upload to the MIMXRT1064-EVK. When I plug in the board I can mount the drive and see the DETAILS.TXT and PRODINFO.HTM files. In the ARM GCC toolchain I downloaded I find example projects like hello_world and led_blink which contains e.g. led_blink.bin. Copying this file to the mounted drive makes the board reflash itself with the file and then delete the file from the drive. However when I run the supplied scripts like `./build_release.sh` they create `.elf` files. Running `arm-none-eabi-objcopy -v -O binary iled_blinky.elf iled_blinky.bin` to create a binary file (or hex file with the correct -O flag) doesn't seem to work. It creates the files, but if I try to copy one of these files to the drive they linger for a while before I get a FAIL.TXT file with the content:

 

error: The transfer timed out.
type: transient, user

 

I can't find any documentation about how you're supposed to go from the `.elf` to the `.bin` stage successfully. Please advise.

0 Kudos
Reply
6 Replies

922 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @PMunch ,

  I write a document for you:

RT Linux SDK build based on Ubuntu:

https://community.nxp.com/t5/i-MX-RT-Knowledge-Base/RT-Linux-SDK-build-based-on-Ubuntu/ta-p/1690185

 If you follow it and meet issues, just create the new question post and let me know.

Best Regards,

Kerry

0 Kudos
Reply

1,083 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @PMunch ,

  I highly recommend you refer to this application note to generate the .bin file, and the method to download the code.

   https://www.nxp.com/docs/en/application-note/AN12108.pdf

   You also can use the MCUBootutility tool or the SPT tool to download the code instead of the MSD method.

1. MCUbootutility:
https://github.com/JayHeng/NXP-MCUBootUtility/releases/tag/v5.1.0
the related user manual is:
https://github.com/JayHeng/NXP-MCUBootUtility

 

2. SPT

https://www.nxp.com/design/software/development-software/mcuxpresso-software-and-tools-/mcuxpresso-s...

you also can use the IDE + MIMXRT1064-EVK on board debugger to download the code, more details, you can refer to the SDK doc.

Please try it on your side.

If you still have questions about it, please kindly let me know.

Best Regards,

Kerry

0 Kudos
Reply

1,075 Views
PMunch
Contributor I

Unfortunately this doesn't bring me any closer to a solution. The build step listed in that document is simply "Build the project and generate an image. You can find the hello_world.bin at following location". This is of course completely useless when the problem is how to build the project, or rather how to go from the `.elf` file that the supplied build process creates to the `.bin` file which I actually need.

 

It does mention a `elftosb` command line utility, but it seems to require a `.bd` file which isn't anywhere to be found in the toolchain I downloaded.

0 Kudos
Reply

1,068 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @PMunch ,

  Please take easy, in fact, it is not difficult to make it works with the binary.

  Just the RT chip is not like the normal MCU, it needs the bin file have the FCB, IVT, BD, app code.

  Now, you want to use  ARM GCC toolchain, right? Any other IDE want to use or not?

  I mean, mcuxpresso IDE, IAR or the keil, that the SDK all include the file.

  If you need the ARM GCC method, I will also tell you step by step to generate the bin file.

  About the download, I highly recommend you use the MCUbootutility or the SPT, I prefer to use the MCUbootutility tool, very easy to use. Just need the board enter the serial download mode. 

And this tool can help you add the bd file, elftosb, blhost itself, you don't need to input the command, you just can see the log is OK.

 

Best Regards,

Kerry

0 Kudos
Reply

1,063 Views
PMunch
Contributor I

I don't doubt that it's easy, I just can't find any documentation for it, which makes it close to impossible to figure out what is going on.

 

And correct, I'm using the ARM GCC toolchain without any IDE. I'm also on Linux so I believe the MCUbootutility is out of the question.

 

I have gotten further though. Turns out the flexspi_nor versions work. Basically I need to build those targets, then run objcopy on the resulting elf files to get bin files. And these versions are accepted by the drag and drop flasher. However I'm not certain as to why only these files are able to be flashed as there doesn't seem to be a whole lot of documentation about what the different targets actually are.

0 Kudos
Reply

1,045 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi @PMunch ,

   Thanks for your updated information.

    Your mentioned linux situation is really lack the document.

    If you can wait, I will write a community document for it these days.

    You need to use flexspi_nor, as you know, the RT1064 internal flash in fact is also the winbond flash, which need to communicate through the flexspi interface, so to the bin image, need to add the FCB which is used to configure the flexSPI, then IVT for boot, DCD for sdram config if you need it, app is the real application code.

  Anyway, thanks for your advice, I will write the detail steps in a community document based on linux ubuntu with the ARM GCC toolchain.

  Any details you want, just let me know, then I can consider to add it to my document, thanks.

 

Best Regards,

Kerry

0 Kudos
Reply