<?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>LPCXpresso IDE中的主题 Re: need an advice on using sd card</title>
    <link>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527157#M337</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by tabby on Fri Dec 09 16:33:30 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;sadly i am using version 0.2 and i receive the same error for every command except speed 1m. Any thoughts?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am sending the commands in this order:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;speed 1m&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;dir&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;log txt&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;speed 1m&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;speed 1m&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;write what&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;dir&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Jun 2016 01:31:22 GMT</pubDate>
    <dc:creator>lpcware</dc:creator>
    <dc:date>2016-06-16T01:31:22Z</dc:date>
    <item>
      <title>need an advice on using sd card</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527108#M288</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by dragilla on Wed Nov 23 03:38:24 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Hey,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want to use sd card in project to:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;a) read some configuration data (best would be from a text file)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;b) save data regularly from my 100hz loop (I want to save data say every 5 iterations of my loop)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;How long do you think will it take to write 100-200 bytes of data to an sd card directly (no fs)? How much longer will it take using petit fatfs for example?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Should I write the data from inside my loop or should I use interrupt maybe and write my data onto sd in a "free" time?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you have some examples of reading/writing to an sd card (with or without fs) using cmsis 1.3 they are greatly welcome here :)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-- &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Luke&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:30:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527108#M288</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:30:51Z</dc:date>
    </item>
    <item>
      <title>Re: need an advice on using sd card</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527109#M289</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Rob65 on Wed Nov 23 06:27:38 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Luke,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;you don't specify a controller ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I did some software for an lpc1754 that you can find &lt;/SPAN&gt;&lt;A href="http://http://bikealive.nl/index.php/lpc1754-test.html"&gt;on this web page&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There are two main projects:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[LIST]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[*]* usb_bootloader&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;contains a slight modified version of the secondary usb bootloader for the lpc1754 (based on the CodeRed version with LPCUSB)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[*]* usb_test&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;is a small test program that allows me to test some functions of my lpc1754 module. One of these tests is a directory read from an SD card.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/LIST]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The usb_test uses lib_efsl which is included as a separate project.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I'm still 'struggling' with FatFS.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Both should be more than fast enough to suite your needs (4 kB per second?)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,[INDENT]Rob&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;[/INDENT]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:30:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527109#M289</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: need an advice on using sd card</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527110#M290</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by dragilla on Wed Nov 23 07:04:22 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, sorry. I'm using lpc1769.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:30:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527110#M290</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:30:53Z</dc:date>
    </item>
    <item>
      <title>Re: need an advice on using sd card</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527111#M291</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Rob65 on Wed Nov 23 07:28:57 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: dragilla&lt;/STRONG&gt;&lt;BR /&gt;I'm using lpc1769.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Perfect,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;in that case you only have to change the MCU.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I've connected my SD card to the the SSP1 port:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;P0.6 = SSEL1 = SD card CS&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;P0.7 = SCK1 = SD SCLK&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;P0.8 = MISO1 = SD D_out&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;P0.9 = MOSI1 = SD D_in&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you also connect a USB connector (don't forget the 1.5 k pull up to D+) then you can also try the bootloader.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;O ... don't forget to re-enable the "Manage linker script" setting in the project properties (under C/C++ Buils -&amp;gt; Settings : MCU Linker -&amp;gt; Target) if you are testing the program stand alone.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Rob&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:30:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527111#M291</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:30:53Z</dc:date>
    </item>
    <item>
      <title>Re: need an advice on using sd card</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527112#M292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by dragilla on Wed Nov 23 11:17:41 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks a lot! I will test it as soon as I can. I don't use the usb and probably won't. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The 4kbytes/s should be enough. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;EFSL is also a file system supporting windows fat formatted cards, right?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I look at your code I will probably have more questions :)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:30:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527112#M292</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: need an advice on using sd card</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527113#M293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by dragilla on Thu Nov 24 09:48:42 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a 2gb card. This is what mount says under my workstation:&lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
