How to generate ivt_flashloader.bin for IMXRT?

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

How to generate ivt_flashloader.bin for IMXRT?

Jump to solution
4,969 Views
jackking
Senior Contributor I

I am trying to generate a custom flashloader using the flashloader example from the SDK.  This generates the full flashloader.bin.   I see in MfGTool and the docs that it uses the special ivt_flashloader.bin which only has the image vector table.

How can I generate this ivt_flashloader.bin  using the SDK example?

0 Kudos
Reply
1 Solution
4,072 Views
jackking
Senior Contributor I

Thanks for the reply.  I am trying to do a complete build of flashloader from source.  Maybe if I outline the steps here it will help clarify the process.

  • Download MCUXpresso SDK (2.5.0 at this time)
  • In MCUXpresso IDE (10.3.1) import the SDK example for flashloader
  • For testing, I am just trying to build the flashloader example as-is.
  • In order to generate the .srec output, modify the post-build steps under C/C++ Build -> Settings.  Refer to: https://mcuoneclipse.com/2017/03/29/mcuxpresso-ide-s-record-intel-hex-and-binary-files/
  • Build the project, it is not configured for XIP (no XIP directives)
  • Collect the flashloader.srec file and dcd.bin file for SDRAM found here: https://community.nxp.com/docs/DOC-340655
  • Download the Flashloader rev 1.1 distribution from here: Flashloader
  • Place the generated flashloader.srec and dcd.bin files into the flashloader directory for the elftosb tool (.\Flashloader_RT1050_1.1\Tools\elftosb\win)
  • Create a bd file (or use the provided bd file imx-dtcm-unsigned.bd in the bd_file directory)
    • I did need to set the sources section to elfFile = extern(0)  not srecFile = extern(0)
    • The contents of my bd file are:
    • options {
          flags = 0x00;
          startAddress = 0x20000000;
          ivtOffset = 0x400;
          initialLoadSize = 0x20000;
          DCDFilePath = "dcd.bin";
      }
      
      sources {
          elfFile = extern(0);
      }
      
      section (0)
      {
      }‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
  • Execute the command to generate the .bin file with dcd.bin and bd_file for dtcm, unsigned:
    • C:\elftosb\win> elftosb.exe -f imx -V -c my-dtcm-unsigned.bd -o ivt_flashloader.bin flashloader.srec‍‍‍‍‍‍‍‍‍
             Section: 0x0
      iMX bootable image generated successfully‍‍‍
  • FYI: Executing the elftosb command, if you just get output that states "Section: 0x0"  and there is no message stating the image is generated, then something didn't work right and the generated ivt_flashloader.bin file is zero bytes in length.
  • Now you should see a generated ivt_flashloader.bin and ivt_flashloader_nopadding.bin in the same directory
  • Success! Now you should be able to use the boot image in MFGtool or Jay Heng's NXP-MCUBootUtility

I also used this post for reference: https://community.nxp.com/docs/DOC-341317

View solution in original post

0 Kudos
Reply
5 Replies
4,072 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Jack King,

Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
ivt_flashloader.bin file is the Flashloader released to support image programming in the development phase, it's a boot image which includes the IVT.
Please refer to the 4.2. Generate unsigned normal i.MX MCU bootable image in the attachment to generate the ivt_flashloader.bin.

Have a great day,
TIC

 

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

4,073 Views
jackking
Senior Contributor I

