2024-05-20 06:06 AM - edited 2024-05-20 06:07 AM
Hello everyone,
I'm facing a perplexing issue with my program getting stuck after a successful upload. The upload process completes without errors (screen remains lit white), but upon running the program, it hangs at MX_OCTOSPI1_Init() and the screen remains black.
Symptoms:
Background:
This problem recently emerged, and the program was functioning correctly beforehand. I've even tried creating new projects from TouchGFX Designer, but the issue persists.
Request for Assistance:
I believe the culprit might be the MX25LM51245G_AutoPollingMemReady function, which verifies if the NOR Flash memory (MX25LM51245G) is ready for new commands. However, I'm seeking your help to pinpoint the exact cause.
Additional Information:
OCTOSPI Configuration:
I have followed this schematic to configure my OCTOSPI Pins https://www.st.com/content/ccc/resource/technical/layouts_and_diagrams/schematic_pack/group1/e0/e5/29/92/9d/37/47/91/MB1332-H7B3I-B02_Schematic/files/MB1332-H7B3I-B02_Schematic.PDF/jcr:content/translations/en.MB1332-H7B3I-B02_Schematic.PDF
Development Environment:
Thank you in advance for your assistance!
2024-05-20 06:34 AM
Make sure to clear out auto/local structures in functions so they don't contain random junk.
Don't have infinite time-outs, other than erase most things should complete in 100's of milliseconds.
Make sure the SystemTick is functioning and counting off time.
Check what state it's waiting for here, and what state it's seeing. Instrument so you can see what's happening in real-time and don't have to fish state out of registers, stack and structures.
2024-05-20 07:52 AM - edited 2024-05-20 07:53 AM
Hello @Ayoub_Bnina ,
Are you able to run OSPI_NOR_MemoryMapped_DTR example? Please take a look at this example may help you.
Could you please check the OCTOSPI configuration, for that please refer to AN5050 table 8 STM32CubeMX - Configuration of OCTOSPI parameters and precisely Octal-SPI Flash Macronix MX25LM51245GXDI00 column and/or to OSPI_NOR_MemoryMapped_DTR example.
Could you please try to enable delay hold quarter cycle.
OSPIHandle.Init.DelayHoldQuarterCycle = HAL_OSPI_DHQC_ENABLE;
Thank you.
Kaouthar
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-05-20 12:36 PM - edited 2024-05-20 12:38 PM
Hi @KDJEM.1, I have been Following the OCTOSPI (Macronix) pins Configuration corresponding to my STM32H7B3I-DK board and it mentions octospi1 instance on the pins label MB1332 (st.com), While in the AN5050 (st.com) you provided, it mentions that the Macronix is situated on the octospi2 instance. which one should I follow ?
2024-05-20 01:25 PM - edited 2024-05-20 01:26 PM
Your board is using OCTOSPIM PORT1, use *THAT*
2024-05-20 01:45 PM
@KDJEM.1 @Tesla DeLorean This my OCTOSPI Configuration
Now I am encountring an old problem situated in Texts.cpp, The program unable to find typedTextDatabaseArray[id]
I am pretty sure my configuration is right, if not please help me understand the problem. Thank you!
2024-05-20 02:02 PM - edited 2024-05-20 02:03 PM
Pins look correct.
The External Loader typically Memory Maps the device, and does a HAL_OSPI_DeInit() prior to HAL_OSPI_Init() to break it out of that mode of operation, and typically sends a RESET to the memory IC to ensure both sides start from a known operational mode from the outset.
The ordering of your MX_XYZ_Init() functions may also be critical.
Build some of the DK's examples the don't use CubeMX to auto-generate, nor use the RTOS.
2024-05-21 02:31 AM
Hi @Ayoub_Bnina ,
To clarify my last comment, the same reference memory MX25LM51245GXDI00 is connected to OCTPOSPI1 instance in STM32H7B3-DK board and to OCTOSPI2 instance in STM32L4P5G-DK board. So, you can refer to AN5050 or to OSPI_NOR_MemoryMapped_DTR and check the memory configuration "devise size, Delay hold quarter cycle, Chip select boundary...."
--> Now I am encountring an old problem situated in Texts.cpp, The program unable to find typedTextDatabaseArray[id]
May this MOOC can help you TouchGFX Webinar - 3 - Project customization (youtube.com)
Thank you.
Kaouthar
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.