Show Posts
Pages: 1 2 [3] 4 5 ... 110
31  Using Arduino / Storage / Re: SdFat recursive File listing on: August 02, 2014, 01:22:07 pm
This changes the file that sd.vwd() point to.
Code:
 sd.chdir(dir);

Restoring the position has no meaning since sd.vwd() now is a handle for "dir", not the file that you referenced with this.

Code:
 pos = sd.vwd()->curPosition();

You can not modify a global variable in a recursive function and have recursion work correctly.

What feature do you need in ls()?
32  Using Arduino / Storage / Re: Benchmarks for new SanDisk and Samsung MicroSDs on: August 02, 2014, 12:18:05 pm
The list was too long for the forum limit so here are the Samsung cards.

Here is a Samsung 16 GB Evo http://www.amazon.com/gp/product/B00IVPU7KE
Quote
Samsung Evo 16 GB

Type is FAT32
Card size: 15.72 GB (GB = 1E9 bytes)

Manufacturer ID: 0X1B
OEM ID: SM
Product: 00000
Version: 1.0
Serial number: 0X2A620035
Manufacturing date: 3/2014

File size 5 MB
Buffer size 512 bytes

write speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
322.44,28452,1424,1582
317.18,28356,1424,1608
316.62,26956,1424,1611
317.52,31996,1424,1606
318.11,26992,1424,1603
317.96,32592,1424,1604
318.37,33372,1424,1602
318.78,27456,1424,1600
318.71,26896,1424,1600
319.06,27464,1424,1599

read speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
501.88,2024,1004,1014
501.93,2024,1004,1014
501.88,2024,1004,1014
501.93,2024,1004,1014
501.82,2024,1004,1014

Here is the 32 GB Samsung Evo http://www.amazon.com/gp/product/B00IVPU7KE.
Quote
Samsung Evo 32 GB

Type is FAT32
Card size: 31.44 GB (GB = 1E9 bytes)

Manufacturer ID: 0X1B
OEM ID: SM
Product: 00000
Version: 1.0
Serial number: 0X780282A4
Manufacturing date: 5/2014

File size 5 MB
Buffer size 512 bytes

write speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
330.58,30080,1444,1543
328.24,29600,1492,1554
327.93,27408,1492,1555
328.69,27320,1492,1551
328.45,27052,1492,1553
327.48,43476,1492,1557
328.71,27372,1492,1552
328.75,28084,1492,1551
328.28,27376,1492,1553
328.86,35408,1492,1551

read speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
502.43,2016,1004,1013
502.38,2012,1004,1013
502.28,2016,1004,1013
502.33,2016,1004,1013
502.28,2016,1004,1013

The Samsung Pro is great on the PC and STM32 but not so much on Uno http://www.amazon.com/gp/product/B00IVPU7DG.
Quote
Samsung Pro 16 GB

Type is FAT32
Card size: 16.00 GB (GB = 1E9 bytes)

Manufacturer ID: 0X1B
OEM ID: SM
Product: 00000
Version: 1.0
Serial number: 0X9B541463
Manufacturing date: 3/2014

File size 5 MB
Buffer size 512 bytes

write speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
276.96,36204,1424,1843
257.49,37008,1492,1982
257.81,36996,1492,1980
258.64,36964,1492,1973
258.58,36040,1488,1974
258.93,36900,1492,1971
259.63,35216,1488,1966
260.17,37708,1488,1962
260.05,36068,1492,1963
260.48,36088,1492,1959

read speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
501.22,2024,1004,1015
501.17,2020,1004,1016
501.27,2016,1004,1015
501.27,2020,1004,1015
501.32,2016,1004,1015

The 32 GB Samsung Pro http://www.amazon.com/gp/product/B00IVPU7DG.
Quote
Samsung Pro 32 GB

Type is FAT32
Card size: 32.01 GB (GB = 1E9 bytes)

Manufacturer ID: 0X1B
OEM ID: SM
Product: 00000
Version: 1.0
Serial number: 0XFC5E3635
Manufacturing date: 4/2014

File size 5 MB
Buffer size 512 bytes

write speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
287.27,24024,1432,1776
278.77,24996,1496,1830
279.69,23140,1496,1824
280.09,23568,1496,1822
280.20,22452,1492,1821
281.04,22140,1496,1816
280.79,25672,1496,1817
280.99,23224,1496,1816
282.32,25372,1496,1807
282.13,26596,1496,1808

read speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
503.95,2012,1000,1010
503.85,2012,1000,1010
503.85,2008,1000,1010
503.90,2008,1000,1010
503.80,2012,1000,1010

Finally don't buy the Samsung 8 GB class 6 card http://www.amazon.com/gp/product/B00IVPU6GO. It has poor max write latency.
Quote
Samsung 8 GB class 6

Type is FAT32
Card size: 7.89 GB (GB = 1E9 bytes)

Manufacturer ID: 0X1B
OEM ID: SM
Product: 00000
Version: 1.0
Serial number: 0X450D3E3
Manufacturing date: 2/2014

File size 5 MB
Buffer size 512 bytes
Starting write test, please wait.

write speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
234.74,98936,1708,2175
244.84,104760,1716,2085
247.08,104732,1712,2066
248.74,104888,1716,2052
247.06,105728,1712,2066
249.14,105096,1716,2049
247.06,98920,1712,2066
248.81,105164,1712,2051
247.01,95652,1716,2065
248.46,104932,1712,2054

read speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
469.85,3188,1036,1084
469.89,2560,1036,1084
469.81,2564,1036,1084
469.85,2568,1036,1084
435.17,47756,1032,1171
33  Using Arduino / Storage / Benchmarks for new SanDisk and Samsung MicroSDs on: August 02, 2014, 12:15:32 pm
I recently bought a number of high end MicroSD cards for SDIO tests on fast STM32 micros.  Performance with 4-bit SDIO is great, read/write at over 20 MB/sec is possible.

I decided to benchmark these cards on an Uno.  Performance is limited since these cards were not designed for SPI.

Here is a long list of benchmarks.   Each test has 10 reps of writing a 5 MB file and five reps of reading a 5 MB file. The biggest difference is write speed and maximum write latency.  

First let me warn you that there are many fake cards floating around.  The first result is a fake SanDisk 8 GB Ultra sold on Amazon by  Nano-Real www.amazon.com/gp/product/B0085EG6OW.

Note the slow, 76 KB/sec, write speed and long , over 140 ms, max write latency.
Quote
Fake 8 GB Ultra

Type is FAT32
Card size: 7.99 GB (GB = 1E9 bytes)

Manufacturer ID: 0X12
OEM ID: 4V
Product: MS
Version: 0.0
Serial number: 0XE1480000
Manufacturing date: 5/2014

File size 5 MB
Buffer size 512 bytes

write speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
75.86,144628,2472,6741
76.34,142692,4740,6698
76.36,142648,4732,6697
76.33,142756,4732,6699
76.20,148644,4732,6711
76.37,142544,4728,6695
76.39,142628,4736,6694
76.43,142504,4724,6690
76.31,142584,4728,6701
76.44,142612,4728,6690

read speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
341.44,2332,1164,1493
341.44,2324,1164,1493
341.44,2332,1164,1493
341.46,2336,1164,1493
341.44,2332,1164,1494

Here is a real SanDisk 16 GB Ultra http://www.amazon.com/gp/product/B007XZM6VG.  Much better.
Quote
16 GB SanDisk Ultra

Type is FAT32
Card size: 15.93 GB (GB = 1E9 bytes)

Manufacturer ID: 0X3
OEM ID: SD
Product: SL16G
Version: 8.0
Serial number: 0XFC434325
Manufacturing date: 4/2014

File size 5 MB
Buffer size 512 bytes

write speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
251.28,22896,1696,2031
250.98,20788,1696,2034
250.61,32348,1696,2037
251.15,20412,1684,2032
250.76,20664,1700,2035
251.30,20036,1696,2031
251.01,19960,1696,2032
251.48,20056,1664,2030
251.24,20736,1672,2032
250.92,20160,1696,2034

read speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
500.07,2028,1000,1018
500.17,2024,1000,1018
500.12,2028,1000,1018
500.02,2020,996,1018
500.07,2020,1000,1018

