 So, good morning everybody. Wake on everybody. This is a brief session about building a known device atom, so something quite easy to do atom, so something about me. I am an embedded system engineer. I am from Trieste, Italy. I am graduating telecommunications. I am actually working at Nomevoq, Finland, so a Linux embedded solution company. I am custodian of the coal-fire architecture on U-boot. I give some contribution to Linux kernel also and for the coal-fire part, and I am a member of some Mitele Bakerspace and Linux user group in my hometown. OK, so the aim of this talk is just to present a possible alternative way to build an embedded device, so instead of buying one, in some time, interesting, try to build one by your own. Of course, it is something not really easy for a first start, so I mean if there is not high experience or practice on soldering and things like that, it can be a bit difficult as a first start. So there can be errors, there can be issues, so components to buy and things like that. So a little investment, but there can be some motivations. Of course, one can ask what could be the benefits, so I can buy an embedded ball ready, but I will try here some answers. So to grow some additional skill on the hardware side, so understanding a bit what's happened as digital signals, interconnections, how peripherals works and things like that. So then you can select some combination of components that you like to experience. For example, you can select a CPU and non-volatile memories, so what you want, what you like. You can contribute eventually to some Linux driver development or fixing or adapting something, and of course finally customizing a bit the board, so adding some components that could be needed. OK, sorry. For this session, this example board is very limited, it's not innovative, I mean it's not a new technology, but it's simple to understand how things work for the start. So it is just 100 MHz and it's a cool fire CPU without memory management unit. It's with a four megabyte parallel nor flash and 16 megabyte of synchronous dynamic RAM. OK, some requirements, maybe not few, so at least some basic electronic knowledge, like just the basics, so some, you know, the difference between AC and DC, home low, what are resistor capacitors, transistors, so diodes, how resistor works, series and parallel things, series and parallel connections, pull up, pull down resistors, things like that, so there are plenty of tutorials, books, or there can be some expert friends to ask. Then some minimal measurement equipment, also here at least a multimeter and a oscilloscope, a solder station with a better iconic, quite thin tip, so possibly also with a not hair gun, if possible. So in case of arrows, you can desolder and remove the components and try to recycle them, so. And other small things, a solder paste, tin, some alcohol, lens, lens is very important because can help a lot, even when the site is not perfect, so with a good lens, or some visual instrument, you can see much better. Some practice that can be done, for example, with old boards, so dyed board, removing components, and try to resolder them, or things like that. It's not necessary, of course, and whole laboratory, this is something in my house done in some years, but of course, initially it's good only just a table that can be used to practice, so that you can damage it. In case you want to spend some money, of course the most used instrument for these things is the oscilloscope and it is very, it can really fast up the job. Of course, it can cost also a lot. This one is mine, is the cost about of a laptop, I mean, not that much, but also not few money, so it's a good candidate to spend money in, because it can really fast up the job and in case I suggest at least one mega point of memory, so you can capture a big timeframe and you can zoom, it very fast up the things. So the CPU selections is quite exciting, so you can select some CPU in the Linux, from the Linux architecture folder. Of course, here there are some limitations, you cannot select a CPU or a system of chip too complex, I mean, there are CPU with too high cost to perform this kind of things at home. And also too complex, so there are of course limitations, but I can suggest some QFP package, so it's easy to solder and generally it is 0.5 millimeter pitch, so yes, it's quite easy to solder with some practice. There are several chances, so from this coal fire to this CPU that is just 100 MHz to some other that has 1 GHz or finally you can find something also with 10 megabyte of internal static RAM, so you can try to have Linux working without an external dynamic RAM, so for example. Clock frequency is a key point, I mean, you can do something at home with not... It is suggested to start with not too high bus frequency, otherwise things get complicated, of course, for signal timing issues, so high speed signals they have some complexity. And the look on the price can be useful, so sometimes you can find some components, some samples maybe for free or at a good price, so also it's very important if there are development boards, documentation, schematics, application notes and things like that that can help a lot. So a first choice after the CPU is the non-volatile memory, of course, here you need a non-volatile memory, of course, generally two boot, a first binary, so generally a boot loader, for example, and it must be loaded into RAM, so the initial ROM loader can execute directly some time with the executant in place, with some parallel flash, or there are, of course, plenty of boot methods offered from the CPU, depending from the CPU you select, of course. Here you can check the boot types from the very first type, so you can select a CPU with the boot type you prefer. Of course, more are the boot types, this means that the CPU is more recent, so it can be more complex to have it working. So SPINOR are generally in packages like T-SOP, easy to solder, and flash chips are also available in T-SOP, but, of course, they introduce some error check issues, so it can be, this can increase complexity, but a good way to start could be a parallel nor, for example, as in this sample board. OK, so I can jump a bit over. This is a simple parallel nor flash, so you have, I color it in different color, the pin out, so there is the address bus. It's very simple, and the data bus, the Q pin, and some control pin, just chip enable, output enable, and write enable. So it's very easy to understand to start. It can be read randomly. Of course, to write it, you need the standard sequences, so it's a bit slow the process, but it is good to start. So this is just an example how it works. You set an address on the address bus from the CPU side, then you put down the chip enable, you put down the output enable, always with the address value set, and after some time the flash gives out the value on the on the data bus, and you can check here also the weight state, so sometimes the CPU is too fast to read this data, so it has generally configurable weight states inside some register, so you can wait a bit more before reading the data. This is a 16 bit flash, so it is readable in 16 bit words. Also as non-BGA package you can find some parallel flash, some greeter, so I have seen until 1 gigabit, but there can be of course greeter, now I didn't very big research, so the size is generally in bit, so you have to convert it in bytes, so it's 256 megabyte. Ok, so this parallel node are erased in blocks, can be read randomly, very simple way, the throughput is known to be not that high, of course a whole cycle can require 100 nanoseconds or something like that, and you can fast up with some tricks like bar street, page read and the like. So then depending on the CPU RAM you can select SD RAM and of course also a DDR but things get much more complex and in this sample board has been selected as synchronous dynamic RAM, so just the first generation, so it's a 16 megabyte SD RAM, so dynamic RAM are just format from of course capacitors and transistor cells, refresh is generally handled from the CPU, so understanding how column and row addressing works can be a bit complex, but fortunately generally CPU data sheets give some tables for each kind of memory that you want to connect. There are generally some tables that tell you how to connect, how to wire the connections. So then about customization you decide of course the time is limited so I couldn't dedicate too much time to the customization because I thought that is more important the main part of the board is understood but I try to add here something so you can add this simple board just add an Ethernet chip so it's a full Ethernet chip with MAC and physical part and it is connected in a parallel bus simple fashion also then I have here RTC chip and then I left a generic connector where I brought the address bus, data bus and GPIOs so in any case you can stand later the board with a connector so with some functionality later. Of course related to the CPU that you select you can add several devices around so you can add all the kind of Wi-Fi models or connected through UART or SDIO or whatever interface available on the CPU of course. Ok, then this is development approach of course not maybe the best one but just one so you select a card software you start with the schematic diagram, you complete it and there is of course the practice of checking for errors, then you move to the PCB side root all the connections also on the PCB side you perform all the electrical checks and then you can proceed to the manufacturing part so generating some gerber files and look for the best price and quality compromise from the very huge number of PCB producers nowadays until some years ago the multi-layer PCB like in this board that is four layer was quite expensive but nowadays you can find a good price it's very the price is really decreasing a lot so it's now possible to spend much less and perform also some more versions so if you do some error you can reorder some other batch for example three prototypes you can pay 100$ but also much less if you can wait much more time the price is some time connected to the delivery time so then of course the PCB is something that cannot be done at this level at home because if you want a board that is some way small you cannot it's difficult to think to do the PCB at home of course someone did some face is available on the net but the board is much more greater and of course can be unwanted ok, so then the last steps are just waiting the PCB and solder the components and debug for errors step by step ok, in case you find issues on the PCB you can do some temporary hack of course with cutting tracks or using wires it's not necessary to order immediately another one so you can still stay with the board with some minimal fixes then ok, about the CAD there are several and several chances there are several possibilities so key CAD is the one I used it's open source you can have several tutorials and support I think all of you know it so then there are none free so cheap but closed still very good CAD but of course you should pay something or you have some free version with the limited size of the board then there are several others of course there are very expensive CAD magic things as you know and they are not in the purpose of this session so CAD is just a tool and of course with a good experience you can improve the design and have a good result even with a cheap CAD or a free CAD so a way to start is from the power supply so if you select a simple CPU like this there is just one power supply 3.3 volt so it's very simple in this case of course as much the CPU complexity grow as much the power supply stage start to be very complex you could also need some power management EC or the like but of course is not a thing that I consider to do that can be done at home but of course as much simpler is the CPU simpler will generally be the power supply stage so nowadays you can select a back converter for example so you can check the datasheet so is some time important depending from the EC the drop between the input voltage and the output voltage you have to select the power stage considering of course the total current that should be consumed from the board and overestimated so of course some more at home you don't have price limit so you can select and I see a power stage much more powerful than the need some time if this IC should give out 2 ampere is not always true depends from also could depend from this drop so if the drop between input output voltage is very low it can give the maximum current otherwise if instead 5 volt in the input side you put 12 volt the current could be less of course so this power supplies give out just the current so they are the last generation of course nothing you can still use the old linear one so is not something important too much important to select some filtering capacitors of course you can check the equivalent series resistors so if is very low value you can have generally a better clean DC as in output filtered so then you can put some lead just to check if the power is there so once the power is done the ground connections and all the VCC connections for this CPU is quite simple because there is only one power supply domain then you connect the oscillator so the parts around the CPU oscillator so some bootstrap options generally CPUs has some initial configuration that you have to set time to ground or to cc some pins so things like bus speed or initial configuration so then also here sometime one can say ok so you have to check the data sheet to check everything around the CPU house how must be configured but if you don't want to spend the life thousand of pages of a data sheet you can look of course development boards and understanding what should be connected or similar boards of course then connection of the non volatile memory in this case is a parallel bus so is very simple so you just connect the address bus and the data bus for this CPU ok about the address bus this flash is only readable 16 bit word so you have just to connect address one of the CPU to the address zero of the flash this is because you can only read 16 bit words and on the data side this is a big indian CPU so I connected here just most significant bytes the two most significant bytes on the data bus then there are just some other connections so the chip select output enable write enable this signal goes directly to the CPU so it's quite easy to connect and ok then there is the SD RAM connection here also there are it can be difficult but you can look to the development boards in most of the cases development boards uses they use very similar or equal connection of dynamic RAM of the development board so this is a good way to start I think different configurations if you select a different exotic configuration for your board start some job behind this because you cannot anymore some ready made parts some parts of the software like uboot has and to configure the RAM so you have to start to adjust these configurations and there is some more job behind so it can still be done but of course requires some more experience so customizing then this board just just connects a net or net chip mainly you can select what you like so it depends from the interfaces available on the CPU so you can select SPI I2C or SDIO devices or whatever so codecs so I2S or things like that so you follow application nodes generally so there are always from the component you select there are always some application nodes so an additional datasheet with circuits and sample circuits so you can follow partially of course them because they generally use some they can be generic or they use other host CPUs or the like so application can still be done in a further step if you add some connectors so if you want to add some sensors or something else you can keep some general connectors so you don't need to you don't need to fix the hardware to a specific configuration still this board has some UR ports for the bug or other purposes and an RTC and a simple RTC chip so with a cell battery and an additional clock quartz so ok, then finally you complete the electrical error check so of course the CAD tell you if there are some connected wires or something wrong so if you duplicate something or some connection is open things like that then you have to assign of course the modules to the components so in the schematics you just of course select the components but not the package so you will need to associate to to select both packages for each component you want so this is a middle step before passing to the PCB side then the PCB design of course it's not mandatory to be a professional designer to have some simple Linux board working so with some attention avoiding initially some high bass frequencies so a basic board should work there are several good tutorials around I'm not talking just a bit how to design the PCB but I don't want to enter this field because it's very very huge of theory and difficult there are also black magic inside so I'm not going to enter on this too much but just a bit so just to give some guidelines before you start you should focus even later but you can start to check a PCB manufacturer so the price is because each manufacturer has some constraints so they give you the size of the vias of the tracks the minimal track size the minimal viadril and things like that so of course before proceeding with the PCB design you need to know these constraints, these limits then you can of course insert the data of your board in some website and they give as an output several choices of boards and prices and time delivery so you can select between many many chances so this sample board uses this parameter so maybe they can be useful just some means so I used a four layer strategy because I would like not a too much big board so quite small board so I selected a four layer I selected to go for a four layer PCB of course you can decide for a different strategy, it's just a matter also of money and of course how much you want to spend to have the PCB just one scheme one strategy I used is to use four layers so with a top layer with VCC and the ground on the bottom layer and the two signals layers in the middle of course an expert designer can say this is not the best solution some constructors suggest six layers of course there is much theory behind so you should keep signal layers always next to a ground plane this for impedance, return paths and things like that but in any case these first attempts I did worked resistors you generally resistor and common 100 nanofarad capacitors you can select hand soldering paths so a bit wider paths so they can help the soldering and capacitors, of course bypass capacitors need to be always physically near the IC because they have to filter noises and high frequency signals to ground and also of course changing of supply stage so if an IC state then change to active state there can be some power variations so these capacitors are able to help to compensate these jumps so they need to be near the IC and ok, oscillator is not that critical I mean most of the cases it still works even if you don't put too much care, too much attention on the oscillator part but there are some good rules so generally you can also find on the datasheet sometime the PCB layout of the oscillator so keeping the tracks of the same length and ground around, things like that of course helps ok, this is just the back converter part here also you can use for example a USB micro connector so you don't need to add additional components for erroneus power inversion so there cannot be any power inversion so you don't need any MOSFET or diode in seri or things like that and just to keep it simple you can use a fuse or something like that to limit the maximum current so a good grounding also help in this kind of back converters because they need to drain the heat through the ground layer so they are quite hot if they are giving out near the maximum current so they need to of course release this heat so current with of course the tracks need to keep to have the current with for the current they should keep so of course you have to do some approximate calculations of the current that need to pass on a track and of course you can stay much then there is much much more knowledge to improve in case so these are just simple hints so the SD RAM is the most difficult part because if it's not working if it's not rooted correctly things can go bad so the board can have issues so nothing work so there can be the need of terminal resistors so this is a quite quite critical step so there are generally two kind of issues so long tracks reflection or short lines rings so there is a huge theory behind this I prefer to avoid to enter inside this but try to give just some pragmatic hints so there are also some very interesting books about this so checking development boards generally help because those board works so at least you know that if those board have serious terminal resistors so this mean you can replicate that configuration and you know it is working if you consider only the short line ring so we keep the SD RAM near the CPU some serious resistors could be needed of course you can set up the PCB for them and then in case you can short and not use them or do some tests so we will see later in case that the things are a bit different and more complex of course I am doing some some tests here in this board but there are some other power supply involved and some different termination can be used so stain still in the SD RAM this can work some time even without any termination resistor this is how I did it the first time there are some rings but the signal levels are still detected properly on the receiver side so high and low level are still detected properly also because the bus clock is 15 MHz so there are not much issues still there are some academic rules of course the value of this terminator resistor of course this is just a configuration of termination there are several the serious termination is generally one of the most used and simple because you can use just a single resistor and mainly the output impedance of the driving stage must match the impedance of the line so since the output stage is a CMOS stage generally so the output impedance is very near to zero should be zero ideally but is very near so you should add of them a resistor to match the line impedance it is generally 22 ohm but it can vary of course for the the series resistor it is only a compromise because also the output impedance of the driving stage has a different value between high stage high level and low level so you need to find a compromise a pragmatic way could be to use a potentiometer in serje and of course you can find the perfect value to avoid the rings so there is much more theory because it is too wide so at the end once you are rooted in the best possible way the dynamic ram you can also launch the auto-routine because you can reduce quite a lot you can reduce development time so you can even launch it over the night in the morning you will find that some connection was not was unresolved so here the human ability can find a way to close this 10-20 connection of whatever they are left out so then here start the practice part so you can start for example from the power supply so you can just solder all the power supply components and then you check even just by the of course better by scope by oscilloscope the output voltage so you can see if the level is correct and if there are noises if there are some garbage over the DC voltage sometimes it is not so critical sometimes it can even work if it is not a perfect power supply stage here of course the low ESR capacitors helps a lot and also some of course some bypass capacitors to drain to ground some noises is always inserted in power supply stages so once the power supply is working you know it is giving out the correct voltage if you have issues you can still check sample circuits in the datasheet so this is the CPU you can put it of course I forgot to add here that the board should be handled carefully so a bit bit in the border so try to avoid to put the fingers on the devices because are CMOS generally CMOS and they are sensitive to electrostatic discharges but I never broken one I mean so just some careful handling it can help so you put carefully the CPU initially and you have to center it of course here lens can help a lot some also cheap lens of few dollars is ok of few euro once the device once the CPU is well centered you can just fix a corner with some some thin so just a minimal soldering better just one pin so in case you can still adjust it so or one or two pins so it's not important and then you can proceed side by side soldering all the pins this is an operation to be done very carefully so with a very with a very careful hand I mean not pressing not doing any operation that can damage the pins because they are very very easy can easily be bent so you have to be careful and mainly drug on the right and outside so you can transport some thin and when it is forming some when it is when it is too much you can out some way with some movements outside so here the solder paste helps a lot because you have to test some solder paste you can find one that produce very bright shiny soldering so it's very good because a good solder paste helps of course the thin to move away from slide away from shorts so as much is wet and shiny as much easier are the things generally so you can use a lot of solder paste and then you can remove from the tip the solder that the thin that is exceeding so in excess so you can remove it from the tip and you proceed better because you avoid shorts so if soldering are not brilliant are not shiny you can test different solder paste then once the CPU is soldered you can verify by a lens, by a cheap lens nothing special and you should be able to see all the soldering if they are well soldered and also if they are not soldered so generally you are able to see by eye these unsoldered or shorts of course are generally visible shorts and open circuits so a very careful check all around in all four corners generally give you a good a good information about the possibility that the component works at the first power connection so then you need to solder of course the components around so compared to CPU resistors and things like that are really easy so you just need some tweezers some tools to keep it you just put some tin on one pad then you block the components and you solder the other pad so it is not that difficult then you need to solder the debug interface, connector and you can power up and check what is happening so if the power supplies are still there so you probably did a good job mainly there are no shortcuts so no shortcuts to ground so otherwise the voltage can drop down so if the voltage is still there this is a good point otherwise disconnect immediately of course the power supply and check for errors the soldering shape should be like in this picture and at least I find quite easy to solder these three dimensions of resistor and capacitors of course if the soldering is a bit rounded is still good but it is important it is not a ball it must be something more is still good but you have to check carefully sometimes by length if you are not sure but generally you can reach a good soldering to many issues so here is the flash same method so you position it you just fix it on a corner and then you solder it you solder it side by side final length check is of course needed so you can check if there are shorts or open soldering and then some good cleaning with a toothbrush or similar tool and alcohol can give you a very clean and nice result at the end so you can power up and still check if there is the power supply or if there is something strange of course if the component if there is some short cuts most of the cases the component is not damaged because the short don't never damage what is on the valley side but it keep very hot the other side so the power supply so a small tip if there is too much thin on the pads so shorts and things like that you can give some small shots just only blocking with the whistle on the table or some small shots on the table you just you just hit the tin and immediately after you give some small shots and the excess tin run away generally then of course here also there is a length check and quite often see if everything is good here also the same for the synchronous dynamic RAM same process so the pitch is always 0.5mm so it's not that dramatic to solder it so fix a corner and then solder side by side very carefully of course you can do some some mistake oh the time is finish ok, I go very fast to the end if you do some mistake of course you can try to to solve by a needle and some tool and to have the pin not bend anymore so then some preliminary checks so you can do some pin to pin continuity test to see for example the continuity between CPU and flash is ok you can check between pin and pin so you have the full path tested for the continuity and then you check the clock is running so then some checks for the parallel null flash ok, you can create once the CPU is running you create a small binary tool software things so you use some common sequences to program the flash these are common write sequences and you can have some small you can write some small algorithm to test to write and read data and test if the value read are ok or from there you can see if there is some unconnected pin or some shortcuts and then the SD RAM in it is very important because you will use it to flash to write the program on the flash and after the initialization the SD RAM should work so also here you have to you can write some some pattern some pattern on the RAM some simple test routine to test the whole address range it is working and of course you can do some of these checks also through the debugger so you don't need to upload a binary on the internal static RAM but of course I prefer that tool so it is more manageable for me ok, the rest is software so here is the bootloader it is the flash has been partitioned with the 3 partitions so in the first partition there is U boot then there is the kernel with the ROM FS and that's all so this is the kernel booting and I can show some very brief live demo of the board and here we are so so if you have questions yes ok, I use the key card that is an open source open source tool is very friendly I find it friendly and there is also an IRC channel so there are guys that very friendly can help you in the usage is full of tutorial and video and things like that that help you to start so I use the key card for this 4 layer board is still good so other questions yes yes ok, ok I didn't use any test point because I have a good practice with the probes and I can measure of course the pin of the devices in this case are all QFP packages so you can measure on the pin of course, test points are a good thing because measuring sometimes you can do some short so some bad operation you can also do some damage so test points are always better than measuring on the pin but of course yes, they must be design level so also maybe at the schematic level you can add them so I don't remember now but I generally don't use them but it's a good practice of course yes ok, I am not I don't have much experience on manufacturers I mean sometimes there can be manufacturers that offer also manufacturing ok ok ok, yes you can look around also in your hometown near my town also in my town there are some manufacturers that can also produce very small batches so you can go there with the board components and in some days of course when they have the right moment to put the things machines they can do it so you can find them quite easily of course I generally prefer to do this at home because I like to solder so it's just a matter of there can be some more difficult components to solder and now I am soldering some BGA so I am succeeding and of course it's money consuming errors but with some entry level soldering stations 200 euro things like that 300 euro you can start to solder BGA someone solder them with hot air there are various methods so you can press solder the pads but keeping very flat or you can not press solder the pads just solder the BGA by hot air I have several feedbacks that the method works of course not very big BGA but like this is 256 balls so still can work ok, finished thank you