<?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 debug driver code (drivers within the zephyr lib - NOT a custom driver), and code within the zephyr library (code that I have not written)?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/121458/how-to-debug-driver-code-drivers-within-the-zephyr-lib---not-a-custom-driver-and-code-within-the-zephyr-library-code-that-i-have-not-written</link><description>Hello Nordic Team, 
 I am reaching out to ask for some advice and/or guidance on how I may debug code that: 
 1. Is initialized and runs BEFORE main 
 2. Is part of the zephyr library, not the application code I have written 
 
 For example, I am using</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 15 May 2025 13:39:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/121458/how-to-debug-driver-code-drivers-within-the-zephyr-lib---not-a-custom-driver-and-code-within-the-zephyr-library-code-that-i-have-not-written" /><item><title>RE: How to debug driver code (drivers within the zephyr lib - NOT a custom driver), and code within the zephyr library (code that I have not written)?</title><link>https://devzone.nordicsemi.com/thread/535614?ContentTypeID=1</link><pubDate>Thu, 15 May 2025 13:39:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:07f98a26-3e39-48e7-b67b-37dcb8ca00b8</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;It&amp;#39;s good to hear that you were able to get it to work in the end.&lt;/p&gt;
[quote user=""]Given the layer of abstraction introduced through the use of a driver in the devicetree, which is configured and initialized BEFORE main, I have been left wondering how I can go about setting break points and debugging code that exists outside of the application layer code I have written, particularly the stuff before main.[/quote]
&lt;p&gt;If you&amp;#39;re using our VS Code extension, you can more easily navigate the code included in the current build, including the initialization code that runs before main(). You are also free to place breakpoints in these init functions.&lt;/p&gt;
&lt;p&gt;E.g.,&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/pastedimage1747315821804v2.png" alt=" " /&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/pastedimage1747316031460v5.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Browsing for the ethernet driver in the SDK tree from the&amp;nbsp;APPLICATIONS view:&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/pastedimage1747316083218v6.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>