Close

Embedded Systems Hack Chat Transcript

A event log for Embedded Systems Hack Chat

Beyond Arduino: Getting Deeper into Embedded Systems

jordan-bunkerJordan Bunker 09/08/2017 at 20:342 Comments

Shulie Tornel Alrighty, let's begin! @elecia Can you please give us a short introduction about yourself?

Elecia White I am an embedded software engineer, been at it for awhile (20 years+). I've worked on DNA scanners, toys for children, gunshot location systems, and a bunch of other neat stuff.

Elecia White I wrote Making Embedded Systems (published by O'Reilly), I host a podcast called Embedded.fm, and I edit and write for the Embedded.fm blog.

Elecia White I really like making things but I tend toward products more than my own projects.

Elecia White (Do I just go on until one of you asks a question?)

Shulie Tornel I'll pull questions from the sheet

Elecia White Currently, I'm an embedded software consultant for my very own company, Logical Elegance.

Elecia White I think Taako had some good questions...

Shulie Tornel Thanks so much, @elecia!

taako.magnusen :)

Shulie Tornel We can start with his first, if you'd like

Shulie Tornel @taako.magnusen : Do professional embedded systems developers use the libraries provided by vendors such as the STMCube/STL or TI's peripheral libraries and if they don't do they reimplement everything from the register level?

Elecia White (I mean, of course, there were lots of good questions but Taako's were ones I wanted to answer.)

Elecia White Yes, we use the HALs when we can.

Elecia White It saves us from having to learn the depths of every chip... mostly. You do have to be aware that the HALs are example code as much as usable code.

Elecia White Reading the HAL is a great way to understand the chip better but sometimes they have bugs. So treat it as partially-tested code and be a little wary.

Elecia White They are getting better so someday my answer will switch to an unqualified yes. But we aren't there yet.

Shulie Tornel @Muriel Green has a quesetion about a project:

Shulie Tornel "I have an arduino prototype that I want to slim down to only necessary components. Other than teaching myself EAGLE and designing a PCB, what else should I look for or learn to transition this product from arduino to something mass-producable?"

Julius (Mr. Seeker) I consider that a good question. I have heard that one a lot at the hackerspace

Elecia White Yeah, I saw that one. :) I think that requires a book to answer. Let me think what I can say that can be useful but not discouraging.

Lucas Rangit MAGASWERAN I have a similar question: How do you learn how to take a reference design (dev kit) and make a custom board with it? Is there a good resource that can teach just enough to get it done quickly, since you're just "copy pasting"?

Elecia White When I think of mass-production, I usually assume closed-source

Elecia White And that is where Arduino runs into problems... once you start selling things the licenses need to be reviewed.

darryln Reimplement without Arduino, from bare metal.

Elecia White So yeah, the hardware is part of it but I worry more about my software (note: my background is more software than hardware so this should be taken with a grain of salt)

Julius (Mr. Seeker) using the arduino libs?

Elecia White reimplement w/out Arduio from bare metal is often too big of a project so how do you find a space in between

Elecia White You can use most of the Arduino libs as libs as long as you don't mod them. (LGPL)

Elecia White https://choosealicense.com/licenses/

CHOOSE A LICENSE

Licenses

Non-judgmental guidance on choosing a license for your open source project

Read this on Choose a License >

Marko Shiva Pavlovic Hello @Elecia White

Boian Mitov Read the library license. Most open source libraries are permissive for closed source products

Lucas Rangit MAGASWERAN Is starting a consulting service that takes Arduino prototypes to production a viable business?

Elecia White So that link is for Choose a License and it breaks down some of what you can and can't do for different ones.

darryln bookmarked

Marko Shiva Pavlovic Yes including GPLv3 except maybe AGPLv3

Elecia White I don't know about "most open source libraries are permissive"... GPL on the whole is not, LGPL is ok but can get you into trouble when you extend their code to do what you want

darryln MIT is permissive

Shulie Tornel Mr. Deep Cat has a question re: Arduino as well: When working with multiple Arduino I found several I2C conflicts, is there any kind of 'dedicated I2C Hub/hardware server' to simplify connections and to avoid clashes?

