This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problem with more member in a structure

Hi there,
I'm using STM32F103 with Keil ver 4.72
I defined a structure like this:

typedef struct
{
 uint16_t X;
 uint16_t Y;
 uint16_t Width;
 uint16_t Height;
 uint16_t BackColor;
 uint16_t TextColor;
 uint16_t TextBackColor;
} button_t;


I use the struct in main file like this:

button_t btn1;

int main()
{
 btn1.X = 100;
 btn1.Y = 100;
 .
 .
 .
 while(1)
 {
 }
}


When I use this struct in program, every things works well.
The problem is when I add more members into the structure, like this:

typedef struct
{
 uint16_t X;
 uint16_t Y;
 uint16_t Width;
 uint16_t Height;
 uint16_t BackColor;
 uint16_t TextColor;
 uint16_t TextBackColor;

 uint16_t TLX;
 uint16_t TLY;
 uint16_t TRX;
 uint16_t TRY;
 uint16_t BLX;
 uint16_t BLY;
 uint16_t BRX;
 uint16_t BRY;
};


When I do that, program compiles without any problem, but when I download it into the MCU, it doesn't work.
I increased Heap Size from 0x0200 to 0x0800, but took the same result. I set the Heap Size in startup.s file. I'm not sure if it's a right way to set that.

0