Live data from Hacker News

Embedded Programming Without the IDE

reecestevens.me

51–59 of 59 posts

Re: Embedded Programming Without the IDE

#51
post #42

Earlier quoted context omitted.

Make is great if you understand how to use it. It's sort of like git in that many people just pick it up as needed and so they don't understand the underlying model, which makes it mysterious to them and causes it to break in ways they don't understand.

Any references that you would recommend for learning Make?

I learned slowly through the years but the first few chapters look a pretty good here:

https://www.gnu.org/software/make/manual/make.html#Introduct...

Re: Embedded Programming Without the IDE

#52
post #6

Earlier quoted context omitted.

Eclipse CDT is perfect for embedded developing, with no real competitor. Given the compilation command line output, its buildin parser can understand very large code base (the linux kernel, chrome browser et) efficiently and precisely, long before llvm-based tools appeared. No need to configure tons of vim plugins, you have tons of powerful features in the default settings, like type hierarchy, call hierarchy, debugg…

> Eclipse CDT is perfect for embedded developing, with no real competitor. ugh, having used cdt a bit, it is terrible when compared to qt creator. It's pretty easy to make, say, an AVR-GCC toolchain and use it with CMake, which will then work ootb with QtC like any other C/C++ project.

A large portion of problems of using Eclipse CDT is that the Language Setting Provider is NOT properly set. See the MDN article mentioned in another comment for more on this. CDT parser is NOT bound to any build system. You can make it work with almost any build system, provided the build system had legitimate command line output. And CDT's performance is better than most of the LLVM/LSP-based tools. LSP based solution has not matured enough to be a real competitor.

I remembered that around 2011 I've tried Qt Creator, and it was a bad experience since I did know how to cope with several build systems. I've no idea how QtCreator's multiple build system support is now. For the same reason, CLion is not good enough to compete with CDT.

LLVM/LSP/Vscode/CLion, these are all exciting and have a lot of fans. Unfortunately, none of them is good enough in this subfield.

Re: Embedded Programming Without the IDE

#53
post #9

Hasn't Make been launched in, like 1976? And vi in '77. Congrats on rediscovering them.

haha, indeed I was quite late to the party in discovering the power of these tools :) In a way though, the fact that a college student in 2016 can get excited about the possibilities of vi and make speak volumes to how influential a well-designed software tool can be!

Well if you take suggestions, I personally only use vi over slow links (it shines on high latency connections where a normal editor does your head in with the slooow updates).

Since you're mentioning the arm gcc you probably have access to the likes of jed, nano or even the editor built into mc there.

Re: Embedded Programming Without the IDE

#54
post #36

Earlier quoted context omitted.

Life as an amateur is better. Arduino + PlatformIO is plain fun to work with. As a professional (as in getting paid to do it), I shed being ashamed of using Arduino a while ago. With PlatformIO, you have great tooling and you can avoid the garbage that are the vendor supplied IDEs. And even tough the Arduino HAL isn't exactly elegant, I can switch between uCs without having to learn a new API. I can even port between…

The problem with a lot of this solutions is that they won’t hold for complex projects. If all you are doing is turning on some leds and connecting through usb, it works okay. Try heavily time-sensitive synchronized SPI transfers and going deep into the hardware layout becomes necessary.

One of the things I like doing is taking an Arduino project and rewriting it without using the Arduino libraries, and the benefits go beyond complex problems like timing. It is possible to trim a lot of memory and flash usage if you are tailoring your code to a specific project. The end result is you can do more without purchasing and learning a new microcontroller.

Re: Embedded Programming Without the IDE

#55

Earlier quoted context omitted.

I'll never understand why professional embedded developers just suck this up Here's my point of view: historically, software engineers didn't pick the ecosystem. The electrical engineers did. They looked at (in descending order) cost, I/O capability, manufacturing lifespan, and then finally the software ecosystem. When things started getting too similar the chipmakers picked up on this and started selling the softwar…

