1k views
in System Integration by

Hi sir,

We are using our own custom board (Controller STM32H753BI6)  and interfaced with our LCD resolution is 240x320. We tested the LCD with a test Image(240x320) in STM32CUBEIDE and its works Fine.

After that we designed a HelloWorld Text with a Yellow Color Rectange in EMBEDDED WIZARD STUDIO and incorporate the generated code in the BUILD Environment and we mapped the FrameBuffer starting address with SDRAM starting Address.

Now we run the test it displays PINK COLOR.

As per the reference we done SDRAM Memory Test and the test is passed.

 

Below are the Embedded Wizard Configuration

             1. Profile STM32H743

             2.Platform Package -> stm32.RGB565

             3.Screen Size 240x320

             4.Application has "Helloworld" Text and a yellow color Rectangle.

Main Function Contains FMC Initialisation,LCD_DriverInitialisation, and the FUnction EwBspConsoleInit();EwInit();  EwPrintSystemInfo();  EwPrintProfilerStatistic(1);
 

Also I attached the EWPRINT debug console Output

[13:29:26:420] Check memory addr 0x30000000 size 0x0003E800␍␊

[13:29:26:441] Write test pattern to SDRAM... [OK]␍␊

[13:29:26:456] Read test pattern from SDRAM... [OK]␍␊

[13:29:36:482] Read test pattern from SDRAM... [OK]␍␊

[13:29:46:490] Read test pattern from SDRAM... [OK]␍␊

[13:29:56:514] Read test pattern from SDRAM... [OK]␍␊

[13:30:06:523] Read test pattern from SDRAM... [OK]␍␊

[13:30:16:548] Read test pattern from SDRAM... [OK]␍␊

[13:30:26:556] Read test pattern from SDRAM... [OK]␍␊

[13:30:36:581] Read test pattern from SDRAM... [OK]␍␊

[13:30:46:589] Read test pattern from SDRAM... [OK]␍␊

[13:30:56:614] Read test pattern from SDRAM... [OK]␍␊

[13:31:06:623] [OK]␍␊

[13:31:06:623] Initialize Memory Manager... Initialize Graphics Engine... Delay [OK]␍␊

[13:31:06:668] Create Embedded Wizard Root Object... [OK]␍␊

[13:31:06:668] Create Embedded Wizard Viewport... [OK]␍␊

[13:31:06:668] Text = V ␍␊

[13:31:06:668] ---------------------------------------------␍␊

[13:31:06:668] Target system STM32H753 ␍␊

[13:31:06:668] Color format RGB565 ␍␊

[13:31:06:668] MemoryPool address 0x30000000 ␍␊

[13:31:06:668] MemoryPool size 256000 bytes␍␊

[13:31:06:712] Framebuffer address 0xC0000000 ␍␊

[13:31:06:712] Doublebuffer address 0xC07DA800 ␍␊

[13:31:06:712] Framebuffer size 240 x 320 ␍␊

[13:31:06:712] EwScreeenSize 240 x 320 ␍␊

[13:31:06:712] Graphics accelerator none ␍␊

[13:31:06:712] Vector graphics support enabled ␍␊

[13:31:06:712] Warp function support enabled ␍␊

[13:31:06:712] Index8 bitmap resource format enabled ␍␊

[13:31:06:712] RGB565 bitmap resource format enabled ␍␊

[13:31:06:755] Bidirectional text support enabled ␍␊

[13:31:06:755] Operating system none ␍␊

[13:31:06:755] External flash device none ␍␊

[13:31:06:755] Toolchain GCC ␍␊

[13:31:06:755] C-Compiler version 7.3.1 ␍␊

[13:31:06:755] Build date and time Sep 17 2021, 13:29:13 ␍␊

[13:31:06:755] Runtime Environment (RTE) version 11.00 ␍␊

[13:31:06:755] Graphics Engine (GFX) version 11.00 ␍␊

[13:31:06:804] Max surface cache size 2097152 bytes␍␊

[13:31:06:804] Glyph cache size 128 x 128 ␍␊

[13:31:06:804] Max issue tasks 100 ␍␊

[13:31:06:804] Surface rotation 0 ␍␊

[13:31:06:804] ---------------------------------------------␍␊

[13:31:06:804] 1 object(s) of class 'Application::Application' (each 1136 bytes large)␍␊

[13:31:06:804] 1 object(s) of class 'Resources::Font' (each 36 bytes large)␍␊

[13:31:06:804] ␍␊

[13:31:06:804] 1252 bytes occupied by 2 Chora objects (peak 1252 bytes)␍␊

[13:31:06:804] 46 bytes occupied by 2 strings (peak 46 bytes)␍␊

[13:31:06:842] 49406 bytes occupied by Graphics Engine objects (without any framebuffers) (peak 49406 bytes)␍␊

