cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with STM32H7 / TouchGFX 4.14 / FreeRTOS project when changing the size of a struct array

GS1
Senior III

Hi all,

I have a strange problem on an STM32H742 project which uses TouchGFX and FreeRTOS.

The project uses a huge array of structured elements. I need 1200 elements, but this will not work. The strange thing is, that the system is working perfectly, when I define only 240 elements!

Increasing the number of elements is corrupting the whole system so that even the main menu screen is no longer presented.

Details:

I run 2 tasks: One for a communication to another processor and a second one for the TouchGFX User interface handlings. The communication task hands over initialisation data to the user interface via RTOS messages.

The project is displaying measurement data. The definition of the data channel handling (Descriptions, calculation factors etc) is defined in a structure which takes 64 bytes per data channel.

Then I define a variable array of this struct definition:

typedef   struct

{

   short m_nActiveIdx;      

   short m_nChannelNo;      

   uint8_t m_ucOnlineOrAlarmMessaged;      

   uint8_t m_ucScan;

   uint8_t m_ucDataformat;   

   uint8_t m_ucNoBits;   

   float m_fFactor;

   float m_fOffset;

   float m_fMinValue;

   float m_fMaxValue;

   int m_nCountMsOutOfRange;   

   float m_fMaxValOutOfRange;   

   char m_cDescription[24];   

   char m_cDim[8];

}   structChannelDef;   // 64 Byte Per Channel = 76800 (=0x12C00) Bytes for 1200 channels

structChannelDef   sChannelInit[1200];   //      <-------- Actually needed amount of elements

I checked the linker map: Data is located in AXI SRam, which has a size of 0x80000 : Still appx. 0x30000 of free RAM space is available if 1200 elements are defined.

I increased Stack and Heap to 0x6000: Doesn't help.

I located the array at a fixed address at the end of IRAM2: Doesn't help.

--------------------------------------------------------------------------------------------------------------------------------------

Part of Linker Map (RAM occupation) when 240 elements are defined:

 gfx_core.lib(application.o)

   0x080f1acc  0x080f1a9c  0x00000004  Data  RO       58375   .init_array        touchgfx_core.lib(lcd.o)

   0x080f1ad0  0x080f1a9c  0x00000000  Data  RO       60998   .init_array        c_w.l(init_aeabi.o)

   Execution Region RW_IRAM1 (Exec base: 0x20000000, Load base: 0x080f1ad0, Size: 0x00000000, Max: 0x0001fff0, ABSOLUTE)

   **** No section assigned to this execution region ****

   Execution Region RW_RAM1 (Exec base: 0x2001fff0, Load base: 0x080f1ad0, Size: 0x00000000, Max: 0x00000010, ABSOLUTE)

   **** No section assigned to this execution region ****

--------------------------------------------------------------------------------------------------------------------------------------

Part of Linker Map (RAM occupation) when 500 elements are defined (system not showing entry screen):

   0x080f1b20  0x080f1aec  0x00000000  Data  RO       60998   .init_array        c_w.l(init_aeabi.o)

   Execution Region RW_IRAM1 (Exec base: 0x20000000, Load base: 0x080f1b20, Size: 0x00000000, Max: 0x0001fff0, ABSOLUTE)

   **** No section assigned to this execution region ****

   Execution Region RW_RAM1 (Exec base: 0x2001fff0, Load base: 0x080f1b20, Size: 0x00000000, Max: 0x00000010, ABSOLUTE)

   **** No section assigned to this execution region ****

   Execution Region RW_IRAM2 (Exec base: 0x24000000, Load base: 0x080f1b20, Size: 0x0004ecf0, Max: 0x00080000, ABSOLUTE, COMPRESSED[0x000006f0])

 ---------------------------------------------------------------------------------------------------------------------------------

When I define 240 channels,  the system is working perfectly!!

Alread when I define 500 array elements, the system does not even boot up properly (no menu entry screen displayed on the display). 

I don't know, why this problem arises only by increasing the number of elements in this structure. Is there a limitation for handling such data definition arrays?

Where could I look at?

Debugging doesn't take me to the point of error.

Any hints very much appreciated!

4 REPLIES 4
GS1
Senior III

As it currently seems this problem is not related to the latest release of TouchGFX Version 4.14.

AfjSpi
Associate II

Hi @GS@S​ ,​ 

Were you ever able to find a solution to this? I am having a currently having a similar error and am unable to find a solution

Thanks,

Hi ASpic,

in fact this is a year ago and the problem is fixed. I think there was a wrong indexing of another data array from my side which caused the problem.

So I guess you should look at your own code areas.

BR GS

AfjSpi
Associate II

I shall have a look, thank you for your response!