Selecting between CS0 and CS1

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Selecting between CS0 and CS1

ソリューションへジャンプ
2,095件の閲覧回数
adi2Intel
Contributor III

Hi all

I am using the example : FlexSPI_nor_polling_transfer to use some SPI features

In the CODE: how do I switch between the default CS0 to CS1 and making the erase and program operation on it ?

where do I need to modify the code??

 

thanks

Adi , Intel

ラベル(1)
0 件の賞賛
返信
1 解決策
2,089件の閲覧回数
jay_heng
NXP Employee
NXP Employee

There are two places you need to modify (SDK 2.12):

 

// in pin_mux.c, update it to SS1_B
void BOARD_InitPins(void) {
  CLOCK_EnableClock(kCLOCK_Iomuxc);           

  IOMUXC_SetPinMux(IOMUXC_GPIO_SD_B1_06_FLEXSPI_A_SS0_B, 1U); 
  IOMUXC_SetPinConfig(IOMUXC_GPIO_SD_B1_06_FLEXSPI_A_SS0_B, 0x10F1U); 
}

// in app.h, PortA1 is for CS0, PortA2 is for CS1
#define FLASH_PORT                      kFLEXSPI_PortA1

 

 

 

元の投稿で解決策を見る

0 件の賞賛
返信
4 返答(返信)
2,088件の閲覧回数
jeremyzhou
NXP Employee
NXP Employee

Hi @adi2Intel ,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
It needs you to assign the size range for the specific port during initializing the FlexSPI, then the AHB bus can determine which port to access according to the target address, however, when using the IP bus, you should set the similar information like the below shows manually which includes the port prior to calling the LUT commands.

    flexspi_transfer_t flashXfer;
    flashXfer.deviceAddress = 0;
    flashXfer.port          = kFLEXSPI_PortA1;
    flashXfer.cmdType       = kFLEXSPI_Read;
    flashXfer.SeqNumber     = 1;
    flashXfer.seqIndex      = NOR_CMD_LUT_SEQ_IDX_READID;
    flashXfer.data          = &temp;
    flashXfer.dataSize      = 1;

    status_t status = FLEXSPI_TransferBlocking(base, &flashXfer);


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

0 件の賞賛
返信
2,085件の閲覧回数
adi2Intel
Contributor III

Hi Jeremy

Thank you for your quick reply

I did not understood what exactly to modify?

for example right now we are using :

adi2Intel_0-1663586787586.png

for reading vendor ID thru CS0

so we need only to change to PortB2?

Adi, Intel

 

0 件の賞賛
返信
2,080件の閲覧回数
jay_heng
NXP Employee
NXP Employee

Better to use SDK 2.12, then you just need to modify one MACRO in app.h

kFLEXSPI_PortA1 is for A_SS0, kFLEXSPI_PortA2 is for A_SS1

kFLEXSPI_PortB1 is for B_SS0, kFLEXSPI_PortB2 is for B_SS1

0 件の賞賛
返信
2,090件の閲覧回数
jay_heng
NXP Employee
NXP Employee

There are two places you need to modify (SDK 2.12):

 

// in pin_mux.c, update it to SS1_B
void BOARD_InitPins(void) {
  CLOCK_EnableClock(kCLOCK_Iomuxc);           

  IOMUXC_SetPinMux(IOMUXC_GPIO_SD_B1_06_FLEXSPI_A_SS0_B, 1U); 
  IOMUXC_SetPinConfig(IOMUXC_GPIO_SD_B1_06_FLEXSPI_A_SS0_B, 0x10F1U); 
}

// in app.h, PortA1 is for CS0, PortA2 is for CS1
#define FLASH_PORT                      kFLEXSPI_PortA1

 

 

 

0 件の賞賛
返信