[13:31:06:842] 15956 bytes occupied by 'watermark' images (used only in evaluation version)␍␊

[13:31:06:842] 32 bytes occupied by the profiler itself␍␊

[13:31:06:842] TOTAL : 66692 bytes, TOTAL PEAK : 66692 bytes␍␊

[13:31:06:842] ␍␊

 

Kindly Suggest where the Issues are?

1 Answer

0 votes
by

Hello,

does this mean that the application is running - only the red / blue colors are changed?

Can you try to place some color gradients on the screen (as it is done in the example ColorFormats that you will find within the Build Environment for STM32H743-Evalboard):

How does it appear on the target?

Maybe you can post some image.

Best regards,

Manfred.

by

HI,

 

Thanks for the answer. I tried the color gradients as per above Image and ran the process still displays PINK color I have attached the Image for your reference. 

Also I got HardFault_Handler while adding EwProcess() function . For your Info we set starting frame buffer address to sdram base address and transferring GUI Image via dma2d

[17:33:45:400] Check memory addr 0x30000000 size 0x0003E800␍␊

[17:33:45:400] Write test pattern to SDRAM... [OK]␍␊

[17:33:45:432] Read test pattern from SDRAM... [OK]␍␊

[17:33:55:469] Check memory addr 0x30000000 size 0x0003E800␍␊

[17:33:55:469] Write test pattern to SDRAM... [OK]␍␊

[17:33:55:501] Read test pattern from SDRAM... [OK]␍␊

[17:34:05:537] Check memory addr 0x30000000 size 0x0003E800␍␊

[17:34:05:537] Write test pattern to SDRAM... [OK]␍␊

[17:34:05:569] Read test pattern from SDRAM... [OK]␍␊

[17:34:15:606] Check memory addr 0x30000000 size 0x0003E800␍␊

[17:34:15:606] Write test pattern to SDRAM... [OK]␍␊

[17:34:15:639] Read test pattern from SDRAM... [OK]␍␊

[17:34:25:675] Check memory addr 0x30000000 size 0x0003E800␍␊

[17:34:25:675] Write test pattern to SDRAM... [OK]␍␊

[17:34:25:707] Read test pattern from SDRAM... [OK]␍␊

[17:34:35:743] Check memory addr 0x30000000 size 0x0003E800␍␊

[17:34:35:743] Write test pattern to SDRAM... [OK]␍␊

[17:34:35:775] Read test pattern from SDRAM... [OK]␍␊

[17:34:45:812] Check memory addr 0x30000000 size 0x0003E800␍␊

[17:34:45:812] Write test pattern to SDRAM... [OK]␍␊

[17:34:45:844] Read test pattern from SDRAM... [OK]␍␊

[17:34:55:880] Check memory addr 0x30000000 size 0x0003E800␍␊

[17:34:55:880] Write test pattern to SDRAM... [OK]␍␊

[17:34:55:913] Read test pattern from SDRAM... [OK]␍␊

[17:35:05:949] Check memory addr 0x30000000 size 0x0003E800␍␊

[17:35:05:949] Write test pattern to SDRAM... [OK]␍␊

[17:35:05:981] Read test pattern from SDRAM... [OK]␍␊

[17:35:16:043] [OK]␍␊

[17:35:16:043] Initialize Memory Manager... Initialize Graphics Engine... Delay [OK]␍␊

[17:35:16:043] Create Embedded Wizard Root Object... [OK]␍␊

[17:35:16:043] Create Embedded Wizard Viewport... [OK]␍␊

[17:35:16:043] ---------------------------------------------␍␊

[17:35:16:043] Target system STM32H753 ␍␊

[17:35:16:043] Color format RGB565 ␍␊

[17:35:16:043] MemoryPool address 0x30000000 ␍␊

[17:35:16:043] MemoryPool size 256000 bytes␍␊

[17:35:16:043] Framebuffer address 0xC0000000 ␍␊

[17:35:16:136] Doublebuffer address 0xC07DA800 ␍␊

[17:35:16:136] Framebuffer size 240 x 320 ␍␊

[17:35:16:136] EwScreeenSize 240 x 320 ␍␊

[17:35:16:136] Graphics accelerator DMA2D ␍␊

[17:35:16:136] Vector graphics support enabled ␍␊

[17:35:16:136] Warp function support enabled ␍␊

[17:35:16:136] Index8 bitmap resource format enabled ␍␊

[17:35:16:136] RGB565 bitmap resource format enabled ␍␊

[17:35:16:136] Bidirectional text support enabled ␍␊

[17:35:16:136] Operating system none ␍␊

[17:35:16:136] External flash device none ␍␊

[17:35:16:136] Toolchain GCC ␍␊

[17:35:16:136] C-Compiler version 7.3.1 ␍␊

