<?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>topic Re: A problem connecting the KMS to a custom hardware in Kinetis Motor Suite</title>
    <link>https://community.nxp.com/t5/Kinetis-Motor-Suite/A-problem-connecting-the-KMS-to-a-custom-hardware/m-p/715695#M290</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have made all the necessary changes in the code.&amp;nbsp; Reducing the baud rate is a good suggestion. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I performed the UART0 to UART1&amp;nbsp;changes to a FRDM-KV31 and made all of the same changes you did in the code.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;in kms_hw.h&lt;BR /&gt;/**&lt;BR /&gt;* @&lt;SPAN style="text-decoration: underline;"&gt;def&lt;/SPAN&gt; KMS_UART&lt;BR /&gt;* @brief UART Instance used by KMS&lt;BR /&gt;*/&lt;BR /&gt;&lt;SPAN style="color: #7f0055; font-size: small;"&gt;&lt;STRONG&gt;#define&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt; KMS_UART (UART1)&lt;BR /&gt;&lt;/SPAN&gt;/**&lt;BR /&gt;* @&lt;SPAN style="text-decoration: underline;"&gt;def&lt;/SPAN&gt; KMS_UART_BAUDRATE&lt;BR /&gt;* @brief Default baud rate for KMS UART communication&lt;BR /&gt;*/&lt;BR /&gt;&lt;SPAN style="color: #7f0055; font-size: small;"&gt;&lt;STRONG&gt;#define&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt; KMS_UART_BAUDRATE (57600u)&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;In main The first step I took was to duplicate all of the UART0 interrupt handler and change to UART1. You can go back and remove the UART0 instances once all is working.&lt;/LI&gt;&lt;LI&gt;in the NVIC_Enable calls I did the same and simply added UART1 calls.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used the MCUXpresso pins tool to add the PTE0 and PTE1 UART pin mux initializations. without removing UART0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One thing I also did during debug is used a terminal program (like Putty) to verify my UART hardware connections.&amp;nbsp; I set up the terminal interface, tied TX to RX and held down the upper case U.&amp;nbsp; If you do this then you should see the U echoed back to the terminal.&amp;nbsp; I also put a scope on the looped back hardware pins to verify the signal.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once that was verified I closed putty and was able to connect the KMS GUI to UART1_TX and UART1_RX on PTE0 and PTE1 with no problems at 57600.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 05 Feb 2018 21:02:13 GMT</pubDate>
    <dc:creator>philip_drake</dc:creator>
    <dc:date>2018-02-05T21:02:13Z</dc:date>
    <item>
      <title>A problem connecting the KMS to a custom hardware</title>
      <link>https://community.nxp.com/t5/Kinetis-Motor-Suite/A-problem-connecting-the-KMS-to-a-custom-hardware/m-p/715693#M288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, I have a problem connecting the KMS to a custom hardware.&lt;/P&gt;&lt;P&gt;I'm working on a Windows 10(32 bit) machine, using the MCUXpresso v10.1.0 and KMS 1.2.0.&lt;BR /&gt;I do the flash programming and debugging using a SEGGER j-link debug probe.&lt;/P&gt;&lt;P&gt;My control board incorporates a 64-pin MKV31F128VLHP MCU.&lt;BR /&gt;(the device is really KMS-enabled, at least each attempt to read the highest 8 kbytes results in an error)&lt;BR /&gt;My serial communication interface uses UART1(PTE0, PTE1) pins instead of (default) UART0.&lt;/P&gt;&lt;P&gt;I created a KMS-project, selecting a PMSM motor, KV3x family, High Voltage platform, Sensorless Velocity control, MCUXpresso IDE.&lt;BR /&gt;Then I followed all the relevant steps depicted in AN5254 "Adapting KMS for Custom Hardware.pdf" Rev. 3, 11/2017:&lt;BR /&gt; - created an SDK for the MKV31F128xxx10 and added it to the IDE&lt;BR /&gt; - changed the MCU Part Number as described&lt;BR /&gt; - in "kms_hw.h" changed UART0 to UART1&lt;BR /&gt; - in "pin_mux.h" changed the UART-pins definitions to correspond to the actually used ones(pins 1 and 2&amp;nbsp;- PTE0, PTE1) for UART1&lt;/P&gt;&lt;P&gt;Then I tried to connect the KMS to the MCU board. This did not succeed.&lt;BR /&gt;I received the following message from KMS:&lt;BR /&gt; -----------------------------------------------------------------------&lt;BR /&gt; An issue has prevented communication with target&lt;BR /&gt; MCU: The ping message was not acknowledged.&lt;BR /&gt; Please check physical connection to MCU, then&lt;BR /&gt; navigate to Project menu to configure communication&lt;BR /&gt; port.&lt;BR /&gt; ----------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;Further, I looked inside "main.c" and found there some calls and function declarations/definitions, explicitly referring to UART0:&lt;BR /&gt; - FAST void UART0_RX_TX_IRQHandler(void) which overwrites the WEAK void UART0_RX_TX_IRQHandler(void)&lt;BR /&gt; - void UART0_ERR_IRQHandler(void)&lt;BR /&gt; - NVIC_EnableIRQ(UART0_RX_TX_IRQn);&lt;BR /&gt; - NVIC_SetPriority(UART0_RX_TX_IRQn, 15);&lt;BR /&gt; - NVIC_EnableIRQ(UART0_ERR_IRQn);&lt;BR /&gt; - NVIC_SetPriority(UART0_ERR_IRQn, 15);&lt;/P&gt;&lt;P&gt;So, I changed 'UART0' with 'UART1' in all these instances.&lt;BR /&gt;Now, when trying a connection with KMS, I started receiving interrupts on UART1,&lt;/P&gt;&lt;P&gt;but still no reply from the MCU followed.&lt;BR /&gt;The above message still appeared.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I stopped the program on a breakpoint and looked at the contents of the UART buffer "uart_rx_buf[]".&lt;BR /&gt;Each time a connection was tried, there were 20 bytes collected in uart_rx_buf[], looking like that:&lt;BR /&gt; 27, 2, 36, 2, 0, 17, 2, 180, 27, 3, 27, 36, 0, 2, 0, 17, 2, 180, 27, 3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The "uart_rx_head" and "uart_rx_tail" values wee both equal to 20.&lt;BR /&gt;However, the "uart_tx_head" and "uart_tx_tail" values stayed 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, what I see is that the Remote Debug Agent invokes the "uart_rx_byte()" method&lt;BR /&gt;and fills the "uart_rx_buf[]", but "uart_tx_byte()" is never called.&lt;BR /&gt;I verified that by setting the optimization level to "O0" for the "rda_uart_kv3" module and adding a breakpoint inside uart_tx_byte().&lt;BR /&gt;The breakpoint was never hit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, as far as I can tell, all hardware-related communication problems are fixed, the RDA receives data from the KMS but it still does not answer to a ping.&lt;/P&gt;&lt;P&gt;Can you, please give me an advice in this situation? What shall I do to make the MCU reply?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Feb 2018 13:55:19 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Motor-Suite/A-problem-connecting-the-KMS-to-a-custom-hardware/m-p/715693#M288</guid>
      <dc:creator>rumenpasev</dc:creator>
      <dc:date>2018-02-05T13:55:19Z</dc:date>
    </item>
    <item>
      <title>Re: A problem connecting the KMS to a custom hardware</title>
      <link>https://community.nxp.com/t5/Kinetis-Motor-Suite/A-problem-connecting-the-KMS-to-a-custom-hardware/m-p/715694#M289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rumen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a key difference between UART0 and UART1 on the KV31 microcontrollers.&amp;nbsp; UART0 has a much deeper FIFO as compared to the other UARTs.&amp;nbsp; (Section 3.9.3.1 of the KV31F128 Ref Manual)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Take a look at the variable&amp;nbsp;uartRxOverRunCounts in the watch window or debugger.&amp;nbsp; My guess is that you are getting a lot of these errors and are triggering the UART1_ERR_IRQHandler.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are a couple options:&lt;/P&gt;&lt;P&gt;1. reduce the baud rate for serial communications (KMS_UART_BAUDRATE in ksm_hw.h)&lt;/P&gt;&lt;P&gt;2. adjust the ISR priority for UART1&lt;/P&gt;&lt;P&gt;3. setup the DMA so that it will handle buffering the incoming data over the serial link&lt;/P&gt;&lt;P&gt;4. modify the hardware to use UART0&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Feb 2018 16:57:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Motor-Suite/A-problem-connecting-the-KMS-to-a-custom-hardware/m-p/715694#M289</guid>
      <dc:creator>linestream-adam</dc:creator>
      <dc:date>2018-02-05T16:57:15Z</dc:date>
    </item>
    <item>
      <title>Re: A problem connecting the KMS to a custom hardware</title>
      <link>https://community.nxp.com/t5/Kinetis-Motor-Suite/A-problem-connecting-the-KMS-to-a-custom-hardware/m-p/715695#M290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You have made all the necessary changes in the code.&amp;nbsp; Reducing the baud rate is a good suggestion. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I performed the UART0 to UART1&amp;nbsp;changes to a FRDM-KV31 and made all of the same changes you did in the code.&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;in kms_hw.h&lt;BR /&gt;/**&lt;BR /&gt;* @&lt;SPAN style="text-decoration: underline;"&gt;def&lt;/SPAN&gt; KMS_UART&lt;BR /&gt;* @brief UART Instance used by KMS&lt;BR /&gt;*/&lt;BR /&gt;&lt;SPAN style="color: #7f0055; font-size: small;"&gt;&lt;STRONG&gt;#define&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt; KMS_UART (UART1)&lt;BR /&gt;&lt;/SPAN&gt;/**&lt;BR /&gt;* @&lt;SPAN style="text-decoration: underline;"&gt;def&lt;/SPAN&gt; KMS_UART_BAUDRATE&lt;BR /&gt;* @brief Default baud rate for KMS UART communication&lt;BR /&gt;*/&lt;BR /&gt;&lt;SPAN style="color: #7f0055; font-size: small;"&gt;&lt;STRONG&gt;#define&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: small;"&gt; KMS_UART_BAUDRATE (57600u)&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;In main The first step I took was to duplicate all of the UART0 interrupt handler and change to UART1. You can go back and remove the UART0 instances once all is working.&lt;/LI&gt;&lt;LI&gt;in the NVIC_Enable calls I did the same and simply added UART1 calls.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used the MCUXpresso pins tool to add the PTE0 and PTE1 UART pin mux initializations. without removing UART0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One thing I also did during debug is used a terminal program (like Putty) to verify my UART hardware connections.&amp;nbsp; I set up the terminal interface, tied TX to RX and held down the upper case U.&amp;nbsp; If you do this then you should see the U echoed back to the terminal.&amp;nbsp; I also put a scope on the looped back hardware pins to verify the signal.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Once that was verified I closed putty and was able to connect the KMS GUI to UART1_TX and UART1_RX on PTE0 and PTE1 with no problems at 57600.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Feb 2018 21:02:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Motor-Suite/A-problem-connecting-the-KMS-to-a-custom-hardware/m-p/715695#M290</guid>
      <dc:creator>philip_drake</dc:creator>
      <dc:date>2018-02-05T21:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: A problem connecting the KMS to a custom hardware</title>
      <link>https://community.nxp.com/t5/Kinetis-Motor-Suite/A-problem-connecting-the-KMS-to-a-custom-hardware/m-p/715696#M291</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Many thanks for the prompt reply, Adam! I really appreciate it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was aware of the difference between UART0 and UART1 (the absence of a FIFO in the latter), but I didn't assess&amp;nbsp;the impact of it in the particular case. The problem was really solved by reducing the UART1 baud rate (as suggested), this obviously follows from the fact that the RDA performs as a background task.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my board design, UART1 was preferred over UART0 solely because it is the uart-interface used by the Kinetis Flashloader. Actually, the board was intended for other purposes(not KMS), but I found it appropriate for assessing the LineStream software.&lt;/P&gt;&lt;P&gt;One small note: in "flash_config.c" un-commenting the "#define KMS_MASS_ERASE_DISABLED" line(as recommended), combined with changing the part type to CPU_MKV31F128VLxx, produces a building error due to redundant braces in lines 67, 68.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks once more and have a good day!&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Feb 2018 06:52:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Motor-Suite/A-problem-connecting-the-KMS-to-a-custom-hardware/m-p/715696#M291</guid>
      <dc:creator>rumenpasev</dc:creator>
      <dc:date>2018-02-06T06:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: A problem connecting the KMS to a custom hardware</title>
      <link>https://community.nxp.com/t5/Kinetis-Motor-Suite/A-problem-connecting-the-KMS-to-a-custom-hardware/m-p/715697#M292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the helpful response and the test you have done, Philip.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As you may have noticed in&amp;nbsp;the reply to the first comment to my post, the problem appeared to be in the communication speed, too high for a port without a FIFO and served from the backgound. And, of course, preserving the UART0-related calls and definitions was not really needed, just the baudrate reduction.&lt;/P&gt;&lt;P&gt;For the time being, I've established connection between the KMS and the control board, now the harder part of the adaptation work lies ahead.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks once more and have a good day! &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 06 Feb 2018 07:22:21 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Motor-Suite/A-problem-connecting-the-KMS-to-a-custom-hardware/m-p/715697#M292</guid>
      <dc:creator>rumenpasev</dc:creator>
      <dc:date>2018-02-06T07:22:21Z</dc:date>
    </item>
  </channel>
</rss>

