cancel
Showing results for 
Search instead for 
Did you mean: 

External Flash downloader shift 1 byte in flash area

PZamb.2
Associate III

Hi

I follow the MOOC tutorial for create the external QSPI loader, my Flash memory is MT25QL128ABB.

The flash is writed but the memory test Fail, with debug inspect there is 1 byte shift from start 0x90000000 (currect 00 01 02 ecc) I read (01 02 03).

I don't know were is the problem , some parameters of flash ?

1 ACCEPTED SOLUTION

Accepted Solutions
PZamb.2
Associate III

Thak I reduced DUMMY_CLOCK_CYCLES_READ_QUAD 8 and Work , Thank

View solution in original post

3 REPLIES 3
PZamb.2
Associate III

Other problem thar the flash is not complete written , the MT25Ql128 is 32mB x 4 therefore from 0x90000000 + 0x1000000 but the pattern is wrote 0x9070000

extern QSPI_HandleTypeDef hqspi;

/* USER CODE BEGIN Private defines */

uint8_t CSP_QUADSPI_Init(void);

uint8_t CSP_QSPI_EraseSector(uint32_t EraseStartAddress, uint32_t EraseEndAddress);

uint8_t CSP_QSPI_WriteMemory(uint8_t* buffer, uint32_t address, uint32_t buffer_size);

uint8_t CSP_QSPI_EnableMemoryMappedMode(void);

uint8_t CSP_QSPI_Erase_Chip (void);

/* USER CODE END Private defines */

void MX_QUADSPI_Init(void);

/* USER CODE BEGIN Prototypes */

/*MX25L512 memory parameters*/

#define MEMORY_FLASH_SIZE              0x1000000 /* 128 MBits => 16MBytes */

#define MEMORY_BLOCK_SIZE              0x10000   /* 1024 sectors of 64KBytes */

#define MEMORY_SECTOR_SIZE             0x1000   /* 16384 subsectors of 4kBytes */

#define MEMORY_PAGE_SIZE               0x100    /* 262144 pages of 256 bytes */

/*MX25L512 commands */

#define WRITE_ENABLE_CMD 0x06

#define READ_STATUS_REG_CMD 0x05

//#define READ_FLAG_STATUS_REG_CMD 0x70

#define WRITE_STATUS_REG_CMD 0x01

#define SECTOR_ERASE_CMD 0x20

#define CHIP_ERASE_CMD 0xC7

#define QUAD_IN_FAST_PROG_CMD 0x38

#define READ_CONFIGURATION_REG_CMD 0x15

#define QUAD_READ_IO_CMD 0xEC

#define QUAD_OUT_FAST_READ_CMD 0x6B

#define QPI_ENABLE_CMD 0x35

#define DUMMY_CLOCK_CYCLES_READ_QUAD 10

#define RESET_ENABLE_CMD 0x66

#define RESET_EXECUTE_CMD 0x99

#define DISABLE_QIP_MODE 0xf5

/* USER CODE END Prototypes */

#ifdef __cplusplus

}

#endif

So perhaps wrong commands, not in the right mode, or a disagreement on address width or dummy cycles. ​

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
PZamb.2
Associate III

Thak I reduced DUMMY_CLOCK_CYCLES_READ_QUAD 8 and Work , Thank