[17:35:16:136] Build date and time Sep 20 2021, 17:33:30 ␍␊

[17:35:16:136] Runtime Environment (RTE) version 11.00 ␍␊

[17:35:16:136] Graphics Engine (GFX) version 11.00 ␍␊

[17:35:16:180] Max surface cache size 2097152 bytes␍␊

[17:35:16:180] Glyph cache size 128 x 128 ␍␊

[17:35:16:180] Max issue tasks 100 ␍␊

[17:35:16:180] Surface rotation 0 ␍␊

[17:35:16:180] ---------------------------------------------␍␊

[17:35:16:180] 1 object(s) of class 'Application::Application' (each 1136 bytes large)␍␊

[17:35:16:180] 1 object(s) of class 'Resources::Font' (each 36 bytes large)␍␊

[17:35:16:180] ␍␊

[17:35:16:180] 1252 bytes occupied by 2 Chora objects (peak 1252 bytes)␍␊

[17:35:16:180] 46 bytes occupied by 2 strings (peak 46 bytes)␍␊

[17:35:16:219] 49406 bytes occupied by Graphics Engine objects (without any framebuffers) (peak 49406 bytes)␍␊

[17:35:16:219] 15956 bytes occupied by 'watermark' images (used only in evaluation version)␍␊

[17:35:16:219] 32 bytes occupied by the profiler itself␍␊

[17:35:16:219] TOTAL : 66692 bytes, TOTAL PEAK : 66692 bytes␍␊

[17:35:16:219] ␍␊

 

 

 

by
Hello,

if you get an HardFault within EwProcess(), then there are some basic settings wrong.... And it seems that the system already got into HardFault before the first update happens.

Can you let me know your memory layout (type of memory, start address, size, ...)?

According to the printed messages you have a framebuffer at address 0xC0000000. Is this correct?

The SDRAM memory test however was done in address range beginning at 0x30000000....

Best regards,

Manfred.
by

Here is my Memory Layout Config 

#define PLATFORM_STRING       "STM32H753"

#define SDRAM_BASE_ADDR       0xC0000000
#define SDRAM_SIZE_BYTES      0x800000 //8 Mb

#define FRAME_BUFFER_WIDTH              240
#define FRAME_BUFFER_HEIGHT             320

/* calculated addresses for framebuffer(s) */
#define FRAME_BUFFER_ADDR     SDRAM_BASE_ADDR
#define FRAME_BUFFER_SIZE     FRAME_BUFFER_WIDTH * FRAME_BUFFER_HEIGHT * EW_FRAME_BUFFER_DEPTH

#if EW_USE_DOUBLE_BUFFER == 1

  /* locate double-buffer at the end of the last SDRAM bank - this ensures
     that front/back-buffer are located within different banks of the SDRAM */
  #define DOUBLE_BUFFER_ADDR  (SDRAM_BASE_ADDR + SDRAM_SIZE_BYTES - FRAME_BUFFER_SIZE)
  #define DOUBLE_BUFFER_SIZE  FRAME_BUFFER_SIZE

#else

  #define DOUBLE_BUFFER_ADDR  0
  #define DOUBLE_BUFFER_SIZE  0
  #define NUMBER_OF_FIELDS    3

#endif

#define EW_USE_GRAPHICS_ACCELERATOR     1

Below is my MPU Config

