Quantcast
Channel: MSP low-power microcontrollers
Viewing all articles
Browse latest Browse all 62309

Forum Post: RE: Global constructors in a C++ project with GCC on the MSP432

$
0
0
I have recompiled my minimal example with Linaro GCC which is bundled with Code Composer Studio 6.2. and the result is more or less the same. The code causes a usage fault in __libc_init_array() only at a different address. The last steps in gdb are now: 0x0000042a in register_fini () (gdb) 0x0000036a in __libc_init_array () (gdb) 0x0000036c in __libc_init_array () (gdb) 0x0000036e in __libc_init_array () (gdb) 0x00000000 in interruptVectors () (gdb) UsageFault_Handler () at main.cpp:10 10 __attribute__((interrupt)) void UsageFault_Handler() {} and the dissasembly of __libc_init_array() reads as follows: 00000334 : 334: b570 push {r4, r5, r6, lr} 336: 4e0f ldr r6, [pc, #60] ; (374 ) 338: 4d0f ldr r5, [pc, #60] ; (378 ) 33a: 1b76 subs r6, r6, r5 33c: 10b6 asrs r6, r6, #2 33e: bf18 it ne 340: 2400 movne r4, #0 342: d005 beq.n 350 344: 3401 adds r4, #1 346: f855 3b04 ldr.w r3, [r5], #4 34a: 4798 blx r3 34c: 42a6 cmp r6, r4 34e: d1f9 bne.n 344 350: 4e0a ldr r6, [pc, #40] ; (37c ) 352: 4d0b ldr r5, [pc, #44] ; (380 ) 354: 1b76 subs r6, r6, r5 356: f000 f94b bl 5f0 35a: 10b6 asrs r6, r6, #2 35c: bf18 it ne 35e: 2400 movne r4, #0 360: d006 beq.n 370 362: 3401 adds r4, #1 364: f855 3b04 ldr.w r3, [r5], #4 368: 4798 blx r3 36a: 42a6 cmp r6, r4 36c: d1f9 bne.n 362 36e: bd70 pop {r4, r5, r6, pc} 370: bd70 pop {r4, r5, r6, pc} 372: bf00 nop ... 37c: 000005f0 .word 0x000005f0 380: 000005e4 .word 0x000005e4 The CFSR register also has the INVSTATE bit set upon entering the UsageFault_Handler(). Since the __libc_init_array() looks exactly the same as with the gcc version from ARM, only shifted slightly in memory, I suspect that maybe something else is causing the problem.

Viewing all articles
Browse latest Browse all 62309

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>