<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>How to use ztest to calculate code coverage</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/127827/how-to-use-ztest-to-calculate-code-coverage</link><description>Hi 
 How can I use ztest to calculate code coverage on the nrf54l15 platform, I tried to use the configurations of CONFIG_FORCE_COVERAGE=y, CONFIG_COVERAGE_GCOV=y, and CONFIG_COVERAGE=y to calculate the test coverage of ztest. However, after enabling</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 28 Apr 2026 06:22:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/127827/how-to-use-ztest-to-calculate-code-coverage" /><item><title>RE: How to use ztest to calculate code coverage</title><link>https://devzone.nordicsemi.com/thread/565585?ContentTypeID=1</link><pubDate>Tue, 28 Apr 2026 06:22:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b22fe764-71cf-4274-a427-3ff46ed30435</guid><dc:creator>mtk0</dc:creator><description>&lt;p&gt;Thank you very much for your answer.&amp;nbsp;I will first learn how to use Twitter, and then use Twitter to calculate our code testing coverage.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use ztest to calculate code coverage</title><link>https://devzone.nordicsemi.com/thread/565547?ContentTypeID=1</link><pubDate>Mon, 27 Apr 2026 13:26:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4cf09c58-88c4-43be-a734-f511ffd8cd2e</guid><dc:creator>Maria Gilje</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Yes, I see this now. I see the same when adding the coverage symbols to Zephyr samples. So the RAM and NVM requirements that coverage has is too large to run on the nRF54L15. Instead of running on the hardware, you could check out using &lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/develop/test/coverage.html#coverage_reports_using_twister"&gt;Twister&lt;/a&gt; instead to generate coverage reports.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Maria&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use ztest to calculate code coverage</title><link>https://devzone.nordicsemi.com/thread/565529?ContentTypeID=1</link><pubDate>Mon, 27 Apr 2026 09:32:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4c743eb-5c8d-4826-9b73-80fa85519ce6</guid><dc:creator>mtk0</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;This issue is not about configuring flash partitions to allow enough space for firmware to flow out. I have also tried using this routine nrf/samples/blue/peripherals_uart to add &lt;span&gt;CONFIG_FORCE_COVERAGE=y, CONFIG_COVERAGE_GCOV=y, and CONFIG_COVERAGE=y&lt;/span&gt; in prj.conf, which will also report the same error during compilation. Therefore, I believe that using these three configurations is not suitable for the nrf54l15 chip. What is the correct way to test code coverage on nrf54l15 using ztest.&lt;/p&gt;
