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

ARMCC V6.12 problem with simple std::queue

Hi everyone!
Im working with STM32F103VB, ARMCC V6.12, C++14(community) and have some problem with simple std::queue.
When i write something like this:

Fullscreen
1
2
3
4
5
6
7
8
#include <queue>
std::queue<int> Q;
int main(){
int i=1213;
Q.push(i);
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


my program ends in _sys_exit() function in my retarget.c file:

Fullscreen
1
2
3
4
void _sys_exit(int return_code)
{
while(1);
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

I have no idea how to fix this. When i tryed std::queue on arm-gcc-none-eabi compiler my program end in hard fault handler, the last function before hard fault was malloc_r() but i don't know if it is the same problem on the ARMCC compiler.

my startup file (notice please, that im using "__use_no_semihosting"):

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Stack_Size EQU 0x00000400
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 0x00000400
AREA HEAP, NOINIT, READWRITE, ALIGN=3
__heap_base
Heap_Mem SPACE Heap_Size
__heap_limit
PRESERVE8
THUMB
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

my retarget.c file:


Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <rt_misc.h>
char *_sys_command_string(char *cmd, int len){
return 0;
}
void _ttywrch(int ch)
{
}
void _sys_exit(int return_code)
{
while(1); /* endless loop */
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX



my linker script:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
LR_IROM1 0x08000000 0x00020000 { ; load region size_region
ER_IROM1 0x08000000 0x00020000 {
*.o (RESET, +First)
*(InRoot$$Sections)
.ANY (+RO)
.ANY (+XO)
}
RW_IRAM1 0x20000000 0x00002800{ ; RW data
.ANY (+RW +ZI)
}
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

I will be very thankful for any hint what is going on.

0