{"id":5687,"date":"2023-06-01T19:33:02","date_gmt":"2023-06-01T17:33:02","guid":{"rendered":"https:\/\/www.pschatzmann.ch\/home\/?p=5687"},"modified":"2024-09-28T11:51:04","modified_gmt":"2024-09-28T09:51:04","slug":"rp2040-debugging-in-arduino-with-linux","status":"publish","type":"post","link":"https:\/\/www.pschatzmann.ch\/home\/2023\/06\/01\/rp2040-debugging-in-arduino-with-linux\/","title":{"rendered":"Arduino 2.0: RP2040 Debugging with Linux"},"content":{"rendered":"<p>I thought it should be quite easy to use the new <strong>debugging functionality<\/strong> of <strong>Arduino 2.0<\/strong> with the <strong>RP2040<\/strong> using the <a href=\"https:\/\/www.raspberrypi.com\/documentation\/microcontrollers\/debug-probe.html\">official RP2040 debug probe<\/a> in Earle Phil Hower&#8217;s core. I am using Arduino on my old Macbook running <strong>Linux<\/strong>: And Boy was I wrong!<\/p>\n<p>The first challenge was to figure out the <strong>correct wiring<\/strong>: The UART from the Debug Probe optinally goes to the UART and a GND pin of the RP2040. Here the documentation is clear. To use the debugging functionality, the pins from the <strong>Debug port<\/strong> of the probe go to the Debug pins of the RP2040. However, I found it was quite tricky to get the sequence of the <strong>debug pins<\/strong> right: the correct sequence is from left to right: <strong>red goes to SWCLK, black to GND and yellow to SWDIO.<\/strong><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2023\/06\/rp2040-debug-300x225.jpg\" alt=\"\" width=\"100%\"  class=\"alignnone size-medium wp-image-5689\" srcset=\"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2023\/06\/rp2040-debug-300x225.jpg 300w, https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2023\/06\/rp2040-debug-768x576.jpg 768w, https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2023\/06\/rp2040-debug.jpg 800w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>In the Arduino Tools menu the <strong>Upload Method PicoProbbe (CMSIS\/DAP)<\/strong> needs to be selected if you use the Pico Debug Probe: but I still had no success!<\/p>\n<p>Then, I was finding <a href=\"https:\/\/github.com\/earlephilhower\/arduino-pico\/discussions\/1299\">this discussion<\/a> which describes that the wrong tcl file is used, because there is a bug in Arduino, so I used the suggested proposal and copied the picoprobe_cmsis_dap.tcl to picoprobe.tcl. Looking at the log, I could confirm that the wrong picoprobe.tcl is still used, so the bug has not been resolved yet. However even with this correction, debugging was still not working!<\/p>\n<p>Finally I was setting up the <a href=\"https:\/\/docs.platformio.org\/en\/stable\/core\/installation\/udev-rules.html\">Linux udev rules and authorizations as documented for PlatformIO<\/a>, assuming that the same must apply to Arduino as well and finally, after rebooting,  things <strong>finally started to work<\/strong>.<\/p>\n<p>To keep things simple, I started with the following minimal test sketch and setting a break point in setup and the loop was halting the execution at the expected locations:<\/p>\n<pre><code>void setup() {\n  Serial.begin(115200);\n  Serial1.begin(115200);\n}\n\nvoid loop() {\n  Serial.println(\"test\");\n  Serial1.println(\"test1\");\n}\n<\/code><\/pre>\n<p>Please note that with this setup the <strong>Debug Probe is using Serial1<\/strong> while Serial is still the output which goes via the USB connection to the RP2040.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I thought it should be quite easy to use the new debugging functionality of Arduino 2.0 with the RP2040 using the official RP2040 debug probe in Earle Phil Hower&#8217;s core. I am using Arduino on my old Macbook running Linux: And Boy was I wrong! The first challenge was to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":5689,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[20],"tags":[],"class_list":["post-5687","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Arduino 2.0: RP2040 Debugging with Linux - Phil Schatzmann<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pschatzmann.ch\/home\/2023\/06\/01\/rp2040-debugging-in-arduino-with-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Arduino 2.0: RP2040 Debugging with Linux - Phil Schatzmann\" \/>\n<meta property=\"og:description\" content=\"I thought it should be quite easy to use the new debugging functionality of Arduino 2.0 with the RP2040 using the official RP2040 debug probe in Earle Phil Hower&#8217;s core. I am using Arduino on my old Macbook running Linux: And Boy was I wrong! The first challenge was to [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pschatzmann.ch\/home\/2023\/06\/01\/rp2040-debugging-in-arduino-with-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"Phil Schatzmann\" \/>\n<meta property=\"article:published_time\" content=\"2023-06-01T17:33:02+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-28T09:51:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2023\/06\/rp2040-debug.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"pschatzmann\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"pschatzmann\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2023\\\/06\\\/01\\\/rp2040-debugging-in-arduino-with-linux\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2023\\\/06\\\/01\\\/rp2040-debugging-in-arduino-with-linux\\\/\"},\"author\":{\"name\":\"pschatzmann\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"headline\":\"Arduino 2.0: RP2040 Debugging with Linux\",\"datePublished\":\"2023-06-01T17:33:02+00:00\",\"dateModified\":\"2024-09-28T09:51:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2023\\\/06\\\/01\\\/rp2040-debugging-in-arduino-with-linux\\\/\"},\"wordCount\":330,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2023\\\/06\\\/01\\\/rp2040-debugging-in-arduino-with-linux\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2023\\\/06\\\/rp2040-debug.jpg\",\"articleSection\":[\"Arduino\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2023\\\/06\\\/01\\\/rp2040-debugging-in-arduino-with-linux\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2023\\\/06\\\/01\\\/rp2040-debugging-in-arduino-with-linux\\\/\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2023\\\/06\\\/01\\\/rp2040-debugging-in-arduino-with-linux\\\/\",\"name\":\"Arduino 2.0: RP2040 Debugging with Linux - Phil Schatzmann\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2023\\\/06\\\/01\\\/rp2040-debugging-in-arduino-with-linux\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2023\\\/06\\\/01\\\/rp2040-debugging-in-arduino-with-linux\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2023\\\/06\\\/rp2040-debug.jpg\",\"datePublished\":\"2023-06-01T17:33:02+00:00\",\"dateModified\":\"2024-09-28T09:51:04+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2023\\\/06\\\/01\\\/rp2040-debugging-in-arduino-with-linux\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2023\\\/06\\\/01\\\/rp2040-debugging-in-arduino-with-linux\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2023\\\/06\\\/01\\\/rp2040-debugging-in-arduino-with-linux\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2023\\\/06\\\/rp2040-debug.jpg\",\"contentUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2023\\\/06\\\/rp2040-debug.jpg\",\"width\":800,\"height\":600},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2023\\\/06\\\/01\\\/rp2040-debugging-in-arduino-with-linux\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Arduino 2.0: RP2040 Debugging with Linux\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#website\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/\",\"name\":\"Phil Schatzmann Consulting\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\",\"name\":\"pschatzmann\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"contentUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"width\":305,\"height\":305,\"caption\":\"pschatzmann\"},\"logo\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Arduino 2.0: RP2040 Debugging with Linux - Phil Schatzmann","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.pschatzmann.ch\/home\/2023\/06\/01\/rp2040-debugging-in-arduino-with-linux\/","og_locale":"en_US","og_type":"article","og_title":"Arduino 2.0: RP2040 Debugging with Linux - Phil Schatzmann","og_description":"I thought it should be quite easy to use the new debugging functionality of Arduino 2.0 with the RP2040 using the official RP2040 debug probe in Earle Phil Hower&#8217;s core. I am using Arduino on my old Macbook running Linux: And Boy was I wrong! The first challenge was to [&hellip;]","og_url":"https:\/\/www.pschatzmann.ch\/home\/2023\/06\/01\/rp2040-debugging-in-arduino-with-linux\/","og_site_name":"Phil Schatzmann","article_published_time":"2023-06-01T17:33:02+00:00","article_modified_time":"2024-09-28T09:51:04+00:00","og_image":[{"width":800,"height":600,"url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2023\/06\/rp2040-debug.jpg","type":"image\/jpeg"}],"author":"pschatzmann","twitter_card":"summary_large_image","twitter_misc":{"Written by":"pschatzmann","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pschatzmann.ch\/home\/2023\/06\/01\/rp2040-debugging-in-arduino-with-linux\/#article","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2023\/06\/01\/rp2040-debugging-in-arduino-with-linux\/"},"author":{"name":"pschatzmann","@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"headline":"Arduino 2.0: RP2040 Debugging with Linux","datePublished":"2023-06-01T17:33:02+00:00","dateModified":"2024-09-28T09:51:04+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2023\/06\/01\/rp2040-debugging-in-arduino-with-linux\/"},"wordCount":330,"commentCount":0,"publisher":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"image":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2023\/06\/01\/rp2040-debugging-in-arduino-with-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2023\/06\/rp2040-debug.jpg","articleSection":["Arduino"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pschatzmann.ch\/home\/2023\/06\/01\/rp2040-debugging-in-arduino-with-linux\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pschatzmann.ch\/home\/2023\/06\/01\/rp2040-debugging-in-arduino-with-linux\/","url":"https:\/\/www.pschatzmann.ch\/home\/2023\/06\/01\/rp2040-debugging-in-arduino-with-linux\/","name":"Arduino 2.0: RP2040 Debugging with Linux - Phil Schatzmann","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2023\/06\/01\/rp2040-debugging-in-arduino-with-linux\/#primaryimage"},"image":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2023\/06\/01\/rp2040-debugging-in-arduino-with-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2023\/06\/rp2040-debug.jpg","datePublished":"2023-06-01T17:33:02+00:00","dateModified":"2024-09-28T09:51:04+00:00","breadcrumb":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2023\/06\/01\/rp2040-debugging-in-arduino-with-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pschatzmann.ch\/home\/2023\/06\/01\/rp2040-debugging-in-arduino-with-linux\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pschatzmann.ch\/home\/2023\/06\/01\/rp2040-debugging-in-arduino-with-linux\/#primaryimage","url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2023\/06\/rp2040-debug.jpg","contentUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2023\/06\/rp2040-debug.jpg","width":800,"height":600},{"@type":"BreadcrumbList","@id":"https:\/\/www.pschatzmann.ch\/home\/2023\/06\/01\/rp2040-debugging-in-arduino-with-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pschatzmann.ch\/home\/"},{"@type":"ListItem","position":2,"name":"Arduino 2.0: RP2040 Debugging with Linux"}]},{"@type":"WebSite","@id":"https:\/\/www.pschatzmann.ch\/home\/#website","url":"https:\/\/www.pschatzmann.ch\/home\/","name":"Phil Schatzmann Consulting","description":"","publisher":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pschatzmann.ch\/home\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1","name":"pschatzmann","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","contentUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","width":305,"height":305,"caption":"pschatzmann"},"logo":{"@id":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png"}}]}},"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/5687","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/comments?post=5687"}],"version-history":[{"count":35,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/5687\/revisions"}],"predecessor-version":[{"id":6336,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/5687\/revisions\/6336"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media\/5689"}],"wp:attachment":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media?parent=5687"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/categories?post=5687"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/tags?post=5687"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}