Skip to main content
Nandagopal
Associate II
March 18, 2022
Question

I have created an External Loader for my custom board with IS25LP064D connected to an STM32H730IB via OCTOSPI 1. I am able to successfully Read, Sector Erase and Mass Erase via Cube Programmer BUT Programming a Binary File into the Flash returns ERRO

  • March 18, 2022
  • 2 replies
  • 2568 views

Dear ST Community,

Thank you for taking the time to go through this :)

I had created the External Loader by following the Tutorial uploaded by STM on Youtube.

Link to the Tutorial: https://youtu.be/XqCq0xtQmbI

I created the External Loader after seeing successful implementation of Sector Erase, Write and Memory mapped Mode in my Cube IDE Project

Cube Programmer (v.2.10.0) returns this when trying to program the Flash with a Binary File:

0693W00000Kd6fIQAR.pngAn Interesting thing is that The file does get written till Address 0x900037FF but it fails afterwards as shown here:

0693W00000Kd6fXQAR.png 

I have tried using older versions of Cube Programmer ( 2.8.0 and 2.7.0) but still the same result.

Any help or direction from your side will go a long way.

Thank you so much in advance!

Attaching the Cube Programmer Log ( Verbose Level 3 ) in case it helps

This topic has been closed for replies.

2 replies

Tesla DeLorean
Guru
March 18, 2022

Will check log when at a PC later.

Best to test and debug the BSP code thoroughly outside of the loader before integrating it.​

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Nandagopal
Associate II
March 18, 2022

Hi Tesla, Thank you so much for taking the time to go through my issue. I hope that you'll be able to uncover something in the Error Log. With Regards to testing, I just followed the STM tutorial. Here is the code snipet. It performs Erase Sector, Write Memory and Memory Mapped mode. Then it reads the Memory and checks if the Read Data from Memory is same as that in the Buffer. If it fails any of these, it will end up in an "Error While Loop". And Finally If all operations are success, it will reach the Main WHILE LOOP.

CSP_QUADSPI_Init();
 
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
}
 
for (var = 0; var < SECTORS_COUNT; var++)
 {
 if (memcmp(buffer_test, (uint8_t*) (0x90000000 + var * MEMORY_SECTOR_SIZE),
 MEMORY_SECTOR_SIZE) != HAL_OK) 
 {
 while (1); //breakpoint - error detected - otherwise QSPI works properly
 }
 }
 
while (1)
 {
 
 }

I checked the data in the Memory Monitor to double check and it was correct as shown.

I even tried writing a Buffer that was bigger so that it crosses the address 0x90003800 and it still worked.

Is there any other test that you recommend that I should try out?

Thanks Once Again Tesla ! :)

Tesla DeLorean
Guru
March 18, 2022

The log doesn't provide much additional information.

It does look like an initialization / memory-mapped issue.

The loader/programming initializes the OSPI for each operation, and this could lead to an issue with the state that the memory device ends up in. Not clear it has an independent async reset.

From a loader perspective you can use GPIO, LEDs or UART to reflect the internal states and progress on your board, you can add instrumentation as you can't directly debug the code via the ST-LINK/SWD interfaces. All board level resources are under your control.

What pins are you using for the OCTOSPI1/QSPI interfacing?

https://www.issi.com/WW/pdf/25LP-WP064D.pdf

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Andreas Bolsch
Lead III
March 18, 2022

If you erase and program repeatedly, does the "good" part (i.e. till 0x900037F0) always extend *precisely* to 0x900037F0? And, do you program in full page size (most commonly 256 bytes) chunks?

Nandagopal
Associate II
March 18, 2022

Hi Andreas, Thank you so much for your time. I have edited my original post. The final Address that is written is 0x900037FF(Not 0x900037F0) And Yes it always extends precisely to this Address.

The Write Memory Function that I have implemented uses the QUAD IN PAGE PROGRAM operation that programs 256 bytes per operation

Also please note that I wrote a program to write data from a Buffer big enough to Exceed 0x900037FF and it was successful. Its the External Loader when used with Cube Programmer (and Cube IDE) that is causing the issue.

Thank you once Again