I’m trying to get the firmware to run on one of my own boards that has a STM32F103C6 chip on there. Compiling the firmware was quite easy, thanks to the documentation in the repo. Now the board isn’t much spark-like, so I undefined the
SPARK_RTC_ENABLE defines and I changed the application.cpp to be pretty much a blinky sketch.
I built the firmware using the
DEBUG_BUILD options and tried debugging the firmware using Eclipse with GDB. This seems to work fine: I can see the program starting in the
Reset_Handler:… I set some breakpoints set after that, so I can see it running towards the
bl SystemInit etc. Now this is where it’s starting to act funny.
According to DGB, it steps towards the
bl SystemInit, but then just steems to step “over” it. By which I mean that I see branch instruction highlighted, but never executed. On closes inspection, the disassembly shows:
LoopFillZerobss: 08007500: movs r0, r0 95 cmp r2, r3 08007502: movs r0, r0 96 bcc FillZerobss 08007504: lsrs r0, r0, #32 98 bl SystemInit 08007506: ands r1, r0 08007508: movs r0, r2 100 bl SparkCoreConfig 0800750a: movs r4, r0 0800750c: movs r0, r0 102 bl CallConstructors 0800750e: movs r0, r0 08007510: lsls r7, r7, #3 104 bl main 08007512: lsls r7, r7, #3 08007514: movs r0, r0 105 bx lr 08007516: movs r0, r0 75 ldr r3, =_sidata 08007518: andeq r0, r0, r0 81 ldr r0, =_sdata 0800751c: andmi r0, r1, r0, lsl #16 82 ldr r3, =_edata 08007520: andeq r0, r5, r0, lsr #32 86 ldr r2, =_sbss 08007524: andeq r0, r0, r0 94 ldr r3, = _ebss 08007528: ldrshteq r0, [pc], #15 118 b Infinite_Loop
So does this mean that all branch instructions are in face
movs r0, r0?
Can someone point me in the right direction perhaps? I’m clearly overlooking something here…