cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX & STemWin

Cevdet
Associate III
Posted on April 23, 2018 at 20:45

Hi 

I am trying to create an interface with STemWin using cubeMX.

I did everthing in [

STM32CubeMX for STM32 configuration

and initialization C code generation (UM1718 User manual)].

[You can reach this file cubeMX app->Display the Help]

I have activated CRC,DMA2D,FMC,LTDC,RCC; have created an interdafe using STemWin; have generated code (EWARM) and all I had is a wide clear-white screen-nothing.

I was expecting to see the interface that I make in STemWin.

What am I suppose to do create an interface with STemWin using cubeMX app?

The devcie I use is STM32F746G-DISCO

Thank you for your help

Best Regards

#stemwin #stm32f746g #cubemx
16 REPLIES 16
world04
Associate II
Posted on April 24, 2018 at 09:33

I would just compare the  build sourcecode with an existend example that st distributes. Generaly, it's hard to say why your code does'nt work, without a further observation. I had done the expression that CubeMX does generate just a framework, if cubeMX is configured right. Even that's a code generator, a deeper knowledge of the mpu and their peripheral extensions are required.

I have never used a cubeMX Framework for my projects, but sometimes it saves time to setup the timing values and the supported peripherie.

It does not generate an example or fillup the init of external and unknown devices.
Nawres GHARBI
ST Employee
Posted on April 30, 2018 at 12:41

Hi

cevdetbas29

Could you please send me your project (*.ioc) I will try to help

Posted on May 02, 2018 at 10:03

Hi

Let me tell you what I did and what ı want to do:

https://www.youtube.com/watch?v=lbca4T4oXWk

Like at this video I am trying to read ADC value and see it in Graph and Progbar widgets. And also as a text.

In the project I have activated the;

CRC

DMA2D

LTDC(RGB888)

FMC.SDRAM1 and parameters are;

  • sdck0+sdne0
  • 2banks
  • 11 bits
  • 16 bits
  • 16-bit byte enable

to activate Grpahics.STemWin at Configuration tab.

I have prepared the interface with emWin.

Genertated EWARM codes and all I had is an empty white screen. Not my interface I prepared with emWin.

I attach my .ioc file.

[BTW I can't attach file while replying..I attach it while I edit my reply. So your attachment system does't work.]

Thank you for interest..

________________

Attachments :

STemWin&CUBE.ioc.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hxf8&d=%2Fa%2F0X0000000b0i%2FHroYSYWeJ7hqdxicu9CEiynoTleoP3eTx0UyQlpcYXw&asPdf=false
Nawres GHARBI
ST Employee
Posted on May 10, 2018 at 14:40

Please find a pre-configured ioc

Hope that helps

________________

Attachments :

STM32F746_Discovery_Board.ioc.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hxdv&d=%2Fa%2F0X0000000b0R%2FBTW5GiSFh8sQH_Op4hj12h7KbauLGoos063ShCSbyd0&asPdf=false
Posted on May 19, 2018 at 18:48

Hi

GHARBI.Nawres

‌,

I used your pre-configured ios with my F746 Discovery and I used IAR as my IDE but it is still not working (the screen is all white). I am using the 1.11 SDK version.

Thank you very much

Nawres GHARBI
ST Employee
Posted on May 21, 2018 at 09:01

Hi Duy, 

Did you add something to display with the GUI builder

Posted on May 21, 2018 at 14:05

At first, if you wanna use the GUI Builder, it's required to bind the guilib in your project.

Second, you need to include the prototype search  path of the guilib in your project.

third - you need to define a display init sequence and init them. This special special job is done by the HAL.

If the GuiLib is used, you need to enable the CRC lib from hal and init them before the guilib is initialized !!!

You need to decide what kind of system you are wanna use - superloop or RTOS. This is important for the event / message handler, that need to be called in the background. In an RTOS this will be done by teh default task - in an superloop this could be done by a timer irq or you call them every loop passing. This job updates the screen and handle the events and messages of the GUI.

The rest is similar like windows. You need to define a windows resource and a callback. This job will be done by the GUIBuilder.

I would recomment using an RTOS to handle all the jobs. That's very easy and you have more control of the timing.

I assume the programm should do more as handle the GUI. This gives you more flexibility.

An example of a superloop is available in the example of the 746 Disco HAL.

If you wanna have an example of RTOS usage with the GUI, send me a message and i will send you project of my first simple projects. This show you everything you need to know. 

I use atollic and the project is available in keil too. The keil is less komplex becaute the most jobs that have to be done is hidden by keils IDE library package scheme.

Beware, the projects are bigger so you need a bigger email account.  

Posted on May 21, 2018 at 16:27

Hi

GHARBI.Nawres

,

Yes I added a window display with GUI Builder...

Is it the reason why the LCD doesn't display? Thank you so much. I am very confused because the is no further setup in the document.

Posted on May 21, 2018 at 16:40

But even if I don't use the GUI builder there is still nothing on the screen. I use the default generate code from CubeMX and IAR to build and flash.

int main(void)

{

/* USER CODE BEGIN 1 */

/* USER CODE END 1 */

/* MCU Configuration----------------------------------------------------------*/

/* Reset of all peripherals, Initializes the Flash interface and the Systick. */

HAL_Init();

/* USER CODE BEGIN Init */

/* USER CODE END Init */

/* Configure the system clock */

SystemClock_Config();

/* USER CODE BEGIN SysInit */

/* USER CODE END SysInit */

/* Initialize all configured peripherals */

MX_GPIO_Init();

MX_ADC3_Init();

MX_CRC_Init();

MX_DCMI_Init();

MX_ETH_Init();

MX_I2C1_Init();

MX_I2C3_Init();

MX_QUADSPI_Init();

MX_RTC_Init();

MX_SAI2_Init();

MX_SDMMC1_SD_Init();

MX_SPDIFRX_Init();

MX_SPI2_Init();

MX_TIM1_Init();

MX_TIM2_Init();

MX_TIM3_Init();

MX_TIM5_Init();

MX_TIM8_Init();

MX_TIM12_Init();

MX_USART1_UART_Init();

MX_USART6_UART_Init();

MX_USB_OTG_HS_HCD_Init();

MX_FATFS_Init();

MX_USB_HOST_Init();

/* USER CODE BEGIN 2 */

/* USER CODE END 2 */

/* Initialise the graphical hardware */

GRAPHICS_HW_Init();

/* Initialise the graphical stack engine */

GRAPHICS_Init();

/* Graphic application */

GRAPHICS_MainTask();

/* Infinite loop */

for(;;);

}

For

GRAPHICS_MainTask();

void GRAPHICS_MainTask(void) {

/* USER CODE BEGIN GRAPHICS_MainTask */

/* User can implement his graphic application here */

/* Hello Word example */

GUI_Clear();

GUI_SetColor(GUI_WHITE);

GUI_SetFont(&GUI_Font32_1);

GUI_DispStringAt('Hello world!', (LCD_GetXSize()-150)/2, (LCD_GetYSize()-20)/2);

/* USER CODE END GRAPHICS_MainTask */

while(1)

{

GUI_Delay(100);

}

}

and here is the screen

________________

Attachments :

error cube emwin.jpg : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HxaS&d=%2Fa%2F0X0000000b06%2Fm0MCSMTSuh6N85eSVxEzUip5vYXivvJL6134hnqt6sw&asPdf=false