cancel
Showing results for 
Search instead for 
Did you mean: 

Problem when I use external SRAM in touchgfx. Wrong pixels.

fernandogamax
Associate III

Hello.

I have made a custom project with STM32H735IGT. I use Touchgfx.

I am using external flash and external RAM. The problem is when I place the framebuffer in external RAM. Some green pixels appear as in image 1. When I place the framebuffer in internal RAM, the image is painted well.

I am using IS66WVH16M8DBLL-100B1LI RAM. I attached hardware configuration, the RAM is OCTOSPI2.

IMG_20230919_174816.jpg

 
video of the problem and .ioc:
 

Where is the problem?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
fernandogamax
Associate III

Hello,

it seems that it is a signal synchronization problem. I have changed the resistances of the CLK and DQS. For resistances of 120. It seems that the problems have been solved. We have ordered the new 4-layer PCB. When I do tests on the new board, I will write to you.

Thank you very much to all.

View solution in original post

35 REPLIES 35
FBL
ST Employee

Hi @fernandogamax,

Have you tried with lower OCTOSPI Clock frequency? It seems you have already exceeded the max frequency as detailed in datasheet. Could explain the use of the MPU configuration for SRAM region (0x30000000)? 

 

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.

Hello.

Yes, I have tried lower clock frequencies OCTOSPI, but the effect is the same.

Could explain the use of the MPU configuration for SRAM region (0x30000000)?

I use that section of RAM to place some buffers that will be sent by DMAUART. And I read in the community that to do it, I had to configure the MPU region.

Thanks for your answer.

hi, this is not a read/write problem in RAM, if you look at your problem you realize that the green pixels are positioned circularly on a shade of the image, therefore typical of a particular color. I believe that you have some problem on the LTDC transmission line of the display or from the RAM to the micro, and that it concerns the low bits of the line itself. Probably the RAM line since the problem is not found on the LTDC when internal.. 

Hello.

At first I thought it was the LTDC, but in the internal memory it works correctly, so I think it has to be a problem with the external RAM.

I am using IS66WVH16M8DBLL-100B1LI which is similar to S70KL1281DABHI023, which is the one used by the STM32H735G-DK evaluation board. It is an OCTOSPI memory.

I don't understand how this can happen in colors.

IMG_20230920_095039.jpg

Thanks for your answer.

hi, the photo is very noisy, it's not clear. Are the colors inside the squares perfect? if so, then yours could be a reading/writing problem in octospi, as touchgfx draws the squares with a mathematical algorithm, while taking the bitmap from the external flash. Check the prescaler in octospi, put it lower and test.

The colors inside the squares are perfect.

I have already decreased the prescaler. But the effect is the same.

I think the problem has to be in the reading and writing of the external RAM. But it only happens in some colors.

I don't know what to try anymore.

I have put the image in the internal FLASH. The effect is the same.

This is the code I run to initialize the RAM.

 

static void MX_OCTOSPI2_Init(void)
{/* USER CODE BEGIN OCTOSPI2_Init 0 */

/* USER CODE END OCTOSPI2_Init 0 */

OSPIM_CfgTypeDef sOspiManagerCfg = {0};
OSPI_HyperbusCfgTypeDef sHyperBusCfg = {0};

/* USER CODE BEGIN OCTOSPI2_Init 1 */

/* USER CODE END OCTOSPI2_Init 1 */
/* OCTOSPI2 parameter configuration*/
hospi2.Instance = OCTOSPI2;
hospi2.Init.FifoThreshold = 4;
hospi2.Init.DualQuad = HAL_OSPI_DUALQUAD_DISABLE;
hospi2.Init.MemoryType = HAL_OSPI_MEMTYPE_HYPERBUS;
hospi2.Init.DeviceSize = 24;
hospi2.Init.ChipSelectHighTime = 4;
hospi2.Init.FreeRunningClock = HAL_OSPI_FREERUNCLK_DISABLE;
hospi2.Init.ClockMode = HAL_OSPI_CLOCK_MODE_0;
hospi2.Init.WrapSize = HAL_OSPI_WRAP_NOT_SUPPORTED;
hospi2.Init.ClockPrescaler = 1;
hospi2.Init.SampleShifting = HAL_OSPI_SAMPLE_SHIFTING_NONE;
hospi2.Init.DelayHoldQuarterCycle = HAL_OSPI_DHQC_ENABLE;
hospi2.Init.ChipSelectBoundary = 23;
hospi2.Init.DelayBlockBypass = HAL_OSPI_DELAY_BLOCK_USED;
hospi2.Init.MaxTran = 0;
hospi2.Init.Refresh = 400;
if (HAL_OSPI_Init(&hospi2) != HAL_OK)
{
Error_Handler();
}
sOspiManagerCfg.ClkPort = 2;
sOspiManagerCfg.DQSPort = 2;
sOspiManagerCfg.NCSPort = 2;
sOspiManagerCfg.IOLowPort = HAL_OSPIM_IOPORT_2_LOW;
sOspiManagerCfg.IOHighPort = HAL_OSPIM_IOPORT_2_HIGH;
if (HAL_OSPIM_Config(&hospi2, &sOspiManagerCfg, HAL_OSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
{
Error_Handler();
}
sHyperBusCfg.RWRecoveryTime = 3;
sHyperBusCfg.AccessTime = 6;
sHyperBusCfg.WriteZeroLatency = HAL_OSPI_LATENCY_ON_WRITE;
sHyperBusCfg.LatencyMode = HAL_OSPI_FIXED_LATENCY;
if (HAL_OSPI_HyperbusCfg(&hospi2, &sHyperBusCfg, HAL_OSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
{
Error_Handler();
}
/* USER CODE BEGIN OCTOSPI2_Init 2 */
EnableMemMapped_RAM();

/* USER CODE END OCTOSPI2_Init 2 */

}


void EnableMemMapped_RAM(void)
{

OSPI_HyperbusCmdTypeDef sCommand={0};
OSPI_MemoryMappedTypeDef sMemMappedCfg={0};
/* Memory-mapped mode configuration ---------------------------------- */
sCommand.AddressSpace = HAL_OSPI_MEMORY_ADDRESS_SPACE;
sCommand.AddressSize = HAL_OSPI_ADDRESS_32_BITS;
sCommand.DQSMode = HAL_OSPI_DQS_ENABLE;
sCommand.Address = 0;
sCommand.NbData = 1;
if (HAL_OSPI_HyperbusCmd(&hospi2, &sCommand,HAL_OSPI_TIMEOUT_DEFAULT_VALUE) != HAL_OK)
{
Error_Handler();
}

sMemMappedCfg.TimeOutActivation = HAL_OSPI_TIMEOUT_COUNTER_DISABLE;

if (HAL_OSPI_MemoryMapped(&hospi2, &sMemMappedCfg) != HAL_OK)
{
Error_Handler();
}

}

Hi @fernandogamax 

Could you try different external hyper RAM die revision?

Have you tried to disable the cache and probe the OCTOSPI clock?

According to your configuration shared in you IOC file, the MPU is not configured correctly. 

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.

Could you try different external hyper RAM die revision?

I will try to do it

Have you tried to disable the cache and test the OCTOSPI clock?

I've tried it, same result.

According to your configuration shared in you IOC file, the MPU is not configured correctly.

In the new file I have changed it.