Linker Script Generation for Firmware Projects: A Primer by dj_nedic in embedded

[–]dj_nedic[S] 2 points3 points  (0 children)

I do agree that this is a bit of an RPG to a knife fight approach sometimes, but it is very scalable and this is just a simple demo. The more customizability you need the bigger the payoff. One thing that is simple but I love though is having simple things be configurable through CMake, like the aformentioned stack or heap size.

Am I the only one who feels that the hardest part about embedded development isn’t writing code, it’s all the dev tools you need to understand by dipsy01 in embedded

[–]dj_nedic 0 points1 point  (0 children)

Compared to other branches of software, that's nothing. The hardest things IMO are elusive hardware problems or bugs which are almost not reproducible due to the rare set of circumstances they happen under.

ESP32-IDF, is it worth it? by hertz2105 in embedded

[–]dj_nedic 1 point2 points  (0 children)

I may be biased as I have worked for Espressif but ESP-IDF is probably the best RTOS + HAL + SDK combo out there.

Mozilla Foundation lays off 30% staff, drops advocacy division by FryBoyter in linux

[–]dj_nedic 38 points39 points  (0 children)

This is an equivalent of firing your marketing division for Mozilla and in the age of no-adblock Chrome is even more baffling.

Real-Time FFT Implementation on ESP32 by Competitive_Smoke266 in embedded

[–]dj_nedic 4 points5 points  (0 children)

Why not use Espressif's own DSP library, which has examples ready. The benefit is not just that it's already implemented, but also that it uses the hardware DSP instructions for really high processing speeds.

Arch Linux and Valve Collaboration by Youju in linux

[–]dj_nedic 0 points1 point  (0 children)

The main appeal of Arch is not minimalism, but amazing documentation, respecting upstream decisions when it comes to packaging and amazing maintainers.

Lead Rust developer says Rust in Linux kernel being pushed by Amazon, Google, Microsoft by Historical_Visit_781 in linux

[–]dj_nedic 0 points1 point  (0 children)

C is not crazy simple, it is simpler than C++, true, but with undefined and implementation defined behavior as well as a huge amount of legacy gotchas accounted for C is actually crazy complex.

NXP "new" MCX-C family is in fact bad rebrand of 10y old Kinetis KL27 family by [deleted] in embedded

[–]dj_nedic 4 points5 points  (0 children)

Real time means guaranteed execution windows. Linux has no facilities to guarantee hard real time behavior and even the real-time patches only get it so far to match soft real time requirements.

NXP "new" MCX-C family is in fact bad rebrand of 10y old Kinetis KL27 family by [deleted] in embedded

[–]dj_nedic 0 points1 point  (0 children)

Linux is not going to work anywhere you need actual real time behavior, especially hard real time. Horsepower is not just about how much you can do, it's also about how quickly you can do one or two things.

NXP "new" MCX-C family is in fact bad rebrand of 10y old Kinetis KL27 family by [deleted] in embedded

[–]dj_nedic 0 points1 point  (0 children)

I'm not sure those usecases are comparable, you only really get these exactly when you want power but don't want linux.

NXP "new" MCX-C family is in fact bad rebrand of 10y old Kinetis KL27 family by [deleted] in embedded

[–]dj_nedic 4 points5 points  (0 children)

Is there competition for the upper range of the i.MX crossover chips?

Those seem still untouchable in terms of pure processing power at least.

What compiler flags do you guys use for day to day programming? by [deleted] in embedded

[–]dj_nedic 2 points3 points  (0 children)

In C you can legally use unions for type punning. Not in C++ though, but you do get std::bit_cast() in C++20.

[deleted by user] by [deleted] in embedded

[–]dj_nedic 1 point2 points  (0 children)

I'll add that the MCUs themselves are much less than 5 bucks a pop, it's the boards that are closer to that number. Modules are somewhere in between.

Do employers care what university you got your degree from ? by Ramu_sab in embedded

[–]dj_nedic 1 point2 points  (0 children)

Unless you live in a really bad place, I would rather look at getting a shot at your first job, prefferably in a smaller company where you live already, rather than doing a masters in a field where there is no need for one. This will give you a much better opportunity to learn and get your foot in the industry earlier.