Elecia White yes, MIT and Apache are great, my favorites.

Elecia White ok, is Mr. Deep Cat here?

Marko Shiva Pavlovic MIT is like a public licence you can put in public domain if you use them :)

Elecia White I wasn't sure if the problem was multiple I2C devices with the same address or some other conflict

Shulie Tornel pinging mr. deep cat?

Shulie Tornel We can move on

Lucas Rangit MAGASWERAN I think Groove and similar shields try to solve that problem

Shulie Tornel Doug: Do you think learning C and an RTOS is needed versus the simple interface for Arduino?

Elecia White I once needed to use 5 accelerometers on a project and ended up with different vendors so that the addresses didn't collide, it was a pain.

Joshua Lifton There wasn't a way to set the address?

Sai Yamanoor I2C multiplexers are an option

Julius (Mr. Seeker) hardcoded most likely

Lucas Rangit MAGASWERAN yeah, i2c mux are used for that

Elecia White I think the simple interface for Arduino is more limiting than you know if that is all you've used. C is great, sure, my favorite language. But Arduino is C++ and that is good, stay there if you can, lots of good stuff.

Elecia White RTOS? You don't have one with Arduino, just the init and the loop. But they can be nice...

Elecia White I tend to suggest mbed or platformio as next steps after Arduino

Elecia White https://developer.mbed.org/

http://platformio.org/

Edgar +1 on mbed

Elecia White They are both easy to set up for most development OSs and they support many different boards.

Elecia White They come with libraries and try to make for an Arduino-like experience.

zacharyklitten I've been thinking about designing an embedded system to monitor and run an automated chicken coop. Still early on, but I want to connect it to an app. Been thinking about going with Arduino or Raspberry Pi maybe for better scalability down the line.

Lalks They are for prototyping purposes..

Lucas Rangit MAGASWERAN Doug: Some boards with radios for bluetooth or zigbee, run an RTOS behind the scenes and give your the same setup() and loop() functions to use from the Arduino IDE. But you have to know how an RTOS scheduler works so that you don't interfere with it's operations.

Julius (Mr. Seeker) The problem with Arduino is that on the long run, they will fail after a day or two due to buffer overflows...

Lucas Rangit MAGASWERAN @Julius (Mr. Seeker) that's a big issue. do you have a reference?

darryln Arduino and Pi are great and all, but if you want a fairly clean unencumbered path to proprietary design and production, select a CPU and an eval board from the CPU silicon vendor (or its hw licensees). 

Elecia White Yes, nordic and ti both have good RTOSs. You don't have to think too much about them, they run in the background and give you an Arduino-like experience (well, times 2 on complexity due to callbacks but they explain it)

Audi McAvoy @Julius (Mr. Seeker) I have a one-off Arduino project that has been live 24-7 for about three years now.

Kevin I just got here. Re: HAL's I have been looking at supplied example code to use the USI peripheral of an ATMEL AVR device to receive serial data. I found it didn't work properly. I wound up just modifying the USI sending routines to handle the receive. Not the first time I've found sample code that doesn't work, or doesn't satisfy my needs.

Julius (Mr. Seeker) had someone with a project to do plant monitoring, broke down every 2-3 days for some unknown reason. Cause was a bug in one of the libraries (if my mind served me well)

Elecia White Arduino isn't one thing... maybe some specs? Or are we all saying UNOs?

zacharyklitten @darryln Thanks for the info! I'm new to the micro-controller scene and I suppose I'll think about that after prototyping.

pawel.wojcicki Probably I't would be good to introduce with hierarchical state machine at first to change way of writing code.

Evan Juras Jumping in with a question! One of the topics advertised for this chat was how to choose which microprocessor to use for your project... Can you elaborate on that? How do you choose a good processor for your application?

Elecia White Depending on your planned scaling and how you want to talk to an app, I'd start with RPi or a BLE dev kit

Elecia White That's in the sheet too... ok so I have a process for choosing...

