Search ARMWorks Answers

Loading...

Sunday, September 16, 2012

Note: Wingston, mentioned in earlier postings, has become so successful that he has pulled his blog.

Developing for Linux on FriendlyARM boards.

A typical development setup has a Mini/Micro/Tiny of your choice with power supply and cables from the SDK accessory kit. Your Mini is connected to a Linux PC by the serial cable (often to a USB to serial converter) and an Ethernet cable. If you have an Ethernet hub, use a regular Cat5 cable from Mini to hub. If not, use the crossover cable from the kit and connect to your PC. The hub is more convenient so that you can use the Internet at the same time without jumping through hoops. The USB cable is used in a few special situations.
A great way to do fast development with the least hassle, is with NFS. NFS, or Network File System, allows part of your PC hard drive to be mounded by the Mini over Ethernet. When you change a script or configuration file or compile something on a shared directory, it is seen by the Mini as being on its own hard drive. There is no burning of NAND or transferring SD cards.
Your PC will need your favorite Linux - FriendlyARM uses Fedora in some of the user manuals, a lot of people use Ubuntu, and some prefer the more Spartan Debian. Debian has the advantage that anything in the repository is available for both x86 and ARM. The pending release of a Debian customized for Mini210 makes this appealing. You will need the "tools", the GNU compilers and linker, GDB for debugging, and and perhaps an IDE like Eclipse. Old school Linux users might scorn the IDE, but most of us relative noobs can make good use of it. Single stepping through lines of code or by machine instructions is simple with a proper setup of Eclipse. If you are new to this and wonder what all thjose special directories are for in Linux, here is a very handy reference.
Your first step if you don't have Linux, is choosing the "Distro" or distribution you want to use. Will you put it on a PC or laptop of it's own? Or set up dual boot with Windows? Or maybe use VirtualBox or VMWare to install a virtual machine? Check the forum at www.friendlyarm.net to see what people are doing and what systems are working best. A favorite around here is a bare bones quad core AMD at 3GHz+ with 4 or 8 GBytes of RAM. We watch for really good sale prices on bare bones and 20" displays at places like Tiger Direct or NewEgg. If you luck out, you can get dual monitors (with stand) and a great box for less than $500. You hardly need this if you have time to wait for long compiles. After all the Mini210S itself is more powerfull than a great PC of 10 years ago.
Can you develop for the Mini210/S directly on the Mini210/S? Yes you can. The Mini210S can run Debian Squeeze, the current Debian for desktops, and that means anything else in the Debian repository. A new release with drivers for I/O on the Mini/Tiny210 systems will be ready soon. There is plenty of RAM on the Mini210S and we like to run Debian from a uSD card so we have up to 32 GBytes of flash. 36 if you count the 4 GBytes on board. If you choose this method, spend the extra for a Class 10 SD. They write much faster. A very simple and powerful way to develop directly on your card is with Python. Once Debian is loaded, add USB mouse and keyboard, connected to the Internet, and just
 
You can even use the HDMI on one of the 210's with a large display or use a 7" 5" or 4.3" LCD. See if IDLE or Eric will load for a Python IDE.

Monday, January 2, 2012

Wingston at WorkshopIndia has been writing a great blog and tutorial on Pengutronix and the Mini2440 and more. Following his tutorial looked like a quick way to get started, and it was. When I began the first steps of the process of getting the ptxdist (Pengutronix Dist) started, I had to apt-get piles of stuff that was not in the Ubuntu install.

Unlike Fedora and some others, Ubuntu does not have an option to install a full development version with tools. The trick is to run

apt-get install build-essentials

and maybe some other things. Wingston has added a line to the tutorial that will install all the needed tools on Ubuntu. Aside from some of the usual frustrations of downloading with a browser and moving files with the terminal command line, everything went quite smoothly. Note: I used all the latest versions of tools and source despite the latest version of gcc not being in the compatibility matrix for Pengutronix Mini2440. I used a "force" option at one point when the ptxdist setup offered it as a way to use a non-specified version of gcc. When cross compiler tool build ran, it chunked away echoing great masses of stuff to the terminal for 80 minutes, and finished with no errors! It would have been faster with a better Internet connection. At least half that time is spent downloading files. I now had the Pengutronic BSP and tool chains for cross compiling to the Mini2440 all built.

