STM32H7 Hyperram Write sequence not correct
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?
Read-Operation:
Read operation
Write-Operation:
Write operation
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;
}
