cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7S7 PSRAM Configuration from "XSPI_PSRAM_MemoryMapped" Example

Nicklesworth
Associate

A couple questions on using the PSRAM on the STM32H7S7 DK.

 

The "XSPI_PSRAM_MemoryMapped" example configures the XSPI module to have a max transfer length of 0, indicating continuous streaming without wrap can be used. However, the datasheet for APS256XNN only lists wrapping burst modes, no continuous streaming. Shouldn't the MaxTran field be set to match the burst wrap of the part? For example, setting the PSRAM to a 2k burst would be accompanied by:

hxspi1.Init.Refresh = 2048;

As an cleaner alternative to manual register writes, I also tried using the "External Memory Manager" Middleware to work with the on-board PSRAM, but it didn't work. Is the APS256XNN PSRAM not supported by this middleware?

2 REPLIES 2
Saket_Om
ST Employee

Hello @Nicklesworth 

Setting hxspi1.Init.MaxTran = 0; means no limit is imposed on the maximum transfer size. The XSPI peripheral will allow transfers of any length.

 


@Nicklesworth wrote:

The "XSPI_PSRAM_MemoryMapped" example configures the XSPI module to have a max transfer length of As an cleaner alternative to manual register writes, I also tried using the "External Memory Manager" Middleware to work with the on-board PSRAM, but it didn't work. Is the APS256XNN PSRAM not supported by this middleware?


Are you using the PSRAM in 8- or 16-lines configuration ? If it is 16 what is your issue with the External Memory manager ?

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.
Saket_Om

Hello,

Re: Transfer Length

From what I can tell from the datasheet, the PSRAM on the DK does not support continuous linear reads without wrap. It is adjustable with a maximum read of 2kB. So I assume XSPI transfers must be limited to match PSRAM setting.

After reading STM32 reference manual, I do not think MaxTran is the appropriate field to enforce this limit, it is related to AHB bus access. Instead I think ChipSelectBoundary field is more appropriate. This should limit XSPI transfer to 2kB and prevent any wrap of PSRAM output. For example:

hxspi1.Init.ChipSelectBoundary = HAL_XSPI_BONDARYOF_2KB;

Can you confirm this is correct?

Re: External Memory Manager

I am using x16 configuration. Now that I think I have wrap issue sorted, I will retry and report results. Should AP256XNN in x16 configuration be supported natively by External Memory Manager?

Thank You.