Re: ESP32-S3 LCD and I2S FULL documentation
Posted: Mon Mar 28, 2022 9:46 pm
?????
i aligned the PSRAM data to a cache line (64 bytes) and not solve the problem.I have no clue, sorry. The ESP_LCD RGB driver does quite a similar thing and does not have the problem of having corruption, so the hardware itself is OK, I think. One thing I know the ESP_LCD driver does is align the PSRAM data to a cache line (64 bytes), but I'm not sure how much that matters outside of speed.
@ESP_Sprite,You may be on to something wrt caching being the issue. To answer your questions: You can't disable cache. You also can't make it coherent wrt edma. What you need to do is make sure the data is written back to the PSRAM after you write it (using the CPU) and before it is read by DMA. You can use the Cache_WriteBack_Addr() function for that.
Code: Select all
#define pixels_size 153600
for( uint32_t i = 0 ; i < pixels_size ; i++ )
{
p_buffer_a[ i ] = 0xffff;
}
p_buffer_a[ 0 ] = 0x1234;
Code: Select all
#define pixels_size 153600
p_buffer_a[ 0 ] = 0x1234;
for( uint32_t i = 1 ; i < pixels_size ; i++ )
{
p_buffer_a[ i ] = 0xffff;
}
Code: Select all
#include "esp32s3/rom/cache.h"
/**
* @brief Writeback the Cache items(also clean the dirty bit) in the region from DCache.
* If the region is not in DCache addr room, nothing will be done.
* Please do not call this function in your SDK application.
*
* @param uint32_t addr : writeback region start address.
*
* @param uint32_t size : writeback region size.
*
* @return 0 for success
* 1 for invalid argument
*/
int Cache_WriteBack_Addr(uint32_t addr, uint32_t size);