cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H7 Memory Overlap with External QSPI

Claydonkey
Senior

I have a QSPI Flash connected to the STM32H70 and it's all been terrific until I realised I can't address the FLASH's (a W95Qxx with 8M) full capacity with my current settings...

How can I (or is it even possible to) change the memory address of the external QSPI to allow for the larger memory?

In the stm32h7b0xx.h.

#define OCTOSPI1_BASE             (0x90000000UL) /*!< Base address of : OCTOSPI1 memories  accessible over AXI

In the loader...

MEMORY
{
  ITCMRAM (xrw)  : ORIGIN = 0x00000000, LENGTH = 64K
  FLASH (rx)     : ORIGIN = 0x08000000, LENGTH = 64K
  QSPI (xrx) 	 : ORIGIN = 0x90000000, LENGTH = 4M //works aok but 8M overlaps DATA
  DATA (xrw)     : ORIGIN = 0x90400000, LENGTH = 4M
  DTCMRAM1 (xrw) : ORIGIN = 0x20000000, LENGTH = 64K
  DTCMRAM2 (xrw) : ORIGIN = 0x20010000, LENGTH = 64K
  RAM (xrw)      : ORIGIN = 0x24000000, LENGTH = 512K
  RAM_NOCACHE (xrw)      : ORIGIN = 0x24080000, LENGTH = 512K
  RAM_CD (xrw)   : ORIGIN = 0x30000000, LENGTH = 128K
  RAM_SRD (xrw)  : ORIGIN = 0x38000000, LENGTH = 32K
}

1 ACCEPTED SOLUTION

Accepted Solutions
Andreas Bolsch
Lead II

You can't. The OctoSPI has a fixed window in address space, starting at 0x90000000, and of size 256 MByte. Depending on the OctoSPI's setting, the external memory occupies the very bottom of this window, the rest being unusable. Same holds for the second OctoSPI interface where the address window starts at 0x70000000.

So, the line "DATA (xrw) : ORIGIN = 0x90400000, LENGTH = 4M" makes no sense at all and should be removed, and the size of QSPI set to 8M. Where did you get this loader file from?

In theory you can split the external address space into different sections as above, but then

  1. you would have to assign your code / constant data to one of these parts individually
  2. xrw still makes no sense as the whole 8 MByte are read only (flash!)

View solution in original post

2 REPLIES 2
Andreas Bolsch
Lead II

You can't. The OctoSPI has a fixed window in address space, starting at 0x90000000, and of size 256 MByte. Depending on the OctoSPI's setting, the external memory occupies the very bottom of this window, the rest being unusable. Same holds for the second OctoSPI interface where the address window starts at 0x70000000.

So, the line "DATA (xrw) : ORIGIN = 0x90400000, LENGTH = 4M" makes no sense at all and should be removed, and the size of QSPI set to 8M. Where did you get this loader file from?

In theory you can split the external address space into different sections as above, but then

  1. you would have to assign your code / constant data to one of these parts individually
  2. xrw still makes no sense as the whole 8 MByte are read only (flash!)

Claydonkey
Senior

cool. Thanks for the heads up. So does that mean FLASH memory is limited to 256 per external Flash + 96kb internal? Why do some stldr's report sizes of up to 64M. Where would that be applicable? Oh 256M is the limit whoops. So it's the DATA section that's the problem. I stupidly was toying with something - It was "I" that put it there and I can't remember wtf I was toying with... and left that in. It's been so long since I looked at this project that I forgot I put it there..