Here is a strange result, the 32 GB version is not very good for write latency on SPI but OK on STM32 with SDIO http://www.amazon.com/gp/product/B007XZM6VG.
Quote
SanDisk 32 GB Ultra

Type is FAT32
Card size: 31.91 GB (GB = 1E9 bytes)

Manufacturer ID: 0X3
OEM ID: SD
Product: SL32G
Version: 8.0
Serial number: 0XC2E6F10D
Manufacturing date: 6/2014

File size 5 MB
Buffer size 512 bytes

write speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
241.93,75572,1608,2110
246.17,69084,1620,2073
242.12,79292,1624,2108
245.67,76168,1620,2078
243.48,85104,1620,2096
241.57,63892,1624,2113
244.10,78440,1616,2091
244.94,70436,1624,2084
239.76,90892,1624,2129
243.35,82420,1620,2097

read speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
480.74,2428,1044,1059
480.74,2420,1044,1059
480.78,2424,1044,1059
480.78,2428,1044,1059
480.83,2428,1044,1059

Here is the 16 GB SanDisk Extreme http://www.amazon.com/gp/product/B00FRHTXR2.  Very good max write latency.
Quote
SanDisk 16 GB Extreme

Type is FAT32
Card size: 15.93 GB (GB = 1E9 bytes)

Manufacturer ID: 0X3
OEM ID: SD
Product: SE16G
Version: 8.0
Serial number: 0X3752B221
Manufacturing date: 10/2013

File size 5 MB
Buffer size 512 bytes

write speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
287.22,10724,1484,1776
296.38,10556,1592,1721
295.38,10552,1624,1727
295.14,10556,1588,1729
295.16,10564,1624,1728
295.28,10564,1624,1728
295.25,10548,1588,1728
295.28,10568,1624,1728
295.30,10552,1584,1728
295.07,10544,1624,1729

read speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
495.41,2036,1004,1027
495.46,2032,1004,1027
495.46,2020,1004,1027
495.56,2020,1004,1027
495.46,2032,1004,1027

The SanDisk 32 GB Extreme is also good http://www.amazon.com/gp/product/B00FRHTXR2.
Quote
SandDisk 32 GB Extreme

Type is FAT32
Card size: 31.91 GB (GB = 1E9 bytes)

Manufacturer ID: 0X3
OEM ID: SD
Product: SE32G
Version: 8.0
Serial number: 0XF6D24F1
Manufacturing date: 5/2014

File size 5 MB
Buffer size 512 bytes

write speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
282.76,10768,1504,1805
292.53,10624,1644,1744
292.28,10596,1648,1746
292.45,10332,1644,1744
292.05,10588,1608,1747
292.50,10600,1648,1744
292.29,10628,1648,1745
292.34,10604,1644,1745
292.46,10604,1648,1744
292.46,10612,1608,1744

read speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
487.54,2060,1016,1044
487.58,2056,1016,1044
487.54,2064,1012,1044
487.58,2056,1016,1044
487.58,2060,1016,1044

Here is a lower cost SanDisk 8 GB class 4 card http://www.amazon.com/SanDisk-microSD-High-Capacity-microSDHC/dp/B00488G6P8 .  Not bad.
Quote
SandDisk 8 GB class 4

Type is FAT32
Card size: 7.95 GB (GB = 1E9 bytes)

Manufacturer ID: 0X3
OEM ID: SD
Product: SS08G
Version: 8.0
Serial number: 0XE40B0A50
Manufacturing date: 3/2014

File size 5 MB
Buffer size 512 bytes

write speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
262.33,21176,1636,1945
260.62,25600,1648,1958
260.03,21880,1648,1963
260.63,17612,1612,1958
260.32,19124,1624,1961
260.21,17396,1604,1961
260.74,17220,1648,1957
260.29,17696,1616,1961
260.79,17220,1600,1957
260.28,18920,1644,1961

read speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
484.18,2088,1040,1051
484.23,2092,1040,1051
484.23,2092,1040,1051
484.18,2096,1040,1051
484.18,2096,1040,1051
34  Using Arduino / Storage / Re: SdFat recursive File listing on: August 02, 2014, 08:22:50 am
Here is the problem.
Code:
 sd.chdir(dir);