Thanks for the reply.  I am trying to do a complete build of flashloader from source.  Maybe if I outline the steps here it will help clarify the process.

  • Download MCUXpresso SDK (2.5.0 at this time)
  • In MCUXpresso IDE (10.3.1) import the SDK example for flashloader
  • For testing, I am just trying to build the flashloader example as-is.
  • In order to generate the .srec output, modify the post-build steps under C/C++ Build -> Settings.  Refer to: https://mcuoneclipse.com/2017/03/29/mcuxpresso-ide-s-record-intel-hex-and-binary-files/
  • Build the project, it is not configured for XIP (no XIP directives)
  • Collect the flashloader.srec file and dcd.bin file for SDRAM found here: https://community.nxp.com/docs/DOC-340655
  • Download the Flashloader rev 1.1 distribution from here: Flashloader
  • Place the generated flashloader.srec and dcd.bin files into the flashloader directory for the elftosb tool (.\Flashloader_RT1050_1.1\Tools\elftosb\win)
  • Create a bd file (or use the provided bd file imx-dtcm-unsigned.bd in the bd_file directory)
    • I did need to set the sources section to elfFile = extern(0)  not srecFile = extern(0)
    • The contents of my bd file are:
    • options {
          flags = 0x00;
          startAddress = 0x20000000;
          ivtOffset = 0x400;
          initialLoadSize = 0x20000;
          DCDFilePath = "dcd.bin";
      }
      
      sources {
          elfFile = extern(0);
      }
      
      section (0)
      {
      }‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍
  • Execute the command to generate the .bin file with dcd.bin and bd_file for dtcm, unsigned:
    • C:\elftosb\win> elftosb.exe -f imx -V -c my-dtcm-unsigned.bd -o ivt_flashloader.bin flashloader.srec‍‍‍‍‍‍‍‍‍
             Section: 0x0
      iMX bootable image generated successfully‍‍‍
  • FYI: Executing the elftosb command, if you just get output that states "Section: 0x0"  and there is no message stating the image is generated, then something didn't work right and the generated ivt_flashloader.bin file is zero bytes in length.
  • Now you should see a generated ivt_flashloader.bin and ivt_flashloader_nopadding.bin in the same directory
  • Success! Now you should be able to use the boot image in MFGtool or Jay Heng's NXP-MCUBootUtility

I also used this post for reference: https://community.nxp.com/docs/DOC-341317

0 Kudos
Reply
4,072 Views
markus2
Contributor I

Hi Jack King,

I am trying to get the MfgTool2.exe working with i.MXRT1015 (it works for me on 1020). I downloaded the SDK 2.5 for i.MXRT1015 and followed all your steps in order to build the ivt_flashloader.bin.

The prob is ivt_flashloader.bin ends up being 2125 KB in size (the earlier one working with the 1020 had only 59KB) and in the MfgTool2.exe logfile I get:

ModuleID[2] LevelID[10]: ExecuteCommand--Boot[WndIndex:0], File is C:\Users\Development\Downloads\Flashloader_RT1020_1.0_GA\Flashloader_RT1020_1.0_GA\Tools\mfgtools-rel\Profiles\MXRT102X\OS Firmware\ivt_flashloader.bin
ModuleID[2] LevelID[1]: WriteReg(): Invalid write ack: 0x23238904

ModuleID[2] LevelID[1]: WriteReg(): Invalid write ack: 0x23238904

ModuleID[2] LevelID[1]: RunPlugIn(): TransData(0x20000000, 0x213800,0x0) failed.
ModuleID[2] LevelID[1]: PortMgrDlg(0)--MxHidDevice--Command Boot excute failed
ModuleID[2] LevelID[10]: CmdOperation[0], current command executed failed, so SetEvent(hDevCanDeleteEvent)

The tool says: "Boot" body="BootStrap" error, file="C:\Users\Development\Downloads\Flashloader_RT1020_1.0_GA\Flashloader_RT1020_1.0_GA\Tools\mfgtools-rel\Profiles\MXRT102X\OS Firmware\ivt_flashloader.bin"

Any idea what's going wrong?

Thanks alot,

Markus

0 Kudos
Reply
4,072 Views
jeremyzhou
NXP Employee
NXP Employee

Hi Jack King,

Thanks for your reply.
The flashloader should be executed in DTCM, however, the imx-flexspinor-normal-unsigned.bd is used to generate a boot image which boots from the QSPI. Obviously, it's not right to do that.
Please use the imx-dtcm-unsigned.bd file, so gives a try.
Have a great day,
TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

4,072 Views
jackking
Senior Contributor I

Thanks, that helps.  After changing to DTCM unsigned, I am able to generate the boot image.  I will amend my previous post with the correct command.

0 Kudos
Reply