4 ms·
I do embedded stuff from time to time in the amateur rocketry hobby. The hardest part for me was getting the initial tool chain setup from scratch. I wanted to
by chasd00 5y ago
I do embedded stuff from time to time in the amateur rocketry hobby. The hardest part for me was getting the initial tool chain setup from scratch. I wanted to do it the way the “pros” did it with C, make, a compiler, and a loader no training wheels. Going from zero tools/code to a blinking led (the hello word of embedded) was pretty tough.
It never dawned on me that different buses run at different speeds and you have to literally setup the clocks. Heh and before that you have to load the assembly to jump to the address where main() is located (basically your own boot loader). I wouldn’t say it’s harder than web dev per se but it’s just very different.
Then I just bought a feather from Adafruit, started using micropython, and never looked back. Much better, although a buddy of mine holds his nose whenever I talk about it.
- smarx007 5y agoPros often use commercially licensed IDEs like Keil or IAR Workbench and a bunch of other tools that only run on Windows (no matter how much they dislike Windows personally). Setting up a toolchain from scratch sounds like what hackers (i.e. those who are not professional embedded devs getting paid for such work) would do.
- ChuckNorris89 5y agoExactly. Setting up your GNU based embedded toolchains and make-files from scratch is something that hackers/hobbyists do. In production, where you have deadlines to build firmware that is set to ship on millions of units, and your company's future is on the line, you just buy how many Windows Keil/IAR licenses you need, and get on with your work, regardless of how you feel about proprietary software.
- RealityVoid 5y agoCurious if you work in the field. Because in my experience, it's not like that at all. YMMV, I guess.
- deleted 5y ago[deleted]
- ChuckNorris89 5y ago>Curious if you work in the field I do work in the filed yes, worked in automotive, semiconductor and IoT. >Because in my experience, it's not like that at all. In what way is it "not like that"?
- RealityVoid 5y agoThe IDE's I've seen are mostly used for the debugging magic, and the toolchain used for building is some customized thing. I work in automotive.
- ChuckNorris89 5y ago>the toolchain used for building is some customized thing. I work in automotive. That's because in automotive the microcontrollers are more complex, with multiple cores of different types doing different things, so the build process is more complex therefore the final binary goes through several steps like patching various calibration data, FPGA bit-streams, cyptopgraphic keys, fuses, debug data, etc. but even so, those custom toolchains still call a comercial compiler via command line using some perl/python scrips at the end of the day. You can script same steps with IAR or Keil if you wish, their compiler support the same command line functionality, except that in IoT we mostly used their solution 'as-is' since it worked well with their debuggers out of the box meaning quicker time to market. Automotive development has a lot more crust in general due to legacy, safety, legal, plus bs stuff like the entire Autosar stack needing to be added to each build whether you need it all or not so a lot of inefficiencies build up over time due to this inertia leading to some insanely complex and lengthy build processes.
- HeyLaughingBoy 5y agoRight :-) Remembering the lengths a former employer would go to fit code into the 32kB limit of a free dev tool because they didn't want to shell out for the unlimited paid version.
- RealityVoid 5y agoHonestly, those ide's suck. Most of the time we only would use them for debugging, but the build system was usually some home grown thing. You get better control. The startup code really depends, you can use the stuff from the vendor, but a lot of the times, the needs are specific so you might roll that up as well.
- HeyLaughingBoy 5y agoIf fsking hate IAR Workbench and can't believe that it exists in this day and age. Especially when PlatformIO with STM32 plugins is free.
- rkangel 5y agoYeah, there's two parts to it. The first is "Can you build your code, for the correct target with the right cross compiler. Is your linker script set up correctly etc.". This isn't too bad once you've done it once, as long as your toolchain isn't proprietary and the target is sane. But the second part is painful every time which is "what code do I need to run at startup so that my hardware is correctly configured". This is before you even write a driver. This is so specific to the particular chip, and even what you're particularly doing with it that it always takes time to get right. I'll tell you that as a "pro" in this field, any time I can skip the second part I will do. STM32 chips for instance need a lot of clock config and selecting the right muxes because their chips are very flexible as to which peripherals can come out of which pins. They have a graphical tool called "STM Cube" where you can select your chip, configure the function for each pin and then it'll generate you a full project with startup code. We threw away the project and just used the startup code, regenerating it occasionally when we changed something. It saved so much time and suffering and is a big reason why I'll always choose an STM32 if I can.
- skybrian 5y agoIf you ever want more performance, I suggest trying PlatformIO and C++. It will set up the toolchain for you and do board initialization, and then you can use the Arduino API. The package manager is more reasonable than Arduino.