<?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>i.MX RT Crossover MCUsのトピックRe: sdphost, blhost on Mac OSX</title>
    <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/sdphost-blhost-on-Mac-OSX/m-p/1163919#M10412</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;a little older post, still it can help someone. The blhost 2.6.2 available here &lt;A href="https://www.nxp.com/webapp/Download?colCode=blhost_2.6.2&amp;amp;appType=license" target="_blank"&gt;https://www.nxp.com/webapp/Download?colCode=blhost_2.6.2&amp;amp;appType=license&lt;/A&gt; has the issue with Mac OS fixed, sources are included.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Libor&lt;/P&gt;</description>
    <pubDate>Wed, 07 Oct 2020 12:54:52 GMT</pubDate>
    <dc:creator>liborukropec</dc:creator>
    <dc:date>2020-10-07T12:54:52Z</dc:date>
    <item>
      <title>sdphost, blhost on Mac OSX</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/sdphost-blhost-on-Mac-OSX/m-p/998204#M5997</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Neither the provided binaries nor binaries built from source from the SDK for sdphost and&amp;nbsp;blhost&amp;nbsp;would run on my Mac (OS 10.15.3 Catalina). &amp;nbsp;I tracked the issue down to a pair of bugs in the function get_string_property_utf8 in middleware/mcu-boot/tools/src/blfwk/src/hid-mac.c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;buf isn't cleared at the start of the function and CFStringGetBytes doesn't terminate the set of bytes pulled so buf may have stale data on return (if, for example, on a previous call a longer string was returned). &amp;nbsp;This is corrected by clearing buf with memset at the start of the function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also,&amp;nbsp;range.length passed to CFStringGetBytes must not exceed the length of the string. &amp;nbsp;See Apple's documentation:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;A class="link-titled" href="https://developer.apple.com/documentation/corefoundation/1543006-cfstringgetbytes" title="https://developer.apple.com/documentation/corefoundation/1543006-cfstringgetbytes"&gt;CFStringGetBytes(_:_:_:_:_:_:_:_:) - Core Foundation | Apple Developer Documentation&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is fixed by setting range.length with CFStringGetLength(str) instead of the length of buf. &amp;nbsp;On my Mac both applications abort&amp;nbsp;with an invalid argument exception without this fix. &amp;nbsp;With it all is well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The corrected function is below. &amp;nbsp;I hope this will save someone some time and that it eventually works its way back into the source tree.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;-Andrew&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;static int get_string_property_utf8(IOHIDDeviceRef device, CFStringRef prop, char *buf, size_t len)&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; &amp;nbsp; CFStringRef str = IOHIDDeviceGetProperty(device, prop);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; memset(buf,0,len);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; if (str)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; {&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CFRange range;&lt;BR /&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;range.location = 0;&lt;BR /&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;range.length = CFStringGetLength(str);&lt;BR /&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;CFIndex used_buf_len;&lt;BR /&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;CFStringGetBytes(str, range, kCFStringEncodingUTF8, (char)'?', FALSE, (UInt8 *)buf, len, &amp;amp;used_buf_len);&lt;BR /&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;return used_buf_len;&lt;BR /&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;}&lt;BR /&gt; &lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;return 0;&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Feb 2020 04:53:49 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/sdphost-blhost-on-Mac-OSX/m-p/998204#M5997</guid>
      <dc:creator>apines</dc:creator>
      <dc:date>2020-02-21T04:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: sdphost, blhost on Mac OSX</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/sdphost-blhost-on-Mac-OSX/m-p/998205#M5998</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="color: #51626f; background-color: #ffffff;"&gt;get_string_property in the same file should also have the same change.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Feb 2020 14:23:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/sdphost-blhost-on-Mac-OSX/m-p/998205#M5998</guid>
      <dc:creator>apines</dc:creator>
      <dc:date>2020-02-24T14:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: sdphost, blhost on Mac OSX</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/sdphost-blhost-on-Mac-OSX/m-p/998206#M5999</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Andrew,&lt;/P&gt;&lt;P&gt;we already fixed it internally, probably it will take some time to get into the latest SDKs builds. I recommend also in both functions to change&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;from&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;buf[len - 1] = 0x00000000;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;to&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;buf[used_buf_len] = 0x00000000;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Libor&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 11 Mar 2020 13:23:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/sdphost-blhost-on-Mac-OSX/m-p/998206#M5999</guid>
      <dc:creator>liborukropec</dc:creator>
      <dc:date>2020-03-11T13:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: sdphost, blhost on Mac OSX</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/sdphost-blhost-on-Mac-OSX/m-p/998207#M6000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Any luck pushing this new SDK out (or just a new release of the sdphost and related binaries)? The flashloader archives available for download for both the RT1050 and the RT1060 are from 2018(!)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 Jul 2020 16:22:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/sdphost-blhost-on-Mac-OSX/m-p/998207#M6000</guid>
      <dc:creator>wj_ueos</dc:creator>
      <dc:date>2020-07-07T16:22:28Z</dc:date>
    </item>
    <item>
      <title>Re: sdphost, blhost on Mac OSX</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/sdphost-blhost-on-Mac-OSX/m-p/1163919#M10412</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;a little older post, still it can help someone. The blhost 2.6.2 available here &lt;A href="https://www.nxp.com/webapp/Download?colCode=blhost_2.6.2&amp;amp;appType=license" target="_blank"&gt;https://www.nxp.com/webapp/Download?colCode=blhost_2.6.2&amp;amp;appType=license&lt;/A&gt; has the issue with Mac OS fixed, sources are included.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Libor&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2020 12:54:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/sdphost-blhost-on-Mac-OSX/m-p/1163919#M10412</guid>
      <dc:creator>liborukropec</dc:creator>
      <dc:date>2020-10-07T12:54:52Z</dc:date>
    </item>
  </channel>
</rss>

