Hi,master:
platform:nrf52840
IDE:keil compiler version 5
tool chain: armcc
There are multiple calls to a function in the product. I suspect that there is a problem with this function in some cases. When a condition is met in this function, I add a log. The log information includes who is calling this function at this time. I want to use lr to analyze, but in this environment, I wrote some assembly code and couldn't get lr, because the compilation failed:
static uint32_t lr_val = 0; void func(void) { asm { LDR R0, =0x200044d4 //0x200044d4 is the address of lr_val STR R14, [R0,#0] } if (condition == true) { flash_log("lr_val = %d", lr_val); } ... }
Is there any way to achieve who is calling this function when there is a problem?
Thanks