Shulie Tornel @Evan Juras Please add your question here: https://docs.google.com/spreadsheets/d/1kfTzK1j4dTzoOrotlLQ-5VsNvoyQsfSWCZKAvqih8bE/edit#gid=0

Audi McAvoy Good point. My Arduino was not an UNO (can't remember what it was for sure though).

Elecia White 1. What did I use in the last similar project? Did the vendor come out with a new rev that is better?

Kevin Choosing a micro. That's changed a lot from early days. So many choices now available.

shamylmansoor @Make Magazine had a cool comparison of currently available boards. I think in the last volume

Elecia White 2. If not, does this vendor have something similar in a close line? Or do their competitors have something really nice for less money?

Anthony I am thinking of making a simple battery management board for a few 18650 batteries. What microcontroller would you suggest?

Elecia White 3. If not, usually because I need a radically different feature like GPU, WiFi or BLE, then start from scratch

Lucas Rangit MAGASWERAN @shamylmansoor https://makezine.com/comparison/boards/how-we-test/shootout/ ?

Elecia White Make Volume 17 Board Guide 2017

Elecia White I do tend to be loyal to vendors not only because I get used to the chip docs but also because I hate changing tools. (I do it all the time being a consultant but I still hate it.)

Elecia White Make Volume 57 Board Guide 2017

Elecia White (sorry)

shamylmansoor @Lucas Rangit MAGASWERAN I guess this one too, and Make Volume 57 as well

darryln choosing micro: don't forget to verify supply chain as part of decision. price breaks, lead time, other major customers who hoover up the channel supply

Elecia White Lead time can be a huge thing

Julius (Mr. Seeker) well, I am a consultant and I always say to our programmers: "stick to the stuff that works, do not try to reinvent the idiot"

Elecia White Nothing like having a crazy 6 month delivery schedule with 10 sample processors and a 32 week lead time for more

Lalks @Julius (Mr. Seeker) Can it sometimes brings optimization issues ?

Elecia White The stick to stuff that works is one reason to at least look at the HAL and vendor sample code.... it may not be perfect but it works more than nothing so can spend the dev time testing it.

Elecia White Working, then readable, then optimized

Elecia White Optimizing first sometimes precludes working

Lalks That's true

Jon How do you balance, "stick to the stuff that works" and "Improvement" ?

Julius (Mr. Seeker) @Lalks unintended behavior due to time limitations... the ones I usually encounter when its in production.

Shulie Tornel Let's get a question in from the sheet. :) Foaly: "You said that HALs sometimes have bugs. How do you deal with that? Fix the bug inside the HAL? Rewrite the function in user space? Ask the company for a fix even though they sometimes thank you but never actually take care of it?"

Elecia White Variably, yes, yes, yes.

Audi McAvoy Good one!

Evan Juras What's a HAL? :)

Julius (Mr. Seeker) Hardware Abstraction Layer, but that is as far as I know...

Kevin Hardware Abstraction Layer

darryln yes, yes, yes, and get used to maintaining all the patches, lol (ASL FTW!)

Elecia White hardware abstraction layer: the code you get from the chip vendor, usually drivers like I2C and SPI and clock setup

Evan Juras Ah, thank you

Joshua Lifton Also a computer that kills its users.

Lucas Rangit MAGASWERAN @darryln ASL as in ACPI ASL?

darryln Atmel Software libs

Kevin @Joshua Lifton :)

Elecia White Fix the bug for sure, usually I do it in my code so I can update the HAL version later or I make big notes about the local mod

Shulie Tornel @Rob asks: What in your opionion is the most "Linux friendly" tool chain and uC line? I'm deeply married to linux and I am starting to move past arduinos. Should I stick with Atmel and avrdude?

Foalyy @darryln I was actually thinking of Atmel :)

Elecia White Let the vendor know, they often don't care but still let them know.

Foalyy Thanks for the answer @elecia

Elecia White GCC with GDB

Kevin Interesting question from @Rob

darryln ditto gcc gdb

Julius (Mr. Seeker) for linux, gcc is the best :)

darryln openocd too

