Tool/software: Code Composer Studio
This is regarding the Sitara AM437x industrial development kit.
Reading the AM437x ARM Cortext -A9 Processors Technical Reference Manual: Page 3693
- In order to be able to utilize 4 byte address mode, you must change the QSPI_SETUP_REG_0 field NUM_A_BYTES bits 9-8.
Following this information, upon the start of my program (This could be considered in main), I do all the initialization. The highlighted line is where I change the register value.
Before my register call:
/* Init SPI driver */ SPI_init(); /* Default SPI configuration parameters */ SPI_Params_init(&spiParams); if(m_flashHandle == 0) { /* Open QSPI driver */ m_flashHandle = SF25FL_open(((QSPI_INSTANCE - 1)+(QSPI_OFFSET)), &spiParams); /* Get Hardware attributes */ m_spiHandle = m_flashHandle->spiHandle; m_rxLines = QSPI_RX_LINES_QUAD; SPI_control(m_spiHandle, SPI_V1_CMD_SETRXLINES, (void *)&m_rxLines); m_hwAttrs = (QSPI_HwAttrs *) m_spiHandle->hwAttrs; /* Print flash Id */ FlashPrintId(m_flashHandle); } if(QSPI_RX_LINES_QUAD == m_hwAttrs->rxLines) { S25FLFlash_QuadModeEnable(m_flashHandle); } QSPI_REG(QSPI_REG_0) = FOUR_BYTE_ENABLE;
After my Register change call:
This is showing that on the Sitara board, 4 byte addressing mode is now enabled.
From here I enter into SF25FL_bufferWrite() in S25FL.c:
up until this point the register still reads the required: 00020303
Once I step past this instruction, the register changes too:
This change in the register changed the value to a write command sending only 3 address bytes.
The problem with this is that this part of code is a loop, and so for all of the loop is sending three address bytes.
Any insight on how to get 4 byte address mode working with MMAP mode would be greatly appreciated.