SlideShare una empresa de Scribd logo
1 de 25
Descargar para leer sin conexión
Embedded platform
choices
Tavish Naruka
BaseApp Systems
Microcontroller or linux platform?
Or both?
When prototyping
OR
System which uses only microcontrollers to
function
System which has a linux cpu (may have
microcontrollers too)
Working with microcontrollers
● First step is component selection
○ Does the controller have all the interfaces required
○ Voltage range, cost, memory sizes(flash and ram)
○ Familiarity with the architecture, supported software,
documentation, even community
○ debugger/programmer, toolchain
○ Is some development kit available? If not, then can
you make a pcb for prototyping yourself? Maybe
someone has published a design using this online
Some popular choices
● AVR is probably most popular due to
arduino.
● PIC family of microcontrollers is also popular
● ST microelectronics
● has a few not too expensive dev kits
● TI MSP
Some dev kits
STM32F4 discovery Olimex PIC32-T79
MSP launchpad
PinguinoPIC32
Parallaxpropeller8core
Firmware
● Most code is in C, or assembly. sometimes
C++
● compilers and chip makers often provides
driver libraries and example code for things
like USB, TCP/IP stack, and other
peripherals
● The reference manual is usually a reference
for a family of similar chips, and the
datasheet is the ultimate reference
ARM Cortex M3 memory map
Peripherals and clocks on an
STM ARM cortex m3 chip
● Input voltages
● Memory layout
● How does it boot
● How do interrupts work in this chip
● System clocks
● Details about any peripherals you want to
use like USB, SPI, serial, DMA, timers etc.
Things to read in the manuals
Difference between bare metal and
hosted programs
● Userspace programs running inside an operating
system are hosted
● Code running on a microcontroller, (and linux kernel)
are compiled for a freestanding environment. You (or
mostly the compiler) provides C ‘runtime’
● C startup =
○ Initialize stack, cannot use variables without it
(mostly), or call functions
○ copy values to Initialized variables’ locations in RAM
○ initialize globals to 0
○ Copy read only data like strings to RAM
Why memory layout is important
● There is a well defined way how a chip boots, might
start executing from a particular location
● Peripherals are memory mapped
● Interrupt handlers, are locations reserved for function
pointers in some
● If you want a bootloader, then the application code must
not have any portion located in flash occupied by
bootloader
● This is done using linker scripts
● The C startup code used locations exported by the
linker script to know where from/to copy or paste code
Why microcontrollers
● Small codebase, everything can be controlled
● Instant on
● Real-time behavior
● Low power
● Less supporting hardware
● cheap
● Low level things are easier to tweak than on linux
Why not microcontrollers
● limited choice of languages, toolchain
● debugging can be difficult
● File Systems, networking, graphics etc.
These things may be done on some
microcontrollers, but with a lot more effort
than if using linux
● application portability to a different system
Embedded linux platform
● Embedded, because its not general purpose,
unlike a desktop
● Platform, because it can carry payload of
your application, and become whatever
specific purpose system you design it to be
Hardware
● Linux supports many architectures x86,
x86_64, ARM, MIPS, powerpc, AVR32 etc.
● Not designed for small microcontrollers
● RAM requirement depends on application,
but on a minimum is around 8MB
Where to get
● Evaluation board from chip manufacturer
AM335x starter kit from TI
cont..
● System on module
AM3352 SOM from olimex Carambola SOM placed on board
cont..
● Or designs/products by open hardware community
● Could be from chip makers(like beaglebone from TI),
companies releasing usable boards(like A13 olinuxino
from olimex)
● custom design
Allwinner A13 olinuxino iMX233 Locux BaseApp BeagleBone Black
cont..
● Consumer devices
A Router running linux
BelkinWemoswitch
Smartphones
Smart tv
And lots of industrial Systems
Kindle
● Some ways to create a linux system(root filesystem) are
○ [Yocto project, openembedded, angstrom]
○ [Buildroot, Openwrt]
○ debian debootstrap
○ Can use full featured distros too, like debian(without
desktop environment)
● Sometimes need to optimize for space/speed
○ provide common tools using busybox
○ simpler init, only necessary programs run on boot
○ only required drivers in kernel
○ compressed fs like squashfs
Making a linux system for an
embedded platform
Linux system boot process
● (not x86)
● first instructions execute a bootloader from
ROM which loads another bootloader, or
sometimes linux kernel itself
● The bootloader loads the kernel, passes it
kernel command line(can be hard coded in
kernel image too)
● after loading, it jumps to the kernel’s entry
point
● kernel command line option ‘rootfs’ is
mounted
cont..
● After mounting rootfs, kernel looks for init program,
which becomes the first process, and all other
processes spawn from it.
● kernel loads modules as required
● Usually init would be a standard program, like
○ systemV init
○ systemd(debian uses this)
○ upstart(ubuntu)
○ busybox provided sysV init(common in embedded
systems to conserve space)
● Init parses its init scripts to launch programs as required
● Suppose you need character LCD, keypad,
CD ROM, SD card, network, USB hard disk
● Choose linux platform which is most suitable
○ Needs USB, ethernet, fast enough
● Decide to use serial port to connect to a
microcontroller, which connects to LCD and
keypad
● If only one USB port, put usb hub
● Linux has drivers for serial(for this particular
cpu), usb-storage(both hard disk and SD
card), and usb CD ROM
Example application
cont..
● Program microcontroller so that it accepts
commands for LCD on serial RX, sends
keypad presses on serial TX
● Choose python to write application
● Can mount/unmount hard disk/SD card(usb
mass storage) and cd-rom with
mount/umount
● can use eject to open tray
● can write to serial port with say pyserial
● can access network easily

