CN / EN
CN / EN

Ask a New Question

Get Supports

If you need one-on-one support for confidential technical issues with your project, please click on "Contact Us" below.

SPI limitation in DMA GR551x

623***567

2022-12-06 03:37

Hi Goodix,

We use the Goodix GR5515IGND chip with SPI display. To ensure an acceptable frame rate, we must use the DMA mode. However, when I use hal_spi_transmit_dma to transmit an array of pixels, only a limited part of the display shows the information I need (less than ~4096 bytes(2k pixels) come from a 32384 buffer). It looks like HAL has restrictions on the maximum data size for transferring via DMA, and I really hope that this is not so.

When working through hal_spi_transmit (in blocking mode), the display works fine (but slowly).

Please help us! Our device is under active development and we won't be able to release the product if we don't achieve the required frame rate.


SDK: GR551x_SDK_V1.7.0

custom_config.h:

// <o> SPI DMA enable
// <0=> DISABLE
// <1=> ENABLE
#ifndef APP_DRV_SPI_DMA_ENABLE
#define APP_DRV_SPI_DMA_ENABLE              1
#endif

a bit of code:

#define DISPLAY_IO_CONFIG                   {{ APP_IO_TYPE_MSIO,   APP_IO_MUX_7, MSIO_PIN_2,    APP_IO_NOPULL, APP_SPI_PIN_ENABLE },\
                                             { APP_IO_TYPE_NORMAL, APP_IO_MUX_0, APP_IO_PIN_24, APP_IO_NOPULL, APP_SPI_PIN_ENABLE },\
                                             { APP_IO_TYPE_NORMAL, APP_IO_MUX_0, APP_IO_PIN_25, APP_IO_NOPULL, APP_SPI_PIN_ENABLE },\
                                             { APP_IO_TYPE_NORMAL, APP_IO_MUX_0, APP_IO_PIN_16, APP_IO_NOPULL, APP_SPI_PIN_ENABLE }}
#define DISPLAY_MODE_CONFIG                 { APP_SPI_TYPE_DMA, DMA_Channel0, DMA_Channel1 }
#define DISPLAY_SPI_CONFIG                  { SPI_DATASIZE_8BIT, SPI_POLARITY_LOW, SPI_PHASE_1EDGE, (SystemCoreClock / 32000000), SPI_TIMODE_DISABLE, SPI_SLAVE_SELECT_0 }
#define DISPLAY_PARAM_CONFIG                { APP_SPI_ID_MASTER, DISPLAY_IO_CONFIG, DISPLAY_MODE_CONFIG, DISPLAY_SPI_CONFIG }


 ...
 app_spi_params_t spi_params = DISPLAY_PARAM_CONFIG;
 ret = app_spi_init(&spi_params, app_spi_callback);
 
 ...
 volatile uint8_t g_master_tdone = 1;
 volatile uint8_t g_master_rdone = 1;

 void app_spi_callback(app_spi_evt_t *p_evt) {	
  if (p_evt->type == APP_SPI_EVT_TX_CPLT) {
		g_master_tdone = 1;
  }
  if (p_evt->type == APP_SPI_EVT_RX_DATA) {
    g_master_rdone = 1;
  }
  if (p_evt->type == APP_SPI_EVT_ERROR) {
    g_master_tdone = 1;
    g_master_rdone = 1;
  }
}

...

//transmit pixels
g_master_tdone = 0;
app_spi_transmit_async(APP_SPI_ID_MASTER, buf, size); //<-- this is not working well. Buf won't transmit fully!
while (g_master_tdone == 0){}; 


0 Favorites

0 Likes

1 Answers

zhongchengzhi

Goodix Employee
2022-12-08 15:02

Hi,

  1. Yes, the max DMA buffer is 4095, but the unit can be byte, half word and word, this depends on the SPI parameter src_data_alignment(I see it's SPI_DATASIZE_8BIT in your code).
  2. You can transfer the data continuously when the first TX operation done.

1 Comment

1 Like

0 Favorites

Your comment

You can answer questions after logging in, please or register

Your Voice Matters
Contact Sales

Scan to follow

Open WeChat, use "Scan" to follow.