<?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 MicrocontrollersのトピックRe: Serial Protocol - KL25Z - KSDK</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Serial-Protocol-KL25Z-KSDK/m-p/1665663#M65151</link>
    <description>&lt;P&gt;Are you using the FRDM-KL25Z board or a circuit board designed by yourself? Have you measured the UART0_TX pin with a logic analyzer or oscilloscope, and can you observe the waveform output? Is there any difference in the relevant register values when you debug the official example and your new project? For example: UART0, SIM_SOPT2, SIM_SOPT5, SIM_SCGC4, PORTx_PCRn[MUX] registers.&lt;/P&gt;</description>
    <pubDate>Thu, 08 Jun 2023 00:35:59 GMT</pubDate>
    <dc:creator>Robin_Shen</dc:creator>
    <dc:date>2023-06-08T00:35:59Z</dc:date>
    <item>
      <title>Serial Protocol - KL25Z - KSDK</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Serial-Protocol-KL25Z-KSDK/m-p/1660175#M65128</link>
      <description>&lt;P&gt;Dear all, I'm trying to send the word "Hello World" to the serial port using the KSDK library.&lt;/P&gt;&lt;P&gt;I'm following the official documentation, but I'm having trouble finding the error.&lt;/P&gt;&lt;P&gt;I wrote the code below, but nothing is being sent. Could someone tell me what I'm doing wrong?&lt;/P&gt;&lt;LI-CODE lang="c"&gt;CLOCK_SYS_EnableUartClock(UART0_IDX);

uart_user_config_t uartConfig;
uart_state_t uartState;
uint8_t sourceBuff[19] = "\r\nHello World!\n\n\r";

uartConfig.baudRate = 115200;
uartConfig.bitCountPerChar = kUart8BitsPerChar;
uartConfig.parityMode = kUartParityDisabled;
uartConfig.stopBitCount = kUartOneStopBit;

OSA_Init();

UART_DRV_Init(UART0_IDX, &amp;amp;uartState, &amp;amp;uartConfig);
uint32_t byteCount = sizeof(sourceBuff);
UART_DRV_SendDataBlocking(UART0_IDX, sourceBuff, byteCount, 1);&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;Thank you very much!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 May 2023 19:30:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Serial-Protocol-KL25Z-KSDK/m-p/1660175#M65128</guid>
      <dc:creator>hmal</dc:creator>
      <dc:date>2023-05-30T19:30:00Z</dc:date>
    </item>
    <item>
      <title>Re: Serial Protocol - KL25Z - KSDK</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Serial-Protocol-KL25Z-KSDK/m-p/1660270#M65129</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;Please download &lt;A href="https://mcuxpresso.nxp.com/en/select" target="_self"&gt;MCUXpresso SDK&lt;/A&gt; for KL25Z, for example:&amp;nbsp;&lt;STRONG&gt;SDK_&lt;WBR /&gt;2.2.0_&lt;WBR /&gt;FRDM-KL25Z&lt;/STRONG&gt;. There are several UART examples.&lt;/P&gt;
