RT1064 Flashloader and Internal ROM and Flash.

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

RT1064 Flashloader and Internal ROM and Flash.

4,297 Views
emvlabs
Contributor III

I am developing RT1064 using IAR.

Please check below, Is it possible or not.

1. Flashloader into Internal using JLINK.

2. My App into internal flash using flashloader.

3. My App using Internal Flash and internal ROM.

Boot sequence are below

1. Power on

2. Flashloader on the internal ROM

3. 1 seconds timeout then jump to My App from Internal flash.

Question

1. I can't find the IAR linker file which use internal flash(4MB) and internal RAM(1MB).

2. I found the flashloader example. Is it possible download to internal ROM(128KB).

3. Is it possible boot from internal ROM.

4. if possible boot from internal ROM, then jump to internal flash. is it possible ?

 

Labels (1)
Tags (1)
18 Replies

3,584 Views
paul_roberts
Contributor III

Hello 

Quad-SPI Flash in i.MX 1064.

Getting the flashloader working on the MIMXRT1064-EVK will be an amazing hurdle to get over.  This flashloader was ported over from that of a different MIMX family member, the 1050.  I know that the 1064 has 4MB of Quad-SPI Flash.  This shows up as external memory in section 2.1 of "i.MX RT1064 Crossover Processors Data Sheet for Consumer Products, Rev. 0.1 01/2019" and appears on the block diagram as "Dual Channel QuadSPI" "Hyper Flash."  On the same block diagram, we show an Internal memory of 4 MB Flash.  Can anyone explain if this flash exists as shown on the diagram, and/or if it actually somehow the same flash as the QuadSPI external memory.

 

More specifically, in my evkmimxrt1064_flashloader Eclipse project, I currently have the following #define found in bootloader_config.h

 

// Internal Flash features
#define BL_FEATURE_HAS_NO_INTERNAL_FLASH (1)

 

I believe this is this correct for MIMXRT1064, as QSPI is external to the CPU bus.  If I try making this a (0) zero, it tries to #include <fsl_flash.h> which I don't have in my SDK, and so cannot build.

Any suggestions are welcome.

Cheers.

0 Kudos

3,584 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi ChoonGyeong Lee ,

  Internal ROM is fixed, you can't modify it.

  The flashloader normally can download to the internal RAM, then run it under the serial download mode.

  But if you are using the IAR, you can debug it directly, the IAR and the JLINK will call the related flashloader code for RT1064. Then you can debug your app directly, you don't need to consider the flashloader.

  

 Now, answer you questions:

1. I can't find the IAR linker file which use internal flash(4MB) and internal RAM(1MB).

Answer:  You can refer to the SDK project for RT1064:

pastedImage_3.png

SDK can be downloaded from this link:

 Welcome | MCUXpresso SDK Builder 

2. I found the flashloader example. Is it possible download to internal ROM(128KB).

Answer: Just as I said, ROM is fixed, it is not used by the customer.

3. Is it possible boot from internal ROM.

Answer: Please check the boot mode:

pastedImage_1.png

4. if possible boot from internal ROM, then jump to internal flash. is it possible ?

Answer: In factor, when you boot, the ROM code will run automatically, you don't need to control it.

   You just need to download the code to the internal flash, then set the boot mode as internal boot, then the ROM will help you to boot the app from internal flash with ROM boot function automatically.

Wish it helps you!

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

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------

3,584 Views
emvlabs
Contributor III

Thanks for your kind explain.

But I have some questions yet.

1. flexspi_nor.icf is used the external SRAM, so I try to internal RAM is it possible ?

2. Boot Mode 00 works with MfgTool. is it right ?

    - Set boot mode 00 or 01 ?

    - Power on the target.

    - MfgTool Start

    - MfgTool download app to internal flash.

   

Thanks

0 Kudos

3,584 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi ChoonGyeong Lee,

1.flexspi_nor.icf is used the external SRAM, so I try to internal RAM is it possible ?

Answer:  If you read our SDK document Getting Started with MCUXpresso SDK for MIMXRT1064.pdf carefully in SDK_2.6.1_EVK-MIMXRT1064\docs, you will find it is not the problem.

• Debug – Compiler optimization is set to low, and debug information is generated for the executable. The linker
file is RAM linker, where text and data section is put in internal TCM.

2.

Boot Mode 00 works with MfgTool. is it right ?

    - Set boot mode 00 or 01 ?

    - Power on the target.

    - MfgTool Start

    - MfgTool download app to internal flash.

Answer: boot mode 00 is using the fuse to boot it. Please check the RT1064 system boot chapter 8, you will find the mode0 and mode 1 difference.

When in boot mode 00, If BT_FUSE_SEL = 0, indicating that the boot device (for example, flash, SD/
MMC) was not programmed yet, the boot flow jumps directly to the Serial Downloader.

So, it will enter the serial downloader mode, you can use the mfgtool to download the app through the UART or the HID.

Wish it helps you!

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

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------

3,584 Views
emvlabs
Contributor III

