AnsweredAssumed Answered

How to enable QSPI1 on imx7DSABRE Board

Question asked by Nguyen Truong on Jun 24, 2019
Latest reply on Jul 4, 2019 by Nguyen Truong

I am try to enable QSPI module on the imx7DSABRE by using C Spy&IAR, but it seem that is not to work correctly.

Here is my C SPY: 

/** Select QSPI2 Clock from PLL2 and divider 2.
SCLK to the QSPI flash will be 66MHz **/
/* CCM Base address on imx7D 0x30380000 */
tmp = __readMemory32(0x30380000,"Memory"); //read QuadSPI_MCR
tmp &= ~((0x3F<<21) | (0x7<<18) | (7<<15)); //qspi2_clk_podf = 0;
tmp |= ((0x0<<26) | (0x1<<25) | (1<<14)); //qspi2_clk_pred = 1; qspi2_clk_sel = 1;
__writeMemory32(tmp,0x30380000,"Memory"); //write back CCM_CS2CDR

 

/** Enable QSPI Clock in CCM **/
/* CCM_CCGR4 imx7 0x30384150 */
tmp = __readMemory32(0x30384150,"Memory"); //read CCM_CCGR21
tmp |= (3<<0); //Set Domain 1 No to check req
tmp |= (3<<4); //Set Domain 2 No to check req
tmp |= (3<<12); //Set Domain 3 No to check req
__writeMemory32(tmp,0x30384150,"Memory"); //write back CCM_CCGR21


/** IOMUX config **/
/*QSPI1A1 pins init*/
/* (IOMUXC_SW_MUX_CTL_PAD_EPDC_DATA00) ALT2_QSPI_A_DATA0 0x30330034[1:0] */
/* (IOMUXC_SW_MUX_CTL_PAD_EPDC_DATA01) ALT2_QSPI_A_DATA1 0x30330038[1:0] */
/* (IOMUXC_SW_MUX_CTL_PAD_EPDC_DATA02) ALT2_QSPI_A_DATA2 0x3033003C[1:0] */
/* (IOMUXC_SW_MUX_CTL_PAD_EPDC_DATA03) ALT2_QSPI_A_DATA3 0x30330040[1:0] */
/* (IOMUXC_SW_MUX_CTL_PAD_EPDC_DATA04) ALT2_QSPI_A_DQS 0x30330044[1:0] */
/* (IOMUXC_SW_MUX_CTL_PAD_EPDC_DATA05) ALT2_QSPI_A_SCLK 0x30330048[1:0] */
/* (IOMUXC_SW_MUX_CTL_PAD_EPDC_DATA06) ALT2_QSPI_A_SS0_B 0x3033004C[1:0] */
/* (IOMUXC_SW_MUX_CTL_PAD_EPDC_DATA07) ALT2_QSPI_A_SS1_B 0x30330050[1:0] */
__writeMemory32(0x2,0x30330034,"Memory");
__writeMemory32(0x2,0x30330038,"Memory");
__writeMemory32(0x2,0x3033003C,"Memory");
__writeMemory32(0x2,0x30330040,"Memory");
__writeMemory32(0x2,0x30330044,"Memory");
__writeMemory32(0x2,0x30330048,"Memory");
__writeMemory32(0x2,0x3033004C,"Memory");
__writeMemory32(0x2,0x30330050,"Memory");
__var tmp;
tmp = __readMemory32(0x60000000, "Memory");
__message "Try to read 0x60000000 = ", tmp:%x;

tmp = __readMemory32(0x60002000, "Memory");
__message "Try to read 0x60002000 = ", tmp:%x;

tmp = __readMemory32(0x60005000, "Memory");
__message "Try to read 0x60005000 = ", tmp:%x;

tmp = __readMemory32(0x60006000, "Memory");
__message "Try to read 0x60006000 = ", tmp:%x;

Data read is always "zero" values although its' values at these addresses(0x60000000, 0x60002000, ...) is non-zero.

And all QSPI1 Pins have no any signals while transferring that is checked by oscilloscope

 

Could Anyone please figure out my mistakes in that settings for QSPI1 module on imx7DSABRE board.

 

Thanks & Best Reagards,

Truong Dinh Nguyen (Mr.)

Senior Embedded Software Developer
FPT Software
E-mail   : nguyentd3@fsoft.com.vn

Outcomes