How to read/write from external memory in RiverDI RVT50HQSNWN00 module for OTA update
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-10-18 3:54 AM - last edited on ‎2024-10-21 7:28 AM by mƎALLEm
Hello,
I am facing the below scenario in my development board. I am trying to do OTA update in my RIverDI 5 inch display module. I receive the firmware chunk from the ESP board which is connected through the external connectors of the riverDI module and through USART1. The USART1 receives the firmware elf chunks and I need to store them in the STM32. The size of my elf file is more than 3MB and I cant directly store the data in the internal flash memory. The only option that I have right now is the external memory, but I am unable to read/write from it.
When I looked through the internet, it was not suggested to write into the external memory since it is allocated for storing the TouchGfx Assets. But my only option is to store the elf file chunks in the external memory and use the same for the OTA update process.
This is what I tried to do in my appliation.
1. Initialized the OSPI in main
MX_OCTOSPI1_Init();
2. Made sure the Memory mapped more is enabled and the API response for OSPI_NOR_EnableMemoryMappedMode() is 0
3. Called memcpy() to write a simple string into the external memory location
memcpy( (uint8_t *)0x91000000, "hello", 5);
I receive a hardfault handler error when I call the memcpy(). Can you please let me know what am I doing wrong here?
Regards
RiverDI user
- Labels:
-
OctoSPI
-
STM32U5 series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-10-18 3:57 AM
A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-10-18 3:59 AM
Yes, its related.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-10-18 4:12 AM
So why two threads on the same subject?
A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-10-18 4:20 AM - edited ‎2024-10-18 4:27 AM
Hello,
You question does not seem to be related to TouchGFX but how to write to a QSPI Flash.
So, as you are writing to a NOR Flash this is not correct. memcpy is only used for volatile RAM.
memcpy( (uint8_t *)0x91000000, "hello", 5);
You need to program that Flash. You can isnspire from this example: https://github.com/STMicroelectronics/STM32CubeH7/tree/master/Projects/STM32H743I-EVAL/Examples/QSPI/QSPI_ReadWrite_IT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-10-18 4:20 AM
That was a generic query and this is specific to the hardfault handler when I tried to access the external flash address location.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-10-18 5:46 AM
What's the size of the region being mapped. Trapping at 16MB
Check Size field passed at OSPI Init
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-10-21 8:38 AM
Hello @RiverDi_user ,
Could you please check if DQSE bit is set or not?
Because it is mentioned in the errata sheet, when doing memory-mapped writes it is recommended to set the DQSE bit of the OCTOSPI_WCCR register, even for memories that have no DQS pin.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-10-22 7:22 AM
Its set as 0, but I am unable to set to 0x1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-10-22 7:38 AM
Hello @RiverDi_user ,
You need to enable the DQS by using a line of code, like this:
sCommand.DQSMode = HAL_XSPI_DQS_ENABLE;
Please take a look at this example OSPI_NOR_MemoryMapped and get inspired. I think can help you.
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.
