2025-05-23 5:16 AM - last edited on 2025-05-23 5:53 AM by Andrew Neil
I have a custom board with a STM32H730 and an IS66WVH32M8 HyperRam.
The ram is connected on octospi1 outputs.
I can read and write in indirect mode to the internal registers of the ram.
But in memory mapped mode i read only wrong values.
To test the ram I write alternating 0x5555 5555 and 0xAAAA AAAA.
When I inspect in the memory view I see always the second byte wrong per word.
For example at address 0x7000 0000:
AAFFAAAA 55FF5555 AAFEAAAA 55DD5555
But when I measure the OCTOSPI on a scope, the data is correct (see attachement)
The setup of the OCTOSPI is as follows:
Clock speed of the OCTOSPI is 20Mhz with prescaler.
OCTOSPIM->PCR[0] = 0x07050333;
OCTOSPI2->CR &= ~OCTOSPI_CR_EN;
wait_busy();
OCTOSPI2->CR = 0x30000300;
OCTOSPI2->DCR1 = 0x4170700;
OCTOSPI2->DCR2 = 4;
OCTOSPI2->DCR3 = 0x5003F;
OCTOSPI2->DCR4 = 0xC8;
OCTOSPI2->TCR = 0x10000000;
OCTOSPI2->CCR = 0x2C003C00;
OCTOSPI2->WCCR = 0x2C003C00;
OCTOSPI2->HLCR = 0x010600;
wait_busy();
OCTOSPI2->CR |= OCTOSPI_CR_EN;
When I run the almost identical setup on a STM32H735-DK, everything works as intended. Only the prescaler and OCTOSPIM are different.
How can I make the ram work on my custom board?
2025-05-23 7:25 AM
Yeah, I'm not going to unpack uncommented register level code.
Try with the HAL, showing the read/write templates. Once it works there you can check the registers and use whatever form you want.
Verify with direct command level interaction, which are just the same, but without the address substitution.