Dear Kerry,

Please check the sequence.

1. I use the iled_blinky project.

pastedImage_2.png

2. set boot mode [01] : connected MIMXRT1064- EKV

pastedImage_3.png

3. rename iled_blinky.out to led_blinky.bin

4. change "name in cfg.ini
    [LIST]
    name=MXRT106x-DevBootSerialFlashXiP
    ;name=MXRT1064-DevBoot

 

5. change name boot_image.bin to led_blink.bin.

<LIST name="MXRT106x-DevBootSerialFlashXiP" desc="Manufacturing with Flashloader">
<!-- Stage 1, load and execute Flashloader --> 
<CMD state="BootStrap" type="boot" body="BootStrap" file="ivt_flashloader.bin" > Loading Flashloader. </CMD>
<CMD state="BootStrap" type="jump" onError = "ignore"> Jumping to Flashloader. </CMD>

<!-- Stage 2, Program boot image into external memory using Flashloader --> 
<CMD state="Blhost" type="blhost" body="get-property 1" > Get Property 1. </CMD> <!--Used to test if flashloader runs successfully-->
<CMD state="Blhost" type="blhost" body="fill-memory 0x2000 4 0xc0000007"> Prepare Flash Configuration option </CMD>
<CMD state="Blhost" type="blhost" body="configure-memory 0x9 0x2000"> Configure QuadSPI NOR Flash </CMD>
<!-- This erase size need to be updated based on the actual boot image size-->
<CMD state="Blhost" type="blhost" timeout="30000" body="flash-erase-region 0x60000000 0x100000" > Erase 1MBytes </CMD> 
<CMD state="Blhost" type="blhost" timeout="15000" body="write-memory 0x60000000 \"Profiles\\MXRT106X\\OS Firmware\\led_blink.bin\"" > Program Boot Image. </CMD> 
<CMD state="Blhost" type="blhost" body="Update Completed!">Done</CMD>
</LIST>

6. MfgTool Failes

pastedImage_1.png

The log is below.

DLL version: 2.7.0
Sunday, January 05, 2020 16:26:48 Start new logging
ModuleID[2] LevelID[10]: CMyExceptionHandler thread is running
ModuleID[2] LevelID[1]: new MxHidDeviceClass
ModuleID[2] LevelID[1]: new KBLHidDeviceClass
ModuleID[2] LevelID[10]: new MxHidDevice[011F8508]
ModuleID[2] LevelID[10]: Device Manager thread is running
ModuleID[2] LevelID[1]: Can't set m_hStopEvent before it initialized or it already stop

ModuleID[2] LevelID[10]: CmdOperation[0] device chagned and reset to state 2
ModuleID[2] LevelID[10]: ExecuteCommand--Blhost[WndIndex:0], Body is get-property 17
ModuleID[2] LevelID[10]: PortMgrDlg(0)--Path=\\.\hid#vid_15a2&pid_0073#6&2383844a&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
ModuleID[2] LevelID[10]: Get Property 17(Secure State) [WndIndex:0] { 
"command" : "get-property", 
"response" : [ 0 ], 
"status" : { 
"description" : "0 (0x0) Success.", 
"value" : 0 
} 
}

ModuleID[2] LevelID[10]: Secure State = UNSECURE
ModuleID[2] LevelID[10]: ExecuteCommand--Blhost[WndIndex:0], Body is get-property 1
ModuleID[2] LevelID[10]: PortMgrDlg(0)--Path=\\.\hid#vid_15a2&pid_0073#6&2383844a&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
ModuleID[2] LevelID[10]: Get Property 1. [WndIndex:0] { 
"command" : "get-property", 
"response" : [ 1258422528 ], 
"status" : { 
"description" : "0 (0x0) Success.", 
"value" : 0 
} 
}

ModuleID[2] LevelID[10]: ExecuteCommand--Blhost[WndIndex:0], Body is fill-memory 0x2000 4 0xc0000007
ModuleID[2] LevelID[10]: PortMgrDlg(0)--Path=\\.\hid#vid_15a2&pid_0073#6&2383844a&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
ModuleID[2] LevelID[10]: Prepare Flash Configuration option [WndIndex:0] { 
"command" : "fill-memory", 
"response" : [], 
"status" : { 
"description" : "0 (0x0) Success.", 
"value" : 0 
} 
}

ModuleID[2] LevelID[10]: ExecuteCommand--Blhost[WndIndex:0], Body is configure-memory 0x9 0x2000
ModuleID[2] LevelID[10]: PortMgrDlg(0)--Path=\\.\hid#vid_15a2&pid_0073#6&2383844a&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
ModuleID[2] LevelID[10]: Configure QuadSPI NOR Flash [WndIndex:0] { 
"command" : "configure-memory", 
"response" : [], 
"status" : { 
"description" : "0 (0x0) Success.", 
"value" : 0 
} 
}

