cancel
Showing results for 
Search instead for 
Did you mean: 

Can't erase external flash sector on a B-U585I-IOT02A board with STM32CubeIDE functions.

Marty
Associate

I'm trying unsuccessfully to erase a 4K sector at 0x73ff0000 using STM32CubeIDE code, but the STM32CubeProgrammer works fine.  I've tried using BSP_OSPI_NOR_Erase_Block() and MX25LM51245G_BlockErase() with no luck.

My code base is the HTTP_IOT_WebServer example.  My basic code is (where addr=0x73FF0000 and EFLASH_SECTOR_MASK=0x03FFF000)

 -------------------------------------------

BSP_OSPI_NOR_DisableMemoryMappedMode(0);

 

rc = MX25LM51245G_BlockErase(&hospi_nor[0], MX25LM51245G_SPI_MODE, MX25LM51245G_STR_TRANSFER,

HAL_OSPI_ADDRESS_32_BITS, addr & EFLASH_SECTOR_MASK,

MX25LM51245G_ERASE_4K);

 

BSP_OSPI_NOR_DisableMemoryMappedMode(0);

 -------------------------------------------

Any idea why this doesn't work? Is the Programmer doing anything I'm not doing?

 

-Marty

0 REPLIES 0