Selecting between CS0 and CS1

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

Selecting between CS0 and CS1

Jump to solution
1,163 Views
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

Labels (1)
0 Kudos
Reply
1 Solution
1,157 Views
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

 

 

 

View solution in original post

0 Kudos
Reply
4 Replies
1,156 Views
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 Kudos
Reply
1,153 Views
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 Kudos
Reply
1,148 Views
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 Kudos
Reply
1,158 Views
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 Kudos
Reply