Elecia White Sublime or emacs or vi or whatever your preferred editor is. Then you can use JLink or Black Magic Probe to debug

Anthony Are there any renowned micros I should look into for battery balancing? Thanks :D

Elecia White Though, you can use mbed and platformio there too, I think.

Rob Thanks!

Shulie Tornel Here are a few 'favorites' questions.... @maclean.at: Favorite Hardware and Toolchain?

Kevin There are cross-compiler versions of GCC for ARM systems and various microcontrollers.

Rob Yes i've been playing with platformio. Need to really contain that it does a lot of weird to atom.

Elecia White Many cross compilers for arm.

Rob as it des*

Elecia White Favorite hardware and toolchain: whatever is newly landed on my desk and whatever it's vendor tutorial uses for toolchain. Or maybe STM32 and IAR. Or Nordic and gcc w/ VSCode. Or TI and anything but CCS. I do miss my TI DSPs and having to really get into the neat signal processing math.

Elecia White That question is too hard. Next, please.

John Schuch lol

darryln haha anything but CCS. TMS320 FTW!

Audi McAvoy +1 VSCode

Julius (Mr. Seeker) DSP... long time since I programmed for those (university to be exact)

Shulie Tornel @Steve Silver : for short run PCB assembly who do you like to use?

Elecia White I kept hearing about VSCode and kept thinking it couldn't possibly be good. And I'm shocked at how much I like it

Kumar, Abhishek I have the same opinion. It's faster than Atom which is why I switched.

Lucas Rangit MAGASWERAN Is the better than Eclipse?

Elecia White I use OSHPark for PCB and Bob Coggeshall at Small Batch Assembly for assembly because I know those guys and trust 'em.

Audi McAvoy WAY better than Eclipse (IMO)

Shulie Tornel +1!! :)

Elecia White VSC is sooooo much better than Eclipse (which is what I switched from)

Shulie Tornel @taako.magnusen : What are the best books/guides/resources for learning C programming techniques for STM32's or other embedded systems?

Lucas Rangit MAGASWERAN @Elecia White wow, okay i'll check it out

Elecia White Uhhh.... so books... uhhh... I was asked recently about books and couldn't figure out if I was supposed to answer "mine, of course" or not. So I will. But I have more

taako.magnusen for context ive read yours

Shulie Tornel haha :)

taako.magnusen i crammed the entire book into my head in one weekend for a job interview

taako.magnusen (yeah i got the job :) )

Julius (Mr. Seeker) lol

Elecia White Grenning's TDD in Embedded C is a good way to think about code

Elecia White Alex Dean's new text book is incredibly thorough and has lots of great, do-able examples for Kinetis based system

Lucas Rangit MAGASWERAN @Elecia White I like that one too but haven't been able my company to adopt TDD.

Elecia White Simon Monk has lots of project related books, essentially choose a platform and find one

Elecia White Oh! Make's Humble Bundle! Right now

Elecia White https://www.humblebundle.com/books/electronics-programming-make-books

HUMBLE BUNDLE

Humble Book Bundle: Electronics & Programming presented by Make:

Pay what you want for electronics & programming books and support charity!

Read this on Humble Bundle >

Julius (Mr. Seeker) I was unsure if I already bought that one

Elecia White Lots of good books there, I like Akkana's PiZero

Shulie Tornel @elecia Sharpic also wants to find books to become familiar with C++

darryln @elecia is this the alex dean book? https://www.amazon.com/Embedded-Systems-Fundamentals-Cortex-Microcontrollers/dp/1911531034

Elecia White Other things... Make Magazine continues to have good stuff. Blogs are harder... we try to do stuff on embedded.fm and Christopher Svec and Andrei Chichak put in a lot of work to teach embedded. 

shamylmansoor I wish the humble bundle included the physical books instead of just pdfs :)

Elecia White https://www.amazon.com/Making-Embedded-Systems-Patterns-Software/dp/1449302149

https://www.amazon.com/Driven-Development-Embedded-Pragmatic-Programmers/dp/193435662X

