<?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>Using IAR, nRF52810, and C++</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/55877/using-iar-nrf52810-and-c</link><description>I am trying to get a project working with a main.cpp file, some C++ modules, and the 16.0.0 SDK using the IAR compiler. However, using the nrfx/mdk startup files, it never actually reaches my main function, instead hanging before it even reaches it. If</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 20 Dec 2019 17:44:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/55877/using-iar-nrf52810-and-c" /><item><title>RE: Using IAR, nRF52810, and C++</title><link>https://devzone.nordicsemi.com/thread/226641?ContentTypeID=1</link><pubDate>Fri, 20 Dec 2019 17:44:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ceae1355-7461-4e13-a3ab-44729958eeb8</guid><dc:creator>Mojo</dc:creator><description>&lt;p&gt;Yes, you can handle all the interrupt in C++. &amp;nbsp;No need to change anything.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;See the UART implementations&amp;nbsp;&lt;a href="https://github.com/IOsonata/IOsonata/blob/master/ARM/Nordic/src/uart_nrf5x.cpp"&gt;github.com/.../uart_nrf5x.cpp&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It is full C++ object oriented design&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using IAR, nRF52810, and C++</title><link>https://devzone.nordicsemi.com/thread/226639?ContentTypeID=1</link><pubDate>Fri, 20 Dec 2019 17:40:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:328e5842-11d2-43a2-bed2-7bcf72c5e6cf</guid><dc:creator>Definitely Confused</dc:creator><description>&lt;p&gt;It was, but I wanted to be able to define some interrupt handlers in C++, so I just went down the full CPP startup file route.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using IAR, nRF52810, and C++</title><link>https://devzone.nordicsemi.com/thread/226638?ContentTypeID=1</link><pubDate>Fri, 20 Dec 2019 17:38:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5915148c-c198-4050-bbbb-5d45fd785948</guid><dc:creator>Mojo</dc:creator><description>&lt;p&gt;Well, the library I pointed to you have done all that for you already. &amp;nbsp;The only thing you need to do is replace the Vector_xxx.c for the 810, only the vector table and the linker script with correct memory size.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using IAR, nRF52810, and C++</title><link>https://devzone.nordicsemi.com/thread/226637?ContentTypeID=1</link><pubDate>Fri, 20 Dec 2019 17:35:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:550cbad0-ca48-4e45-b101-0fdd22a83e3c</guid><dc:creator>Definitely Confused</dc:creator><description>&lt;p&gt;So I&amp;#39;m gonna answer my own question. Big thanks to &lt;a href="https://devzone.nordicsemi.com/members/mojo"&gt;Mojo&lt;/a&gt; for pointing me in the direction he went.&lt;/p&gt;
&lt;p&gt;Basically, you have to define your own startup file because you need to make sure the interrupts are provided with C linkage (so they need &amp;#39;extern &amp;quot;C&amp;quot;&amp;#39; prefixed before the forward declarations. If you do this you can also overwrite any of the handlers you want with a class and static member functions if you so desire.&lt;/p&gt;
&lt;p&gt;The starting point I used is here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.iar.com/support/tech-notes/compiler/cortex-m-interrupt-vector-in-c-ewarm-6.21/"&gt;https://www.iar.com/support/tech-notes/compiler/cortex-m-interrupt-vector-in-c-ewarm-6.21/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I also used the latest (as of posting) CMSIS v5.6.0 compiler abstraction macros to make things more portable. They define things like __PROGRAM_START and __VECTOR_TABLE so you can write one startup file and use it for any compiler (in theory).&lt;/p&gt;
&lt;p&gt;Overall a bit of a pain, but hopefully this helps people so they don&amp;#39;t have to go through this hunting.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using IAR, nRF52810, and C++</title><link>https://devzone.nordicsemi.com/thread/226627?ContentTypeID=1</link><pubDate>Fri, 20 Dec 2019 15:51:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac9c9cc0-2c35-4d7d-acd5-7d85a4bc491f</guid><dc:creator>Mojo</dc:creator><description>&lt;p&gt;Can&amp;#39;t say if that is the cause. &amp;nbsp;I don&amp;#39;t like assembly and never used nordic startup code. &amp;nbsp;I used code from that library in multiple projects on different mcu. &amp;nbsp;Moving from one mcu to another with minimum code changes. Code reuse works great in&amp;nbsp;C++.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using IAR, nRF52810, and C++</title><link>https://devzone.nordicsemi.com/thread/226624?ContentTypeID=1</link><pubDate>Fri, 20 Dec 2019 15:43:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88a43374-99fe-4c93-9894-590e8f1b3d7f</guid><dc:creator>Definitely Confused</dc:creator><description>&lt;p&gt;So I had been using the iar_startup_nrf52810.s file as my vector table. Do you think that might be the cause of the problem? &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Using IAR, nRF52810, and C++</title><link>https://devzone.nordicsemi.com/thread/226620?ContentTypeID=1</link><pubDate>Fri, 20 Dec 2019 15:11:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:750031da-ecdb-4985-868a-679b272d2f2c</guid><dc:creator>Mojo</dc:creator><description>&lt;p&gt;This library has the full C++ supports with startup code that works with any Cortex MCU. &amp;nbsp;Although it has implementations for 832 and 840, you can easily adapt it for 810 with minimum changes. It&amp;#39;s all C/C+++ code no assembly&lt;/p&gt;
&lt;p&gt;linker script :&amp;nbsp;&lt;a href="https://github.com/IOsonata/IOsonata/tree/master/ARM/Nordic/nRF52/nRF52832/ldscript"&gt;https://github.com/IOsonata/IOsonata/tree/master/ARM/Nordic/nRF52/nRF52832/ldscript&lt;/a&gt;&amp;nbsp;modify this for the 810&lt;/p&gt;
&lt;p&gt;startup generic to all Cortex MCU :&amp;nbsp;&lt;a href="https://github.com/IOsonata/IOsonata/blob/master/ARM/src/ResetEntry.c"&gt;github.com/.../ResetEntry.c&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;832 implementation specific :&amp;nbsp;&lt;a href="https://github.com/IOsonata/IOsonata/tree/master/ARM/Nordic/nRF52/nRF52832/lib/src"&gt;https://github.com/IOsonata/IOsonata/tree/master/ARM/Nordic/nRF52/nRF52832/lib/src&lt;/a&gt;&amp;nbsp;modify this for the 810&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>