2024-10-15 06:47 PM
This code doesn't write anything:
*(__IO uint16_t*) 0xD0000000 = (uint16_t) 0x01;
However, this code does write:
*(__IO uint16_t*) 0xD0000002 = (uint16_t) 0x01;
As you can see, the only difference is the 2 vs 0 at the end. The 0xD0000000 address is defined in the .ioc settings and in the .ld.
What can this be? Where am I going wrong?
2024-10-15 11:10 PM
Hi,
Please send more information about Your project. Please check also for other address. Maybe You have problem with physically connection to the external SDRAM. Please see this guide: https://support.touchgfx.com/docs/development/board-bring-up/how-to/04-enable-external-ram
Best Regards,
Slawek
2024-10-16 12:17 AM
some points to check:
- what board used ? your own board or board from ST ? Are you sure your board works fine ?
- any debug with scope to check the corresponding signals ? like address and data signals ?
2024-10-16 01:00 PM
It's a display connected to a Waveshare board. I had already done the setup that the link suggests.
Sure, the hardware could be an issue. I didn't attempt to debug with the scope yet.
I run this code to test:
uint16_t sdrambuf[SDRAM_BUFFER_SIZE] __attribute__ ((section(".sdram")));
for (counter = 0x00; counter < (SDRAM_SIZE); counter++) {
sdrambuf[counter] = (uint16_t) counter;
}
You can see in the memory that it first writes 00010001. The variable 'counter' is zero on the first iteration, so I don't know why it writes that.
The second thing is that first it writes 00000003 and then 00040003. I thought it would be 00030004.
2024-10-16 07:36 PM
You mentioned "It's a display connected to a Waveshare board."
it is confusing. it seems that Waveshare board has MCU STM32H7 on it. but what is the relationship between SDRAM and display ? You would access SDRAM and it is on the display (connected to a Waveshare board) ?
or You would access display (connected to a Waveshare board) and the display using SDRAM address ?
2024-10-17 01:52 AM - edited 2024-10-17 01:54 AM
The SDRAM is on the board and I use that to connect to the display.
2024-10-23 05:57 PM
I finally got it to work by simply copying and pasting the board vendor sdram initialization code.
What is strange and I haven't found the reason yes is how it writes to memory: 00030002 00050004 etc. The endianness in the memory region is set to default.
It doesn't really matter for what I do, but it is annoying not to understand what's happening.