I would have continued, but ran into a problem with permissions and left it till Sunday afternoon. In the tutorial, you create a directory for the BSP in /home/BSP and I either missed something or made a mistake during installation. Firefox would not download to the directory and ptxdist gave an error when trying to create directories. If you try to run ptxdist as root, it will give an error. It refuses to run as root, which is a good thing.

I had forgotten that the permissions for my user account did not include /home, only /home/myUser. On the advice of an experience Ubuntu user (thanks Seppoz), I did a quick

~$sudo chown -R myUser /home/BSP

and all was well with the world. After a simple configuration for LCD type and IP addresses and boot method, I was able to command 

~$ptxdist go

and off it went! Biding Wingston's advice in his tutorial, I stayed within range to see if things stopped, and they did, about 4 times. Each stop was because a file to be downloaded could not be found - error 404. It was easy to copy the file name and Google for it. I found most in Fedora repositories, and now that Firefox would download to /BSP, it was easy to drop them directly to the /src directory shown in the stoppages. Another ptxdist go and it starts where it quit. A little over 90 minutes and it was done. Again error free! And in an images directory sat barebox and the kernel and file system. Woohoo! It would have taken maybe half the time with faster Internet and me noticing things had stopped instead of reading tables of ballistic coefficients for another project.

Note that the commands are given from inside /home/BSP/long-name-of-bsp-directory .

So far this is the best Linux experience I have ever had :-) I think I configured correctly to load the bootloader over tftp and everything else will be NSF. Hmm. Now I haver to check on that. Anyway, assuming it runs on the Mini, everything is sweetness and light. If it doesn't, I'll revise my opinion about best -- experience -- ever.

Would I do anything differently? Yes, I would put the BSP in my user directory so there were no confusions over permissions. However, if you change the ownership as above in the beginning, it will be painless as is. It is definitively awesome that you can assemble a new computer, install Ubuntu, build cross development tools and BSP, and generate a new Linux for the Mini2440 in a day. More details as testing continues!

Sunday, November 6, 2011

Embedded ARM Pricing Expectations

Embedded Pricing and Expectation.

The FriendlyARM line of ARM boards, Mini2440, Mini6410, Mini210, and displays are a bargain when compared to similar products - if you can find a truly similar product. This is especially true in the US and Europe. Yet quite often I see remarks in forums and on blogs that imply or say outright that they are too expensive. Or that some other device does the same thing and is much cheaper. But if you look around, there are ARM9 S3C2440 boards at 200 MHz that retail for $650, and they have buyers. [Actually, the FriendlyARM products were 50% higher before the eBay price wars of a couple years ago.]

The source of expectations: Apple sells an iPhone 4GS for $200 to $400 and an iPhone 4 for around $100. The iPhone 3G will shortly be $50 or less; even free in some cases. These products have high performance ARM9 and A8 Cortex dual core technology. I hear "Why should we pay more for the same thing in a larger package, and no cellular MODEM?" Good question! Shouldn't these ARM systems for embedded applications be even less expensive?

The short answer is "Because you don't understand the business model". The long answer is "Because you don't understand the business model at Apple and the cellular providers". Not much longer is it? Here is the simple truth. Apple has contracts with AT&T and Verizon to get a portion of earnings over the initial contract period of the buyer. Apple's revenue for an iPhone 4GS is not $200 or $400, it is $620. A "free" iPhone 3GS will produce $381 for Apple. An iPad with 3G probably earns Apple over $1000.

Retail in the phone business is not the same as retail in the embedded space! Now you have to wonder, do the Android phone makers have similar deals? They must have, to even survive. How about "unlocked" phones? How much more do they cost? Do some Android makers have deals where a provider detects the manufacturer of the unlocked device using one of their SIMs and pays the phone maker?

Pricing expectations in the embedded space have been strongly influenced by the phone market. And the hidden subsidies for phones have produced these expectations that are wildly out of sync with the reality of manufacturing. Anyone who has driven by Foxcon, or even seen the pictures, assumes Apple has great economy of scale. But economy of scale has a limit after which volume doesn't matter. These things are still expensive. (The iPhone 4GS is truly twice the price of the new Mini210 from FriendlyARM.)

