Skip to main content
MKoca.1
Senior
February 16, 2021
Question

About STM32F429 TouchGFX Using External Flash (W25Q128)

  • February 16, 2021
  • 10 replies
  • 4126 views

Hello to everyone. I am working with STM32F429 mcu on Touchgfx. I have successfully run the Touchgfx. I am using a 7inch screen and sending images line by line with DMA. I want to use an external flash as I have too many images to use. I am using W25Q128 flash. Normally I was able to write and read, but could not integrate it with Touchgfx. I could not integrate the MB1642BDataReader library in the STM32G0 example into STM32F429. Would you help me with this topic? Am I following the wrong path? @Flemming Gram CHRISTENSEN​ @Martin KJELDSEN​ 

This topic has been closed for replies.

10 replies

zzzzz
Senior
February 16, 2021

External flash needs to be set to memory-mapped mode. Then added a section for it in ld file and attribute all images to this section. It should work.

MKoca.1
MKoca.1Author
Senior
February 16, 2021

Firstly, thank you for your reply. I made the adjustments in the id file as in the pictures. The code is being compiled, but the pictures that should be on the 7 inch screen are not visible. I don't know how to set the external flash to memory mapped mode. Can you help me ?

MKoca.1
MKoca.1Author
Senior
February 16, 2021

Firstly, thank you for your reply. I made the adjustments in the id file as in the pictures. The code is being compiled, but the pictures that should be on the 7 inch screen are not visible. I don't know how to set the external flash to memory mapped mode. Can you help me ?0693W000008GJMeQAO.jpg0693W000008GJMPQA4.jpg

zzzzz
Senior
February 16, 2021

sorry, my bad. I didn't notice you are using F4 MCU. It doesn't have QSPI interface and not support memory-mapped mode. In my case, it is F7.

Here is the link shows how to config memory-mapped mode:

https://support.touchgfx.com/docs/development/board-bring-up/how-to/06-flash-external-addressable

MKoca.1
MKoca.1Author
Senior
February 17, 2021

The block mode you said here is configured with FMC. The flash I used is W25Q128. Typical SPI configured with STM32F429 mcu. I'm very confused.0693W000008GNRdQAO.jpg

Tesla DeLorean
Guru
February 17, 2021

It is not going to work as an FMC device, that would be for 8 or 16-bit parallel memories, not QuadSPI

With QuadSPI FLASH on a F429, you're going to have to interface in 1-bit SPI mode, and transit data through an SRAM on it's way to video or frame-buffer handling software.

Would an F469 device work? That supports QSPI

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

Here is what I understand, may not 100% correct.

https://support.touchgfx.com/docs/development/board-bring-up/how-to/07-flash-external-nonaddressable

1 This article says the user needs to implement the read function to develop the TouchGFX abstraction layer if the external flash does not support memory-mapped mode. The FMC NAND flash is just an example. In your case is an SPI NOR flash. Both of them do not support memory-mapped mode. you need to create a read function with the format in this article. I think you have created it as you mentioned you had tested read and write.

https://support.touchgfx.com/docs/development/scenarios/using-non-memory-mapped-flash

2 This article shows how to create an image cache. External RAM is memory-mapped. The user could copy all images to this cache during startup. The function you created will be used in TouchGFXHAL::blockCopy function,

https://support.touchgfx.com/docs/development/scenarios/using-serial-flash

3 This one shows how to use serial flash for images and font. the reading function is used to implement the interfaces in FlashDataReader class. TGFX uses these interfaces to grab data in SPI flash.

You could either implement 2 or 3 for your project.

MKoca.1
MKoca.1Author
Senior
February 18, 2021

@Community member​  Thank you for your answer. I have to use F429 in this project.

@zzzzz​  Thank you for your answer. When I browsed through the manuals on TGFX site, I learned that I need to write flashloader. There is an example of writing flashloader for QSPI on the site. But I couldn't see a flashloader example for SPI. It will be easier for me to learn if there is at least an example. I don't know how to write this flashloader.

0693W000008GW8BQAW.jpg 

zzzzz
Senior
February 19, 2021

0693W000008GhFNQA0.pngI don't know how to make an external flash loader. But I found one spi flash loader in ST utility external loaders. There should have a way to make one.

Maybe post a new question to ask about this.

Hope you solve this problem.

Tesla DeLorean
Guru
February 19, 2021

It is basically a byte field in the loader header that specifies it being an SPI_FLASH

I'd need to know the pins and SPIx involved to port the W25Q128 loader over to an F4

Tips, Buy me a coffee, or three.. PayPal VenmoUp vote any posts that you find helpful, it shows what's working..
Uusta.1
Associate III
January 12, 2022

Did you become successful to implement Spi Flash to your project? If so, could you share how to?

MKoca.1
MKoca.1Author
Senior
January 13, 2022

We have since suspended this issue, we are currently using the STM32F429's internal flash. We think that if we use external flash it will slow down the speed of our application. That's why we won't use external flash unless we have to. But if there is more detailed and informative content about external flash and GFX for other projects, we would be glad to see and learn about it.