void MPU_Config(void){
      MPU_Region_InitTypeDef MPU_InitStruct;

//      /* Disable the MPU */
      HAL_MPU_Disable();
//
//      /* Configure the MPU attributes as WT for SRAM */
//      MPU_InitStruct.Enable           = MPU_REGION_ENABLE;
//      MPU_InitStruct.BaseAddress      = 0x24000000;
//      MPU_InitStruct.Size             = MPU_REGION_SIZE_512KB;
//      MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS;
//      MPU_InitStruct.IsBufferable     = MPU_ACCESS_NOT_BUFFERABLE;
//      MPU_InitStruct.IsCacheable      = MPU_ACCESS_CACHEABLE;
//      MPU_InitStruct.IsShareable      = MPU_ACCESS_SHAREABLE;
//      MPU_InitStruct.Number           = MPU_REGION_NUMBER0;
//      MPU_InitStruct.TypeExtField     = MPU_TEX_LEVEL0;
//      MPU_InitStruct.SubRegionDisable = 0x00;
//      MPU_InitStruct.DisableExec      = MPU_INSTRUCTION_ACCESS_ENABLE;
//      HAL_MPU_ConfigRegion(&MPU_InitStruct);


      /* Configure the MPU attributes for SDRAM_Banks area to strongly ordered
         This setting is essentially needed to avoid MCU blockings!
         See also STM Application Note AN4861 */
      MPU_InitStruct.Enable           = MPU_REGION_ENABLE;
      MPU_InitStruct.Number           = MPU_REGION_NUMBER4;
      MPU_InitStruct.BaseAddress      = SDRAM_BASE_ADDR;
      MPU_InitStruct.Size             = MPU_REGION_SIZE_512MB;
      MPU_InitStruct.SubRegionDisable = 0x0;
      MPU_InitStruct.TypeExtField     = MPU_TEX_LEVEL0;
      MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS;
      MPU_InitStruct.DisableExec      = MPU_INSTRUCTION_ACCESS_DISABLE;
      MPU_InitStruct.IsShareable      = MPU_ACCESS_SHAREABLE;
      MPU_InitStruct.IsCacheable      = MPU_ACCESS_NOT_CACHEABLE;
      MPU_InitStruct.IsBufferable     = MPU_ACCESS_NOT_BUFFERABLE;
      HAL_MPU_ConfigRegion(&MPU_InitStruct);

//      /* Configure the MPU attributes for SDRAM 32MB to normal memory Cacheable */
//      MPU_InitStruct.Enable           = MPU_REGION_ENABLE;
//      MPU_InitStruct.Number           = MPU_REGION_NUMBER5;
//      MPU_InitStruct.BaseAddress      = 0xD0000000;
//      MPU_InitStruct.Size             = MPU_REGION_SIZE_32MB;
//      MPU_InitStruct.SubRegionDisable = 0x0;
//      MPU_InitStruct.TypeExtField     = MPU_TEX_LEVEL0;
//      MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS;
//      MPU_InitStruct.DisableExec      = MPU_INSTRUCTION_ACCESS_ENABLE;
//      MPU_InitStruct.IsShareable      = MPU_ACCESS_NOT_SHAREABLE;
//      MPU_InitStruct.IsCacheable      = MPU_ACCESS_CACHEABLE;
//      MPU_InitStruct.IsBufferable     = MPU_ACCESS_NOT_BUFFERABLE;
//      HAL_MPU_ConfigRegion(&MPU_InitStruct);

      /* Enable the MPU */
      HAL_MPU_Enable(MPU_PRIVILEGED_DEFAULT);
}

 

by
The MPU settings will not work. Please take the original settings from the Build Environment as a foundation.

But anyhow, I'm still confused...

What is the real memory situation on your hardware (not in some configuration files)?

Do you have external memory (e.g. SDRAM, QSPI flash,...)? If yes, in which address ranges?
by

Thanks for the clarifications I set the SDRAM memory Test at 0xC0000000 and run the SDRAM memory test,  SDRAM read and write got Failed

Do you have external memory (e.g. SDRAM, QSPI flash,...)? If yes, in which address ranges? Yes we have external memory and the starting address 0xC0000000

 

by

HI

I corrected the SDRAM to be tested in the memory test and ran the test. Now the SDRAM memory test got passed. But while debugging I get the HardFault error after EwEndUpdate function. Guide me what are the other configurations need to be checked?

 

As per the Platform Package RGB565 downloaded for STM32H743 Evaluation Board doesnt have ewgfx.c file SO I cant able to trace from the EwEndUpdate() Function.

 

[13:27:15:628] Check memory addr 0xC0000000 size 0x00800000␍␊

[13:27:15:628] Write test pattern to SDRAM... [OK]␍␊

[13:27:16:283] Read test pattern from SDRAM... [OK]␍␊

[13:27:26:327] Read test pattern from SDRAM... [OK]␍␊

[13:27:36:373] Read test pattern from SDRAM... [OK]␍␊

[13:27:46:417] Read test pattern from SDRAM... [OK]␍␊

[13:27:56:462] Read test pattern from SDRAM... [OK]␍␊

[13:28:06:508] Read test pattern from SDRAM... [OK]␍␊

[13:28:16:552] Read test pattern from SDRAM... [OK]␍␊

[13:28:26:596] Read test pattern from SDRAM... [OK]␍␊

[13:28:36:641] Read test pattern from SDRAM... [OK]␍␊

[13:28:46:685] Read test pattern from SDRAM... [OK]␍␊

[13:28:56:730] [OK]␍␊

[13:28:56:776] Initialize Memory Manager... Initialize Graphics Engine... Delay [OK]␍␊

[13:28:56:776] Create Embedded Wizard Root Object... [OK]␍␊

[13:28:56:776] Create Embedded Wizard Viewport... [OK]␍␊

[13:28:56:776] Text = V ␍␊

[13:28:56:776] ---------------------------------------------␍␊

[13:28:56:776] Target system STM32H753 ␍␊

[13:28:56:776] Color format RGB565 ␍␊

[13:28:56:776] MemoryPool address 0x30000000 ␍␊

[13:28:56:776] MemoryPool size 256000 bytes␍␊

[13:28:56:821] Framebuffer address 0xC0000000 ␍␊

