Can't seem to get FlexSPI to work for me; RT106X

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

Can't seem to get FlexSPI to work for me; RT106X

2,022 Views
bezalel
Contributor I
Hi,
I am designing a product that requires two RT1064 to communicate with one another. The communications speed that I need is around 400MHz (maybe higher if possible). In order to achieve that, I am trying to utilize the FlexSPI peripheral. From what I understand, I can get with FlexSPI a speed of up to 166MHz per data line, and there are 4 data lines available.
I have the NXP 1064 EVK. When I was looking over the schematics I notices that neither of the clocks (FlexSPIA or FlexSPIB) are easily accessible. So I found that the Teensy 4.0/4.1 have an easily accesable clock for FlexSPIA, so I can do my testing on it. The teensy EVB does not use the 1064 but rather uses the 1062. From my understanding, the difference between them is just the amount of memory they have, so for the initial test the 1062 will be fine.
To flash the program to the Teeny, we need to use the Teesny Loader. The loader requires a HEX file in order to flash the Teensy. 
I am using MCUXpresso IDE and the NXP SDK while using the config tool to configure the pins and peripherals.
To start off, I started with something easy - a blinking LED. After I was able to get that to work, I tried to get the LPSPI to work. I made one Teensy EVB as a Master SPI and another a Slave SPI.
The Maser was always sending 170 (in binary it is 10101010, it gave me an easy way to see the communication with an oscilliscope or Logic analyzer).
The Slave was always waiting for a received packet, and when got on a GPIO was toggled (easy indicator to see with an oscilliscope/Logic analyzer).
After I was able to get SPI communications, I tried to configure and use FlexSPI. Here I ran into problems. I was not able to get it to work. I tried different settings, but nothing. In my example program (attached) I started off with was just blinking a LED (that i know already works) but with the FlexSPI peripheral configured. Anything I tried didn't work. I had two indications that it was not working: 1) the LED would not blink. 2)  The Teensy Loader shows the flash usage of the programmed HEX file. It was showing 0% with the Flex (and 1% with just the blinking LED).
The FlexSPI peripheral configuration in pretty much default (I have tried a few diffirent configurations, but the current one is pretty much default). I changed two things: I disabled doze mode and enabled SCK output free-running; hoping to have a clock that I can sample with am oscilloscope or logic analizer.
Any ideas to what I am doing wrong or how I can get the FlexSPI to work?
Thanks,
Bezalel
Labels (1)
Tags (1)
0 Kudos
5 Replies

1,967 Views
mjbcswitzerland
Specialist V

Hi Bezalel

The 1062 has two FlexSPI interfaces - the first is used to boot on (QSPI flash) and the second is free for other usage.

The 1064 boots from internal QSPI flash on FlexSPI2 and this interface is not available externally,  however the first is free for other usage.

This means that they are not compatible but the same can effectively be done by swapping FlexSPI 1 and 2 around.

Which FlexSPI are you using for your tests? If you are using FlexSPI1 on the 1062 you will need to run the code in SRAM so that it is no longer needed by the code (XiP).

You may like to consider the uTasker project if starting a professional development since it offers compatible operation on 1064 and 1062, including Teensy 4.0 and 4.1 targets. It also includes FlexSPI1 and FlexSPI2 drivers (including QSPI flash API for file system and parameter storage in QSPI flash) and simulation of the operation:
https://www.utasker.com/iMX/Teensy_4_0.html
https://www.utasker.com/iMX/Teensy_4_1.html
https://www.utasker.com/iMX/RT1064.html


Regards

Mark
[uTasker project developer for Kinetis and i.MX RT]

0 Kudos

1,967 Views
bezalel
Contributor I

Thanks for your reply.

Didn't realize the difference between the two controllers, thanks. I was trying to use FlexSPI1 for my testing in 1062. How do I run my code in SRAM? If I do that I would be able to use both FlexSPI if I want, is that correct?avndd

About uTasker, have not heard of it. I will look into it. Does uTasker have a good support for the SDK and some sort of config tool like MCUXpresso for the different definitions, pins, peripherals and such?

0 Kudos

1,967 Views
mjbcswitzerland
Specialist V

Hi

uTasker has its own advanced SDK and simulation. It doesn't need pin configuration tools since it makes it easy and understandable https://www.youtube.com/watch?v=SmFTi8hlba0&list=PLWKlVb_MqDQEOCnsNOJO8gd3jDCwiyKKe&index=2

Regards

Mark
[uTasker project developer for Kinetis and i.MX RT]

0 Kudos

1,947 Views
bezalel
Contributor I

Hi,

1) About uTasker, you mentioned that in uTasker you don't need to define pins because uTaskers SDK works a little differently. If I dont use teensy (down the road), does uTasker support my own pin configuration?

2) About running from SRAM, how can I do so? And once doing so, I will be able to use both FlexSPI controllers independently?

Thanks,

0 Kudos

999 Views
functional_des
Contributor III

This is also of interest to me- is there a way to actually access both FlexSPI ports for use with other types of peripherals? In my use case I want two high-speed SPI ports to access other devices. 

0 Kudos