Question
Program crashed when I declare a array of Custom Container and add it to scrollableContainer in a constructor.
I want to display a list of Custom Container in a scrollableContainer .
So I write the code like blow.
//declare in public
std::vector <menuDisplayContent> menuDisplayContanier;
/*--------------------------------------------------------------------*/
//in constructor
menuDisplayContanier.resize(5);
for (int i = 0; i < menuDisplayContanier.size(); i++)
{
menuDisplayContanier[i].setY( i * 170);
scrollableContainer1.add(menuDisplayContanier[i]);
}It worked in PC simulator.But crashed when enter this screen in real board.
Firstly,I doubt the leak of heap is the reason. So I expand the heap size from 0x2000 to 0xF000. It crashed again. The heap size like below.
//in startup_stm32f429xx.s file
Stack_Size EQU 0x4000
AREA STACK, NOINIT, READWRITE, ALIGN=3
Stack_Mem SPACE Stack_Size
__initial_sp
; <h> Heap Configuration
; <o> Heap Size (in Bytes) <0x0-0xFFFFFFFF:8>
; </h>
Heap_Size EQU 0xF000 // I change the heap size here.
AREA HEAP, NOINIT, READWRITE, ALIGN=3
__heap_base
Heap_Mem SPACE Heap_Size
__heap_limit
PRESERVE8
THUMBNow, I can not find the reason. Is there other reason lead to this phenomenon?