/dev/mmcblk0p1 on /media/8F9B-9741 type vfat (rw,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks)
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;SPAN&gt;It won't mount under your program. It says: CARD init... failed with -1. Which would suggest it's not formatted as it should be.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have my sd card connected to spi1 as well. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This is what the spi_sdcard example (from cmsis1.3 library) returns: &lt;/SPAN&gt;&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD bgcolor="#cacaca"&gt; &lt;PRE&gt;
Please plug-in SD card!...Connected!
Initialize SD card in SPI mode...Done!
Reading SD card's CID register...Done!
Manufacture ID: 0x1F
Application ID: SK
Product name: SD2GB
Product revision: 001.000
Product serial number: 0xC30FE023
Manufacturing date: 009/2006********************************************************************************
&lt;/PRE&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What could be the reason?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;edit: no, wait, -1 means if_initInterface failed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The sd_Init funtion returns &amp;lt;0&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-- &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Luke&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:30:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527113#M293</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: need an advice on using sd card</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527114#M294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by dragilla on Thu Nov 24 10:00:21 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;sd_Init function returns -1 (file sd.c, line 54).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What does it mean?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:30:55 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527114#M294</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: need an advice on using sd card</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527115#M295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by dragilla on Thu Nov 24 11:26:23 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Damn I had my sd card connected spi2 (P0:17 - 15). Now it's connected as&amp;nbsp; you said: to p0.9-6 (spi1). Now I get -3 returned by sd_Init (line78 in&amp;nbsp; sd.c).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I get resp = 0x41, which is 'unknown error'. Just great :)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It says 'see SanDisk docs p5-13' - what SanDisk docs?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;edit: ... it works now - no Idea what has changed.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:30:56 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527115#M295</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: need an advice on using sd card</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527116#M296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by dragilla on Thu Nov 24 12:30:38 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Found some (I think useful) sample codes here:&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://"&gt;http://coineltech.com/shop/product_info.php/cPath/5_8/products_id/33&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;Go to downloads. It's for 1768. They also use efsl and read, write, create dirs, etc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Looks nice.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway, any advice on the other part of my question? How do I save my data to sd? I guess writing 100-200 bytes will take more than 10 ms?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Should I buffer data and write them in packets? Or should I write small pieces?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Should I use interrupts somehow? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I use a main loop working at 100hz and want to save 100-200 bytes every 5 cycles (my gps is working at 20hz). I want to save gps data (~60 bytes) + data from other sensors to an sd card. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What approach would you suggest?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:30:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527116#M296</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: need an advice on using sd card</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527117#M297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Polux rsv on Thu Nov 24 12:50:55 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Data is already buffered by the file system. It first fill a 512 bytes buffer (disk sector) in ram, then write it in the SD card. You can declare several buffers, but then the writing time will be longer and you can loose some samples. That's why I used Freertos with a task reading datas and sending them to the disk task, through a queue. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Angelo&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:30:57 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527117#M297</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:30:57Z</dc:date>
    </item>
    <item>
      <title>Re: need an advice on using sd card</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527118#M298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Rob65 on Thu Nov 24 14:48:21 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I should have stated this right away but kind of forgot this myself ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The EFSL post was taken from &lt;/SPAN&gt;&lt;A href="http://http://www.nxp.com/documents/application_note/AN10916.pdf"&gt;AN10916&lt;/A&gt;&lt;SPAN&gt;. That document also contains informations on porting FatFS - including a demonstration program.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There is also a .zip file available with the source files.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I started with EFSL but don't remember why. FatFS seems to be the choice of many programmers - given the level of information available and the regular updates I can understand why.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There is a lot of information available on &lt;/SPAN&gt;&lt;A href="http://http://elm-chan.org/fsw/ff/00index_e.html"&gt;ChaN's website&lt;/A&gt;&lt;SPAN&gt;, especially have a look at the "How to use MMC/SDC", he reports measurements of writes to different cards changing from 28 to 182 kB/s on an ATMega64 depending on the type of card ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Somehow I missed the NXP port of FatFS when I started with FatFS some time ago.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[INDENT]Rob&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/INDENT]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:30:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527118#M298</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: need an advice on using sd card</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527119#M299</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by NXP_Europe on Thu Nov 24 15:35:46 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Rob65:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;FatFS is probably the best option going forward since it's actively supported by the original author, and once you wrap your head around the structure it's relatively easy to port to new chips later. The code formatting might leave something to be desired (admitedly a matter of taste though), but it's thorough, up to date, and the license terms are very developper-friendly. It's been tested here with 16GB cards with no problems using FAT32, etc.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:30:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527119#M299</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:30:58Z</dc:date>
    </item>
    <item>
      <title>Re: need an advice on using sd card</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527120#M300</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Polux rsv on Fri Nov 25 01:11:32 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Examples of both EFSL and FatFs are available on Martin Thomas website. &lt;/SPAN&gt;&lt;A href="http://"&gt;http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/arm_memcards/index.html#chanfat_lpc_cm3&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Angelo&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:30:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527120#M300</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: need an advice on using sd card</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527121#M301</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Rob65 on Fri Nov 25 02:06:59 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: Polux rsv&lt;/STRONG&gt;&lt;BR /&gt;Examples of both EFSL and FatFs are available on Martin Thomas website.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried the FatFS implementation from Martin's site but did not succeed. NXP's FatFS code worked without any problems.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As already pointed out by NXP_Europe; FatFS has better support (the latest update is from last week!) and is fairly well documented.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I moved the NXP code into an LPCXpresso project and attached it to LPCUSB's virtual serial port.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It's available on my &lt;/SPAN&gt;&lt;A href="http://http://bikealive.nl/index.php/lpc1754-test.html"&gt;lpc1754 target test page&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And now back to Luke's original question: "what FAT implementation would work for me?" Most likely both, the logic analyzer shows that FatFS has a throughput of 1.1 MByte/s, EFSL 0.8 MByte/s - that is when writing or reading a single block to SD. ChaN's program gives some data throughput figures (including filesystem overhead) but these numbers are not that accurate: For large (2kByte) reads I see 0.8 to 1.3 MByte/s (faster than the actual bitrate on SPI :eek:), writes of 2 kByte are around 600 kByte/s.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;With smaller blocks the overhead grows but it's still OK.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;FatFS comes with a price. In release build it takes up 8980 expensive bytes of Flash, EFSL uses just 5456 bytes. An unfair comparison since the FatFS test program uses much more functionality than my lpc1754 test program with EFSL. FatFS can be stripped down to 6564 bytes by just setting FS_MINIMIZE to 3 (and removing the stripped down functionality from the test program).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Given that FatFS is faster, is well supported and is actually documented is a big pro.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,[INDENT]Rob&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/INDENT]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:30:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527121#M301</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:30:59Z</dc:date>
    </item>
    <item>
      <title>Re: need an advice on using sd card</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527122#M302</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by dragilla on Fri Nov 25 02:41:37 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;There is however one thing that bothers me about petit fatfs. It says on their website it cannot expand the file size when writing to it. It means I have to create a file that fills up say 2gb and fill it with zeros (on my computer) then write to that file (on lpc)?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I'll try the Chan's module - looks nice.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You also haven't answered my question about the general approach to saving data in a loop. I have a loop @ 100hz and want to write @ 20hz or maybe buffered @ 10hz, 1hz, whatever. @ 20hz I get max 200 bytes. How? Please.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:31:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527122#M302</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:31:00Z</dc:date>
    </item>
    <item>
      <title>Re: need an advice on using sd card</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527123#M303</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Rob65 on Fri Nov 25 05:34:50 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;Luke,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;indeed PetitFS (which is also ChaN's work) cannot expand files. Perfect if you want to read file but writing should indeed be done as you suggested. Also note that writes can only start on a sector boundary.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;It's small and relatively fast but has no flexible interface like FatFS.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Like Angelo (Polux RSV) already suggested I would use something like FreeRTOS to control this. Although I do realize that this may be a kind of a brain breaker if you have never used a thing like this before.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In FreeRTOS you can define tasks that all run in parallel. These tasks are being executed whenever they can be. If you want a task (your main loop) to run at an exact tick rate, I suggest to use an interrupt routine to send a message to that task. The task then just waits for the message (or in fact an message) to arrive in the queue.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Having the interrupt routine to send the message to the task also triggers FreeRTOS to perform a task switch (i.e: interrupt the current task and check if there is a higher priority task that is ready to run).&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You main loop must then be the highest normal task. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There will be higher priority tasks that are being triggered by interrupt routines.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;An interrupt routine (the IRQ routine itself) should have a short execution time: just save important volatile data and trigger a task that uses the data.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Of course that task should have a higher priority than the normal running tasks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This principle is used in most OSes, sometimes the IRQ routine and the task are both called "interrupt handler". The IRQ routine is then being called "top half" and the task is the "bottom half" on the interrupt routine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,[INDENT]Rob&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[/INDENT]P.s: Angelo will explain that interrupt handlers sometime do need to do more than just trigger the bottom half: if you are controlling an ignition system and you need to handle between 1000 - 4000 interrupts per second, the OS overhead can already kill you.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:31:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527123#M303</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: need an advice on using sd card</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527124#M304</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Polux rsv on Fri Nov 25 06:12:45 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: Rob65&lt;/STRONG&gt;&lt;BR /&gt; Angelo will explain that interrupt handlers sometime do need to do more than just trigger the bottom half: if you are controlling an ignition system and you need to handle between 1000 - 4000 interrupts per second, the OS overhead can already kill you.&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;that's totally....right:D&amp;nbsp; The system should be designed taking care of tasks and irq priorities. IRQ should be as short as possible. IRQ for hard real time should not compute any long calculation, it only should place new registers value, handle serial line buffer, read analog values to buffer, save important values comming from peripheral, etc...and trigger tasks which wait on results. These tasks, depending on their respective priorities, will compute thinks like ignition retard calculation, handle file system, set new values to be used in next timer IRQ.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;As you can see, not a trivial setup to be sure the design will work from 1000 to 12000rpm. Depending on bike, 12000 rpm ignition system on a 4 cyl would result in 24000 ignition per minute, ie 400Hz. But in the latest R1, ignition cycles are note evenly spaced (cross plane crank), so some ignition events are close to each other. It means the IRQ should be very short, even if 400Hz is "slow" for a 120MHz LPC1769.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Edit1: You should add the wheel sensors: let's say 320km/h, 24 pulses coding disks(for better precision), it makes 1066Hz, on both sensors. Wow, lot of interrupts. But as everyone knows that the japanese bikes are not able to go that fast (exept on paper and at the bar), and we don't need high precision, what append with real 280km/h and only 5 pulses(brake disks bolts): 194Hz, more realistic.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Edit2: You should add the GPS handling, probably at 115200bauds for a 20Hz GPS. It means 11520chars/s, ie 11520 interrupts/s&amp;nbsp; for serial line, re-wow. IRQ routines should be very short to allow main software to run and do all the remaing things: data acquisition, compute delays, write on SD, etc...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Angelo&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:31:01 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527124#M304</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: need an advice on using sd card</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527125#M305</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by Polux rsv on Fri Nov 25 06:16:33 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;And what about Poland? Is there any good place to visit ? :rolleyes: &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Has Poland any track ?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Angelo&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:31:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527125#M305</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: need an advice on using sd card</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527126#M306</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by dragilla on Fri Nov 25 09:59:24 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;HR /&gt;&lt;SPAN style="color: #0000ff;"&gt;&lt;STRONG&gt;Quote: Polux rsv&lt;/STRONG&gt;&lt;BR /&gt;And what about Poland? Is there any good place to visit ? :rolleyes: &lt;BR /&gt;Has Poland any track ?&lt;BR /&gt;&lt;BR /&gt;Angelo&lt;/SPAN&gt;&lt;HR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We unfortunately only have one big track - in Poznan - &lt;/SPAN&gt;&lt;A href="http://"&gt;http://www.aw.poznan.pl/tor/plan.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;come and test it :)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;edit: I'm not going to interrupt every wheel sensor pulse. I have external counters :P which I'm going to read every loop cycle.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have the gps handling working already. I buffer using isr and read in my loop.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Now I lack only the magical 'match' mechanisms, which I have no idea of, ... and saving to sd which is not so important...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If I fail to handle all the stuff on one 1769 I might consider adding an atmega or something to do the spark stuff.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:31:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527126#M306</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: need an advice on using sd card</title>
      <link>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527127#M307</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;STRONG&gt;Content originally posted in LPCWare by dragilla on Fri Nov 25 12:49:47 MST 2011&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't get it. I downloaded the lpc17xx_chanfat_mthomas_20100715c_pub.zip from &lt;/SPAN&gt;&lt;A href="http://"&gt;http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/arm_memcards/index.html#chanfat_lpc_cm3&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The description on the site says: "ChaN's FAT-Module with LPC17xx SPI/SSP and USB-MSD". Seems 100% of what I want. But when I open the zip there is bunch of stuff among which I cannot see anything connecte to SD card. Only one example - USBHostLite. There is cmsis 1.3, fatfs (without the low level i/o functions).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Am I missing something here?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;edit: Maybe this is the way to go? &lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://"&gt;http://sigalrm.blogspot.com/2011/01/introduction-to-arm-cortex-m3-part-2.html&lt;/A&gt;&lt;SPAN&gt; -&amp;gt; &lt;/SPAN&gt;&lt;A href="http://"&gt;https://lpc17xx-fatfs-sdc.googlecode.com/hg/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;edit2: it compiles at first try and it worked like a charm - it saved a file on my sd card and read from it. That's all I wanted :P&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jun 2016 01:31:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/LPCXpresso-IDE/need-an-advice-on-using-sd-card/m-p/527127#M307</guid>
      <dc:creator>lpcware</dc:creator>
      <dc:date>2016-06-16T01:31:03Z</dc:date>
    </item>
  </channel>
</rss>

