<?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中的主题 K64 custom freedom bootloader with RTS support (RS485)</title>
    <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-custom-freedom-bootloader-with-RTS-support-RS485/m-p/604675#M35596</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've been working with the freedom bootloader on the FRDM-K64F board (UART1), and all worked well. I've now changed the FRDM board to my custom board (the RX,TX pins of the freedom_bootloader code did not change, as in the FRDM board I also changed to UART1 and it worked fine). I'm working with half duplex RS485.&lt;/P&gt;&lt;P&gt;I cannot connect with the KinetisFlashTool. I'm guessing the reason is my custom board is working with half duplex RS485. As such, I need to enable the RTS of the chip, just as I did with&amp;nbsp;my application on this board:&lt;/P&gt;&lt;P&gt;UART1-&amp;gt;MODEM |= UART_MODEM_TXRTSPOL(1);&lt;BR /&gt; UART1-&amp;gt;MODEM |= UART_MODEM_TXRTSE(1);&lt;/P&gt;&lt;P&gt;My problem is I don't know where to put these 2 lines in the freedom_bootloader code. If placed in the wrong place (I guess before the UART is init) there's a hard fault.&lt;/P&gt;&lt;P&gt;I've found this function:&amp;nbsp;&lt;EM&gt;scuart_poll_for_activity&lt;/EM&gt;, but don't know if this is the correct place.&amp;nbsp;&lt;/P&gt;&lt;P style="color: #222222; background-color: #ffffff; font-size: 12.8px;"&gt;&lt;SPAN style="font-size: 15px;"&gt;When I click 'Connect' in the GUI of Kinetis FLash Tool, there's an autoBaudRate function which get interrupted, in which the baud rate is calculated (counts the transitions of some signal, I guess), then it goes to the UART configuarion function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #222222; background-color: #ffffff; font-size: 12.8px;"&gt;&lt;SPAN style="font-size: 15px;"&gt;In my board the&amp;nbsp;autoBaudRate function is not called, which leads me to the conclusion it is somehow connected to the RS485 half duplex issue?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Mar 2017 14:36:15 GMT</pubDate>
    <dc:creator>roymessinger</dc:creator>
    <dc:date>2017-03-21T14:36:15Z</dc:date>
    <item>
      <title>K64 custom freedom bootloader with RTS support (RS485)</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-custom-freedom-bootloader-with-RTS-support-RS485/m-p/604675#M35596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've been working with the freedom bootloader on the FRDM-K64F board (UART1), and all worked well. I've now changed the FRDM board to my custom board (the RX,TX pins of the freedom_bootloader code did not change, as in the FRDM board I also changed to UART1 and it worked fine). I'm working with half duplex RS485.&lt;/P&gt;&lt;P&gt;I cannot connect with the KinetisFlashTool. I'm guessing the reason is my custom board is working with half duplex RS485. As such, I need to enable the RTS of the chip, just as I did with&amp;nbsp;my application on this board:&lt;/P&gt;&lt;P&gt;UART1-&amp;gt;MODEM |= UART_MODEM_TXRTSPOL(1);&lt;BR /&gt; UART1-&amp;gt;MODEM |= UART_MODEM_TXRTSE(1);&lt;/P&gt;&lt;P&gt;My problem is I don't know where to put these 2 lines in the freedom_bootloader code. If placed in the wrong place (I guess before the UART is init) there's a hard fault.&lt;/P&gt;&lt;P&gt;I've found this function:&amp;nbsp;&lt;EM&gt;scuart_poll_for_activity&lt;/EM&gt;, but don't know if this is the correct place.&amp;nbsp;&lt;/P&gt;&lt;P style="color: #222222; background-color: #ffffff; font-size: 12.8px;"&gt;&lt;SPAN style="font-size: 15px;"&gt;When I click 'Connect' in the GUI of Kinetis FLash Tool, there's an autoBaudRate function which get interrupted, in which the baud rate is calculated (counts the transitions of some signal, I guess), then it goes to the UART configuarion function.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="color: #222222; background-color: #ffffff; font-size: 12.8px;"&gt;&lt;SPAN style="font-size: 15px;"&gt;In my board the&amp;nbsp;autoBaudRate function is not called, which leads me to the conclusion it is somehow connected to the RS485 half duplex issue?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Mar 2017 14:36:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-custom-freedom-bootloader-with-RTS-support-RS485/m-p/604675#M35596</guid>
      <dc:creator>roymessinger</dc:creator>
      <dc:date>2017-03-21T14:36:15Z</dc:date>
    </item>
    <item>
      <title>Re: K64 custom freedom bootloader with RTS support (RS485)</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-custom-freedom-bootloader-with-RTS-support-RS485/m-p/604676#M35597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Roy&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you want to use the RTS and/or CTS lines you need to create a driver to perform the Flow control communication, unfortunately, this driver is not implemented on KSDK, as you already got on this thread&amp;nbsp;&lt;/P&gt;&lt;H1 style="color: #646464; background-color: #ffffff; border: 0px; font-weight: 200; font-size: 2rem;"&gt;&lt;A _jive_internal="true" href="https://community.nxp.com/message/887836?commentID=887836#comment-887836"&gt;UART Flow control, K64&lt;/A&gt;&lt;/H1&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And also as I know the Kinetis Flash tool does not use the flow control.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Vicente&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Mar 2017 22:05:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-custom-freedom-bootloader-with-RTS-support-RS485/m-p/604676#M35597</guid>
      <dc:creator>vicentegomez</dc:creator>
      <dc:date>2017-03-24T22:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: K64 custom freedom bootloader with RTS support (RS485)</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-custom-freedom-bootloader-with-RTS-support-RS485/m-p/604677#M35598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Roy doesn't need HW Flow control. He just need the automatic RS485 mode in the MODEM register to be enabled so that semi-duplex RS485 operates.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;enable clocks to UART 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;UART1-&amp;gt;MODEM |= UART_MODEM_TXRTSPOL(1);&lt;BR /&gt; UART1-&amp;gt;MODEM |= UART_MODEM_TXRTSE(1);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;should work, &lt;SPAN style="text-decoration: underline;"&gt;before&lt;/SPAN&gt; the main UART initialisation.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Professional support for Kinetis: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Findex.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/index.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;Remote desktop one-on-one coaching: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fservices.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/services.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;Getting started to expert videos: &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fwww.youtube.com%2Fresults%3Fsearch_query%3Dutasker%2Bshorts" rel="nofollow" target="_blank"&gt;https://www.youtube.com/results?search_query=utasker+shorts&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Mar 2017 04:53:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-custom-freedom-bootloader-with-RTS-support-RS485/m-p/604677#M35598</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2017-03-25T04:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: K64 custom freedom bootloader with RTS support (RS485)</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-custom-freedom-bootloader-with-RTS-support-RS485/m-p/604678#M35599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&amp;nbsp;&lt;SPAN style="background-color: #ffffff; color: #5e89c1; font-weight: 500; font-size: 15px;"&gt;&lt;A class="jx-jive-macro-user" href="https://community.nxp.com/people/vicentegomez"&gt;vicentegomez&lt;/A&gt;‌&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Indeed, as Mark pointed out, I want to write to the MODEM registers to enable the HW control flow:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;UART1-&amp;gt;MODEM |= UART_MODEM_TXRTSPOL(1);&lt;/SPAN&gt;&lt;BR style="color: #51626f; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;UART1-&amp;gt;MODEM |= UART_MODEM_TXRTSE(1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;just as I did with my own application. If I do it before the clock is enabled to the UART1, I'm getting a hard fault.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 15px;"&gt;&lt;SPAN style="color: #222222; background-color: #ffffff;"&gt; I try to call the&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;UART_Init&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="color: #222222; background-color: #ffffff;"&gt;function in &lt;/SPAN&gt;&lt;SPAN style="color: #222222; background-color: #ffffff; font-size: 12.8px;"&gt;&lt;EM&gt;&lt;STRONG&gt;fsl_uart.c&lt;/STRONG&gt;&lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #222222; background-color: #ffffff;"&gt;, passing it with the correct values, but getting a &lt;/SPAN&gt;&lt;SPAN style="color: #222222; background-color: #ffffff; font-size: 12.8px;"&gt;&lt;EM&gt;kStatus_UART_BaudrateNotSupport &lt;/EM&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #222222; background-color: #ffffff;"&gt;return from the function and the UART is not init.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-size: 15px; background-color: #ffffff;"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #222222; font-size: 15px; background-color: #ffffff;"&gt;Roy&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 26 Mar 2017 07:08:15 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-custom-freedom-bootloader-with-RTS-support-RS485/m-p/604678#M35599</guid>
      <dc:creator>roymessinger</dc:creator>
      <dc:date>2017-03-26T07:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: K64 custom freedom bootloader with RTS support (RS485)</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-custom-freedom-bootloader-with-RTS-support-RS485/m-p/604679#M35600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Roy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Why don't you just add the clock enable before the MODEM register writes? I expect that this will solve the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;POWER_UP(4, SIM_SCGC4_UART1);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;UART1-&amp;gt;MODEM |= UART_MODEM_TXRTSPOL(1);&lt;/SPAN&gt;&lt;BR style="color: #51626f; background-color: #ffffff;" /&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;UART1-&amp;gt;MODEM |= UART_MODEM_TXRTSE(1);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #000000;"&gt;You just need to find the suitable initialisation routine in your own framework. In case of difficulties the following will do it:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #000000;"&gt;SIM_SCGC4 |= 0x800;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #000000;"&gt;or&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #000000;"&gt;*(volatile unsigned long *)(0x40048034) |= 0x800;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mark&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 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&gt;Professional support for Kinetis: &lt;/SPAN&gt;&lt;A class="" data-content-finding="Community" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Findex.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/index.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;Remote desktop one-on-one coaching: &lt;/SPAN&gt;&lt;A class="" data-content-finding="Community" href="https://community.nxp.com/external-link.jspa?url=http%3A%2F%2Fwww.utasker.com%2Fservices.html" rel="nofollow" target="_blank"&gt;http://www.utasker.com/services.html&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;Getting started to expert videos: &lt;/SPAN&gt;&lt;A class="" data-content-finding="Community" href="https://community.nxp.com/external-link.jspa?url=https%3A%2F%2Fwww.youtube.com%2Fresults%3Fsearch_query%3Dutasker%2Bshorts" rel="nofollow" target="_blank"&gt;https://www.youtube.com/results?search_query=utasker+shorts&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 26 Mar 2017 13:16:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-custom-freedom-bootloader-with-RTS-support-RS485/m-p/604679#M35600</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2017-03-26T13:16:34Z</dc:date>
    </item>
    <item>
      <title>Re: K64 custom freedom bootloader with RTS support (RS485)</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-custom-freedom-bootloader-with-RTS-support-RS485/m-p/604680#M35601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Thanks. I've just tried it, but it doesn't work (doesn't go to hardfault but not working).&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's a pitty the remote update does not support half duplex RS485. I ought to know that before implementing my board.&lt;/P&gt;&lt;P&gt;Roy&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Mar 2017 14:52:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-custom-freedom-bootloader-with-RTS-support-RS485/m-p/604680#M35601</guid>
      <dc:creator>roymessinger</dc:creator>
      <dc:date>2017-03-27T14:52:01Z</dc:date>
    </item>
    <item>
      <title>Re: K64 custom freedom bootloader with RTS support (RS485)</title>
      <link>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-custom-freedom-bootloader-with-RTS-support-RS485/m-p/604681#M35602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Roy&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it doesn't work it may be that the UART initialisation is clearing the mode as a part of its procedure. You can see this by checking the MODEM register state before and after the initialisation: before it should have your value; after it may be gone. If this is the case search for the code that clears it and simply comment the line out.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It is not possible that it can't work - it is simply a case of controlling the code to do what you want it to do.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;P.S. I expect that you can deactivate the Auto-Baud part because the PC tool works at a fixed Baud rate anyway. It can be set to match this.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;P.P.S As I mentioned a few times before you could have done this with the uTasker project in a couple of hours and have been finished several weeks ago. Rather than giving tips I could have solved any issues for you and if you are working professionally saved you presumably a few thousand Dollars in working rates (or whoever is paying you for your time).&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 27 Mar 2017 15:09:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Microcontrollers/K64-custom-freedom-bootloader-with-RTS-support-RS485/m-p/604681#M35602</guid>
      <dc:creator>mjbcswitzerland</dc:creator>
      <dc:date>2017-03-27T15:09:34Z</dc:date>
    </item>
  </channel>
</rss>

