Loading...
 

SW4STM32 and SW4Linux fully supports the STM32MP1 asymmetric multicore Cortex/A7+M4 MPUs

   With System Workbench for Linux, Embedded Linux on the STM32MP1 family of MPUs from ST was never as simple to build and maintain, even for newcomers in the Linux world. And, if you install System Workbench for Linux in System Workbench for STM32 you can seamlessly develop and debug asymmetric applications running partly on Linux, partly on the Cortex-M4.
You can get more information from the ac6-tools website and download (registration required) various documents highlighting:

System Workbench for STM32


STM32F746G-Discovery display memory problem

Dear community,

I have been looking for a very simple running display minimum example using HAL and BSP interfaces for quite some time. Unfortunately, I did not succeed and tested around. Finally, I found how to interface the display, but I wasn’t able to properly execute drawing functions like the BSP_LCD_DrawRect() function from the stm32746g_discovery_lcd.h library. I always got some strange display behavior when drawing something with those functions. I started to draw the most simple geometry one could think about by using the BSP_LCD_DrawPixel() function. Still, I am running into strange display behavior, which I think corresponds to a memory leak in my code:

Drawing a pixel to positions like (0,0) or (10,0) seems to work correctly. However, the pixels begin to flicker when increasing the x coordinate and especially the y coordinate:

[...]
// Draw pixels
BSP_LCD_SelectLayer(0);
BSP_LCD_DrawPixel(0,0,0xffffffff);
BSP_LCD_DrawPixel(5,0,0xff00ffff);
BSP_LCD_DrawPixel(10,0,0xff0000ff);
BSP_LCD_DrawPixel(20,0,0xffffffff);
BSP_LCD_DrawPixel(40,0,0xffffffff);
BSP_LCD_DrawPixel(80,0,0xffffffff); // begins to flicker
BSP_LCD_DrawPixel(160,0,0xffffffff); // flickers significantly
[...]


I would be very happy if anyone could explain me what I am doing wrong here. Please find the simple minimum example attached to this post:

/**
  ******************************************************************************
  * @file    main.cpp
  * @author  Ac6
  * @version V1.0
  * @date    01-December-2013
  * @brief   Default main function.
  ******************************************************************************
*/

//#define USE_HAL_DRIVER // redefined?
#include "stm32f7xx.h"
#include "stm32746g_discovery.h"
#include "stm32746g_discovery_lcd.h"
#include "stm32f7xx_hal.h"

#include 
#include 
using namespace std;

int main(void)
{
	// HAL initialization
	SystemInit(); // task? (not required)
	HAL_Init(); // #include "stm32f7xx_hal.h"

	// LED configuration
	GPIO_InitTypeDef GPIO_InitStruct;
	__GPIOI_CLK_ENABLE(); // GPIO Ports Clock Enable
	GPIO_InitStruct.Pin = GPIO_PIN_1; // Configure GPIO pin : PI1
	GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
	GPIO_InitStruct.Pull = GPIO_NOPULL;
	GPIO_InitStruct.Speed = GPIO_SPEED_LOW;
	HAL_GPIO_Init(GPIOI, &GPIO_InitStruct);

	// LCD configuration
	BSP_LCD_Init();
	uint32_t start_address = LCD_FB_START_ADDRESS; // LCD_FB_START_ADDRESS 0xC0000000
	uint32_t lcd_size = (BSP_LCD_GetXSize() * BSP_LCD_GetYSize()* sizeof(uint32_t));
	BSP_LCD_LayerDefaultInit(0, (uint32_t) (start_address + 0*lcd_size));
	BSP_LCD_LayerDefaultInit(1, (uint32_t) (start_address + 1*lcd_size));

	BSP_LCD_DisplayOn();
	BSP_LCD_SelectLayer(0);
	BSP_LCD_Clear(LCD_COLOR_RED);
	BSP_LCD_SelectLayer(1);
	BSP_LCD_Clear(LCD_COLOR_GREEN);
	BSP_LCD_SetTransparency(0, 255);
	BSP_LCD_SetTransparency(1, 200);
	BSP_LCD_SetLayerVisible(0, ENABLE);
	BSP_LCD_SetLayerVisible(1, DISABLE);

	// Draw pixels
	BSP_LCD_SelectLayer(0);
	BSP_LCD_DrawPixel(0,0,0xffffffff);
	BSP_LCD_DrawPixel(5,0,0xff00ff00);
	BSP_LCD_DrawPixel(10,0,0xff0000ff);
	BSP_LCD_DrawPixel(20,0,0xffffffff);
	BSP_LCD_DrawPixel(40,0,0xffffffff);
	BSP_LCD_DrawPixel(80,0,0xffffffff); // begins to flicker
	BSP_LCD_DrawPixel(160,0,0xffffffff); // flickers significantly
        
        // Check LED to ensure functions were executed properly before
	while(1) {
		HAL_GPIO_TogglePin(GPIOI, GPIO_PIN_1);
		HAL_Delay(250);
	}
}


Thank you very much in advance and best regards.

Dear all,

is there anybody who can confirm that the code generates timely constant pixels in the top left corner (0,0) and flickering pixels at positions (80,0) and (160,0)? Otherwise, I would expect a hardware bug on my device. To visualize my problem in more detail, I will upload an image of the display.

Stm32f746g Discovery Pixel Flickering

Thanks in advance and best regards,
Sebastian


Dear all,

Unfortunately, this post already has 83 reads at this point of time, but nobody seems to have a solution for the problem. I just wanted to add that I would also really appreciate if anybody would be able to run the code without having any flickering/jumping pixels. Please also add a comment to this post if the code runs without having the abovementioned problem. In this case, I would know that something is wrong with my hardware.

Thanks in advance and best regards,
Sebastian