Inexperienced designers or those not well connected in the industry are easily seduced by these apparently low retail prices and think the costs of production must be equally low. Prime examples are found in China, with its recent over production of engineers and special embedded ARM courses and ARM specific college text books, it is a hotbed of developers who think they must produce systems with performance/price ratios that meet or exceed Apple hand held products. To meet this impossible goal they must operate at margins so slim that a small increase in the value of the Yuan will instantly close off the foreign markets. We see copying of everything, cost cutting and short cuts from outright theft of designs and documents to complete copies of web sites, on top of which they are practically giving away their products. DVDs from eBay sources will have complete PDFs of copyrighted books and unlocked versions of top end EDA suites. But that is another topic. It is the business model that gets distorted. (We loose ten cents on each sale, but we will make it up in volume! An old joke in the West, but new doctrine in Shanghai?) I would bet that 99% of these newly minted entrepreneurs have no idea that Apple gets much more than the retail price of their phones and tablets. The other 1% get excoriated for being over priced.

Tuesday, October 18, 2011

Or Questions!

Good evening Ladles and Jellyspoons, Horses and Mules, and all the Ships at sea. This new blog will be a place for conversations even more informal than the ARMWorks Andahammer.com home page. We can gather information and code and questions and answers that fall outside the realm of support by ARMWorks, Inc.

It is always a bad idea for hardware companies to announce new products before they are ready. The infamous example is Osbourne Computer, which announced a new generation Osbourne with a warehouse full of the current model. Sales dropped to near zero, there was no money to build the new systems and pay employees and they were out of business in about six weeks. However, it seems to work for software companies like Microsoft.

I won't be talking about coming products. But there is nothing wrong with making wish lists! I have one now. I want to make a Mini2440 variant. Maybe something like this: CPU S3C2410, 2416, 2443, or 2450. About the same size as a Mini2440, and with I/O for industry. The COM ports will have RJ11 jacks for twisted pair phone cable and RS-485 drivers. Each port can then run at least 1,000 feet over twisted pair and multi-drop network to 254 devices. Are you familiar with CAN-bus? Is it needed? It was rather popular in automation a few years ago. 

Anyway, remove the on-board push buttons and LEDs.  Use uSD/TF card slots - two if possible for loads of data storage (are book codes unbreakable?). Add a USB hub chip and a pair of stacked USB sockets for 4 or 5 USB ports. SOme people need them. WHat if the hub chipp plus ports was in an attachable add-on? Real-timers need good support under Micrium uC-OS, and how about TimeSys real-time Linux? I'm partial to fast A/D and D/A with DMA with good resolution. 14 bits or better? What to add and what to remove? Should we go with a header style smaller than 2mm? Cat5 cable has 4 unused wires. Is there a smaller cable and connector that would be good for Ethernet?

I would also like to hear about reliability. I have many times seen blogs and comments by people who will refer to the Mini2440 as a "Chinese knockoff". I often wonder "Knockoff of what?" When I decided to start selling the QQ2410/QQ2440 as a distributor outside China, it was because there was nothing like it in the States or Europe. Yes, there were boards with ARM9s and there were boards with displays and they all looked like some kind of prototype with connectors sticking in all directions and maybe an awkwardly mounted little display and with a price tag that would require medical attention if you took it seriously. The QQ and later the Mini have singularly fine quality layouts. One of the first things I noticed when I bought a QQ off a Chinese web site was layout for equal length traces in critical areas and a great deal of attention paid to the esthetics and usefulness of the board shape and the I/O positioning. I had worked at Apple, and I know good when I see it.


We have sold thousands, nay, tens of thousands of Mini2440--gotta get a total. The return rate is so low that we can't get any statistics. Yesterday I saw a display with 1 bad pixel. This is the 3rd or 4th I have ever seen out of all those boards. If you discount the obvious failures at start up from a broken connector or missing socket (anything that would not show when Linux is loaded and tested in China), we basically never see them again, even the ones we know are used in the hundreds or thousands on projects in deserts or the Arctic. Once installed and passed initial test, they just don't fail. I can't count ones owned by hobbyists and developers. We all know the things that can happen on the lab bench or while removing and reinstalling in prototype equipment. The upshot is, the Mini2440 and Mini35 are awesome! Your opinion may differ, and I would like to read about it here, then erase it if I don't like it :-)