This changes sd.vwd() to a different directory so the recursion will not work.  Your in the wrong directory when the recursive call returns.

You need to keep the state of the directory at every level.

That's why ls() does the recursion like this with an additional file, s.
Code:
     SdBaseFile s;
      if (s.open(this, index, O_READ)) s.ls(pr, flags, indent + 2);

I wrote ls() quickly a long time ago and should revisit ls().  I may do that soon since I am writing a new generic FAT filesystem that is not SD or Arduino dependent.
35  Using Arduino / Storage / Counterfeit SD Cards. on: August 01, 2014, 05:05:42 pm
I recently bought a number of SanDisk cards from Amazon and some from Amazon sellers.   Several were counterfeit.

Here is an example.  I bought Sandisk Ultra 8GB, 16GB, and 32GB.  The 8GB is clearly counterfeit  Here is it's CID and a performance test:
Quote
Manufacturer ID: 0X12
OEM ID: 4V
Product: MS
Version: 0.0
Manufacturing date: 5/2014

Type is FAT32
Card size: 7.99 GB
File size 5 MB
Buffer size 512 bytes
Starting write test, please wait.

write speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
70.61,137276,2476,7242
70.77,136732,5280,7226
70.96,119376,5276,7206
71.02,119312,5216,7200
70.93,119272,5276,7210
71.03,119172,5216,7199
71.04,119156,5212,7198
71.04,119112,5216,7199
70.93,119152,5212,7209
71.03,119132,5212,7199
Starting read test, please wait.

read speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
263.50,80812,1168,1937
264.59,2856,1168,1929
264.59,2856,1164,1929
264.60,2860,1168,1929
264.59,2860,1168,1929

The write speed, 71 KB/se,c and write latency,119 ms, are really poor.  The CID is totally wrong.

Here is the 16 GB version of the card.  I think it is genuine.
Quote
Manufacturer ID: 0X3
OEM ID: SD
Product: SL16G
Version: 8.0
Manufacturing date: 4/2014

Type is FAT32
Card size: 15.93 GB
File size 5 MB
Buffer size 512 bytes
Starting write test, please wait.

write speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
243.48,20076,1740,2096
243.57,21888,1744,2096
243.96,21560,1740,2092
243.51,22836,1744,2096
243.84,21416,1744,2093
243.46,20164,1712,2096
243.64,20392,1744,2095
243.74,22168,1744,2094
243.90,20640,1744,2093
243.82,21536,1740,2093
Starting read test, please wait.

read speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
496.94,2052,1004,1024
497.08,2056,1004,1024
497.04,2056,1004,1024
496.99,2056,1004,1024
497.04,2060,1004,1024
Seems OK.  New cards don't do too well on SPI but 243 KB/sec is way better than 71 KB/sec and 20 ms compared to 119 ms for write latency.

Here is a 32 GB that seems to have a good CID but poor latency.
Quote
Manufacturer ID: 0X3
OEM ID: SD
Product: SL32G
Version: 8.0
Manufacturing date: 6/2014

Type is FAT32
Card size: 31.91 GB
File size 5 MB
Buffer size 512 bytes
Starting write test, please wait.

write speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
243.57,78984,1624,2096
242.66,69304,1620,2103
245.36,77012,1612,2080
242.28,76568,1624,2107
246.34,98144,1620,2072
244.45,68888,1620,2088
241.52,100384,1616,2113
243.85,96224,1624,2093
243.36,74688,1620,2097
243.53,93152,1620,2096
Starting read test, please wait.

read speed and latency
speed,max,min,avg
KB/Sec,usec,usec,usec
480.83,2412,1044,1059
480.83,2416,1044,1059
480.83,2424,1044,1059
480.88,2416,1044,1059
480.88,2412,1044,1059
The long unstable write latency might mean it's not genuine.  I don't have another 32 GB card.  I have another 16 GB card and it has short write latency.

