Open ialokim opened 2 years ago
actually it is present as well in the app code, but obviously at the wrong offset:
Disassembly of section .rodata.delay_machine_code.8023:
00030050 <delay_machine_code.8023>:
30050: d8fd3803 ldmle sp!, {r0, r1, fp, ip, sp}^
30054: Address 0x0000000000030054 is out of bounds.
Also, apparently it is generated in .rodata
instead of in .text
as in the base firmware.
Looking at the symbol/map file, it can be seen that the corresponding label is actually defined twice in the app code:
delay_machine_code.8023 = 0x00030050
delay_machine_code.8023 = 0x00000830
A fix might be to somehow force the linker to use the one provided by the base firmware instead of the one in the app. Perhaps the nrf_delay.h
file emits some code instead of only serving as header file?
You can play with it yourself on the branch https://github.com/Slurre/PES-Project/tree/symbol-def-file
in the app generates
Here, the app does not crash, but the LEDs are only turned on for a very short time before the are turned off again (i.e., the delay is not working as expected).
For comparison, the asm of the main function using the same delay function:
apparently the
delay_machine_code
part is not generated/used as it should from within the app