Hello,
I've setup a project with the following hardware/software:
- STM32F401xE (84MHz clock, 96KB SRAM - no internal buffer)
- 3.5" Display with ILI9488 controller, 8 bit I8080
- I've assigned 32KB of SRAM memory to the emWin library (STemWin GUI_VERSION 54401)
LCD_X_Config :
Display All
I've made a test with the GUI_AA_DrawArc function and it is only working when I set GUI_AA_SetFactor(1).
If I set a number higher than 1 on GUI_AA_SetFactor() the program will execute the ReadM8_A1 function and will get stuck on a HardFault after its execution.
Same happens to GUI_AA_DrawPolygon.
Is it something related to the display controller reading back function or is it a RAM issue?
According to the documentation the pfReadM8_A1 is a pointer to a function which reads multiple bytes from the controller with C/D line high.
From my understanding it has to be the function related to a generically read on the controller after the command (when C/D line is low).
This is the implementation:
Display All
No problems with other drawing functions such as GUI_DrawArc, GUI_DrawPolygon, etc with no Antialiasing (it doesn't seem to need to read back pixels from the controller).
Any hints on which could cause this behavior and how to solve it?
Thanks a lot!
Mark
I've setup a project with the following hardware/software:
- STM32F401xE (84MHz clock, 96KB SRAM - no internal buffer)
- 3.5" Display with ILI9488 controller, 8 bit I8080
- I've assigned 32KB of SRAM memory to the emWin library (STemWin GUI_VERSION 54401)
LCD_X_Config :
Source Code
- void LCD_X_Config(void)
- {
- GUI_DEVICE * pDevice;
- CONFIG_FLEXCOLOR Config = {0};
- GUI_PORT_API PortAPI = {0};
- //
- // Set display driver and color conversion
- //
- pDevice = GUI_DEVICE_CreateAndLink(GUIDRV_FLEXCOLOR, GUICC_565, 0, 0);
- //
- // Display driver configuration
- //
- LCD_SetSizeEx (0, XSIZE_PHYS , YSIZE_PHYS);
- LCD_SetVSizeEx(0, VXSIZE_PHYS, VYSIZE_PHYS);
- //
- // Configuration
- //
- /* Orientation possible values
- GUI_MIRROR_X: Mirroring X-axis
- GUI_MIRROR_Y: Mirroring Y-axis
- GUI_SWAP_XY: Swapping X and Y axis
- */
- #if DISPLAY_CONFIG_PORTRAIT
- Config.Orientation = GUI_MIRROR_X;
- #elif DISPLAY_CONFIG_LANDSCAPE
- Config.Orientation = GUI_MIRROR_X|GUI_MIRROR_Y|GUI_SWAP_XY;
- #endif
- #if (NUM_BUFFERS > 1)
- GUI_MULTIBUF_ConfigEx(0, NUM_BUFFERS);
- #endif
- GUIDRV_FlexColor_Config(pDevice, &Config);
- //
- // Set controller and operation mode
- //
- PortAPI.pfWrite8_A0 = LcdWriteReg;
- PortAPI.pfWrite8_A1 = LcdWriteData;
- PortAPI.pfWriteM8_A1 = LcdWriteDataMultiple;
- PortAPI.pfReadM8_A1 = LcdReadDataMultiple;
- GUIDRV_FlexColor_SetFunc(pDevice, &PortAPI, GUIDRV_FLEXCOLOR_F66709, GUIDRV_FLEXCOLOR_M16C0B8);
- }
I've made a test with the GUI_AA_DrawArc function and it is only working when I set GUI_AA_SetFactor(1).
If I set a number higher than 1 on GUI_AA_SetFactor() the program will execute the ReadM8_A1 function and will get stuck on a HardFault after its execution.
Same happens to GUI_AA_DrawPolygon.
Is it something related to the display controller reading back function or is it a RAM issue?
According to the documentation the pfReadM8_A1 is a pointer to a function which reads multiple bytes from the controller with C/D line high.
From my understanding it has to be the function related to a generically read on the controller after the command (when C/D line is low).
This is the implementation:
Source Code
- /********************************************************************
- *
- * LcdReadDataMultiple
- *
- * Function description:
- * Reads multiple values from a display register.
- */
- static void LcdReadDataMultiple(U8 * pData, int NumItems)
- {
- LCD_IO_ReadMultipleData8(0, pData, NumItems, 0);
- }
- void LCD_IO_ReadMultipleData8(uint8_t Cmd, uint8_t *pData, uint32_t Size, uint32_t DummySize)
- {
- uint8_t *dummy_data;
- // CS LOW
- CS_GPIO_Port->BSRR = (uint32_t)CS_Pin << 16U;
- // DCX HI
- DCX_GPIO_Port->BSRR = (uint32_t)DCX_Pin;
- // Write HI
- WRX_GPIO_Port->BSRR = (uint32_t)WRX_Pin;
- // Read LOW
- RDX_GPIO_Port->BSRR = (uint32_t)RDX_Pin << 16U;
- GPIO_InitTypeDef GPIO_InitStruct = {0};
- __HAL_RCC_GPIOA_CLK_ENABLE();
- //Set port as input
- /*Configure GPIO pin Output Level */
- HAL_GPIO_WritePin(GPIOA, DB0_Pin|DB1_Pin|DB2_Pin|DB3_Pin
- |DB4_Pin|DB5_Pin|DB6_Pin|DB7_Pin, GPIO_PIN_RESET);
- GPIO_InitStruct.Pin = DB0_Pin|DB1_Pin|DB2_Pin|DB3_Pin
- |DB4_Pin|DB5_Pin|DB6_Pin|DB7_Pin;
- GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
- GPIO_InitStruct.Pull = GPIO_PULLUP;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
- //Dummy read
- LCD_IO_InData8(dummy_data);
- // Read LOW
- RDX_GPIO_Port->BSRR = (uint32_t)RDX_Pin << 16U;
- for(; Size; Size--){
- // Read LOW
- RDX_GPIO_Port->BSRR = (uint32_t)RDX_Pin << 16U;
- // IN Data
- LCD_IO_InData8(pData);
- pData++;
- }
- // Read HI
- RDX_GPIO_Port->BSRR = (uint32_t)RDX_Pin;
- // CS HI
- CS_GPIO_Port->BSRR = CS_Pin;
- __HAL_RCC_GPIOA_CLK_ENABLE();
- //Set port as output
- /*Configure GPIO pin Output Level */
- HAL_GPIO_WritePin(GPIOA, DB0_Pin|DB1_Pin|DB2_Pin|DB3_Pin
- |DB4_Pin|DB5_Pin|DB6_Pin|DB7_Pin, GPIO_PIN_RESET);
- GPIO_InitStruct.Pin = DB0_Pin|DB1_Pin|DB2_Pin|DB3_Pin
- |DB4_Pin|DB5_Pin|DB6_Pin|DB7_Pin;
- GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
- GPIO_InitStruct.Pull = GPIO_NOPULL;
- GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
- HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);
- }
No problems with other drawing functions such as GUI_DrawArc, GUI_DrawPolygon, etc with no Antialiasing (it doesn't seem to need to read back pixels from the controller).
Any hints on which could cause this behavior and how to solve it?
Thanks a lot!
Mark