&lt;p&gt;The following is the log compiled from prj.conf in nrf/samples/blue/peripheral-uart with the addition of &lt;span&gt;CONFIG_FORCE_COVERAGE=y, CONFIG_COVERAGE_GCOV=y, and CONFIG_COVERAGE=y&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1777282271159v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use ztest to calculate code coverage</title><link>https://devzone.nordicsemi.com/thread/565326?ContentTypeID=1</link><pubDate>Wed, 22 Apr 2026 12:54:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d2c4b0f-80c6-4579-b50e-7f1dbd29e327</guid><dc:creator>Maria Gilje</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you for the additional information. Since your partitions indicate that you are using dual bank DFU, this overflow is not very surprising.&lt;/p&gt;
[quote user="mtk0"]&lt;p&gt;2,&amp;nbsp; This is the compilation log when closing VNet FORCE-COVERAGE=n, VNet COVERAGE_GCOV=n, and VNet COVERAGE=n:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;cursor:zoom-in;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/4861.pastedimage1776737263889v1.png" alt=" " /&gt;&lt;/p&gt;[/quote]
&lt;p&gt;Your application is already at 85% of the allocated flash before enabling the coverage symbols. Would it have any value for you to do a coverage test without the DFU configurations? It could at least shed some light on how much the memory usage increases when enabling the coverage symbols. If it seems feasible with those numbers that you could be able to fine tune your partitions to barely fit the application with the coverage symbols enabled, then I&amp;#39;d say you should give it a try. But do please note that we don&amp;#39;t recommend shipping products with 100% flash usage because it can make it impossible to perform future upgrades.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Also, to improve readability of your latest reply, I will edit the formatting of it and put the partition code into a code block (with Insert-&amp;gt;Code). Please use Insert-&amp;gt;Code for logs and code in the future, thanks!&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Maria&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use ztest to calculate code coverage</title><link>https://devzone.nordicsemi.com/thread/565195?ContentTypeID=1</link><pubDate>Tue, 21 Apr 2026 02:07:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:825f1e2d-3fdf-45c4-8b3c-a39d7ebc9d4b</guid><dc:creator>mtk0</dc:creator><description>&lt;p&gt;Hello&lt;/p&gt;
&lt;p&gt;1, I am using the NRF54L15 chip, with 1.5MB of flash and 256KB of RAM.This is the partition table of my project,&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;app:
address: 0xd000
end_address: 0x8d000
region: flash_primary
size: 0x80000
mcuboot:
address: 0x0
end_address: 0xc000
placement:
align:
end: 0x1000
before:
- mcuboot_primary
region: flash_primary
size: 0xc000
mcuboot_pad:
address: 0xc000
end_address: 0xd000
placement:
align:
start: 0x1000
before:
- mcuboot_primary_app
region: flash_primary
size: 0x1000
mcuboot_primary:
address: 0xc000
end_address: 0x8d000
orig_span: &amp;amp;id001
- app
- mcuboot_pad
region: flash_primary
sharers: 0x1
size: 0x81000
span: *id001
mcuboot_primary_app:
address: 0xd000
end_address: 0x8d000
orig_span: &amp;amp;id002
- app
region: flash_primary
size: 0x80000
span: *id002
mcuboot_secondary:
address: 0x8d000
end_address: 0x10d000
placement:
after:
- mcuboot_primary
align:
start: 0x1000
region: flash_primary
share_size:
- mcuboot_primary_app
size: 0x80000
settings_storage:
address: 0x10d000
end_address: 0x10f000
placement:
after:
- app
align:
start: 0x1000
before:
- end
region: flash_primary
size: 0x2000
user_nvs:
address: 0x10f000
end_address: 0x111000
placement:
after:
- app
align:
start: 0x1000
before:
- end
region: flash_primary
size: 0x2000
settings_user_storage:
address: 0x111000
end_address: 0x16a000
placement:
after:
- app
align:
start: 0x1000
before:
- end
region: flash_primary
size: 0x59000
coredump_partition:
address: 0x16a000
end_address: 0x16e000
placement:
after:
- app
align:
start: 0x1000
before:
- end
region: flash_primary
size: 0x4000
offline_logging:
address: 0x16e000
end_address: 0x17c000
placement:
after:
- app
align:
start: 0x1000
before:
- end
region: flash_primary
size: 0xe000
dtm_flag:
address: 0x17c000
end_address: 0x17d000
placement:
after:
- app
align:
start: 0x1000
before:
- end
region: flash_primary
size: 0x1000
otp:
address: 0xffd500
end_address: 0xffd9fc
region: otp
size: 0x4fc
sram_primary:
address: 0x20000000
end_address: 0x2002f000
region: sram_primary
size: 0x2f000&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;2,&amp;nbsp; This is the compilation log when closing VNet FORCE-COVERAGE=n, VNet COVERAGE_GCOV=n, and VNet COVERAGE=n:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/0216.pastedimage1776737263889v1.png" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to use ztest to calculate code coverage</title><link>https://devzone.nordicsemi.com/thread/565152?ContentTypeID=1</link><pubDate>Mon, 20 Apr 2026 09:19:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6aeeb835-c7ab-47d0-924a-7c283427c31d</guid><dc:creator>Maria Gilje</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You would need to review your partitions and memory usage. Could you please share what your partitions are? Also, when you are &lt;strong&gt;not&lt;/strong&gt; enabling the code coverage Kconfig symbols, what is the memory report at the end of your build log?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Maria&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>