We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
We are using ARM CM0+ in our embedded SoC design and I noticed that boot takes a long time. Specifically, I saw that it took ~18K cycles after the unreset before we executed an instruction that I recognize (which is inside __rt_entry). We are of course using the CMSIS RTX RTOS on the CM0.
It appears from an RTL simulation that during 18000 cycles, the MCU is mostly inside a tight loop of 4 instructions. The PC keeps going looping across 0x178->0x17a->0x17c->0x17e->back. This is most likely some zero initialization (BSS?). The armlink generated .info suggests that the PC is inside !!handler_zi which is inside the object: c_p.l (__scatter_zi.o). This comes from ARM/sw/ARMCompiler5.05u1/lib/armlib/c_p.l.
Questions
- how do I find out what is being initialized?
- how do I not initialize (if not required in our design)?
The scatter text file is very simple and copy-pasted below.
Thanks in advance!!
LOAD 0x0000 SRAM_SIZE { EXEC_ROM_VECTOR_DATA +0 { startup_ARMCM0.s.o(RESET) } EXEC_ROM_VECTOR_HANDLERS +0 { startup_ARMCM0.s.o(.text) } EXEC_ROM +0 { *(+RO) } EXEC_RAM +0 { *(+RW) } EXEC_ZI +0 { *(+ZI) } HEAP +0 { startup_ARMCM0.s.o(HEAP) } STACK +0 { startup_ARMCM0.s.o(STACK) } }
Yes, this is likely zeroing the zero-initialised data pool (ZI/BSS). If you run armlink with --map it will provide a breakdown of how all of the input objects contributed to the final output image.
Simon.