Kind of disgusting.
36  Development / Suggestions for the Arduino Project / Re: Does Arduino have a future? on: July 28, 2014, 08:51:44 am
Quote
Unfortunately, there is no way to create OS-like functionality without incurring some overhead.
Modern embedded OSes are often more efficient than ad hoc solutions.  The algorithms in these systems have been under development for over 40 years.  It's like the difference between a bubble sort and quick sort.

Quote
A lot of intermediate-sized OS development gets distracted by "real time", which complicates everything and may not be necessary (arguably, Arduino is already NOT "real-time.")
Real-time and RTOS are unfortunate terms for an OS designed for embedded systems.  It's not about fast, it's about appropriate features.

Here are some quotes from "Introduction to Embedded Systems" by Lee & Seshia.  Download link  http://leeseshia.org/download.html
Quote
The computers in embedded systems often do not interact directly with humans in the same way that desktop or handheld computers do. As a consequence, the collection of services that they need from an operating system (OS) may be very different. The dominant general-purpose OSs for desktops today, Microsoft Windows, Mac OS X, and Linux, provide services that may or may not be required in an embedded processor.

An OS for embedded systems should have a few additional featues.
Quote
These OSs share many features with general-purpose OSs, but typically have specialized the kernel to become a real-time operating system (RTOS). An RTOS provides bounded latency on interrupt servicing as well as a scheduler for processes that takes into account real-time constraints.

A microkernel and modularity is desirable.
Quote
The core of any operating system is the kernel, which controls the order in which processes are executed, how memory is used, and how information is communicated to peripheral devices and networks (via device drivers). A microkernel is very small operating system that provides only these services (or even a subset of these services).

I also believe features to support the "Internet of Things" are also important.  The OS should make it easy to inter-operate with phones and other modern smart devices.

Quote
The problem is that there are thousands of RTOS to choose from, but drivers and middleware for them is lacking. I think this is one area where diversity doesn't help, and a single standard would allow people to develop drivers and middleware instead of re-inventing the RTOS.
I have evaluated RTOSes for many years.  If you screen the long list of OSes with a few key requirements such as HAL support or driver support for your chip and a modular micokernel, the list will soon be reduced to a manageable size.

The major chip companies all support an RTOS with FreeRTOS being most popular.

RTOSes are now used in the majority of 32-bit embedded systems.  Billions of copies of OSes like VxWorks and FreeRTOS are now in every day products.
37  Using Arduino / Storage / Re: SD card adapter bought on ebay on: July 27, 2014, 04:29:57 pm
Quote
I have one of those,  and it works fine with 5V supply and 5V on the signal lines.

The LC Studio modules do work with some SD cards.  I have checked several cases where cards work.  The card draws a lot of current on the 5V signal lines which may not good for the card or the Arduino  The Arduino can only supply enough current to reach about 4 V on the signal lines.

The card input lines should not draw current so I think the excess current is due to input protection devices in the card.

Not a desirable condition.
38  Using Arduino / Storage / Re: Reading from CSV file and storing into multiple arrays with SdFat library on: July 25, 2014, 05:10:27 pm
Sorry, I didn't notice that you have an extra comma at the end of input lines.  Either remove the extra comma in the input or add a third char variable to read this comma.
Code:
1120,538,0, <-- extra comma
1556,695,0, <-- extra comma

Quote
It appears to be copying the previous line's z value into each line's x value. I've been trying to track down the source of this issue without much success yet.

Trying to read a comma as a number causes an error and leaves the file's position to be incorrect.

You must provide a variable for every item in the input line.  White space is skipped so you don't need to read the CR/LF at the end of lines.
39  Using Arduino / Storage / Re: Reading from CSV file and storing into multiple arrays with SdFat library on: July 24, 2014, 06:36:56 pm
First, you should check for errors when you read from a file like this:
Code:
  if (!(sdin >> x[xyzpoints] >> y[xyzpoints] >> z[xyzpoints])) {
    // Handle read error.
  }

Second, you must provide a char variable to read the comma separators:

 
Code:
  if (!(sdin >> x[xyzpoints] >> sep1 >> y[xyzpoints] >> sep >> z[xyzpoints]) || sep1 != ',' || sep2 != ',') {
    // Handle read error.
  }