Más contenido relacionado

La actualidad más candente

Phoenix family overview 080414
Phoenix family overview 080414Phoenix family overview 080414
Phoenix family overview 080414A&D Technology
 
Porting linux to a new architecture
Porting linux to a new architecturePorting linux to a new architecture
Porting linux to a new architectureKALRAY
 
Cloud Computing in practice with OpenNebula ~ Develer workshop 2012
Cloud Computing in practice with OpenNebula ~ Develer workshop 2012Cloud Computing in practice with OpenNebula ~ Develer workshop 2012
Cloud Computing in practice with OpenNebula ~ Develer workshop 2012Giovanni Toraldo
 
General architecture ppt
General architecture pptGeneral architecture ppt
General architecture pptNikita Nagwani
 
Unit 1 2 p2 3 (2)
Unit 1 2  p2 3  (2)Unit 1 2  p2 3  (2)
Unit 1 2 p2 3 (2)jackboy10
 
0.3 arsitektur mikrokontroler
0.3   arsitektur mikrokontroler0.3   arsitektur mikrokontroler
0.3 arsitektur mikrokontrolerAdi Tri Soelistio
 
mbed @ Elektor Live! 2010
mbed @ Elektor Live! 2010mbed @ Elektor Live! 2010
mbed @ Elektor Live! 2010ARM mbed
 
IncludeOS for ics 2018
IncludeOS for ics 2018IncludeOS for ics 2018
IncludeOS for ics 2018Per Buer
 
20111130 hardware-monitoring-with-the-new-ipmi-plugin-v2
20111130 hardware-monitoring-with-the-new-ipmi-plugin-v220111130 hardware-monitoring-with-the-new-ipmi-plugin-v2
20111130 hardware-monitoring-with-the-new-ipmi-plugin-v2Werner Fischer
 
LAS16-400: Mini Conference 3 AOSP (Session 1)
LAS16-400: Mini Conference 3 AOSP (Session 1)LAS16-400: Mini Conference 3 AOSP (Session 1)
LAS16-400: Mini Conference 3 AOSP (Session 1)Linaro
 
A low cost, real-time algorithm for embedded devices based on freertos kernel
A low cost, real-time algorithm for embedded devices based on freertos kernelA low cost, real-time algorithm for embedded devices based on freertos kernel
A low cost, real-time algorithm for embedded devices based on freertos kerneleSAT Journals
 

La actualidad más candente (20)

Vpm
VpmVpm
Vpm
 
Phoenix family overview 080414
Phoenix family overview 080414Phoenix family overview 080414
Phoenix family overview 080414
 
Embedded Operating System - Linux
Embedded Operating System - LinuxEmbedded Operating System - Linux
Embedded Operating System - Linux
 
Masters porting linux
Masters porting linuxMasters porting linux
Masters porting linux
 
Porting linux to a new architecture
Porting linux to a new architecturePorting linux to a new architecture
Porting linux to a new architecture
 
Embedded Android : System Development - Part III (Audio / Video HAL)
Embedded Android : System Development - Part III (Audio / Video HAL)Embedded Android : System Development - Part III (Audio / Video HAL)
Embedded Android : System Development - Part III (Audio / Video HAL)
 