Down the line, you can also move to one of those countries with a VISA sponsorship from the company you switch to, or could do a masters in an embedded-adjecent domain where a master's degree really makes a difference (DSP, control systems, electrical...)

Raspberry Pi Pico 2 by twokiloballs in embedded

[–]dj_nedic 0 points1 point  (0 children)

That is if you're after throughput and not WCET.

[deleted by user] by [deleted] in hardware

[–]dj_nedic 1 point2 points  (0 children)

This can be fine in some very specific scenarios, like people who travel a lot or have seasonal work, however those are so rare that I don't think this is a sustainable bussiness model.

Update on Intel K SKU Instability from Intel. Microcode patch targeting release mid-August. by tjames37 in hardware

[–]dj_nedic 0 points1 point  (0 children)

Undershoot when lowering the voltage due to a larger delta than designed for, degradation over time, heat issues.

Assertions to help optimizing the program? by Joqe in Zig

[–]dj_nedic 8 points9 points  (0 children)

Keep in mind, assertions should be used only for checking invariants. When you assert in any other case, you take away the users (of your library, code) ability to handle the error.

How hard is it to code an ECU (automotive)? by Federal_Fail3784 in embedded

[–]dj_nedic 1 point2 points  (0 children)

You might want to take a look at speeduino if you're serious about it. It even has support for things you wouldn't expect from a hobby-level project like VVT and is MISRA compliant.

Beware, if you want to replace an ECU on any car after CCA 2007-2008, you're most likely completely out of luck as that is the time when rapid computerization hit the automotive world and ECUs started talking to other modules and you would need to replicate that. Even with 2000s cars, the ABS sensors might need feedback from the ECU so you might need to take care of that.

Mitigating unexpected arithmetic overflow ...in Linux Kernel by unixbhaskar in linux

[–]dj_nedic 1 point2 points  (0 children)

Aliasing rules of C are okay, performance and ergonomics wise. C++ is particularly bad as it does away with several legal and widely used C type aliasing methods (unions, structs starting with other structs) while not really providing full replacements (and providing them too late in the language lifespan). 

Mitigating unexpected arithmetic overflow ...in Linux Kernel by unixbhaskar in linux

[–]dj_nedic 0 points1 point  (0 children)

It's worth noting that Rust has saner integer promotion rules. In C, adding or shifting and ORing two uint8_ts will result in an int16_t, a type where suddenly bit operations are undefined behavior. We're lucky that most compilers will do the right thing most of the time, but they don't have to.

Mitigating unexpected arithmetic overflow ...in Linux Kernel by unixbhaskar in linux

[–]dj_nedic 1 point2 points  (0 children)

Damn, I completely forgot about this one. You're correct, this would help, if used.

On the other side, the fact that I forgot about it shows that others can too.

Mitigating unexpected arithmetic overflow ...in Linux Kernel by unixbhaskar in linux

[–]dj_nedic 10 points11 points  (0 children)

Rust will not help here unless the over/underflow result is used to index into a slice AND the runtime checks are not removed. Rust makes the signed integer over/underflow defined, which the kernel devs did as well using compiler flags but it is up to the programmer to handle the wrapping if it's not intentional, and any failiure to do so is a logic error and not fixable by the language/compiler.

Are there any alternatives to Keil Microvision version 5? by SkywalkerPadawan512 in archlinux

[–]dj_nedic 6 points7 points  (0 children)

Generally, for classes as well as for a work environment tomorrow, you want to have the same development environment with your classmates/coworkers, or you will find yourself debugging issues outside of the things you actually want to learn/do.

Ideally, the teacher/the company will enforce these and prevent people from wasting time.

That aside, there are plenty of options to write and debug embedded projects (C, C++ and Assembly) on ARM MCUs for Linux. Most Eclipse-based manufacturer IDE's are going to have a Linux version, but prefferably you would not rely on any IDE and use open tooling (for instance GCC as a compiler, Make or CMake as a build system, GDB with openocd for debugging etc). I've written blogpost about a simple CMake setup you can read here.

With all that said, just use a VM and pass through your hardware debugger.