"Historically", electrical engineers were the software engineers. You picked from a small collection of available parts which met your cost and design goals, and you put up with whatever horrific software tools supported the platform. This was my experience as an EE grad doing embedded SW work in the late 90s. Embedded back then didn't get anywhere near the attention that desktop processors received. Toolchains, debu…

Very solid point, and something I should have said earlier.

I'm a computer science major that went into embedded by circumstance of working in a particular field, but we were always kind of rare. (I should have gone into CE, which in my school was a hybrid of CS and EE and would have been more valuable).

The influx of CS majors into embedded now is creating a new field of innovation and also a new field of problems, like people trying to cram node.js into microcontrollers.

But, if you saw the actual code that EEs would write, the past was way way worse.

Re: Embedded Programming Without the IDE

#56

Author here. Wow, I wrote this article back in college and I was really surprised to see it up here on HN! Pretty cool to see so many talented embedded folks reading my "write to learn" piece :) This blog post was the start of me figuring out the love of diving in deep to embedded development. Since then, I built a patient monitor device using this makefile-driven build approach. Nowadays, I am re-writing this device…

Did the toolchain you were working on support both GCC and Clang? I ask because I was recently trying to work on a ESP32 project in vim and got stuck hard on YouCompleteMe only using a clangd-based completer while the project was only compileable with a GCC-based toolchain, leading to annoying things like headers not being found due to things like `#if GCC...` (or the like), and also not all cli switches matching up.…

In my case, I don't believe I had any GCC-only restrictions for the STM32F4 chip I was developing on, so I didn't ever run into this issue.

That being said, it's always worth experimenting with flags in YCM or clangd to see if you can get something working well enough for most development needs. I would take a look at the places where those `#ifdef GCC` macros are used and see if you can spoof the flags enough to get something workable. Throwing a `-DGCC` in your YCM flags, worst case scenario, will just raise an error message and you can remove it. Best case scenario, it won't behave quite the same as GCC but you can get basic linting, autocomplete etc. working. Sometimes this stuff requires a bit of exploration to get working the first time, but once you get a working setup it's very satisfying!

Re: Embedded Programming Without the IDE

#57

Author here. Wow, I wrote this article back in college and I was really surprised to see it up here on HN! Pretty cool to see so many talented embedded folks reading my "write to learn" piece :) This blog post was the start of me figuring out the love of diving in deep to embedded development. Since then, I built a patient monitor device using this makefile-driven build approach. Nowadays, I am re-writing this device…

Hi Reece! Love your work! Also checkout comments here https://www.reddit.com/r/embedded/comments/jgk3o1/embedded_p...

Hey, thanks! I appreciate the post :)

Re: Embedded Programming Without the IDE

#58

Earlier quoted context omitted.

"Historically", electrical engineers were the software engineers. You picked from a small collection of available parts which met your cost and design goals, and you put up with whatever horrific software tools supported the platform. This was my experience as an EE grad doing embedded SW work in the late 90s. Embedded back then didn't get anywhere near the attention that desktop processors received. Toolchains, debu…

Very solid point, and something I should have said earlier. I'm a computer science major that went into embedded by circumstance of working in a particular field, but we were always kind of rare. (I should have gone into CE, which in my school was a hybrid of CS and EE and would have been more valuable). The influx of CS majors into embedded now is creating a new field of innovation and also a new field of problems,…

Haha yeah, I was the young guy working with a lot of senior, senior engineers. The code was often atrocious. Those guys had a ton of knowledge, but software was just an afterthought to them. On the plus side, it kept things simple. Definitely a new world these days.

Re: Embedded Programming Without the IDE

#59
post #42

Earlier quoted context omitted.

Any references that you would recommend for learning Make?

I learned slowly through the years but the first few chapters look a pretty good here: https://www.gnu.org/software/make/manual/make.html#Introduct...

Thank you!
Post reply on HN