https://www.amazon.com/Embedded-Systems-Fundamentals-Cortex-Microcontrollers/dp/1911531034

https://www.amazon.com/Simon-Monk/e/B003VOT2DI/

https://makezine.com/

https://www.humblebundle.com/books/electronics-programming-make-books

Julius (Mr. Seeker) physical is too expensive to ship ;)

Elecia White (Yes, that is the book but, look, I have links!)

Shulie Tornel Now about your own book!

Shulie Tornel @maclean.at asks Plans for a new rev of your book or is it good as is?

Elecia White Loose, undated plans for a new edition but only small mods. The biggest change would not be visible to most readers: describing the pics for unsighted readers and then doing an audio book. Though if someone wants to suggest more changes, I'm interested. (Don't tell me how much you hated the math chapter, me too, it will get shortened and bugs fixed.)

Julius (Mr. Seeker) what is the ISBN number?

shamylmansoor This is by far the best HackChat so far! I've learned so many new things today!

Elecia White ISBN-13: 978-1449302146

ISBN-10: 1449302149

Audi McAvoy Yeah, there was no way I was missing this chat.

Lalks Same here

Elecia White :) I'm glad. But there are more questions, right @Shulie Tornel?

Shulie Tornel @elecia yes!

Julius (Mr. Seeker) meeh, delivery in 2 weeks...

Shulie Tornel Can you stay a bit longer to answer just a few more questions?

Elecia White yes

Shulie Tornel @Lalks asks Was making your company a good idea ? How about the competition ?

Shulie Tornel and how do you find paying clients?

shamylmansoor Any discount coupons for your books ;)

darryln sign the cover and charge more

shamylmansoor lol

Elecia White I get most of business from people I know and referrals. Some now comes from people who hear the podcast. Since I'd already been in Silicon Valley for 10+ years when I started the biz for the first time, it has been good for me and I don't worry too much about competition. My skills are strange and not everyone needs 'em or has 'em.

darryln ooh, that was my question, thanks!

Shulie Tornel What is the difference with being an Embedded Software Engineer consultant vs. working at a company full-time?

Elecia White I used to find paying clients on AngelList, Craigslist, and LinkedIn. But I suspect Meetups and chat channels play a bigger role now.

Lalks You're lucky then @elecia :D Thanks for answering

Philip Consultants get to see many different domain, and many different teams and skill sets.

Julius (Mr. Seeker) and get to talk to clients ;)

Julius (Mr. Seeker) main reason I switched from development to consultancy...

Elecia White Consultant vs full time: working full-time I often felt like I should always be doing more... working more, being available more. Being a consultant broke that destructive cycle for me. Now I get paid for the hours I work and if I want to knock off at 3pm to bake cookies, that's fine. The payoff is more direct and less nebulous.

Philip If looking for consulting work, application engineers for chip companies may know customers in trouble, needing help.

darryln @Philip - good suggestion

Shulie Tornel Two more questions! Where to look for a job as Embedded Systems Engineer?

Shulie Tornel and What kind of missions does have an embedded systems engineer in the industry ?

Elecia White The downside is that I don't always get paid (ouch), I don't always have work (fine, I do projects and take classes until the next project), and many companies don't care about me at all so training and tools are my responsibility (which is totally fine with me though I have worked at great full-time companies so I miss the career development and mentoring sometimes)

Elecia White Where to look.... depends on your level. LinkedIn has been useful for me lately, lots of stuff even in my not-Silicon-Valley-address, lots of full-time stuff.

Julius (Mr. Seeker) monsterboard?

darryln i would think soft skills are key to indy consulting. cliche, but many engr type ppl sorely lack in this area.

Sai Yamanoor I usually setup email alerts

Elecia White What kind of mission? Uhhh? To blow things up? To not blow things up? Now I have the Mission Impossible theme song in my head.

Will Kalman Everytime I do a side gig in embedded systems and make, say, $1000, I'm like "Whee! Maybe I can do this full-time..." But the idea of *having* to accomplish that (finding, working, billing) over and over and over without fail to make a living is very daunting.