Cloud Computing in practice with OpenNebula ~ Develer workshop 2012
Cloud Computing in practice with OpenNebula ~ Develer workshop 2012Cloud Computing in practice with OpenNebula ~ Develer workshop 2012
Cloud Computing in practice with OpenNebula ~ Develer workshop 2012
 
General architecture ppt
General architecture pptGeneral architecture ppt
General architecture ppt
 
Unit 1 2 p2 3 (2)
Unit 1 2  p2 3  (2)Unit 1 2  p2 3  (2)
Unit 1 2 p2 3 (2)
 
0.3 arsitektur mikrokontroler
0.3   arsitektur mikrokontroler0.3   arsitektur mikrokontroler
0.3 arsitektur mikrokontroler
 
mbed @ Elektor Live! 2010
mbed @ Elektor Live! 2010mbed @ Elektor Live! 2010
mbed @ Elektor Live! 2010
 
Embedded Android : System Development - Part II (HAL)
Embedded Android : System Development - Part II (HAL)Embedded Android : System Development - Part II (HAL)
Embedded Android : System Development - Part II (HAL)
 
Arm processor
Arm processorArm processor
Arm processor
 
Android Things : Building Embedded Devices
Android Things : Building Embedded DevicesAndroid Things : Building Embedded Devices
Android Things : Building Embedded Devices
 
Linux systems - Getting started with setting up and embedded platform
Linux systems - Getting started with setting up and embedded platformLinux systems - Getting started with setting up and embedded platform
Linux systems - Getting started with setting up and embedded platform
 
IncludeOS for ics 2018
IncludeOS for ics 2018IncludeOS for ics 2018
IncludeOS for ics 2018
 
20111130 hardware-monitoring-with-the-new-ipmi-plugin-v2
20111130 hardware-monitoring-with-the-new-ipmi-plugin-v220111130 hardware-monitoring-with-the-new-ipmi-plugin-v2
20111130 hardware-monitoring-with-the-new-ipmi-plugin-v2
 
Lect16
Lect16Lect16
Lect16
 
LAS16-400: Mini Conference 3 AOSP (Session 1)
LAS16-400: Mini Conference 3 AOSP (Session 1)LAS16-400: Mini Conference 3 AOSP (Session 1)
LAS16-400: Mini Conference 3 AOSP (Session 1)
 
A low cost, real-time algorithm for embedded devices based on freertos kernel
A low cost, real-time algorithm for embedded devices based on freertos kernelA low cost, real-time algorithm for embedded devices based on freertos kernel
A low cost, real-time algorithm for embedded devices based on freertos kernel
 

Similar a Embedded platform choices

01 linux-quick-start
01 linux-quick-start01 linux-quick-start
01 linux-quick-startNguyen Vinh
 
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSDLAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSDLinaro
 
Introduction to Firmware
Introduction to FirmwareIntroduction to Firmware
Introduction to FirmwareCaroline Murphy
 
Add sale davinci
Add sale davinciAdd sale davinci
Add sale davinciAkash Sahoo
 
Deep Learning on ARM Platforms - SFO17-509
Deep Learning on ARM Platforms - SFO17-509Deep Learning on ARM Platforms - SFO17-509
Deep Learning on ARM Platforms - SFO17-509Linaro
 
Module 4 Embedded Linux
Module 4 Embedded LinuxModule 4 Embedded Linux
Module 4 Embedded LinuxTushar B Kute
 
LAS16-402: ARM Trusted Firmware – from Enterprise to Embedded
LAS16-402: ARM Trusted Firmware – from Enterprise to EmbeddedLAS16-402: ARM Trusted Firmware – from Enterprise to Embedded
LAS16-402: ARM Trusted Firmware – from Enterprise to EmbeddedLinaro
 
Building Embedded Linux Full Tutorial for ARM
Building Embedded Linux Full Tutorial for ARMBuilding Embedded Linux Full Tutorial for ARM
Building Embedded Linux Full Tutorial for ARMSherif Mousa
 
Heterogeneous multiprocessing on androd and i.mx7
Heterogeneous multiprocessing on androd and i.mx7Heterogeneous multiprocessing on androd and i.mx7
Heterogeneous multiprocessing on androd and i.mx7Kynetics
 
Linux kernel modules
Linux kernel modulesLinux kernel modules
Linux kernel modulesEddy Reyes
 
High-Performance Computing with C++
High-Performance Computing with C++High-Performance Computing with C++
High-Performance Computing with C++JetBrains
 
