cancel
Showing results for 
Search instead for 
Did you mean: 

External Flash for STM32F439Zi

VinceTai
Associate II

Dear Sir/Madam,

Good day~

I am currently using STM32F439ZI for the purpose of developing BMS.

However, the code size exceed the internal Flash capacity, which is 2MB.

To address this, I intend to add an external Flash (MXIC:MX25L25645G).

May I know whether the external Flash can connect to any of the six SPIs available on the STM32F439ZI?

or there are specific SPIs for interfacing with external Flash?

Any guidance would be appreciated.

Vince

1 ACCEPTED SOLUTION

Accepted Solutions
Pavel A.
Super User

From the data sheet of this flash, it has compatibility mode with simple SPI. Then yes it should work with any of SPIs of STM32F4, but will be quite slow.

View solution in original post

8 REPLIES 8
Pavel A.
Super User

From the data sheet of this flash, it has compatibility mode with simple SPI. Then yes it should work with any of SPIs of STM32F4, but will be quite slow.

Peter BENSCH
ST Employee

Well, it's a bit confusing for me that on the one hand you use a STM32F439 with hardware-accelerated AES (STM32F429 is generally the same, but without H/W AES) and then want to connect an external flash for code that can be read freely via the SPI bus.

But regardless of this, SPI cannot be memory-mapped on the family of STM32F4, so code must first be copied to internal RAM before it can be executed. Newer families of STM32 like e.g. STM32H563 provide Quad- or Octo-SPI which can be memory-mapped.

Regards
/Peter

In order 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.

Necessity is mother of invention ))  In this situation we split some code to small overlays, loaded (and decrypted) from external flash and run in the RAM.

 

Dear Pavel, 

Thank you for your prompt reply.

I have been searching through the STM32F439ZI datasheet for compatibility information, but I couldn't find any clues, appreciate your help.

Vince

Dear Peter, 

Thank you for your response.

I have been using the STM32F439 for a while now, so it might not be ideal to switch to a newer STM32 family at this stage.

However, for the next revision, the newer families would be a good solution, as they offer memory-mapped capabilities and faster data transmission.

I will keep your suggestion in mind, thank you so much.

Vince

 

 

Hi @VinceTai , the data sheet ch. 8, page 13 describes the operation of the flash in simple SPI mode (4-wire MISO, MOSI, CLK, CS). How to set up the SPI on STM32F4 side you can find in the ST examples. (the data sheet also mentions DTR mode, but STM32F4 does not support this so refer to STR mode only).

If you are new to STM32 and would like more help with the tools and coding, here this is available.

 

What are you doing that's taking 2MB of code space?

For imagery an external SPI NOR FLASH, or eMMC or MicroSD.

Parallel NOR FLASH can be added via FSMC/FMC.

Most will require a board revision, so look at other newer parts. Not many F4 support QSPI, but I think there are a few.

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

Dear @Tesla DeLorean ,

I'm using the code to monitor a large number of parameters, such as battery cell voltages and currents through daisy chain on the BMS, which results in a large code size. In case of internal memory shortage in the future, I intend to reserve a footprint for external flash memory.

Thank you for your advice.

 

Vince