[13:28:56:821] Doublebuffer address 0xC07DA800 ␍␊

[13:28:56:821] Framebuffer size 240 x 320 ␍␊

[13:28:56:821] EwScreeenSize 240 x 320 ␍␊

[13:28:56:821] Graphics accelerator DMA2D ␍␊

[13:28:56:821] Vector graphics support enabled ␍␊

[13:28:56:821] Warp function support enabled ␍␊

[13:28:56:821] Index8 bitmap resource format enabled ␍␊

[13:28:56:821] RGB565 bitmap resource format enabled ␍␊

[13:28:56:865] Bidirectional text support enabled ␍␊

[13:28:56:865] Operating system none ␍␊

[13:28:56:865] External flash device none ␍␊

[13:28:56:865] Toolchain GCC ␍␊

[13:28:56:865] C-Compiler version 7.3.1 ␍␊

[13:28:56:865] Build date and time Sep 22 2021, 13:26:35 ␍␊

[13:28:56:865] Runtime Environment (RTE) version 11.00 ␍␊

[13:28:56:865] Graphics Engine (GFX) version 11.00 ␍␊

[13:28:56:929] Max surface cache size 2097152 bytes␍␊

[13:28:56:929] Glyph cache size 128 x 128 ␍␊

[13:28:56:929] Max issue tasks 100 ␍␊

[13:28:56:929] Surface rotation 0 ␍␊

[13:28:56:929] ---------------------------------------------␍␊

[13:28:56:929] 1 object(s) of class 'Application::Application' (each 1136 bytes large)␍␊

[13:28:56:929] 1 object(s) of class 'Resources::Font' (each 36 bytes large)␍␊

[13:28:56:929] ␍␊

[13:28:56:929] 1252 bytes occupied by 2 Chora objects (peak 1252 bytes)␍␊

[13:28:56:929] 46 bytes occupied by 2 strings (peak 46 bytes)␍␊

[13:28:56:963] 49406 bytes occupied by Graphics Engine objects (without any framebuffers) (peak 49406 bytes)␍␊

[13:28:56:963] 15956 bytes occupied by 'watermark' images (used only in evaluation version)␍␊

[13:28:56:963] 32 bytes occupied by the profiler itself␍␊

[13:28:56:963] TOTAL : 66692 bytes, TOTAL PEAK : 66692 bytes␍␊

[13:28:56:963] ␍␊

[13:28:56:963] trace: "BUFF"␍␊

 

 

by
Hello,

ok, now you have an external SDRAM starting at 0xC0000000 with 8 MB. I assume the MPU settings are correctly set for this region?

The framebuffers are located within the SDRAM - however, the memory pool for Embedded Wizard GUI application is still located at 0x30000000. Is there some reason why this is not located within the SDRAM and using a larger memory area?

Please have a look into our default configuration for STM32H743-Evalboard (ewconfig.h), there you will find that the memory pool is located within the remaining area of the SDRAM between the two framebuffers.

Do you have other external memory components, e.g. QSPI Flash?

I still have no overview of your system to give you some help concerning the system configuration.

Best regards,

Manfred.
by

Thanks for the response

We have only External SDRAM(1 Meg Bits x 16 Bits x 4 Banks (64-MBIT)) and we dont have QSPI Flash. As per your guidance I config the MPU settings for 64MB

MPU_InitStruct.Enable           = MPU_REGION_ENABLE;
      MPU_InitStruct.Number           = MPU_REGION_NUMBER2;
      MPU_InitStruct.BaseAddress      = 0xC0000000;
      MPU_InitStruct.Size             = MPU_REGION_SIZE_64MB;
      MPU_InitStruct.SubRegionDisable = 0x0;
      MPU_InitStruct.TypeExtField     = MPU_TEX_LEVEL0;
      MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS;
      MPU_InitStruct.DisableExec      = MPU_INSTRUCTION_ACCESS_ENABLE;
      MPU_InitStruct.IsShareable      = MPU_ACCESS_NOT_SHAREABLE;
      MPU_InitStruct.IsCacheable      = MPU_ACCESS_CACHEABLE;
      MPU_InitStruct.IsBufferable     = MPU_ACCESS_NOT_BUFFERABLE;
      HAL_MPU_ConfigRegion(&MPU_InitStruct);

 

As per your suggestion we allocated the EwHeap pool memory to (FRAME_BUFFER_ADDR + FRAME_BUFFER_SIZE) instead to Internal SRAM(0x30000000) and size of 128KB still I got  the same hardfault error.

We need to display the "Hello WOrld"GUI in the LCD(240x320) Driver with external SDRAM(IS42S16400J) via DMA2d in our custom stm32h7 board in which the platform package is RGB565.
 
 

 

by
Hello,

some more points to check...

