cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F767 and external SDRAM addressing issue

Gregory3
Associate III

Hello!

I have my custom board with STM32F767 and external SDRAM (MT48LC4M32B2 - 128MBit) on it.

Basically the connection between them works fine, because I'm able to write and to readout the data. The problem is, that if I try to access an address above the half of my external SDRAM, the the program crash...

Here is the connection between the MCU and SDRAM:

0693W000005AYHaQAO.pngMy settings in CubeIDE:

0693W000005AYHkQAO.pngWhen I read the datasheet of the STM32F7x then it says, that the starting address for the external SDRAM connection shall be the 0xC000 0000:

0693W000005AYHuQAO.png 

So I have used this as the starting address for my SDRAM. By this I shall have a maximum address space of 0xC000 0000 - 0xCFFF FFFF.

The connected SDRAM has 4 banks with 4096 rows x 256 columns x 32Bit cell width.

So one bank shall have 1.048.576 cells x 32Bit = 4.194.304Byte and so = 4.194.304 addresses.

This also means that one bank has an address space of 0x0040 0000 (4.194.304Byte) and the whole SDRAM shall have an address space of 0x100 0000 (4 x bank address space).

When I use the memory viewer during debugging, then I can see, that addresses only up to 0x0080 0000 are mapped:

0693W000005AYIxQAO.png 

This means, that only 2 banks are mapped. I have set the CubeMX for 4 internal banks, so I'm wondering what I did wrong?

Why the mapping is going only up to the 0xC080 0000?

Thank you for any help on that!

Regards,

Gregor

2 REPLIES 2
Gregory3
Associate III

Update: I have discovered this site with some hints on how to solve this issue:

https://www.keil.com/support/docs/3777.htm

Basically 3 solutions are proposed:

1. Enable the MPU for this region

2. Remap the SDRAM to a different address

3. Generate code with the natural alignment

The 1. solution is to insert the specified code before any SDRAM activity. This doesn't solve my issue: the mapped adress ends at 0xC080 0000...

The 2. solution is to remap the memory to another region of the STM32F7: 0x6000 0000. This also dosen't help. Here the screen shot with my code redirected to 0x6000 0000:

0693W000005AfPgQAK.pngThe problem is the same -> nothing above 0x6080 0000...

The 3. solution is to use a natural aligment with special compiler option: --no_unaligned_access

This I haven't tried yet, because I don't know where to set this option in the CubeIDE...

MNema.1
Associate II

Hello!

I face the same issue - can't get access to the half of the SDRAM. Did you solve the issue in the end? Can you share your solution?

Thank you.