Can we use MCX Nx4x FlexSPI portA and portB with different device at the same time.

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

Can we use MCX Nx4x FlexSPI portA and portB with different device at the same time.

837 Views
greatshow_chen
Contributor I

Hello NXP,

Can we use FlexSPI to connet the hardware and use both device at the same time?

PortA->NOR FLASH

PortB->PSRAM

And is there any conguration example for reference?

 

Thanks a lot

Labels (1)
0 Kudos
Reply
5 Replies

815 Views
Harry_Zhang
NXP Employee
NXP Employee

Hi @greatshow_chen 

Yes, on the NXP MCX Nx4x, you can use both FlexSPI Port A and Port B simultaneously to connect to two different memory devices.

PortA->NOR FLASH

PortB->PSRAM

You must ensure that:

NOR Flash and PSRAM are not sharing any conflicting pins.

You can refer to the flexspi_octal_polling_transfer

Harry_Zhang_0-1751622607790.png

BR

Harry

0 Kudos
Reply

668 Views
greatshow_chen
Contributor I

Hi Harry,

According to Spark's description, should we check the device_config and clk source?

I saw 

typedef struct _flexspi_config
{

......

#if defined(FSL_FEATURE_FLEXSPI_SUPPORT_SEPERATE_RXCLKSRC_PORTB) && FSL_FEATURE_FLEXSPI_SUPPORT_SEPERATE_RXCLKSRC_PORTB
flexspi_read_sample_clock_t rxSampleClockPortB; /*!< Sample Clock source_b selection for Flash Reading. */
#endif

1. While using portA and PortB, is it required to use separate rxclksource?

2. Should we check the &deviceconfig that pass to FLEXSPI_SetFlashConfig()?

Tags (1)
0 Kudos
Reply

683 Views
Sparklin
Contributor II

Hi Harry,

The sample code only provides how to access NOR Flash ID on PortA and  I try to add code to access PortB with PSRAM connected on MCX-N5XX-EVK. Here is the experiment result for you reference:

The FlexSPI setting:

PortA->NOR FLASH

PortB->PSRAM

Test Case 1 : Successful

Initial PortA and Read PortA flash ID(1 byte) 

Sparklin_0-1752651824941.png

Test Case 2 : Successful

Initial Port B and Read Port B flash ID(1 byte) 

Sparklin_1-1752651987591.png

Test Case 3 : Failed

Initially both PortA and Port B then read PortA and Port B flash ID(1 byte) individually with the address

Sparklin_2-1752653036217.png

Here are the code snippets for your reference. Please check if we made some mistakes or need more configuration on PortA and PortB situation.

code modification on flexspi_nor_flash_init for initalize both Port A and Port B flash device

Sparklin_3-1752653316172.png

Add offset to flashXfer.deviceAddress to read Port B device

Sparklin_4-1752653442642.png

 

Here are the modified files and the whole project archive for your reference:

 

 

0 Kudos
Reply

819 Views
peter75moose
Contributor I

Hello,

Many NXP microcontrollers featuring FlexSPI (like the i.MX RT series) have two independent FlexSPI channels (Port A and Port B). Each port can be configured to communicate with different types of memory devices. This allows you to connect your NOR Flash to one port and your PSRAM to the other.   

 

768 Views
GavinGG
Contributor I

Hi 

I refer to SDK sample, but that connected to one flash device not two devices concurrently.

I'm afraid that I missing something configure to make two devices workable at the same time.

Is there any sample configure for reference?

Or how can I make sure I did the correct configure from register level?

thanks 

0 Kudos
Reply