2024-02-16 02:43 AM - last edited on 2024-02-22 07:32 AM by KDJEM.1
Dear ST-community,
im Niklas Diehm and currently working on a student project, developing a Formula Student racecar. This year, we want to build a new dashboard for the driver. Therefore, we want to use a STM32H725ZGT6 with an external Hyperram S70KL1282.
For testing, we connected a Nucleo-H723 to our self-developed PCB-Shield and tried sending read and write operations. We generated the HAL-Abstraction using CubeMX and for logic we are using the provided BSP-Code from here.
The commands are not failing (HAL_OK), but the Write-Operations are not working. Below you can see two images of scopes from an oscilloscope. The yellow line is the clock signal, the green RWDS. The read operation looks as described in the Hyperbus-Protocol (Command Frame, then 2x initial delay, then RWDS aligned with clock signal). The write operation however stops after the 2x initial delay. Can you find the error here?
Attached you find our CubeMX configuration.
If you need any more information, please let me know.
The code looks like this (only the relevant parts):
uint8_t dataWrite16 = 0xAAAA;
uint32_t ramAddress = 0x00000020;
uint8_t errorCode;
errorCode = S70KL1281_Write(&hospi1, &dataWrite16, ramAddress, 16);
The function S70KL1281_Write is defined as the following:
int32_t S70KL1281_Write(OSPI_HandleTypeDef *Ctx, uint8_t *pData, uint32_t WriteAddr, uint32_t Size)
{
OSPI_HyperbusCmdTypeDef sCommand;
/* Initialize the write command */
sCommand.AddressSpace = HAL_OSPI_MEMORY_ADDRESS_SPACE;
sCommand.AddressSize = HAL_OSPI_ADDRESS_32_BITS;
sCommand.Address = WriteAddr;
sCommand.DQSMode = HAL_OSPI_DQS_DISABLE;
sCommand.NbData = Size;
/* Configure the command */
if (HAL_OSPI_HyperbusCmd(Ctx, &sCommand, HAL_OSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
{
return S70KL1281_ERROR;
}
/* Transmission of the data */
if (HAL_OSPI_Transmit(Ctx, pData, HAL_OSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
{
return S70KL1281_ERROR;
}
return S70KL1281_OK;
}
2024-03-04 03:26 AM
Hello @LCE ,
Yes you are right RWDS pin is the same as the DQS signal.
I used the OSPI_HyperRAM_MemoryMapped example to check HAL and Cube, and I found that the DQS is set without any issue.
Thank you for you contribution in STCommunity.
Kaouthar
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-03-05 04:37 AM
@niklasdiehm any news?
I'm really curious about this PSRAM, because I will use it soon, too.
2024-03-26 08:25 PM
Hi Niklas,
did you solved the problem? I'm currently working with the same HyperRAM chip and I'm also having strange issues. Can you please check my thread and try my sample code if it will behave the same?
I have done my custom PCB design where I carefully tuned the length of OSPI signals and the same as you I tried to lower OSPI clock speed (by divider) to low values but without any chages so we can probably guess it's not a signal integrity problem. In my case I'm able to write some data in memory but at wrong location. I cannot be 100% sure but it seems reading is OK and write is wrong. When I reset the MCU without clearing the RAM content I still read the same data...
I cannot test with s70kl1281 chip but I suspect there may be some difference to s70kl1282 (2-dies chip) that may need some specific configuration but it seems it's too new so not many users challenged it yet...