Content originally posted in LPCWare by dariy on Wed May 04 11:40:53 MST 2016
My Optimization Level is -O0 (None) for all files.
If you would look into the examples I gave you, you could see the same assembler lines (optimized or not) in all three disassembled files but the source lines are garbled in systick.dis.
Focusing on the source line 73 from systick.c
SysTick_Config(SystemCoreClock / TICKRATE_HZ1);
we can see it in systick.asm at line 1958 in systick.asm as
73:../example/src/systick.c **** SysTick_Config(SystemCoreClock / TICKRATE_HZ1);
204 .loc 2 73 0
205 000c 054B ldrr3, .L15
206 000e 1B68 ldrr3, [r3]
207 0010 054A ldrr2, .L15+4
208 0012 A2FB0323 umullr2, r3, r2, r3
209 0016 DB08 lsrsr3, r3, #3
210 0018 1846 movr0, r3
211 001a FFF7FEFF blSysTick_Config
or at line 879 in periph_blinky.dis as
SysTick_Config(SystemCoreClock / TICKRATE_HZ1);
350:4b05 ldrr3, [pc, #20]; (368 <main+0x24>)
352:681b ldrr3, [r3, #0]
354:4a05 ldrr2, [pc, #20]; (36c <main+0x28>)
356:fba2 2303 umullr2, r3, r2, r3
35a:08db lsrsr3, r3, #3
35c:4618 movr0, r3
35e:f7ff ffc7 bl2f0 <SysTick_Config>
but in systick.dis at line 569 it looks like
if(IRQn < 0) {
c:4b05 ldrr3, [pc, #20]; (24 <main+0x24>)
e:681b ldrr3, [r3, #0]
10:4a05 ldrr2, [pc, #20]; (28 <main+0x28>)
12:fba2 2303 umullr2, r3, r2, r3
SCB->SHP[((uint32_t)(IRQn) & 0xF)-4] = ((priority << (8 - __NVIC_PRIO_BITS)) & 0xff); } /* set Priority for Cortex-M System Interrupts */
16:08db lsrsr3, r3, #3
18:4618 movr0, r3
1a:f7ff fffe bl0 <main>
:exmark:
This is happening only since downloading v8.1.4