Skip to main content
APate.18
Associate III
February 16, 2024
Question

Program loading is failed

  • February 16, 2024
  • 2 replies
  • 1416 views

Hey Team, I am working on STM32H745 for display project.

I have faced following issue. 

Some time when I was program my device it was completed in 1.38 minutes usually it takes around 4 minutes because of external flash erase and program loading. 

1) Issue was on device that took ~1.31 minutes to program it went to hard fault.

2) On device that took ~3.51 minutes to program no issues were found.

Controller:  STM32H745.

External Memory using QSPI: W25Q512JV.

configuration of memory 

/*W25Q512JV memory parameters*/
#define MEMORY_FLASH_SIZE 0x4000000 /* 64Mbit =>8Mbyte */
#define MEMORY_BLOCK_SIZE 0x10000 /* 64KBytes */
#define MEMORY_SECTOR_SIZE 0x10000 /* 4kBytes *///0x1000
#define MEMORY_PAGE_SIZE 0x100 /* 256 bytes */
#define TOTAL_PAGES 262144 /* Total number of pages */

 

 

 

This topic has been closed for replies.

2 replies

TDK
Super User
February 17, 2024

Step through the code, debug the hard fault, determine where and why it's happening and correct those issues. There's unlikely to be a magic solution here.

If you think loading is failing, perhaps do a CRC check at program startup to verify memory content.

"If you feel a post has answered your question, please click ""Accept as Solution""."
APate.18
APate.18Author
Associate III
February 19, 2024

It appears that even though I selected the memory erase option during programming, it did not erase properly after a failed attempt. Here's a revised version with rephrased sentences and spell-checked:

  1. Initially, I began programming the hardware using Cube Programmer with the flash memory erase option selected.
  2. However, due to intermittent connection issues, the programming process was interrupted, leading to a failure to download the code.
  3. Subsequently, I restarted the programming process, again opting for the flash memory erase option.
  4. Unfortunately, the process encountered an error and halted at around 50% completion.
  5. To address this issue, I manually performed a full chip erase on the external flash memory.
  6. After waiting for approximately four minutes, I restarted the programming process, which then completed successfully, loading the code onto the device.
TDK
Super User
February 19, 2024

You shouldn't be having connection issues as a general rule. If you are, something is likely wrong. Maybe recheck your hardware setup. Use a genuine programmer. Lower connection clock speed if you must.

Flash can be verified after writing which will provide assurance that it programmed successfully.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Tesla DeLorean
Guru
February 24, 2024

Related post  https://community.st.com/t5/stm32-mcus-embedded-software/issue-with-qspi-external-flash-loader-verification-functionality/td-p/637813

Generally one would CRC / HASH firmware images so they can be validated in-situ and you'd know what you have on the PC side is what you've got on the STM32 side, and you'd be able to pin down WHERE the problem lies, and WHAT you need to fix.

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