@ESP_Sprite,
i am still investigating a problem with gdma crashing, but, maybe you can help me.
Initial context:
I was setting dma channel without using esp-idf lib(gdma.h), something like that, i am on cell phone now, gdma_new_channel().
I was directly allocating channel 0 without use gdma.h.
while i was testing only gdma with lcd everything was ok, but when i enabled esp_https_server, the data at lcd bus bugged.
Fortunately, i supposed that esp_https_server was using aes e sha along with gdma, and after some tests, i was able to confirm my assumption.
So i used the gdma.h lib to allocate a gdma channel that was available, and apparently it solved this problem.
continuing......
Apparently using psram alone with gdma to transfer data to the lcd peripheral is ok.
When i enabled graphical lib, the gdma crashed.
I think because i am using double buffering, ie, when one buffer is being transferred by gdma, the other buffer is being rendered.
I tested with sram and it worked.
The problem appears when i use psram.
Could it be that the psram cannot be written while gdma is reading the psram ?
Some cache problem with psram or maybe with the flash memory ?
Note: i disabled function Cache_WriteBack_Addr() to test, but it didn't work either.
Code: Select all
static esp_err_t hw_lcd_dma_allocate_dma_channel_to_lcd_cam_peripheral(uint32_t* allocated_channel)
{
int channel_id;
esp_err_t ret;
gdma_channel_handle_t dma_chan; // DMA channel handle
gdma_channel_alloc_config_t dma_chan_config =
{
.direction = GDMA_CHANNEL_DIRECTION_TX,
};
ret = gdma_new_channel(&dma_chan_config, &dma_chan);
if(ret!=ESP_OK) return ret;
ret = gdma_get_channel_id(dma_chan, &channel_id);
if(ret!=ESP_OK) return ret;
*allocated_channel = channel_id;
hw_lcd_dma_set_dma_channel(*allocated_channel);
return ESP_OK;
}