10 things that make software
integration easier
H/WExpo 2016
10 things that make software integration easier 1 Copyright © 2011-2016, 2net Ltd
About Chris Simmonds
• Consultant and trainer
• Author of Mastering Embedded Linux
Programming
• Working with embedded Linux since 1999
• Android since 2009
• Speaker at many conferences and
workshops
"Looking after the Inner Penguin" blog at http://2net.co.uk/
https://uk.linkedin.com/in/chrisdsimmonds/
https://google.com/+chrissimmonds
10 things that make software integration easier 2 Copyright © 2011-2016, 2net Ltd
The problem
• Q. How many hardware engineers does it take to
change a light bulb?
10 things that make software integration easier 3 Copyright © 2011-2016, 2net Ltd
The problem
• Q. How many hardware engineers does it take to
change a light bulb?
• A. None: we’ll fix it in software
10 things that make software integration easier 3 Copyright © 2011-2016, 2net Ltd
The problem
• Q. How many hardware engineers does it take to
change a light bulb?
• A. None: we’ll fix it in software
• Q. How many software engineers does it take to
change a light bulb?
10 things that make software integration easier 3 Copyright © 2011-2016, 2net Ltd
The problem
• Q. How many hardware engineers does it take to
change a light bulb?
• A. None: we’ll fix it in software
• Q. How many software engineers does it take to
change a light bulb?
• A. None: that’s a hardware problem
10 things that make software integration easier 3 Copyright © 2011-2016, 2net Ltd
Some ideas
• Here are my top 10 ideas that will make software
integration easier, faster and less stressful
• I work mostly with Linux and Android, so they are
biased in that direction...
10 things that make software integration easier 4 Copyright © 2011-2016, 2net Ltd
1: Choose chips with good software
support
• Lack of support for $OS is biggest bugbear
• Don’t rely on what the salesman says: demand to
see the code
• Check that it:
• is up to date
• works with the version of $OS you are using
• will be supported over the lifetime of your product
10 things that make software integration easier 5 Copyright © 2011-2016, 2net Ltd
Background on vendor kernels
• In the case of Linux, ask if the support is in mainline
• If not, why not?
Mainline
Vendor
4.N 4.N+44.N+24.N+1 4.N+3
4.N 4.N+4
10 things that make software integration easier 6 Copyright © 2011-2016, 2net Ltd
2: Stick to the vendor reference
design
• Keep it simple: minimal changes are good for us
10 things that make software integration easier 7 Copyright © 2011-2016, 2net Ltd
3: Fit a JTAG connector
• How else to debug the bootloader?
10 things that make software integration easier 8 Copyright © 2011-2016, 2net Ltd
4: Fit a serial console
• Once the $OS kernel has started, debug is usually
via a serial console
• It is really helpful to reserve a UART for this purpose
10 things that make software integration easier 9 Copyright © 2011-2016, 2net Ltd
5: Fit more RAM
• Double it!
• You would be surprised how much memory we can
use up
• It takes developement time to reduce the memory
footprint
10 things that make software integration easier 10 Copyright © 2011-2016, 2net Ltd
6: Fit more flash memory
• See 5
10 things that make software integration easier 11 Copyright © 2011-2016, 2net Ltd
7: Think about in-field update
• Double amount of flash for redundant copies of OS
• Or, fit removeable storage (USB, uSD) for local
upgrade
10 things that make software integration easier 12 Copyright © 2011-2016, 2net Ltd
8: Don’t use the main CPU to flash an
LED
• Use LED with flash mode: saves waking the main
CPU up every half cycle
• Likewise, maybe use a buzzer rather than employing
a full audio stack to sound an alert
10 things that make software integration easier 13 Copyright © 2011-2016, 2net Ltd
9: Hard real-time in microcontroller
• In the case of Linux, it can perform hard real-time
mission-critical tasks
• But, bear in mind that the hardware of a typical SoC
is not deterministic
• Probably better to offload to a PIC or Cortex-M
10 things that make software integration easier 14 Copyright © 2011-2016, 2net Ltd
10: Anti-brick mode
• Provide some way to recover when the bootloader is
broken
• e.g. image load via USB, serial, JTAG
10 things that make software integration easier 15 Copyright © 2011-2016, 2net Ltd
Bonus: Don’t multiplx those pins
• Try to avoid multiplexing ports (e.g. serial) so that one
port can perform several different roles
• It complicates drivers and applications
• There is always a case when you need both functions
at the same time
• Example: serial console and GSM modem
multiplexed to the same port, making it difficult to
debug the modem
10 things that make software integration easier 16 Copyright © 2011-2016, 2net Ltd
Bonus: Board ident
• Fit some means of identifying one version of a board
from another (e.g. GPIO pins with pull up/down
resistors)
• Means that one s/w image can be used on multiple
boards
• (make sure there are enough bits to cover the
anticipated number of variants)
10 things that make software integration easier 17 Copyright © 2011-2016, 2net Ltd
Utopia
Stopping Bootlog daemon: bo
Poky (Yocto Project Refer
sama5d4-xplained login: root
root@sama5d4-xplained:~#
root@sama5d4-xplained:~#
root@sama5d4-xplained:~#
• Hardware and software engineers should talk to each
other more
• It helps if software engineer are involved in the early
design
10 things that make software integration easier 18 Copyright © 2011-2016, 2net Ltd

10 ways hardware engineers can make software integration easier

  • 1.
    10 things thatmake software integration easier H/WExpo 2016 10 things that make software integration easier 1 Copyright © 2011-2016, 2net Ltd
  • 2.
    About Chris Simmonds •Consultant and trainer • Author of Mastering Embedded Linux Programming • Working with embedded Linux since 1999 • Android since 2009 • Speaker at many conferences and workshops "Looking after the Inner Penguin" blog at http://2net.co.uk/ https://uk.linkedin.com/in/chrisdsimmonds/ https://google.com/+chrissimmonds 10 things that make software integration easier 2 Copyright © 2011-2016, 2net Ltd
  • 3.
    The problem • Q.How many hardware engineers does it take to change a light bulb? 10 things that make software integration easier 3 Copyright © 2011-2016, 2net Ltd
  • 4.
    The problem • Q.How many hardware engineers does it take to change a light bulb? • A. None: we’ll fix it in software 10 things that make software integration easier 3 Copyright © 2011-2016, 2net Ltd
  • 5.
    The problem • Q.How many hardware engineers does it take to change a light bulb? • A. None: we’ll fix it in software • Q. How many software engineers does it take to change a light bulb? 10 things that make software integration easier 3 Copyright © 2011-2016, 2net Ltd
  • 6.
    The problem • Q.How many hardware engineers does it take to change a light bulb? • A. None: we’ll fix it in software • Q. How many software engineers does it take to change a light bulb? • A. None: that’s a hardware problem 10 things that make software integration easier 3 Copyright © 2011-2016, 2net Ltd
  • 7.
    Some ideas • Hereare my top 10 ideas that will make software integration easier, faster and less stressful • I work mostly with Linux and Android, so they are biased in that direction... 10 things that make software integration easier 4 Copyright © 2011-2016, 2net Ltd
  • 8.
    1: Choose chipswith good software support • Lack of support for $OS is biggest bugbear • Don’t rely on what the salesman says: demand to see the code • Check that it: • is up to date • works with the version of $OS you are using • will be supported over the lifetime of your product 10 things that make software integration easier 5 Copyright © 2011-2016, 2net Ltd
  • 9.
    Background on vendorkernels • In the case of Linux, ask if the support is in mainline • If not, why not? Mainline Vendor 4.N 4.N+44.N+24.N+1 4.N+3 4.N 4.N+4 10 things that make software integration easier 6 Copyright © 2011-2016, 2net Ltd
  • 10.
    2: Stick tothe vendor reference design • Keep it simple: minimal changes are good for us 10 things that make software integration easier 7 Copyright © 2011-2016, 2net Ltd
  • 11.
    3: Fit aJTAG connector • How else to debug the bootloader? 10 things that make software integration easier 8 Copyright © 2011-2016, 2net Ltd
  • 12.
    4: Fit aserial console • Once the $OS kernel has started, debug is usually via a serial console • It is really helpful to reserve a UART for this purpose 10 things that make software integration easier 9 Copyright © 2011-2016, 2net Ltd
  • 13.
    5: Fit moreRAM • Double it! • You would be surprised how much memory we can use up • It takes developement time to reduce the memory footprint 10 things that make software integration easier 10 Copyright © 2011-2016, 2net Ltd
  • 14.
    6: Fit moreflash memory • See 5 10 things that make software integration easier 11 Copyright © 2011-2016, 2net Ltd
  • 15.
    7: Think aboutin-field update • Double amount of flash for redundant copies of OS • Or, fit removeable storage (USB, uSD) for local upgrade 10 things that make software integration easier 12 Copyright © 2011-2016, 2net Ltd
  • 16.
    8: Don’t usethe main CPU to flash an LED • Use LED with flash mode: saves waking the main CPU up every half cycle • Likewise, maybe use a buzzer rather than employing a full audio stack to sound an alert 10 things that make software integration easier 13 Copyright © 2011-2016, 2net Ltd
  • 17.
    9: Hard real-timein microcontroller • In the case of Linux, it can perform hard real-time mission-critical tasks • But, bear in mind that the hardware of a typical SoC is not deterministic • Probably better to offload to a PIC or Cortex-M 10 things that make software integration easier 14 Copyright © 2011-2016, 2net Ltd
  • 18.
    10: Anti-brick mode •Provide some way to recover when the bootloader is broken • e.g. image load via USB, serial, JTAG 10 things that make software integration easier 15 Copyright © 2011-2016, 2net Ltd
  • 19.
    Bonus: Don’t multiplxthose pins • Try to avoid multiplexing ports (e.g. serial) so that one port can perform several different roles • It complicates drivers and applications • There is always a case when you need both functions at the same time • Example: serial console and GSM modem multiplexed to the same port, making it difficult to debug the modem 10 things that make software integration easier 16 Copyright © 2011-2016, 2net Ltd
  • 20.
    Bonus: Board ident •Fit some means of identifying one version of a board from another (e.g. GPIO pins with pull up/down resistors) • Means that one s/w image can be used on multiple boards • (make sure there are enough bits to cover the anticipated number of variants) 10 things that make software integration easier 17 Copyright © 2011-2016, 2net Ltd
  • 21.
    Utopia Stopping Bootlog daemon:bo Poky (Yocto Project Refer sama5d4-xplained login: root root@sama5d4-xplained:~# root@sama5d4-xplained:~# root@sama5d4-xplained:~# • Hardware and software engineers should talk to each other more • It helps if software engineer are involved in the early design 10 things that make software integration easier 18 Copyright © 2011-2016, 2net Ltd