ModuleID[2] LevelID[10]: ExecuteCommand--Blhost[WndIndex:0], Body is flash-erase-region 0x60000000 0x100000
ModuleID[2] LevelID[10]: PortMgrDlg(0)--Path=\\.\hid#vid_15a2&pid_0073#6&2383844a&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}
ModuleID[2] LevelID[1]: Erase 1MBytes [WndIndex:0] { 
"command" : "flash-erase-region", 
"response" : [], 
"status" : { 
"description" : "10200 (0x27D8) kStatusMemoryRangeInvalid", 
"value" : 10200 
} 
}

ModuleID[2] LevelID[10]: CmdOperation[0], current command executed failed, so SetEvent(hDevCanDeleteEvent)

0 Kudos

3,584 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi ChoonGyeong Lee,

    Do you want to download the code to the board, and you meet the problems, right?

Now, two ways for you to download the code, just take SDK  iled_blinky project as an example.

1. generate the app.srec file

pastedImage_1.png

After you build the project, you will find the rt1064_iled_blinky.srec under folder:

 SDK_2.6.1_EVK-MIMXRT1064\boards\evkmimxrt1064\demo_apps\led_blinky\iar\flexspi_nor_debug

2. Use MCUBootUtility to download the app code

https://github.com/JayHeng/NXP-MCUBootUtility/archive/v2.2.0.zip

the related user manual is:
https://github.com/JayHeng/NXP-MCUBootUtility

You can let your board enter the serial download mode, then use the mcubootutility tool to download the code.

pastedImage_4.png

3. MFGtool download

   You can refer to this application note, generate the .sb file to download it.

  Please refer to application note: AN12108.

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

 It has the detail steps.

In my own opinion, MCUbootutility is more easy to use.

Please try it again.

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

Wish it helps you!

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

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------

  

3,584 Views
emvlabs
Contributor III

Dear Kerry,

Please check the build option

DEBUG

XIP_EXTERNAL_FLASH=1

XIP_BOOT_HEADER_ENABLE=0

XIP_BOOT_HEADER_DCD_ENABLE=0

CPU_MIMXRT1064DVL6A

Is it right ?

Also please check the option.

pastedImage_1.png

I download success, but it do not work.

pastedImage_2.png

I move the 7-3 switch ON.

Then reset

but no response.

What is wrong ?

0 Kudos

3,584 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi ChoonGyeong Lee,

    Thanks for your updated information.

    Do you try to use the offiical SDK code, for example, the very easy project, led blinky, then generate the firmware and use the MCUBootUtility tool to download it?

    Another way, you can try the MCUbootUtility tool app firmware to test it at first:

\NXP-MCUBootUtility-2.2.0\apps\NXP_MIMXRT1064-EVK_Rev.A

pastedImage_1.png

Please try it again.

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

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------

3,584 Views
emvlabs
Contributor III

Hi Kerry,

It works,

I found that I didn't push the [All in-one Action] button before.

Now, It runs on internal flash. Is it right?

Thanks for your kind supports.

0 Kudos

3,584 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi ChoonGyeong Lee,

  Push the All in-one Action will download the APP code to the MIMXRT1064 internal Flash( in factor just put one QSPI to the chip internal side, still use the flexSPI to communicate with the QSPI flash). 

  After you download it, then set the chip mode to the internal boot , then your internal flash code will run.

Wish it helps you!

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

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------

3,584 Views
emvlabs
Contributor III

Hi Kerry,

Many thanks for your help.

0 Kudos

3,584 Views
kerryzhou
NXP TechSupport
NXP TechSupport

You are welcome!

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------

0 Kudos

3,584 Views
emvlabs
Contributor III

Hi Kerry,

I try to use the your demo project.

But some functions are exist in the "fsl_clock.c"

My project is base on the littlevgl_demo.

be_api.c functions are already implemented in the "fsl_clock.c".

I think that I must use the be_api.c functions instead of  "fsl_clock.c"

Is it right ?

I'm really thanks for your help.

0 Kudos

3,584 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi ChoonGyeong Lee,

    My demo project? Do you try the simple project, iled_blinky? Is it works?

   If you are using littlevgl_demo, which SDK version you are using now?

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------

0 Kudos

3,584 Views
emvlabs
Contributor III

Dear Kerry,

I used the 2.6.1 standalone project.

Thanks

0 Kudos

3,584 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi ChoonGyeong Lee,

  We already have the SDK2.7.0, please try the newest SDK!

  If you still have problems, just let me know.

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------

3,584 Views
emvlabs
Contributor III

Dear Kerry,

So, you means I must use the rt1060_rom_api base on  SDK2.7.0.

Is it right ?

Thanks 

0 Kudos

3,584 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hi ChoonGyeong Lee,

  I am a little lost in your new question, do you mean you use the littlevgl_demo, and can't download it?

  Please give me more details.

  Please use the newest SDK, BTW, please check your code, whether you are using the SDRAM or not, if you are using the SDRAM, you also need to add the DCD configuration in the MCUBootUtility tools.

Have a great day,
Kerry

 

-------------------------------------------------------------------------------
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.
-------------------------------------------------------------------------------

0 Kudos