Julius (Mr. Seeker) to fix that nuke ;)

MarkAtMicrochip @Philip Good point!

Elecia White Seriously though, we do have a responsibility to think about more than what someone assigns us: how will this code be used? Are there safety concerns I should raise? Security issues I should think about? Better ways to solve problems than I've seen before?

Lalks Is it a source of stress sometimes ?

Julius (Mr. Seeker) Talking about security: Do you just start programming, or just think about it before you even start coding?

Lalks I mean a significant stress

darryln @elecia have you ever walked away from a paying gig due to ethical or moral reasons?

Elecia White So the mission would be to be a good engineer, not only a programmer. Think about the system and think about the world you want to build. You can't do it all (unless you are apparently Elon Musk), you aren't necessarily responsible for everything that goes wrong in the 'verse but identifying the challenges helps you find ways to make it better for everyone.

Julius (Mr. Seeker) I suddenly got reminded about my gf who mentioned a client with "crazy" ideas surrounding a safety valve... the safety valve would never trigger, but the client still demanded one "just in case"

Elecia White @darryln: Yes. More than once.

shamylmansoor What would happen if you had to work on the Death Star?

sfrias1 I have to go out. A pleasure to have been here. ;-)

Audi McAvoy I have to bolt too. THANKS @elecia !

Elecia White I'm extremely fortunate that I have the privilege to have enough savings that I can do that. I know not everyone does. Still, I hope those people who need the money more than their ethics sort it out quickly and work from the inside.

Will Kalman @shamylmansoor : I'd concentrate on the exhaust ports...

Philip I've walked away from a client that owed me money due to stress of their poor management of resources and goals. I didn't bill them for the money owed, so they wouldn't bug me. Best money I ever threw away.

Elecia White So to answer the Death Star question: more exhaust ports leading to the core... and bigger ones.

shamylmansoor @Elecia White lol

Julius (Mr. Seeker) But it would still be hackable ;)

taako.magnusen as someone who knows plenty of people working in defense i have to interject that its not as simple as "these things can hurt people thus you're bad for working on them"

Sophi Kravitz hi @Elecia White !

taako.magnusen thats a pretty simple answer to a really complex problem

Elecia White Indeed. It is a tough problem. And I don't want unthinking or incompetent people working to defend my country.

Julius (Mr. Seeker) *remains silent*

Lalks They still can see elsewhere

darryln really getting kinda close to politics here, eh?

Elecia White And "these things can hurt people" problems should have reach into medical, automotive, and aviation (at least).

Lalks Sad truth...

Julius (Mr. Seeker) yeah: "one person might print out a gun, but 15 others will print out ambulances"

morganrallen @elecia have you even caught any flack for your work on shot spotter? I've heard people raise privacy concerns from time to time (I have no knowledge if they are warranted)

maclean.at @Elecia and @Shulie Tornel - This has been most informative. Thanks!

morganrallen I feel like this has some "pick your clientele" aspects to it

Elecia White Some but I am confident in my beliefs about they system.... having heard many hours of the audio data personally. :)

Shulie Tornel Thank you @elecia!!

Boian Mitov And one question from me... What are you working on now (if not secret ;-) )

Shulie Tornel You're more than welcome to stay and chat!

Elecia White I need to go very soon, thank you!

Philip Thank you Elecia

Boian Mitov Thank you @Shulie Tornel for organizing it! :-)

darryln yes, thank you @Elecia White and @Shulie Tornel

morganrallen thanks Elecia

Will Kalman +1

Lalks Thank you Elecia ! That was an interesting chat !

shamylmansoor +2

Boian Mitov Thank you @Elecia White ! Very nice chat!

Shulie Tornel Thank you all for joining us. :) It's always a pleasure to have @elecia hang out with our community!!

Discussions

n8solar wrote 09/09/2017 at 09:29 point

I missed this event:( is there a recording that I can listen to?

  Are you sure? yes | no

Bhavesh Kakwani wrote 09/12/2017 at 15:52 point

It is a text-based chat, so there is no recording. The chat is in its original form above :)

  Are you sure? yes | no