<?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>Compile nRF5 SDK with C++</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/56975/compile-nrf5-sdk-with-c</link><description>Hi, 
 I am programming for an nRF52840 chip. I am using Keil uVision with the ARM compiler in version 5. My codebase is in C++, this is why I have the Misc control &amp;quot;--cpp&amp;quot;. 
 I want to use the uart library. But I do get compile errors, such as: 
 static</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 27 Jan 2020 11:07:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/56975/compile-nrf5-sdk-with-c" /><item><title>RE: Compile nRF5 SDK with C++</title><link>https://devzone.nordicsemi.com/thread/231086?ContentTypeID=1</link><pubDate>Mon, 27 Jan 2020 11:07:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ca155766-e373-4344-abd1-6e435e264ffd</guid><dc:creator>Kai</dc:creator><description>&lt;p&gt;I was able to compile the nrf5 SDK with the ARM compiler 6 instead of 5, the errors with &amp;#39;vfpcc&amp;#39; resolve, if the CMSIS Core is selected as Run-Time Environment in Keil. My setup used some default CMSIS, which I do not know where it is located.&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compile nRF5 SDK with C++</title><link>https://devzone.nordicsemi.com/thread/231035?ContentTypeID=1</link><pubDate>Mon, 27 Jan 2020 08:40:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22b259ef-59f9-4682-ba82-2225576672c1</guid><dc:creator>Kai</dc:creator><description>&lt;p&gt;Thanks, but this does not solve the problem. Even, if I only use the nrfx_uart.c, which requires nrfx_prs.c, I get the errors mentioned above. Compiling nrfx_prs.c fails with the following errors:&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;C:\nordic\sdk_16.0\modules\nrfx\drivers\src\prs\nrfx_prs.c(69): error:  #29: expected an expression
  PRS_BOX_DEFINE(0)
C:\nordic\sdk_16.0\modules\nrfx\drivers\src\prs\nrfx_prs.c(69): error:  #29: expected an expression
  PRS_BOX_DEFINE(0)
C:\nordic\sdk_16.0\modules\nrfx\drivers\src\prs\nrfx_prs.c(72): error:  #29: expected an expression
  PRS_BOX_DEFINE(1)
C:\nordic\sdk_16.0\modules\nrfx\drivers\src\prs\nrfx_prs.c(72): error:  #29: expected an expression
  PRS_BOX_DEFINE(1)
C:\nordic\sdk_16.0\modules\nrfx\drivers\src\prs\nrfx_prs.c(75): error:  #29: expected an expression
  PRS_BOX_DEFINE(2)
C:\nordic\sdk_16.0\modules\nrfx\drivers\src\prs\nrfx_prs.c(75): error:  #29: expected an expression
  PRS_BOX_DEFINE(2)
C:\nordic\sdk_16.0\modules\nrfx\drivers\src\prs\nrfx_prs.c(78): error:  #29: expected an expression
  PRS_BOX_DEFINE(3)
C:\nordic\sdk_16.0\modules\nrfx\drivers\src\prs\nrfx_prs.c(78): error:  #29: expected an expression
  PRS_BOX_DEFINE(3)
C:\nordic\sdk_16.0\modules\nrfx\drivers\src\prs\nrfx_prs.c(81): error:  #29: expected an expression
  PRS_BOX_DEFINE(4)
C:\nordic\sdk_16.0\modules\nrfx\drivers\src\prs\nrfx_prs.c(81): error:  #29: expected an expression
  PRS_BOX_DEFINE(4)
C:\nordic\sdk_16.0\modules\nrfx\drivers\src\prs\nrfx_prs.c: 0 warnings, 10 errors&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Compile nRF5 SDK with C++</title><link>https://devzone.nordicsemi.com/thread/230941?ContentTypeID=1</link><pubDate>Fri, 24 Jan 2020 19:11:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64820a06-3f32-413e-af59-9f07c2481f21</guid><dc:creator>Patrick</dc:creator><description>&lt;p&gt;You need to explicitly initialize the struct members in the correct order rather than using the initialization macros. It should look something like the following:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;static nrf_drv_uart_t uart = {
    .inst_idx = 0, 
    .uarte = { 
        .p_reg = NRF_UARTE0, 
        .drv_inst_idx = NRFX_UARTE0_INST_IDX
        }
    }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Hopefully I&amp;#39;m close, the UART driver has a couple more layers of macros that need to be expanded than the other peripherals I&amp;#39;ve worked with.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>