<?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: problem writting 2d arrays into SD card in Kinetis Design Studio</title>
    <link>https://community.nxp.com/t5/Kinetis-Design-Studio/problem-writting-2d-arrays-into-SD-card/m-p/438557#M4028</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if the array is one or two (or more) dimensional, really should not matter.&lt;/P&gt;&lt;P&gt;Anway, what you have pasted will not compile anyway, I think you wanted to have this:&lt;/P&gt;&lt;P&gt; FAT1_f_printf(&amp;amp;fs,"%d,",Ringbuf[0][0]);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //random garbage is being written to file here.&lt;/P&gt;&lt;P&gt;The other thing to check: is your code warning-free?&lt;/P&gt;&lt;P&gt;Make sure you have included "Fat1.h" before using any function of it, especially functions with open argument lists.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 16 May 2015 11:36:43 GMT</pubDate>
    <dc:creator>BlackNight</dc:creator>
    <dc:date>2015-05-16T11:36:43Z</dc:date>
    <item>
      <title>problem writting 2d arrays into SD card</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/problem-writting-2d-arrays-into-SD-card/m-p/438554#M4025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey guys,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am having some problem writing 2D arrays into SD card.&lt;/P&gt;&lt;P&gt;Please consider the following example:&lt;/P&gt;&lt;P&gt;[code]&lt;/P&gt;&lt;P&gt;int16 Ringbuf[5][2] = { {0,0}, {1,2}, {2,4}, {3,6},{4,8}};&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt; FAT1_f_printf(&amp;amp;fs,"%d,",Ringbuf[0,0);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //random garbage is being written to file here.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[/code]&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea why this is happening?&lt;/P&gt;&lt;P&gt;I am using MK60MOVLQF15 CPU&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Arun&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 May 2015 10:14:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/problem-writting-2d-arrays-into-SD-card/m-p/438554#M4025</guid>
      <dc:creator>arunkumar1989</dc:creator>
      <dc:date>2015-05-16T10:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: problem writting 2d arrays into SD card</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/problem-writting-2d-arrays-into-SD-card/m-p/438555#M4026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Arun,&lt;/P&gt;&lt;P&gt;I think I have not really used that printf() function.&lt;/P&gt;&lt;P&gt;printf() uses a lot of stack, make sure you have plenty stack space allocated.&lt;/P&gt;&lt;P&gt;Then, %d is for integer, probably 32bit on your microcontroller.&lt;/P&gt;&lt;P&gt;Use %hd instead (see &lt;A href="http://www.cplusplus.com/reference/cstdio/printf/" title="http://www.cplusplus.com/reference/cstdio/printf/"&gt;printf - C++ Reference&lt;/A&gt; ).&lt;/P&gt;&lt;P&gt;Maybe this explains what is happening.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope this helps,&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 May 2015 10:41:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/problem-writting-2d-arrays-into-SD-card/m-p/438555#M4026</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2015-05-16T10:41:18Z</dc:date>
    </item>
    <item>
      <title>Re: problem writting 2d arrays into SD card</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/problem-writting-2d-arrays-into-SD-card/m-p/438556#M4027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;no luck so far ,single dimensional arrays are working correctly,my problem is with 2D arrays,the manual also has no examples with 2D examples are given,is there any way around this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://elm-chan.org/fsw/ff/en/printf.html" title="http://elm-chan.org/fsw/ff/en/printf.html"&gt;FatFs - f_printf&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 May 2015 11:17:34 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/problem-writting-2d-arrays-into-SD-card/m-p/438556#M4027</guid>
      <dc:creator>arunkumar1989</dc:creator>
      <dc:date>2015-05-16T11:17:34Z</dc:date>
    </item>
    <item>
      <title>Re: problem writting 2d arrays into SD card</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/problem-writting-2d-arrays-into-SD-card/m-p/438557#M4028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if the array is one or two (or more) dimensional, really should not matter.&lt;/P&gt;&lt;P&gt;Anway, what you have pasted will not compile anyway, I think you wanted to have this:&lt;/P&gt;&lt;P&gt; FAT1_f_printf(&amp;amp;fs,"%d,",Ringbuf[0][0]);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //random garbage is being written to file here.&lt;/P&gt;&lt;P&gt;The other thing to check: is your code warning-free?&lt;/P&gt;&lt;P&gt;Make sure you have included "Fat1.h" before using any function of it, especially functions with open argument lists.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Erich&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 May 2015 11:36:43 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/problem-writting-2d-arrays-into-SD-card/m-p/438557#M4028</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2015-05-16T11:36:43Z</dc:date>
    </item>
    <item>
      <title>Re: problem writting 2d arrays into SD card</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/problem-writting-2d-arrays-into-SD-card/m-p/438558#M4029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The warning at that line is this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Description&amp;nbsp;&amp;nbsp;&amp;nbsp; Resource&amp;nbsp;&amp;nbsp;&amp;nbsp; Path&amp;nbsp;&amp;nbsp;&amp;nbsp; Location&amp;nbsp;&amp;nbsp;&amp;nbsp; Type&lt;/P&gt;&lt;P&gt;left-hand operand of comma expression has no effect [-Wunused-value] passing argument 1 of 'f_printf' from incompatible pointer type [enabled by default]&amp;nbsp;&amp;nbsp;&amp;nbsp; sdcard.c&amp;nbsp;&amp;nbsp;&amp;nbsp; /sdcard_150_v2/Sources&amp;nbsp;&amp;nbsp;&amp;nbsp; line 55&amp;nbsp;&amp;nbsp;&amp;nbsp; C/C++ Problem&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 May 2015 12:22:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/problem-writting-2d-arrays-into-SD-card/m-p/438558#M4029</guid>
      <dc:creator>arunkumar1989</dc:creator>
      <dc:date>2015-05-16T12:22:35Z</dc:date>
    </item>
    <item>
      <title>Re: problem writting 2d arrays into SD card</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/problem-writting-2d-arrays-into-SD-card/m-p/438559#M4030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So is fs really of type FIL?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 May 2015 12:33:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/problem-writting-2d-arrays-into-SD-card/m-p/438559#M4030</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2015-05-16T12:33:27Z</dc:date>
    </item>
    <item>
      <title>Re: problem writting 2d arrays into SD card</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/problem-writting-2d-arrays-into-SD-card/m-p/438560#M4031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes sir it is.&lt;/P&gt;&lt;P&gt;I am attaching the .c file for your reference.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what i am getting in the file:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;536805384,&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 May 2015 12:42:42 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/problem-writting-2d-arrays-into-SD-card/m-p/438560#M4031</guid>
      <dc:creator>arunkumar1989</dc:creator>
      <dc:date>2015-05-16T12:42:42Z</dc:date>
    </item>
    <item>
      <title>Re: problem writting 2d arrays into SD card</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/problem-writting-2d-arrays-into-SD-card/m-p/438561#M4032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Change&lt;/P&gt;&lt;P&gt;FAT1_f_printf(&amp;amp;fs,"%d,",Ring[0,1]);&lt;/P&gt;&lt;P&gt;to&lt;/P&gt;&lt;P&gt;FAT1_f_printf(&amp;amp;fs,"%hd,",Ring[0][1]);&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 May 2015 14:09:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/problem-writting-2d-arrays-into-SD-card/m-p/438561#M4032</guid>
      <dc:creator>BlackNight</dc:creator>
      <dc:date>2015-05-16T14:09:11Z</dc:date>
    </item>
    <item>
      <title>Re: problem writting 2d arrays into SD card</title>
      <link>https://community.nxp.com/t5/Kinetis-Design-Studio/problem-writting-2d-arrays-into-SD-card/m-p/438562#M4033</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes ,a silly typo from me ,thanks that did the trick.&lt;/P&gt;&lt;P&gt;Thanks a lot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;AK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 May 2015 04:16:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Kinetis-Design-Studio/problem-writting-2d-arrays-into-SD-card/m-p/438562#M4033</guid>
      <dc:creator>arunkumar1989</dc:creator>
      <dc:date>2015-05-18T04:16:11Z</dc:date>
    </item>
  </channel>
</rss>

