{"id":405,"date":"2015-03-15T22:03:57","date_gmt":"2015-03-15T21:03:57","guid":{"rendered":"http:\/\/www.sevenwatt.com\/main\/?page_id=405"},"modified":"2016-01-10T14:15:56","modified_gmt":"2016-01-10T13:15:56","slug":"picos-arm-lpc810-swd-jtag-with-nucleo-stm32","status":"publish","type":"page","link":"https:\/\/www.sevenwatt.com\/main\/picos-arm\/picos-arm-lpc810-swd-jtag-with-nucleo-stm32\/","title":{"rendered":"Picos ARM &#8211; LPC810 SWD \/ JTAG with Nucleo STM32"},"content":{"rendered":"<p>All LPC8xx microcontrollers have a SWD \/ JTAG interface for HW debugging. Even the tiny LPC810 has the SWD interface. Using it comes at a cost. A cost of two of the usable 6 pins. So there are still 4 remaining pins for your project! In this guide, the LPC810 SWD will be connected to the SWD interface of a competing brand demo boad. The Nucleo F103RB STM32 board. This board provides a on-board STLINK-V2-1 USB interface. Actually the board has two STM32 chips. One is the target of the demo board, and the other is the STLINK. This STLINK-V2-1 can be used as programmer and debugger for &#8220;external&#8221; targets. Even of foreign brands like NXP&#8217;s LPC-series. I am not the first to do similar things. In the reference some articles can be found that served as inspiration. The inexpensive nucleo boards can be obtained from companies like Farnell[5] and Conrad[6]<\/p>\n<p>How to use the setup is described in article <em><a title=\"Picos ARM \u2013 HW Debugger in Eclipse CDT\" href=\"\/\/www.sevenwatt.com\/main\/picos-arm\/picos-arm-hw-debugger-in-eclipse-cdt\/\" target=\"_blank\">Picos ARM &#8211; HW debugger in Eclipse CDT<\/a>.<\/em><\/p>\n<h3>Preparing the STLink Interface<\/h3>\n<p><a href=\"\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2015\/03\/20150315_123443-CN2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-415 alignleft\" src=\"\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2015\/03\/20150315_123443-CN2.jpg\" alt=\"20150315_123443 - CN2\" width=\"436\" height=\"216\" srcset=\"https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2015\/03\/20150315_123443-CN2.jpg 436w, https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2015\/03\/20150315_123443-CN2-300x149.jpg 300w\" sizes=\"auto, (max-width: 436px) 100vw, 436px\" \/><\/a>Remove the two jumpers from CN2, and place them at the two outermost empty jumper pins marked CN11 and CN12, as indicated by the orange box and lines. See also Figure 7, section 5.2.3 of ref [3].<\/p>\n<p>This all there is to prepare the Nucleo STM32 for its STLink-V2-1 functionality.<\/p>\n<p>&nbsp;<\/p>\n<h3><\/h3>\n<h3>\u00a0Connecting the SWD interface<\/h3>\n<p><a href=\"\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2015\/03\/20150315_123443.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-417\" src=\"\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2015\/03\/20150315_123443.jpg\" alt=\"20150315_123443\" width=\"1175\" height=\"720\" srcset=\"https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2015\/03\/20150315_123443.jpg 1175w, https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2015\/03\/20150315_123443-300x184.jpg 300w, https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2015\/03\/20150315_123443-1024x627.jpg 1024w\" sizes=\"auto, (max-width: 1175px) 100vw, 1175px\" \/><\/a><\/p>\n<p><a href=\"\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2015\/03\/LPC810-Nucleo-SWD-wiring.png\"><img loading=\"lazy\" decoding=\"async\" class=\" size-full wp-image-413 alignright\" src=\"\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2015\/03\/LPC810-Nucleo-SWD-wiring.png\" alt=\"LPC810-Nucleo-SWD-wiring\" width=\"652\" height=\"389\" srcset=\"https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2015\/03\/LPC810-Nucleo-SWD-wiring.png 652w, https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2015\/03\/LPC810-Nucleo-SWD-wiring-300x179.png 300w\" sizes=\"auto, (max-width: 652px) 100vw, 652px\" \/><\/a>Connect according to the diagram. The green line is not a 3.3V power supply to the LPC810, but it informs the Nucleo SWD interface on the operating voltage of the target.<\/p>\n<p>The LPC810 requires to be powered through another source (red wire).<\/p>\n<p>SWCLK (yellow) and SWDIO (orange) are the actual debug signals.<\/p>\n<p>Nucleo SWD nSRST remains unconnected.<\/p>\n<p>The Nucleo STM32 provides two lines for serial communication of the target. In this example the dashed blue line connects serial output of the LPC810 to the RX pin of the Nucloe STLink. The LPC810 can now print information on the console of the SerialUSB COM port of the Nucleo.<\/p>\n<p>&nbsp;<\/p>\n<p>On the Nucleo and LPC810 the wires are connected like this:<\/p>\n<p><a href=\"\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2015\/03\/20150315_124151.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-410\" src=\"\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2015\/03\/20150315_124151.jpg\" alt=\"20150315_124151\" width=\"1080\" height=\"720\" srcset=\"https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2015\/03\/20150315_124151.jpg 1080w, https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2015\/03\/20150315_124151-300x200.jpg 300w, https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2015\/03\/20150315_124151-1024x683.jpg 1024w\" sizes=\"auto, (max-width: 1080px) 100vw, 1080px\" \/><\/a><a href=\"\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2015\/03\/20150315_1242231.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-420\" src=\"\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2015\/03\/20150315_1242231.jpg\" alt=\"20150315_124223\" width=\"716\" height=\"569\" srcset=\"https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2015\/03\/20150315_1242231.jpg 716w, https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2015\/03\/20150315_1242231-300x238.jpg 300w\" sizes=\"auto, (max-width: 716px) 100vw, 716px\" \/><\/a><\/p>\n<h3>\u00a0Connecting the Serial TX\/RX interface<\/h3>\n<p>In this example pin 2 of the LPC810 is configured to be serial TX pin. The program running on the LPC810 can now print to console:<\/p>\n<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">int main () {\r\n    \/* Pin Assign 8 bit Configuration *\/\r\n    \/* U0_TXD *\/\r\n    LPC_SWM-&gt;PINASSIGN&#x5B;0] = 0xffffff04UL; \/\/ only connect TXD\r\n\r\n    \/* Pin Assign 1 bit Configuration *\/\r\n    \/* SWCLK *\/\r\n    \/* SWDIO *\/\r\n    \/* RESET *\/\r\n    LPC_SWM-&gt;PINENABLE0 = 0xffffffb3UL;\r\n\r\n    uart0Init(115200);\r\n    SysTick_Config(12000000\/1000); \/\/ 1000 Hz\r\n    printf(&quot;Hello from LPC%3x Blink\\n&quot;, LPC_SYSCON-&gt;DEVICE_ID&gt;&gt;4);\r\n}<\/pre>\n<p><a href=\"\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2015\/03\/20150315_124602.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-412\" src=\"\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2015\/03\/20150315_124602.jpg\" alt=\"20150315_124602\" width=\"1060\" height=\"720\" srcset=\"https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2015\/03\/20150315_124602.jpg 1060w, https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2015\/03\/20150315_124602-300x204.jpg 300w, https:\/\/www.sevenwatt.com\/main\/wp-content\/uploads\/2015\/03\/20150315_124602-1024x696.jpg 1024w\" sizes=\"auto, (max-width: 1060px) 100vw, 1060px\" \/><\/a><\/p>\n<h3>References<\/h3>\n<ol>\n<li><a href=\"http:\/\/fabooh.com\/2014\/02\/28\/cortex-m0-swd-debugging-on-the-cheap\/\" target=\"_blank\">cortex-m0+ SWD debugging on the cheap<\/a><\/li>\n<li><a href=\"http:\/\/www.nxp.com\/documents\/user_manual\/UM10601.pdf\" target=\"_blank\">UM10601 LPC8xx User Manual<\/a><\/li>\n<li><a href=\"http:\/\/www.st.com\/st-web-ui\/static\/active\/en\/resource\/technical\/document\/user_manual\/DM00105823.pdf\" target=\"_blank\">UM1724 User Manual Nucleo STM32 Boards<\/a><\/li>\n<li><a href=\"http:\/\/www.micromouseonline.com\/2014\/01\/05\/mini-st-linkv2-programmer\/\" target=\"_blank\">Build a mini ST-LINK\/V2 programmer\/debugger for the STM32<\/a><\/li>\n<li><a href=\"http:\/\/uk.farnell.com\/stmicroelectronics\/nucleo-f411re\/dev-board-stm32f411re-cortex-m4\/dp\/2433469\" target=\"_blank\">Farnell Nucleo F411RE STM32<\/a><\/li>\n<li><a href=\"http:\/\/www.conrad.de\/ce\/de\/product\/1172442\/Nucleo-Entwicklungsboard-fuer-STM32-Microcontroller-STMicroelectronics-NUCLEO-F103RB\" target=\"_blank\">Conrad Nucleo F103RB STM32<\/a><\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>All LPC8xx microcontrollers have a SWD \/ JTAG interface for HW debugging. Even the tiny LPC810 has the SWD interface. Using it comes at a cost. A cost of two of the usable 6 pins. So there are still 4 remaining pins for your project! In this guide, the LPC810 SWD will be connected to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":409,"parent":186,"menu_order":0,"comment_status":"open","ping_status":"open","template":"","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"class_list":["post-405","page","type-page","status-publish","has-post-thumbnail","hentry"],"_links":{"self":[{"href":"https:\/\/www.sevenwatt.com\/main\/wp-json\/wp\/v2\/pages\/405","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sevenwatt.com\/main\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.sevenwatt.com\/main\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.sevenwatt.com\/main\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sevenwatt.com\/main\/wp-json\/wp\/v2\/comments?post=405"}],"version-history":[{"count":14,"href":"https:\/\/www.sevenwatt.com\/main\/wp-json\/wp\/v2\/pages\/405\/revisions"}],"predecessor-version":[{"id":583,"href":"https:\/\/www.sevenwatt.com\/main\/wp-json\/wp\/v2\/pages\/405\/revisions\/583"}],"up":[{"embeddable":true,"href":"https:\/\/www.sevenwatt.com\/main\/wp-json\/wp\/v2\/pages\/186"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.sevenwatt.com\/main\/wp-json\/wp\/v2\/media\/409"}],"wp:attachment":[{"href":"https:\/\/www.sevenwatt.com\/main\/wp-json\/wp\/v2\/media?parent=405"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}