‎2021-08-17 10:38 PM
I am trying to record instruction traces on-chip via ETF on a stm32mp157a-dk1 board, but the data read from FIFO through RRD is always 0. During the debugging process, I found the value of ETM_AUTHSTAT is 0x08, which means non-secure non-invasive debug disabled.
...
uint32_t ret;
void __iomem *vaddr = ioremap(ETM_AUTHSTAT, 4);
ret = __raw_readl(vaddr);
iounmap(vaddr);
...
After that, I tried to read DBG_AUTHSTAT and BSEC_DENABLE respectively:
[10725.551984] Check some registers......
[10725.555600] BSEC_DENABLE:047F
[10725.565686] DBG_AUTHSTAT:00FF
It seems all debug signals are 1.
​
So what I want to confirm is whether the trace function is disabled on my board? Is it because stm32mp1 supports the Security Extensions?
Solved! Go to Solution.
‎2021-09-07 11:40 PM
Thanks for your reply OlivierK, I've already solved this problem :)
From the results of various attempts, I made 2 mistakes before:
1. The trace clock was not enabled, that's why I cannot get any data from ETF. Then I added these codes and it worked!
write_reg(0x5000080C, 0x0301);
reg = read_reg(0x5000080C);
pr_info("RCC_DBGCFGR: %04X\n", reg);
2. It seems the ETM_AUTHSTAT can be enabled by ETMPDN, not permanently disabled. It’s just the name made me believe it’s OTP related
‎2021-09-07 12:23 PM
Hi Yujia.L (Community Member)
Did you manage to progress on the issue? I don't have the DK1 board at hand but the DK2 board have the same settings regarding BSEC_DENABLE after linux boot. The NSNI and NSI are by default set to 1. Which mode register did you select for the ETF?
‎2021-09-07 11:40 PM
Thanks for your reply OlivierK, I've already solved this problem :)
From the results of various attempts, I made 2 mistakes before:
1. The trace clock was not enabled, that's why I cannot get any data from ETF. Then I added these codes and it worked!
write_reg(0x5000080C, 0x0301);
reg = read_reg(0x5000080C);
pr_info("RCC_DBGCFGR: %04X\n", reg);
2. It seems the ETM_AUTHSTAT can be enabled by ETMPDN, not permanently disabled. It’s just the name made me believe it’s OTP related
‎2021-09-14 09:22 AM
Hi Yujia.L (Community Member)
Thank you for your inputs. For sure it will help others on this topic.
Regards,
Olivier