* According to your description, your SDRAM is 64 MBits (= 8 MByte) - thus the MPU_REGION_SIZE_64MB is not suitable, please use MPU_REGION_SIZE_8MB

* Which kind of error do you get? Is it a HardFault or a MemFault?

* Have you licensed the Professional Edition of Embedded Wizard? If yes, then you have access to the source code, which helps to debug the issue.

* You can send me your ewconfig.h file, your linkerscript and your complete MPU initialization. Just for review.

Best regards,

Manfred.
by

Hello,

As per the above points

I have Set MPU_REGION_SIZE_8MB

I am getting HardFault Handle Error;

We have License for ARGB8888 color format but we are doing evaluation for RGB565 Color format in a new project.

Just for confirmation we are using Internal Flash and we need to prcocess GUI without using FREERTOS

Here I share the ewconfig.h , Linkerscript and MPU Initialisation File

LinkerScript

ewconfig

MainFile

RamInfo

by
Hello,

according to your linker script, the stack size is too small - please increase that to 4...8 kByte.

According to your initialization, the MPU is still disabled and the MPU settings do not consider the SRAM areas.

Do you still get the HardFault error after EwEndUpdate function? If yes, please set a breakpoint into file ewextgfx.c function GfxEndUpdate(). Is the function called? Can you step through?

Best regards,

Manfred.
by

Hello,

Thanks for the response as per your suggestion

Increased the stack size to 8KB _Min_Stack_Size = 0x2000 ;

Enabled the MPU ->HAL_MPU_Enable(MPU_PRIVILEGED_DEFAULT);

 

Now I didnt get any hardfault Error EwProcess() function is successfully completed. Thanks for the ANSWER

 

But GUI is not displayed in the screen kindly suggest what are the other areas need to be fine tuned.

 

Below I shared the EwPrint file

[18:08:51:863] Check memory addr 0xC0000000 size 0x00800000␍␊

[18:08:51:884] Write test pattern to SDRAM... [OK]␍␊

[18:08:52:908] Read test pattern from SDRAM... [OK]␍␊

[18:08:53:980] [OK]␍␊

[18:08:53:980] Initialize Memory Manager... [OK]␍␊

[18:08:53:980] Initialize Graphics Engine... [OK]␍␊

[18:08:53:980] Create Embedded Wizard Root Object... trace: "Application Constructor"␍␊

[18:08:53:980] trace: "Device Class Constructor"␍␊

[18:08:53:980] [OK]␍␊

[18:08:53:980] Create Embedded Wizard Viewport... [OK]␍␊

[18:08:53:980] ---------------------------------------------␍␊

[18:08:53:980] Target system STM32H753 ␍␊

[18:08:53:980] Color format RGB565 ␍␊

[18:08:53:980] MemoryPool address 0xC0025800 ␍␊

[18:08:54:024] MemoryPool size 8081408 bytes␍␊

[18:08:54:024] Framebuffer address 0xC0000000 ␍␊

[18:08:54:024] Doublebuffer address 0xC07DA800 ␍␊

[18:08:54:024] Framebuffer size 240 x 320 ␍␊

[18:08:54:024] EwScreeenSize 240 x 320 ␍␊

[18:08:54:024] Graphics accelerator DMA2D ␍␊

[18:08:54:024] Vector graphics support enabled ␍␊

[18:08:54:024] Warp function support enabled ␍␊

[18:08:54:024] Index8 bitmap resource format enabled ␍␊

[18:08:54:068] RGB565 bitmap resource format enabled ␍␊

[18:08:54:068] Bidirectional text support enabled ␍␊

[18:08:54:068] Operating system none ␍␊

[18:08:54:068] External flash device none ␍␊

[18:08:54:068] Toolchain GCC ␍␊

[18:08:54:068] C-Compiler version 7.3.1 ␍␊

[18:08:54:068] Build date and time Sep 23 2021, 16:51:07 ␍␊

[18:08:54:068] Runtime Environment (RTE) version 11.00 ␍␊

[18:08:54:112] Graphics Engine (GFX) version 11.00 ␍␊

[18:08:54:112] Max surface cache size 2097152 bytes␍␊

[18:08:54:112] Glyph cache size 128 x 128 ␍␊

[18:08:54:112] Max issue tasks 100 ␍␊

[18:08:54:112] Surface rotation 0 ␍␊

[18:08:54:112] ---------------------------------------------␍␊

[18:08:54:112] 1 object(s) of class 'Application::Application' (each 1440 bytes large)␍␊

[18:08:54:112] 1 object(s) of class 'Resources::Font' (each 36 bytes large)␍␊

[18:08:54:157] 1 object(s) of class 'Application::DeviceClass' (each 20 bytes large)␍␊

[18:08:54:157] ␍␊