TMSLF2407 DSP Controller
TMSLF2407 DSP ControllerTMSLF2407 DSP Controller
TMSLF2407 DSP ControllerANIRUDDHMAINI1
 
Introduction to FreeRTOS
Introduction to FreeRTOSIntroduction to FreeRTOS
Introduction to FreeRTOSICS
 

Similar a Embedded platform choices (20)

01 linux-quick-start
01 linux-quick-start01 linux-quick-start
01 linux-quick-start
 
Embedded Linux on ARM
Embedded Linux on ARMEmbedded Linux on ARM
Embedded Linux on ARM
 
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSDLAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
LAS16-210: Hardware Assisted Tracing on ARM with CoreSight and OpenCSD
 
Hardware hacking
Hardware hackingHardware hacking
Hardware hacking
 
Embedded Linux on ARM
Embedded Linux on ARMEmbedded Linux on ARM
Embedded Linux on ARM
 
TMS320DM8148 Embedded Linux
TMS320DM8148 Embedded LinuxTMS320DM8148 Embedded Linux
TMS320DM8148 Embedded Linux
 
Introduction to Firmware
Introduction to FirmwareIntroduction to Firmware
Introduction to Firmware
 
Add sale davinci
Add sale davinciAdd sale davinci
Add sale davinci
 
Hands on OpenCL
Hands on OpenCLHands on OpenCL
Hands on OpenCL
 
Deep Learning on ARM Platforms - SFO17-509
Deep Learning on ARM Platforms - SFO17-509Deep Learning on ARM Platforms - SFO17-509
Deep Learning on ARM Platforms - SFO17-509
 
Module 4 Embedded Linux
Module 4 Embedded LinuxModule 4 Embedded Linux
Module 4 Embedded Linux
 
LAS16-402: ARM Trusted Firmware – from Enterprise to Embedded
LAS16-402: ARM Trusted Firmware – from Enterprise to EmbeddedLAS16-402: ARM Trusted Firmware – from Enterprise to Embedded
LAS16-402: ARM Trusted Firmware – from Enterprise to Embedded
 
Building Embedded Linux Full Tutorial for ARM
Building Embedded Linux Full Tutorial for ARMBuilding Embedded Linux Full Tutorial for ARM
Building Embedded Linux Full Tutorial for ARM
 
Heterogeneous multiprocessing on androd and i.mx7
Heterogeneous multiprocessing on androd and i.mx7Heterogeneous multiprocessing on androd and i.mx7
Heterogeneous multiprocessing on androd and i.mx7
 
Linux kernel modules
Linux kernel modulesLinux kernel modules
Linux kernel modules
 
High-Performance Computing with C++
High-Performance Computing with C++High-Performance Computing with C++
High-Performance Computing with C++
 
Embedded Linux - Building toolchain
Embedded Linux - Building toolchainEmbedded Linux - Building toolchain
Embedded Linux - Building toolchain
 
TMSLF2407 DSP Controller
TMSLF2407 DSP ControllerTMSLF2407 DSP Controller
TMSLF2407 DSP Controller
 
Porting Android
Porting AndroidPorting Android
Porting Android
 
Introduction to FreeRTOS
Introduction to FreeRTOSIntroduction to FreeRTOS
Introduction to FreeRTOS
 

Último

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 

