2022-10-21 04:33 AM
I am using STM32L4 for my application and I want to do code coverage on my controller to see how it performs. How can I do that? Is there any tool or is there any in-built feature in STM32CubeIDE which I can use?
2022-10-21 02:43 PM
IAR EWARM has good instrumentation for coverage.
2022-10-21 08:29 PM
Yes. But I am running linux so only STM32CubeIDE is working for me. IAR, Keil dont have support for linux. So is there any option?
2022-10-21 10:35 PM
If board is equiped wih a large package, maybe ETM can be accessible through debug/trace connector. In this case Ozone debugger from Segger with j-trace probe are very good. Not affordable for hobbyst but helpfull for professional targeting good quality software.
With it you can code coverage in real time! A must have. Caution: With j link probe you can't code coverage. Only with j trace and if you can connect to ETM.
I use it under Windows but it is also under Linux.
2022-10-21 11:29 PM
Thanks. Will try that and revert back for any queires.
2022-10-23 02:12 PM
ITM also has some capability for profiling (PC sampling). Of course, ETM is better, but ITM is cheaper for coarse profiling. CubeIDE has a limited support for this, see the fine manual.
2022-10-23 02:18 PM
What is code coverage?
JW
2022-10-23 08:25 PM
Hi Jan. Code coverage is a metrics on source code based on runtime analysis. With ETM it can be done in real time with not noticable impact on timing.
Doing so can highlight for example instruction that are not executed during a non regression test. Generally tools give also statistic so you can target very qickly witch part of code need to be rewrite for optimisation purpose.
As stated by @Pavel A. ITM can only sample PC to give a statistic. Sampling approche is not so accurate due to insuffisant sampling on very small part of code as like ISR for example...
Have a look to video example using J-TRACE not j link!!!
https://www.segger.com/products/development-tools/ozone-j-link-debugger/technology/code-coverage/
2022-10-24 12:50 AM
Thanks.
JW
2022-10-26 12:18 AM
I dont have J-Trace. Currently I have JLink Mini. Using that I cant do code coverage?