[18:08:54:157] 1648 bytes occupied by 3 Chora objects (peak 1648 bytes)␍␊

[18:08:54:157] 210 bytes occupied by 5 strings (peak 210 bytes)␍␊

[18:08:54:157] 32666 bytes occupied by Graphics Engine objects (without any framebuffers) (peak 32666 bytes)␍␊

[18:08:54:157] 7978 bytes occupied by 'watermark' images (used only in evaluation version)␍␊

[18:08:54:157] 48 bytes occupied by the profiler itself␍␊

[18:08:54:157] TOTAL : 42550 bytes, TOTAL PEAK : 42550 bytes␍␊

[18:08:54:157] ␍␊

[18:08:54:157] trace: "SLOT METHOD CPAP_PROJECT"␍␊

[18:08:54:197] Shutting down Application... [OK]␍␊

[18:08:54:197] Deinitialize Graphics Engine... [OK]␍␊

 

 

by
Hello,

great to hear that that this part is working now!

I assume your application is terminated:

[18:08:54:197] Shutting down Application... [OK]␍␊

[18:08:54:197] Deinitialize Graphics Engine... [OK]␍␊

Do you have a main loop that is driving the GUI application?
by

Now I change the main loop to

 

EwBspConsoleInit();
  EwInit();
  EwPrintSystemInfo();
  EwPrintProfilerStatistic(1);

  while(EwProcess())
      ;
  EwDone();
  /* USER CODE END 2 */

  /* Infinite loop */
  /* USER CODE BEGIN WHILE */
  while (1)
  {
    /* USER CODE END WHILE */

    /* USER CODE BEGIN 3 */
  }
  /* USER CODE END 3 */
}

Really sorry to say this The GUI is not displayed in the screen
Main File

by
It is not so simple to make this remotely....

Let's go ahead with ew_bsp_display.c, ewextgfx.c and ewmain.c. - If you modified one of these files compared to the original Build Environment, please let me have a look on that.
by

Sure I got your point

For your reference I modified ew_bsp_dispaly.c and ewmain.c according to our application In ew_bsp_display.c we changed the LCD configuration and in ewmain.c we commented touch and keyboard settings

ewmain.c

ewbspdispaly.c

ewbspgraphics.c

ewextgfx.c

by
There seems to some mixture with your defines concerning the framebuffer. Sometimes you are using EW_FRAME_BUFFER_WIDTH, FRAME_BUFFER_WIDTH or 240. Sometimes you are using EW_FRAME_BUFFER_HEIGHT, FRAME_BUFFER_HEIGHT or 320. Please use (in case of version 11.00) always EW_FRAME_BUFFER_WIDTH and EW_FRAME_BUFFER_HEIGHT.

This indicates some version mixture.

In ew_bsp_display.c function EwBspDisplayInit() please activate the line

      //memset((void*)FRAME_BUFFER_ADDR, 0, FRAME_BUFFER_WIDTH * FRAME_BUFFER_HEIGHT * EW_FRAME_BUFFER_DEPTH );

Do you have a black framebuffer now?

How does the application behave in case you set EW_USE_DOUBLE_BUFFER to 1 (ewconfig.h)?
by

Hi,

As per the suggestion I have chosen a common name for frame buffer height and name as per version 11.0 EW_FRAME_BUFFER_WIDTH = 240 and EW_FRAME_BUFFER_HEIGHT = 320

Activated the memset Line.

 

Set EW_USE_DOUBLE_BUFFER to 0 in c/c++ General=>Paths and symbols

while debugging found that the program is entered into ew_bsp_display.c function SyncOnLine()  and not comming out from the loop     while( aLine != CurrentLine )
      ;

 

by
The endless looping within SyncOnLine() indicates, that the LTDC line interrupt does not work. Please check the configuration.

Btw: In my previous comment I mentioned to set EW_USE_DOUBLE_BUFFER to 1 not to 0. But in both cases (with single buffering or with double buffering) it is necessary that the LTDC line interrupt is working.
by

Hello,

I enable the Line Interrupt and run the process it passes the SyncOnLine() function

But Once Power Off and Power On we got the HardFaultError after ewEndUpdate() function only 30% of background rectangle(Lowest Order) is displayed on the LCD. But doing multiple debug the Hardfault error has gone and the Full screen is dispayed in the LCD.

 

What may be the reason for random HardFaul Error?

EwScreen

LCD_Screen

EwPrintLog

by
Hello,

o.k. next step is done... Please try with the setting EW_USE_DOUBLE_BUFFER=1 in ewconfig.h. Then you should see at least the entire frame. Does this work?

Concerning the HardFault: Do you have a debugger? What is on the stack?
by

Hello,

Here I shared the HardFault Register in this below file

EWPrint_HardFault

For your clarification I got the Output screen in after multiple repeated debug but Once I switch off the Power and On the supply I got hardfault

 