Where sep1 and sep2 are type char:
Code:
  char sep1, sep2;
40  Development / Suggestions for the Arduino Project / Re: Does Arduino have a future? on: July 24, 2014, 09:51:15 am
This feels like a search for the Holly Grail.
 
Quote
He's not included any of the ARM core MCUs. If he expanded it to Cortex-M3.. for DUE.. .Then we'd want him to expand it to Cortex-M0 for ZERO.... then there would be others of us who'd like to see it expanded to Cortex-M4 for TI Tiva C series.
I am mainly interested in Cortex-M processors.   There is no hope that one person or even a few people can provide an open source firmware library for these devices.

Here is a project with the goal for providing such a library http://libopencm3.org/wiki/Main_Page
Quote
The libopencm3 project (previously known as libopenstm32) aims to create a free/libre/open-source (LGPL v3, or later) firmware library for various ARM Cortex-M0(+)/M3/M4 microcontrollers, including ST STM32, Ti Tiva and Stellaris, NXP LPC 11xx, 13xx, 15xx, 17xx parts, Atmel SAM3, Energy Micro EFM32 and others.
They barely have software to configure the pins on devices. There is no support for SDIO on any device http://libopencm3.org/wiki/Status.

Quote
Kowalski's work with Cosa is a really interesting development for a C++ OO Framework. It's a bare metal approach that will give us some task scheduling that might allow us to do some things that we expect an RTOS to accomplish.

Embedded systems are about time and Costa almost ignores problems of concurrency.  The importance of preemptive systems has been understood for over 40 years.
Quote
Liu, C. L.; Layland, J. (1973), "Scheduling algorithms for multiprogramming in a hard real-time environment", Journal of the ACM 20 (1): 46–61,

Here is a summary of this important theoretical result http://en.wikipedia.org/wiki/Rate-monotonic_scheduling.

There are lots of resources for Cortex M http://en.wikipedia.org/wiki/List_of_ARM_Cortex-M_development_tools  so I can't complain too much.
41  Development / Suggestions for the Arduino Project / Re: Does Arduino have a future? on: July 23, 2014, 08:28:25 am
Small simple projects will continue to use the bare metal approach.  An OS makes little sense for under 32 KB of program space.  A simple development environment is adequate.

For larger DIY/hobby projects using 32-bit processors there are now many hardware options and the future will bring many more.  It would be a shame to be limited to choices made by the Arduino company.

About 30 years ago big science faced a similar situation.  From the late 1960s to mid 1980s DEC (Digital Equipment Corp)  minicomputers dominates control and data acquisition in large science experiments.  DEC supplied the software environment with systems like RSX/M, a real time system, and VMS for larger VAX machines.

Around 1985 single board computers based on the MC68000 and other microprocessors started to be used There was no standard OS for these boards.

Fortunately two of my friends, Jerry Fiddler, and David Wilner, had left the Lab in 1982 and founded Wind River Systems.  Wind River developed VxWorks which is a flexible RTOS that can be targeted to a wide variety of processors.  VxWorks became very popular in large physics experiments, space experiments like the NASA Clementine moon probe, and the Mars landers.  This defacto standardization was really important for big science at that time.

UNIX on SUN and other work stations became the standard OS for operator consoles and other non-real time applications . Linux is now  the best choice for boards like Rpi and BB that have Cortex Application processors.

The problem is that there are too many RTOS choices for micro-controllers like Cortex M and PIC32.  Many companies are supporting FreeRTOS but it is not technically outstanding.

I like ChibiOS/RT but it only has great HAL support for STM32.

I think Arduino is like Digital Equipment Corp and will fade in the same way.  There will are too many other outstanding hardware options and there will be even more in the future.

There is not an obvious software solution for DIY/hobby users.  FreeRTOS supports a wide variety of hardware, just look at this list http://www.freertos.org/RTOS_ports.html.  FreeRTOS is just not very exciting.
 
Too bad it is so easy to build a little RTOS kernel, this means there are many half baked RTOS systems instead of a project like UNIX and it's follow on, Linux.