Último (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 

Embedded platform choices

  • 2. Microcontroller or linux platform? Or both? When prototyping OR
  • 3. System which uses only microcontrollers to function System which has a linux cpu (may have microcontrollers too)
  • 4. Working with microcontrollers ● First step is component selection ○ Does the controller have all the interfaces required ○ Voltage range, cost, memory sizes(flash and ram) ○ Familiarity with the architecture, supported software, documentation, even community ○ debugger/programmer, toolchain ○ Is some development kit available? If not, then can you make a pcb for prototyping yourself? Maybe someone has published a design using this online
  • 5. Some popular choices ● AVR is probably most popular due to arduino. ● PIC family of microcontrollers is also popular ● ST microelectronics ● has a few not too expensive dev kits ● TI MSP
  • 6. Some dev kits STM32F4 discovery Olimex PIC32-T79 MSP launchpad PinguinoPIC32 Parallaxpropeller8core
  • 7. Firmware ● Most code is in C, or assembly. sometimes C++ ● compilers and chip makers often provides driver libraries and example code for things like USB, TCP/IP stack, and other peripherals ● The reference manual is usually a reference for a family of similar chips, and the datasheet is the ultimate reference
  • 8. ARM Cortex M3 memory map
  • 9. Peripherals and clocks on an STM ARM cortex m3 chip
  • 10. ● Input voltages ● Memory layout ● How does it boot ● How do interrupts work in this chip ● System clocks ● Details about any peripherals you want to use like USB, SPI, serial, DMA, timers etc. Things to read in the manuals
  • 11. Difference between bare metal and hosted programs ● Userspace programs running inside an operating system are hosted ● Code running on a microcontroller, (and linux kernel) are compiled for a freestanding environment. You (or mostly the compiler) provides C ‘runtime’ ● C startup = ○ Initialize stack, cannot use variables without it (mostly), or call functions ○ copy values to Initialized variables’ locations in RAM ○ initialize globals to 0 ○ Copy read only data like strings to RAM
  • 12. Why memory layout is important ● There is a well defined way how a chip boots, might start executing from a particular location ● Peripherals are memory mapped ● Interrupt handlers, are locations reserved for function pointers in some ● If you want a bootloader, then the application code must not have any portion located in flash occupied by bootloader ● This is done using linker scripts ● The C startup code used locations exported by the linker script to know where from/to copy or paste code
  • 13. Why microcontrollers ● Small codebase, everything can be controlled ● Instant on ● Real-time behavior ● Low power ● Less supporting hardware ● cheap ● Low level things are easier to tweak than on linux
  • 14. Why not microcontrollers ● limited choice of languages, toolchain ● debugging can be difficult ● File Systems, networking, graphics etc. These things may be done on some microcontrollers, but with a lot more effort than if using linux ● application portability to a different system
  • 15. Embedded linux platform ● Embedded, because its not general purpose, unlike a desktop ● Platform, because it can carry payload of your application, and become whatever specific purpose system you design it to be
  • 16. Hardware ● Linux supports many architectures x86, x86_64, ARM, MIPS, powerpc, AVR32 etc. ● Not designed for small microcontrollers ● RAM requirement depends on application, but on a minimum is around 8MB
  • 17. Where to get ● Evaluation board from chip manufacturer AM335x starter kit from TI
  • 18. cont.. ● System on module AM3352 SOM from olimex Carambola SOM placed on board
  • 19. cont.. ● Or designs/products by open hardware community ● Could be from chip makers(like beaglebone from TI), companies releasing usable boards(like A13 olinuxino from olimex) ● custom design Allwinner A13 olinuxino iMX233 Locux BaseApp BeagleBone Black
  • 20. cont.. ● Consumer devices A Router running linux BelkinWemoswitch Smartphones Smart tv And lots of industrial Systems Kindle
  • 21. ● Some ways to create a linux system(root filesystem) are ○ [Yocto project, openembedded, angstrom] ○ [Buildroot, Openwrt] ○ debian debootstrap ○ Can use full featured distros too, like debian(without desktop environment) ● Sometimes need to optimize for space/speed ○ provide common tools using busybox ○ simpler init, only necessary programs run on boot ○ only required drivers in kernel ○ compressed fs like squashfs Making a linux system for an embedded platform
  • 22. Linux system boot process ● (not x86) ● first instructions execute a bootloader from ROM which loads another bootloader, or sometimes linux kernel itself ● The bootloader loads the kernel, passes it kernel command line(can be hard coded in kernel image too) ● after loading, it jumps to the kernel’s entry point ● kernel command line option ‘rootfs’ is mounted
  • 23. cont.. ● After mounting rootfs, kernel looks for init program, which becomes the first process, and all other processes spawn from it. ● kernel loads modules as required ● Usually init would be a standard program, like ○ systemV init ○ systemd(debian uses this) ○ upstart(ubuntu) ○ busybox provided sysV init(common in embedded systems to conserve space) ● Init parses its init scripts to launch programs as required
  • 24. ● Suppose you need character LCD, keypad, CD ROM, SD card, network, USB hard disk ● Choose linux platform which is most suitable ○ Needs USB, ethernet, fast enough ● Decide to use serial port to connect to a microcontroller, which connects to LCD and keypad ● If only one USB port, put usb hub ● Linux has drivers for serial(for this particular cpu), usb-storage(both hard disk and SD card), and usb CD ROM Example application
  • 25. cont.. ● Program microcontroller so that it accepts commands for LCD on serial RX, sends keypad presses on serial TX ● Choose python to write application ● Can mount/unmount hard disk/SD card(usb mass storage) and cd-rom with mount/umount ● can use eject to open tray ● can write to serial port with say pyserial ● can access network easily