IMX1060 non XIP code too slow

cancel
Showing results for 
Search instead for 
Did you mean: 

IMX1060 non XIP code too slow

647 Views
markomarusic25
Contributor II

Hi, 

I am currently using MIMXRT1060-EVK for evaluating IMXRT1060 and I am trying to see if it would suit our needs. I am trying to load my code to on board QSPI flash memory and I want it to be loaded into the RAM memory when device starts.

The code I have only toggles one 'fast gpio pin' in a while loop.

 while (1)
{
GPIO6->DR_SET = mask;
GPIO6->DR_CLEAR = mask;
}

I am trying to compare speed of pin toggle in different cofingurations. 

1. Debugging (loading program directly to RAM over debug interface)

It is loaded to RAM and runs as axpected. Frequency of output signal is 150MHz. (Max fast gpio frequency is 300MHz which results in 150MHz signal - ON - OFF.)

2. XIP - Loading bootable image to external flash and running it from flash

I had some problems, but mannaged to do this using mfgTool and result is also somewhat expected. Toggle signal is 3.3MHz (Cache is disabled in all examples). 

3. non XIP - loading image into the RAm on startup and ruuning it from there

I had many poblems here, but mannaged to do it also, this time using NXP MCU Boot Utility. I setup my linker and everything so that code would go to ITCM and in this case everythong should work like in 1.) but it doesn't. Signal is 15MHz. Can enyone help to explain why would this happen?

Thanks, Marko

Labels (2)
6 Replies

179 Views
nvitya
Contributor II

Hi Marko,

According our experience with the IMXRT1052, every peripheral register access takes minimum 32 clocks which is about 60 ns. (I don't know if there is a difference between 1060 and 1050.) So I think you have only luck with the 150 MHz output, probably the AXI bus handler could queue the consecutive writes somehow, but this is not normal.

So I think the normal highest GPIO toggling frequency is about 8 MHz.

br.

Viktor

179 Views
markomarusic25
Contributor II

Hi viktor,

Thank you for taking time to answer. 

IMXRT106x microcontrollers have tightly coupled GPIO peripheral which allows GPIO commands to be executed in one cycle.

0 Kudos

179 Views
nvitya
Contributor II

Hi Marko,

I've checked the reference manual of the 1060 before I wrote you my previous answer.

I did not find anything about this at the GPIO chapter.

Now I searched for tightly coupled GPIO and then found some small notes.

I think the documentation is still the weakest point of the IMXRT...

br.

Viktor

0 Kudos

179 Views
victorjimenez
NXP TechSupport
NXP TechSupport

Hello Viktor,

You can refer the following document to learn more about the tightly coupled GPIO on the RT1060.

Hope it helps!

Victor

0 Kudos

179 Views
markomarusic25
Contributor II

jeremyzhou I have solved this problem while waiting for my project upload to be verified. Though to DTCM, but it should be the same. First I mannaged to upload an image to QSPI flash without MCU Boot Utility, but using mfgTool. Procedure was this:

1. Buil MCUExpresso project, and create .s19 file

2. Make sure linker is set up correctly:

   -XIP_BOOT_HEADER_ENABLE=0

   -XIP_EXTERNAL_FLASH==

   -Memory map looks like this, it is not necessary to split ITC if you will be using DTC and vice versapastedImage_1.png

   -Link application to ram should be checked 

3. Copy .19 file to "..\FLASHLOADER-RT106x-1-GA\Flashloader_RT106x_1.0_GA\Tools\elftosb\win"

4. Run this from CMD: elftosb.exe -f imx -V -c ..\..\bd_file\imx10xx\imx-dtcm-unsigned.bd -o ivt_flexspi_nor_hello_world.bin evkmimxrt1060_hello_world.s19

5. (This is what was wrong) Content of imx-dtcm-unsigned.bd was this:

options {
flags = 0x00;
startAddress = 0x20000000;
ivtOffset = 0x1000;
initialLoadSize = 0x2000;
entryPointAddress = 0x20002345;
}

sources {
elfFile = extern(0);
}

section (0) {
}

6. Run this from cmd: elftosb.exe -f kinetis -V -c ..\..\bd_file\imx10xx\program_flexspinor_image_qspinor.bd -o boot_image.sb ivt_flexspi_nor_hello_world_nopadding.bin

7. Copy boot_image.sb to "..\FLASHLOADER-RT106x-1-GA\Flashloader_RT106x_1.0_GA\Tools\mfgtools-rel\Profiles\MXRT106X\OS Firmware"

8. Run MfgTool

9. Change switches to '0010' so that ROM loads from flex spi not flash

10. Reset board

It worked, but not in expected way, like I explained in original post, toggle (therefore fetching commands) was slower than expected.

Many iterations and few hours later, i found out that only wrong thing was in imx-dtcm-unsigned.bd. In That file, entry point address shoult be 0x20002000, not 0x20002345. 

Confusing thing was that MCU Boot utility, automatically created .bd file and value there was also 0x2002345.

Now everything works OK, and toggle signal frequency is 150MHz as expected.

Hope this is usefull to someone. Also if anyone can explain what was exactly going on there and why it worked, but slower, it would be great.

179 Views
jeremyzhou
NXP TechSupport
NXP TechSupport

Hi Marko Marusic

Thank you for your interest in NXP Semiconductor products and
for the opportunity to serve you.
I'd like to replicate the phenomenon you mentioned prior to answering the question, so whether you can introduce the testing process for the third case and demo project.
Looking forward to your reply.

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