2026-02-16 10:00 AM - last edited on 2026-02-16 11:19 AM by mƎALLEm
Continuation of this thread.
Hello,
I've wired SDRAM (AS4C4M16SA-5TCN) with STM32H730ZBT. Connection works, I can read/write data, but every other byte.
Let's start with array declaration:
uint8_t *externalRAM = (uint8_t*)0xC0000000;
/* USER CODE END PV */
Then I'm trying to write some bytes to this array, ie:
externalRAM[0] = 0xAA;
externalRAM[1] = 0xAA;
externalRAM[2] = 0xAA;
externalRAM[3] = 0xAA;
And to read it:
uint8_t test[4];
test[0] = externalRAM[0];
test[1] = externalRAM[1];
test[2] = externalRAM[2];
test[3] = externalRAM[3];
And this is the result:
Sometimes test[1] has 0xAA too, but mostly it's 0. I've tried to lower FMC frequency or change memory timings. What does this look like?
Solved! Go to Solution.
2026-02-18 7:32 AM - edited 2026-02-18 7:33 AM
Could you please do the same test with 8-bit access after resoldering the NBL pins? if it's not working, could you please configure SDRAM memory space as device or strongly-ordered?
2026-02-18 7:50 AM - edited 2026-02-18 7:51 AM
I could do this, but it's important to me to store whole 16 bits at once (it's faster than sending 2x 8 bits).
Why do you want me to check it?
Btw, how to configure SDRAM memory space as device or strongly-ordered? I don't see such option in MPU config.
And how about my question about read/write time? I've checked memory clock and it's about 91.7MHz, as expected.
2026-02-18 8:11 AM - edited 2026-02-18 8:22 AM
@sebxx4 wrote:
I could do this, but it's important to me to store whole 16 bits at once (it's faster than sending 2x 8 bits).
Why do you want me to check it?
We want to understand the root cause of the problem.
@sebxx4 wrote:
Btw, how to configure SDRAM memory space as device or strongly-ordered? I don't see such option in MPU config.
You need to set it as not cacheable/not bufferable/ Sharable with TEX level set to 0:
@sebxx4 wrote:
And how about my question about read/write time? I've checked memory clock and it's about 91.7MHz, as expected.
I can't answer that question. I'm not SDRAM interface expert.
2026-02-19 6:18 AM - edited 2026-02-19 6:19 AM
Well, I would prefer to avoid desoldering the circuit again, but I uploaded the previous code and the problem does not occur, so it looks like the cause was a missing connection of one of the NBL signals.
If you can't help me with SDRAM performance, maybe do you know who can I ask?
2026-02-19 6:28 AM
@sebxx4 wrote:
but I uploaded the previous code and the problem does not occur, so it looks like the cause was a missing connection of one of the NBL signals.
In that case, that's the issue what I was talking about from the beginning.
So need to close this thread by accepting this post:
And open a new one for the SDRAM timing. We need to separate issues in this community.
PS: unfortunately I don't have a contact to help you with the SDRAM timings.
2026-02-19 7:08 AM
Well, I think I managed the performance by enabling Dcache.