<?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>conflicting types for &amp;#39;_putchar&amp;#39;</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/34784/conflicting-types-for-_putchar</link><description>Hello, 
 There&amp;#39;s a problem compiling the standard ble_app_uart_pca10040_s132 in Segger Embedded Studio for ARM V3.40. The UART example is straight out of nRF5_SDK_14.2.0_17b948a. 
 The exact same example can be compiled OK in SES V3.34. 
 The error message</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 07 Aug 2018 17:47:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/34784/conflicting-types-for-_putchar" /><item><title>RE: conflicting types for '_putchar'</title><link>https://devzone.nordicsemi.com/thread/143263?ContentTypeID=1</link><pubDate>Tue, 07 Aug 2018 17:47:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:82def330-4661-41a6-a256-a4e479672871</guid><dc:creator>madhu</dc:creator><description>&lt;p&gt;Hi , I observed the same issue with 3.40 SES and SDK_15... &lt;br /&gt;The above solution worked fine .&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: conflicting types for '_putchar'</title><link>https://devzone.nordicsemi.com/thread/137261?ContentTypeID=1</link><pubDate>Fri, 22 Jun 2018 14:39:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6375360-c60a-48ee-8589-34f63421cfc7</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks for pointing that out.&lt;/p&gt;
&lt;p&gt;At the time we did not have official SES support in the SDK, and so there was no release note recommendation available. Now that we do have official SES support the recommendation is to use the version for which the SDK release was tested and verified.&lt;/p&gt;
&lt;p&gt;If there is no statement of supported version then using the latest version is usually the best bet, and if that does not work you may find a solution through DevZone.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: conflicting types for '_putchar'</title><link>https://devzone.nordicsemi.com/thread/137253?ContentTypeID=1</link><pubDate>Fri, 22 Jun 2018 13:37:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f405e21-4993-4700-be90-0cf92bdd1aed</guid><dc:creator>awneil</dc:creator><description>[quote userid="8164" url="~/f/nordic-q-a/34784/conflicting-types-for-_putchar/137159"]we always recommend the versions listed in the release notes for the particular version of the SDK[/quote]
&lt;p&gt;Actually, you don&amp;#39;t - see:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/b/blog/posts/segger-embedded-studio-a-cross-platform-ide?CommentId=e94a1633-e277-45b1-93c1-abfaba042028"&gt;https://devzone.nordicsemi.com/b/blog/posts/segger-embedded-studio-a-cross-platform-ide?CommentId=e94a1633-e277-45b1-93c1-abfaba042028&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: conflicting types for '_putchar'</title><link>https://devzone.nordicsemi.com/thread/137159?ContentTypeID=1</link><pubDate>Thu, 21 Jun 2018 16:24:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:450ae898-cd95-4f9b-a73a-2d44d98d6470</guid><dc:creator>tesc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I would not go as far as to say that Segger broke anything. SDK 15.0.0 was tested and verified using SES 3.34, and so that is the version supported. We do not (and for obvious reasons can not) guarantee forwards compatibility with development tools, and hence we always recommend the versions listed in the release notes for the particular version of the SDK.&lt;/p&gt;
&lt;p&gt;However, things tend to work with other toolchain versions, and that is great! In the rare occasions when we get toolchain compatibility issues we do our best to provide a workaround, as was done by &lt;a href="https://devzone.nordicsemi.com/members/male"&gt;Martin Lesund&lt;/a&gt; in this thread. We do know that for some of you being able to run on a different version of the toolchain matters.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Terje&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: conflicting types for '_putchar'</title><link>https://devzone.nordicsemi.com/thread/137127?ContentTypeID=1</link><pubDate>Thu, 21 Jun 2018 14:00:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9f00dbc-85ab-4708-b788-16680ea983cb</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;I see.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So Segger broke it, then?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: conflicting types for '_putchar'</title><link>https://devzone.nordicsemi.com/thread/137115?ContentTypeID=1</link><pubDate>Thu, 21 Jun 2018 13:44:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03f9c907-14af-4341-85bf-f508db98a57f</guid><dc:creator>Martin Lesund</dc:creator><description>&lt;p&gt;Hi Andrew,&lt;/p&gt;
&lt;p&gt;You are correct.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Unfortunately, this change came with the new version of SES v3.&lt;strong&gt;40,&amp;nbsp;&lt;/strong&gt;and the SDKv15 was released before that update.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;From the &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.0.0%2Findex.html&amp;amp;cp=4_0_0" target="_blank" rel="noopener noreferrer"&gt;SDK v15 release notes&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;The following toolchains/devices have been used for testing and
verification:
- SES: SES 3.34
[...]&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You have two options:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Use the recommended version of SES v3.34.&lt;/li&gt;
&lt;li&gt;Use the solution posted in this thread.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best Regards,&lt;/p&gt;
&lt;p&gt;Martin L.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: conflicting types for '_putchar'</title><link>https://devzone.nordicsemi.com/thread/137098?ContentTypeID=1</link><pubDate>Thu, 21 Jun 2018 13:04:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f89af75a-8157-499c-ab5a-2b5a49d4a6c2</guid><dc:creator>awneil</dc:creator><description>[quote userid="66115" url="~/f/nordic-q-a/34784/conflicting-types-for-_putchar/133589"]I have confirmed that this issue is for SDK v14.2 with the new SES v3.40[/quote]
&lt;p&gt;And it is &lt;em&gt;&lt;strong&gt;still&lt;/strong&gt; &lt;/em&gt;a problem with SDK v15.0.0 !&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: conflicting types for '_putchar'</title><link>https://devzone.nordicsemi.com/thread/133776?ContentTypeID=1</link><pubDate>Tue, 29 May 2018 09:30:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39742538-14e8-479f-8e46-3c603b427997</guid><dc:creator>Martin Lesund</dc:creator><description>&lt;p&gt;Hi Winston,&lt;/p&gt;
&lt;p&gt;SEGGER has added the prototype for &lt;em&gt;_putchar()&lt;/em&gt; in &lt;em&gt;stdio.h,&amp;nbsp;&lt;/em&gt;but the declaration of this prototype has a different type of variable.&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;em&gt;See below:&amp;nbsp;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;stdio.h (line 773)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// Macro version of putchar.
#ifndef __PRINTF_TAG_PTR_DEFINED
#define __PRINTF_TAG_PTR_DEFINED
typedef struct __printf_tag *__printf_tag_ptr;
#endif
int __putchar(int, __printf_tag_ptr);
#define putchar(x) __putchar(x, 0)
&lt;/pre&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;&amp;nbsp;&lt;/h2&gt;
&lt;h2&gt;&lt;strong&gt;&lt;em&gt;Solution:&lt;/em&gt;&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;To solve this issue, we need to change the type of value in&lt;em&gt; __putchar&lt;/em&gt; to&lt;em&gt; __printf_tag_ptr&lt;/em&gt; instead of &lt;em&gt;FILE *.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;before: (retarget.c, line100)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;int __putchar(int ch, FILE * p_file)
{
    UNUSED_PARAMETER(p_file);

    UNUSED_VARIABLE(app_uart_put((uint8_t)ch));
    return ch;
}
&lt;/pre&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;after:&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;int __putchar(int ch, __printf_tag_ptr p_file)
{
    UNUSED_PARAMETER(p_file);

    UNUSED_VARIABLE(app_uart_put((uint8_t)ch));
    return ch;
}
&lt;/pre&gt;&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: conflicting types for '_putchar'</title><link>https://devzone.nordicsemi.com/thread/133589?ContentTypeID=1</link><pubDate>Mon, 28 May 2018 08:13:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7ecb1c13-3fb5-4f69-bceb-42bdf84af1c0</guid><dc:creator>Martin Lesund</dc:creator><description>&lt;p&gt;Hi Winston,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;I have confirmed that this issue is for SDK v14.2 with the new SES v3.40. I do not know the reason for this as for now.&lt;/p&gt;
&lt;p&gt;I would recommend you to &lt;a href="https://www.segger.com/downloads/embedded-studio/" target="_blank" rel="noopener noreferrer"&gt;downgrade SES to v3.34&lt;/a&gt;&amp;nbsp;or change to &lt;a href="http://developer.nordicsemi.com/nRF5_SDK/nRF5_SDK_v15.x.x/" target="_blank" rel="noopener noreferrer"&gt;SDK v15&lt;/a&gt;&amp;nbsp;(&lt;em&gt;where this issue does not appear).&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>