&lt;P&gt;By the way, please note:&amp;nbsp;&lt;A href="https://community.nxp.com/t5/MCUXpresso-IDE-Knowledge-Base/MCUXpresso-IDE-and-Semihosting/ta-p/1116467" target="_self"&gt;MCUXpresso IDE and Semihosting&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Robin&lt;BR /&gt;-------------------------------------------------------------------------------&lt;BR /&gt;Note:&lt;BR /&gt;- If this post answers your question, please click the "Mark Correct" button. Thank you!&lt;/P&gt;
&lt;P&gt;- We are following threads for 7 weeks after the last post, later replies are ignored&lt;BR /&gt;Please open a new thread and refer to the closed one, if you have a related question at a later point in time.&lt;BR /&gt;-------------------------------------------------------------------------------&lt;/P&gt;</description>
      <pubDate>Wed, 31 May 2023 00:57:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Serial-Protocol-KL25Z-KSDK/m-p/1660270#M65129</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2023-05-31T00:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: Serial Protocol - KL25Z - KSDK</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Serial-Protocol-KL25Z-KSDK/m-p/1663733#M65144</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/57959"&gt;@Robin_Shen&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I consulted your reference and was able to identify several errors I was making. However, I still haven't been able to solve it. Please see the code below:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;uint8_t rxChar = 0;
	uint32_t byteCountBuff = 0;
	uint32_t uartSourceClock = 0;
	UART_Type * baseAddr = BOARD_DEBUG_UART_BASEADDR;

	CLOCK_SYS_EnableUartClock(BOARD_DEBUG_UART_INSTANCE);

	uartSourceClock = CLOCK_SYS_GetUartFreq(BOARD_DEBUG_UART_INSTANCE);

	UART_HAL_SetBaudRate(baseAddr, uartSourceClock, BOARD_DEBUG_UART_BAUD);
	UART_HAL_SetBitCountPerChar(baseAddr, kUart8BitsPerChar);
	UART_HAL_SetParityMode(baseAddr, kUartParityDisabled);
	UART_HAL_SetStopBitCount(baseAddr, kUartOneStopBit);

	UART_HAL_EnableTransmitter(baseAddr);
	UART_HAL_EnableReceiver(baseAddr);

	const char* message = "Teste\r\n";
	size_t messageLength = strlen(message);

	UART_HAL_SendDataPolling(baseAddr, (const uint8_t*)message, messageLength);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I believe I am making a mistake in the initialization because the examples I see on the internet use the functions &lt;/SPAN&gt;hardware_init()&lt;SPAN&gt; and &lt;/SPAN&gt;dbg_uart_init()&lt;SPAN&gt;, but I cannot use those resources. I need to resolve it using only the KSDK library.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks again!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2023 23:32:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Serial-Protocol-KL25Z-KSDK/m-p/1663733#M65144</guid>
      <dc:creator>hmal</dc:creator>
      <dc:date>2023-06-05T23:32:58Z</dc:date>
    </item>
    <item>
      <title>Re: Serial Protocol - KL25Z - KSDK</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Serial-Protocol-KL25Z-KSDK/m-p/1664086#M65145</link>
      <description>&lt;P&gt;If you have to use &lt;A href="https://www.nxp.com/design/designs/software-development-kit-for-kinetis-mcus:KINETIS-SDK" target="_self"&gt;KSDK&amp;nbsp;&lt;/A&gt;&lt;SPAN&gt;library,&lt;/SPAN&gt; then please refer to the examples:&lt;BR /&gt;C:\Freescale\KSDK_1.3.0\examples\frdmkl25z\demo_apps\hello_world&lt;BR /&gt;C:\Freescale\KSDK_1.3.0\examples\frdmkl25z\driver_examples\lpsci&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2023 08:01:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Serial-Protocol-KL25Z-KSDK/m-p/1664086#M65145</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2023-06-06T08:01:43Z</dc:date>
    </item>
    <item>
      <title>Re: Serial Protocol - KL25Z - KSDK</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Serial-Protocol-KL25Z-KSDK/m-p/1664582#M65148</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/57959"&gt;@Robin_Shen&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I studied the demo and attempted to reproduce it, following the documentation provided on the website:&amp;nbsp;&lt;A href="https://www.nxp.com/docs/en/reference-manual/KSDK12APIRM.pdf" target="_blank"&gt;https://www.nxp.com/docs/en/reference-manual/KSDK12APIRM.pdf&lt;/A&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;In the documentation, it states:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;1 - To initialize the LPSCI driver, call the LPSCI_DRV_Init() function and pass the instance number of the relevant LPSCI peripheral, memory for the run-time state structure, and a pointer to the user configuration structure. For example, to use LPSCI0 pass a value of 0 to the initialization function.&lt;/P&gt;&lt;P&gt;2 - Then, pass the memory for the run-time state structure and, finally, pass a user configuration structure of the type lpsci_user_config_t&lt;/P&gt;&lt;LI-CODE lang="c"&gt;lpsci_user_config_t lpsciConfig;
lpsciConfig.baudRate = 9600;
lpsciConfig.bitCountPerChar = kLpsci8BitsPerChar;
lpsciConfig.parityMode = kLpsciParityDisabled;
lpsciConfig.stopBitCount = kLpsciOneStopBit;&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;This example shows how to call the LPSCI_DRV_Init() function given the user configuration structure and the LPSCI instance 0.&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;uint32_t lpsciInstance = 0;
lpsci_state_t lpsciState; // user provides memory for the driver state structure
LPSCI_DRV_Init(lpsciInstance, &amp;amp;lpsciConfig, &amp;amp;lpsciState);&lt;/LI-CODE&gt;&lt;P&gt;For blocking transfer functions transmit and receive:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;uint8_t sourceBuff[26] ={0}; // sourceBuff is populated with desired data
uint8_t readBuffer[10] = {0}; // readBuffer is populated with LPSCI_DRV_ReceiveData function

uint32_t byteCount = sizeof(sourceBuff);
uint32_t rxRemainingSize = sizeof(readBuffer);

