2023-07-10 01:37 AM
Hi
I have develop a custom board wit stm32F799 cpu, there is External Quad flash model MT25QL128ABB1ESE 128Mbit 16Mbyte.
My problem thar the falsh erase only half size, the address in memory map shall be 0x90000000 to 0x90FFFFFF but the erase work until 0x907FFFFF.
I first time wen the flash was clean fro the factory I wrote data in full address range with succes, but in successive tentative of format end write only first hal size is initialize, the address after 0x90800000 remain writed with old data.
This is the simple program for test Flash memory:
#include "main.h"
#include "quadspi.h"
#include "gpio.h"
#include <string.h>
HAL_Init();
/* USER CODE BEGIN Init */
/* USER CODE END Init */
/* Configure the system clock */
SystemClock_Config();
/* USER CODE BEGIN SysInit */
/* USER CODE END SysInit */
/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_QUADSPI_Init();
/* USER CODE BEGIN 2 */
uint8_t buffer_test[MEMORY_SECTOR_SIZE];
uint32_t var = 0;
if (QSPI_ResetChip() != HAL_OK) {
while (1);
}
HAL_Delay(10);
for (var = 0; var < MEMORY_SECTOR_SIZE; var++) {buffer_test[var] = (var & 0xff);}
for (var = 0; var < (SECTORS_COUNT); var++)
{
if (CSP_QSPI_EraseSector(var * MEMORY_SECTOR_SIZE,
(var + 1) * MEMORY_SECTOR_SIZE - 1) != HAL_OK)
{ while (1);} //breakpoint - error detected
//if (CSP_QSPI_WriteMemory(buffer_test, var * MEMORY_SECTOR_SIZE, sizeof(buffer_test)) != HAL_OK)
//{while (1); } //breakpoint - error detected}
}
if (CSP_QSPI_EnableMemoryMappedMode() != HAL_OK) {
while (1);} //breakpoint - error detected
Attach Qspi files:
There is someone that have some ideas?
Solved! Go to Solution.
2023-07-12 12:30 AM
Hi
I resolved the problem change the componet with new chip.
I don't know becase the upper half size is in protection mode , no change any thing in the firmware bat the new chip work fine.
Thank for the support
2023-07-10 04:52 PM
Hi PZamb,
Can you try this:
hqspi.Init.FlashSize = 24; instead of hqspi.Init.FlashSize = 23;
Maybe the driver implementation has changed and you need to change that too.
I faced the same issue with the new OSPI peripheral.
2023-07-10 07:13 PM
If this flash has a chip (might be called bulk) erase, that will make all the memory reprogrammable.
2023-07-12 12:30 AM
Hi
I resolved the problem change the componet with new chip.
I don't know becase the upper half size is in protection mode , no change any thing in the firmware bat the new chip work fine.
Thank for the support