westfw is right, the problem is the proper OS for DIY/hobby users.
Quote
Or an OS for  Teensy/NXP/ST/TI that is better than the current bare metal, without sacrificing the "ease of use" of the Arduino libraries.  But I don't think that either one exists yet.
42  Development / Suggestions for the Arduino Project / Re: Does Arduino have a future? on: July 22, 2014, 03:34:07 pm
Quote
I've just received a Tiva C-Series TM4C1294XL evaluation board from Texas Instruments.
Looks like a nice board.

This is great, the major companies are all building boards that can compete with Adruino and are talking to users.
Quote
We are looking forward meeting Makers and showcasing the MCU LaunchPad development ecosystem at Maker Faire Bay Area in San Mateo, Calif.

These companies are also working with universities to provide better tools and products for labs.
43  Using Arduino / Storage / Re: Teensy 3.1 / Data Logging / SD Card / Latency / Non-Blocking SDFAT Library on: July 22, 2014, 10:05:06 am
The example http://forum.arduino.cc/index.php?topic=228549.0 shows how to use a per-allocated contiguous file.  Study it and use a similar method on Teensy.

Are you a lazy student trying to get others to think for you?

I won't be replying to any more of your questions since the examples I pointed out have the basic solution.

44  Using Arduino / Storage / Re: Teensy 3.1 / Data Logging / SD Card / Latency / Non-Blocking SDFAT Library on: July 22, 2014, 07:08:01 am
Quote
So basically it would be sufficient to check if the card is busy in checking if DO is low, and only send commands and / or data packets to the card when DO is high

Won't work.  Please read the following carefully.

When you write to a file, a large number of SD commands and operations operations are required.  There is no way you could check for busy before executing this statement.
Code:
logfile << charBuf << flush;
This statement may require a cluster to be allocated.  That requires reading FAT blocks until a free cluster is found.  Updating the FAT block in memory, writing it back to the SD, then updating the backup FAT.  Even if you write 512 bytes, the data may cross a block so there could be read of a block, copy part of the data to that block, write the block back, then write a second block.  Then the flush requires reading the directory entry for the file, updating the directory entry and writing it back.

The SdFat library does check for busy before every write since the write would fail otherwise.  The problem here is that the card won't indicate busy until you send the write command.  Then you must wait before sending the data packet. If you write a RU which may be 16 KB, there may be 32 busy periods.

SdFat can't check for busy before reads.  The card sends a stream of busy tokens for read and finally sends a start data token.   

No reasonable SD library can do what you want.  Chan's FatFS does not have a non-blocking mode.  FatFS is widely use and the latency problem is handled by using FatFS in an RTOS.

I also have a new replacement for SdFat that I use in RTOSs like ChibiOS and FreeRTOS.  The problem is simpler on ARM processors with more features than Teensy.  You can use SDIO and write a driver that sleeps while the SDIO controller does all the busy checking for a large read or write.  Other threads run and no CPU time is lost in busy checks.

There is another possibility.  You can create a large continuous file and write it with low level SD operations.  You must still buffer data but the check of MISO should work. 

This program used one large multiple block write and avoids most busy periods. It can log data much faster than your requirement on an Uno http://forum.arduino.cc/index.php?topic=228549.0 .
Quote
I did a reliability test logging five analog pins at 5,000 samples per second.  This is an ADC rate of 25,000 values per second.  I logged 512 MB of data without dropping any values.



45  Using Arduino / Storage / Re: Teensy 3.1 / Data Logging / SD Card / Latency / Non-Blocking SDFAT Library on: July 21, 2014, 11:02:13 am
This won't work.
Quote
What about the idea to first open a file on the SD card (T). Then pre-erase a block of 8 KB on the SD card in the next loop (T+1). Send 8 KB from the buffer to the SD card in the following loop  (T+2) , but in a way that the code is not blocked. Then a few loops later (T + 10) close the SD file.


Use an RTOS, that will work.
Quote
There are several ways to deal with this problem.  You can use an RTOS to buffer sensor data in a high priority thread and write to the SD in a low priority thread.  See the SD logger example in NilRTOS https://code.google.com/p/rtoslibs/downloads/list.
Pages: 1 2 [3] 4 5 ... 110