<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Kinetis Software Development KitのトピックRe: UART0 initialization problem in KSDK V2.0</title>
    <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/UART0-initialization-problem-in-KSDK-V2-0/m-p/629336#M6677</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Xiangjun,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The KL27 may have the "lpuart" function, but it's not the same name in KL26. In KL26 family, it's named "lpsci".&lt;/P&gt;&lt;P&gt;Anyway, thank you for your effort of trying to help me in this issue.&lt;/P&gt;&lt;P&gt;Have a nice day!&lt;/P&gt;&lt;P&gt;-Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 27 Dec 2016 17:13:15 GMT</pubDate>
    <dc:creator>danieltruong</dc:creator>
    <dc:date>2016-12-27T17:13:15Z</dc:date>
    <item>
      <title>UART0 initialization problem in KSDK V2.0</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/UART0-initialization-problem-in-KSDK-V2-0/m-p/629332#M6673</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm using KDS 3.2.0 along with KSDK v2.0 and I'm having a&amp;nbsp;trouble with programming the UART0 channel&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;. The microcontroller is&amp;nbsp;&lt;SPAN&gt;MKL26Z256VLL4.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;Unlike the UART1 and UART2 channels which I don't have any problem accessing them via API library functions (KSDK 2.0), I just can't use the same library with UART0 because&amp;nbsp;the base address is&amp;nbsp;defined at 0 instead of&amp;nbsp;&lt;SPAN&gt;0x4006A000. As a result, I got a crash when the following API function was called:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #800000;"&gt;&lt;EM style="background-color: #ffffff;"&gt;static UART_Type *const s_uartBases[] = UART_BASE_PTRS;&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #993300;"&gt;&lt;EM&gt;uint32_t UART_GetInstance(UART_Type *base)&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #993300;"&gt;&lt;EM&gt;{&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #993300;"&gt;&lt;EM&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;uint32_t instance;&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #993300;"&gt;&lt;EM&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;uint32_t uartArrayCount = (sizeof(s_uartBases) / sizeof(s_uartBases[0]));&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #993300;"&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;/* Find the instance index from base address mappings. */&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #993300;"&gt;&lt;EM&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;for (instance = 0; instance &amp;lt; uartArrayCount; instance++)&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #993300;"&gt;&lt;EM&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #993300;"&gt;&lt;EM&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if (s_uartBases[instance] == base)&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #993300;"&gt;&lt;EM&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #993300;"&gt;&lt;EM&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;break;&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #993300;"&gt;&lt;EM&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #993300;"&gt;&lt;EM&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #993300;"&gt;&lt;EM&gt;assert(instance &amp;lt; uartArrayCount);&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #993300;"&gt;&lt;EM&gt;return instance;&lt;/EM&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="color: #993300;"&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When called, "base" was passed in as&amp;nbsp;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;0x4006A000. In the for loop, the if statement expects a match at the 1st "instance" value . However, when instance=0,&amp;nbsp;s_uartBases[0] = 0 instead of&amp;nbsp;0x4006A000 (see &lt;SPAN style="background-color: #ffffff;"&gt;UART_BASE_PTRS definition below)&lt;/SPAN&gt;&lt;EM style="color: #993300;"&gt;.&lt;/EM&gt; So there was no match&lt;EM style="color: #993300;"&gt;.&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;Here is an excerpt from the MKL26Z4.h file:&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;#define UART0_BASE (0x4006A000u)&lt;BR /&gt;#define UART0 ((UART0_Type *)UART0_BASE)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;#define UART1_BASE (0x4006B000u)&lt;BR /&gt;#define UART1 ((UART_Type *)UART1_BASE)&lt;BR /&gt;#define UART2_BASE (0x4006C000u)&lt;BR /&gt;#define UART2 ((UART_Type *)UART2_BASE)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;#define UART_BASE_ADDRS { &lt;SPAN style="color: #ff0000;"&gt;&lt;STRONG&gt;0u&lt;/STRONG&gt;&lt;/SPAN&gt;, UART1_BASE, UART2_BASE }&lt;BR /&gt;#define UART_BASE_PTRS { &lt;STRONG style="color: #ff0000;"&gt;(UART_Type *)0u&lt;/STRONG&gt;, UART1, UART2 }&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;I guess my project was still somehow set up with a FRDM-XXX board in mind (which reserves UART0 for a dedicated OpenSDA channel as a debug console). Thus the base address was re-routed to 0, but I'm not so sure if this is the case.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;Can someone please help me shed some lights on this problem?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;Daniel&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2016 00:26:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/UART0-initialization-problem-in-KSDK-V2-0/m-p/629332#M6673</guid>
      <dc:creator>danieltruong</dc:creator>
      <dc:date>2016-12-21T00:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: UART0 initialization problem in KSDK V2.0</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/UART0-initialization-problem-in-KSDK-V2-0/m-p/629333#M6674</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;The KL26 has three UART modules:LPUART0, LPUART1 and UART2, in SDK2.0, there is lpuart example and uart example and correspondind drivers. So the SDK2.0 see lpuart and uart as two modules.&lt;/P&gt;&lt;P&gt;Hope it can help you&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;XiangJun Rong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2016 06:47:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/UART0-initialization-problem-in-KSDK-V2-0/m-p/629333#M6674</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2016-12-21T06:47:27Z</dc:date>
    </item>
    <item>
      <title>Re: UART0 initialization problem in KSDK V2.0</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/UART0-initialization-problem-in-KSDK-V2-0/m-p/629334#M6675</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Xiangjun,&lt;/P&gt;&lt;P&gt;I found there are no "lpuart" drivers in the driver directory of my project (fsl_xxx.c, fsl_xxx.h). There are fsl_uart.c and fsl_uart.h as far as uart-related names. Is it possible that I don't have the right SDK ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm pretty sure I downloaded SDK2.0 with the configuration set for the microcontroller MKL26Z256xxx as follows:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="Capture.PNG"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/10155i6A2329F4CB276A15/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I followed this link to downloaded and configured my SDK:&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://www.nxp.com/products/wireless-connectivity/2.4-ghz-wireless-solutions/bluetooth-low-energy-ble/software-development-kit-for-kinetis-mcus:KINETIS-SDK?&amp;amp;tab=Design_Tools_Tab" title="http://www.nxp.com/products/wireless-connectivity/2.4-ghz-wireless-solutions/bluetooth-low-energy-ble/software-development-kit-for-kinetis-mcus:KINETIS-SDK?&amp;amp;tab=Design_Tools_Tab"&gt;Software Development Kit for Kinetis MCUs|NXP&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and downloaded the 2nd item (Kinetis SDK Builder REV 2 &amp;amp; 1.3) in the Software Development Kit section.&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this is not the right one or there is something wrong in my setup, can you help me to correct it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks so much.&lt;/P&gt;&lt;P&gt;--Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Dec 2016 17:02:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/UART0-initialization-problem-in-KSDK-V2-0/m-p/629334#M6675</guid>
      <dc:creator>danieltruong</dc:creator>
      <dc:date>2016-12-21T17:02:33Z</dc:date>
    </item>
    <item>
      <title>Re: UART0 initialization problem in KSDK V2.0</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/UART0-initialization-problem-in-KSDK-V2-0/m-p/629335#M6676</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I attach the SDK driver for KL27, you can see the fsl_lpuart.c, hope it can help you&lt;/P&gt;&lt;P&gt;BR&lt;/P&gt;&lt;P&gt;XiangJun Rong&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/2242i7402732E8D36C0E4/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Dec 2016 02:52:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/UART0-initialization-problem-in-KSDK-V2-0/m-p/629335#M6676</guid>
      <dc:creator>xiangjun_rong</dc:creator>
      <dc:date>2016-12-26T02:52:42Z</dc:date>
    </item>
    <item>
      <title>Re: UART0 initialization problem in KSDK V2.0</title>
      <link>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/UART0-initialization-problem-in-KSDK-V2-0/m-p/629336#M6677</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Xiangjun,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The KL27 may have the "lpuart" function, but it's not the same name in KL26. In KL26 family, it's named "lpsci".&lt;/P&gt;&lt;P&gt;Anyway, thank you for your effort of trying to help me in this issue.&lt;/P&gt;&lt;P&gt;Have a nice day!&lt;/P&gt;&lt;P&gt;-Daniel&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Dec 2016 17:13:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Software-Development-Kit/UART0-initialization-problem-in-KSDK-V2-0/m-p/629336#M6677</guid>
      <dc:creator>danieltruong</dc:creator>
      <dc:date>2016-12-27T17:13:15Z</dc:date>
    </item>
  </channel>
</rss>