by

Hello,

do you have a debugger? If yes, then please let me know the call stack, in order to find the location. If no, then please put some EwPrint() messages within the code to find the location. You can start within the main loop:

  EwPrint( "A\n" );
  /* process expired timers */
  timers = EwProcessTimers();

  EwPrint( "B\n" );
  /* process the pending signals */
  signals = EwProcessSignals();

  EwPrint( "C\n" );
  /* refresh the screen, if something has changed and draw its content */
  if ( devices || timers || signals || events )
  {
    EwPrint( "D\n" );
    if ( CoreRoot__DoesNeedUpdate( RootObject ))
      EwUpdate( Viewport, RootObject );

    EwPrint( "E\n" );
    /* just for debugging purposes: check the memory structure */
    EwVerifyHeap();

    EwPrint( "F\n" );
    /* after each processed message start the garbage collection */
    EwReclaimMemory();

    /* print current memory statistic to console interface */
    #ifdef EW_PRINT_MEMORY_USAGE
      EwPrintProfilerStatistic( 0 );
    #endif

    /* evaluate memory pools and print report */
    #ifdef EW_DUMP_HEAP
      EwDumpHeap( 0 );
    #endif
    EwPrint( "G\n" );
  }

What are the outputs on the console?

by

Another question: Have you seen your outputs on the console:

[18:08:54:157] ␍␊

[18:08:54:157] trace: "SLOT METHOD CPAP_PROJECT"␍␊

[18:08:54:197] Shutting down Application... [OK]␍␊

[18:08:54:197] Deinitialize Graphics Engine... [OK]␍␊

Why is the application shutting down? Is the function EwDone() called? Please check your main.c file.

by

Yes I had seen the output on the console

 

Here I share the call stack Image

HardFault

MPU Config File

void MPU_Config(void){
      MPU_Region_InitTypeDef MPU_InitStruct;

//      /* Disable the MPU */
      HAL_MPU_Disable();
//
//        MPU_InitStruct.Enable           = MPU_REGION_ENABLE;
//        MPU_InitStruct.BaseAddress      = 0x30000000;//0x30000000;//0x38000000;
//        MPU_InitStruct.Size             = MPU_REGION_SIZE_128KB;
//        MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS;
//        MPU_InitStruct.IsBufferable     = MPU_ACCESS_NOT_BUFFERABLE;
//        MPU_InitStruct.IsCacheable      = MPU_ACCESS_CACHEABLE;
//        MPU_InitStruct.IsShareable      = MPU_ACCESS_NOT_SHAREABLE;
//        MPU_InitStruct.Number           = MPU_REGION_NUMBER2;
//        MPU_InitStruct.TypeExtField     = MPU_TEX_LEVEL0;
//        MPU_InitStruct.SubRegionDisable = 0x00;
//        MPU_InitStruct.DisableExec      = MPU_INSTRUCTION_ACCESS_ENABLE;
//        HAL_MPU_ConfigRegion(&MPU_InitStruct);
//
      /* Configure the MPU attributes for SDRAM_Banks area to strongly ordered
         This setting is essentially needed to avoid MCU blockings!
         See also STM Application Note AN4861 */
      MPU_InitStruct.Enable           = MPU_REGION_ENABLE;
      MPU_InitStruct.Number           = MPU_REGION_NUMBER0;
      MPU_InitStruct.BaseAddress      = 0xC0000000;
      MPU_InitStruct.Size             = MPU_REGION_SIZE_8MB;
      MPU_InitStruct.SubRegionDisable = 0x0;
      MPU_InitStruct.TypeExtField     = MPU_TEX_LEVEL0;
      MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS;
      MPU_InitStruct.DisableExec      = MPU_INSTRUCTION_ACCESS_ENABLE;
      MPU_InitStruct.IsShareable      = MPU_ACCESS_NOT_SHAREABLE;
      MPU_InitStruct.IsCacheable      = MPU_ACCESS_CACHEABLE;
      MPU_InitStruct.IsBufferable     = MPU_ACCESS_NOT_BUFFERABLE;
      HAL_MPU_ConfigRegion(&MPU_InitStruct);

    //HAL_MPU_ConfigRegion(&MPU_InitStruct);

      /* Enable the MPU */
    HAL_MPU_Enable(MPU_HFNMI_PRIVDEF);
}

by
Concerning the MPU settings, please see my comments some messages above.

What about double-buffereing? How does this behave?

Any idea, why the application is shutting down?

Let me know...
by
I forgot to enable the cache once I enabled the screen is displayed in the LCD Thanks for your patience and time to guiding me up to this level
by
This means, it is running now and you see the GUI on the display?!?
by
Yes I can able to see the GUI in LCD display

Embedded Wizard Website | Privacy Policy | Imprint

...