// for each use there, set timeout as "1"
// lpsciState is the run-time state. Pass in memory for this
// declared previously in the initialization chapter
LPSCI_DRV_SendDataBlocking(&amp;amp;lpsciState, sourceBuff, byteCount, 1); // function won’t return until transmit is complete
LPSCI_DRV_ReceiveDataBlocking(&amp;amp;lpsciState, readBuffer, 1, timeoutValue); //function won’t return until it receives all data&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;I tried to adapt the code as follows:&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;lpsci_user_config_t lpsciConfig;

lpsciConfig.baudRate = 115200;
lpsciConfig.bitCountPerChar = kLpsci8BitsPerChar;
lpsciConfig.parityMode = kLpsciParityDisabled;
lpsciConfig.stopBitCount = kLpsciOneStopBit;

uint32_t lpsciInstance = 0;
lpsci_state_t lpsciState;

LPSCI_DRV_Init(lpsciInstance, &amp;amp;lpsciConfig, &amp;amp;lpsciState);

uint8_t sourceBuff = 1;
uint32_t byteCount = sizeof(sourceBuff);

LPSCI_DRV_SendDataBlocking(&amp;amp;lpsciState, sourceBuff, byteCount, 1);&lt;/LI-CODE&gt;&lt;P&gt;However, I am still unable to send anything through the USB port.&lt;/P&gt;&lt;P&gt;I am using PuTTY to monitor the USB port.&lt;/P&gt;&lt;P&gt;Could you please advise me on what I might be doing wrong?&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you for the help and patience.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jun 2023 19:44:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Serial-Protocol-KL25Z-KSDK/m-p/1664582#M65148</guid>
      <dc:creator>hmal</dc:creator>
      <dc:date>2023-06-06T19:44:07Z</dc:date>
    </item>
    <item>
      <title>Re: Serial Protocol - KL25Z - KSDK</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Serial-Protocol-KL25Z-KSDK/m-p/1665663#M65151</link>
      <description>&lt;P&gt;Are you using the FRDM-KL25Z board or a circuit board designed by yourself? Have you measured the UART0_TX pin with a logic analyzer or oscilloscope, and can you observe the waveform output? Is there any difference in the relevant register values when you debug the official example and your new project? For example: UART0, SIM_SOPT2, SIM_SOPT5, SIM_SCGC4, PORTx_PCRn[MUX] registers.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 00:35:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Serial-Protocol-KL25Z-KSDK/m-p/1665663#M65151</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2023-06-08T00:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: Serial Protocol - KL25Z - KSDK</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Serial-Protocol-KL25Z-KSDK/m-p/1665674#M65152</link>
      <description>&lt;P&gt;I am using the KL25Z board connected to my computer through the OpenSDA port. I would like to read the message sent by the board on my computer through the USB port.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 00:53:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Serial-Protocol-KL25Z-KSDK/m-p/1665674#M65152</guid>
      <dc:creator>hmal</dc:creator>
      <dc:date>2023-06-08T00:53:58Z</dc:date>
    </item>
    <item>
      <title>Re: Serial Protocol - KL25Z - KSDK</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Serial-Protocol-KL25Z-KSDK/m-p/1665676#M65153</link>
      <description>&lt;P&gt;Does psci_polling work on your FRDM-KL25Z? If you can obersive signal on UART0_TX(J2.4) but did not receive information on&amp;nbsp;&lt;SPAN&gt;PuTTY&amp;nbsp;, then&amp;nbsp;you may need to check that the &lt;A href="https://www.pemicro.com/opensda/" target="_self"&gt;drivers&lt;/A&gt; for PEMicro are installed correctly and check the settings for PuTTY.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 01:05:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Serial-Protocol-KL25Z-KSDK/m-p/1665676#M65153</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2023-06-08T01:05:06Z</dc:date>
    </item>
    <item>
      <title>Re: Serial Protocol - KL25Z - KSDK</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Serial-Protocol-KL25Z-KSDK/m-p/1665687#M65154</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I believe the issue is not with the PEMicro driver because the Hello World example works perfectly. I think I'm forgetting to configure the ports or initialize some functionality on the board.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 01:31:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Serial-Protocol-KL25Z-KSDK/m-p/1665687#M65154</guid>
      <dc:creator>hmal</dc:creator>
      <dc:date>2023-06-08T01:31:51Z</dc:date>
    </item>
    <item>
      <title>Re: Serial Protocol - KL25Z - KSDK</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/Serial-Protocol-KL25Z-KSDK/m-p/1665744#M65155</link>
      <description>&lt;P&gt;So did you compare the difference in register values while debugging?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 02:44:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/Serial-Protocol-KL25Z-KSDK/m-p/1665744#M65155</guid>
      <dc:creator>Robin_Shen</dc:creator>
      <dc:date>2023-06-08T02:44:25Z</dc:date>
    </item>
  </channel>
</rss>

