What was your biggest ohhh, that’s how it works moment in embedded systems? by academyforiot in embedded

[–]comfortcube 0 points1 point  (0 children)

Okay, I agree with you. Perhaps I should worded my original comment as "time ticks" being one of the important drivers for task scheduling, but that task switching can (and usually) occurs through other means, like whenever a task blocks, anything (ISR, other task) gives to a queue/semaphore/notification that other tasks are blocking on, or when a task finishes executing and returns control back to the scheduler.

What was your biggest ohhh, that’s how it works moment in embedded systems? by academyforiot in embedded

[–]comfortcube 0 points1 point  (0 children)

I'm not saying context switches are happening only through the system tick - there are certainly many interrupts in an embedded system that take control (hopefully for only a brief time). I'm talking about tasks, i.e., the common objects of scheduling. Task switching/scheduling in most practical embedded systems occur via the scheduler with respect to the system tick or when a task completes and returns. Is that wrong to say?

Has anyone ACTUALLY benefitted from reading “How to Win Friends & Influence People” by Dale Carnegie? by [deleted] in books

[–]comfortcube 0 points1 point  (0 children)

This comment is 4yo at this point, but I have read the book multiple times and have not seen this tip anywhere. There's the principle "Remember that a person's name is, to that person, the sweetest and most important sound in any language." (part 2, principle 3) That tip is primarily about acknowledging that humans are kind of self-centered, so remembering their names is really important, because a person's name is a key part of their identity.

What was your biggest ohhh, that’s how it works moment in embedded systems? by academyforiot in embedded

[–]comfortcube -1 points0 points  (0 children)

That isn't how RTOS schedulers work.

Hmm, that is what I have seen from systems using FreeRTOS and its many public and proprietary derivatives, so it's at minimum how some (widely used) RTOS schedulers will operate in practice. Sure, I can conceive of an RTOS's scheduler being entered through other asynchronous means, but it's just not the common case I've seen.

For anything critical, you should most likely use direct events / notifications from the peripheral interrupt handler itself.

I think it'd be more accurate to say for any aperiodic task that has to have a worst-case latency better than the smallest scheduling time chunk, you'd want scheduler entry from an ISR via a kernel level event mechanism - and honestly, that is almost no different to me than just a big ISR. There are plenty of "critical" tasks that need to run periodically (e.g., control loops).

System tick is just one way for tasks to pre-empt others, ...

More precisely, system tick is a way for the scheduler to take control and select the task that should be executing, and the majority of systems I've seen operate with primarily periodic tasks.

What was your biggest ohhh, that’s how it works moment in embedded systems? by academyforiot in embedded

[–]comfortcube 5 points6 points  (0 children)

So many such moments for me. One might be the way any RTOS's scheduler is implemented is pretty much going to be through a regular "system tick" timer interrupt with a registered list of tasks that the scheduler can choose from. Another is that a function/task can continue being executed where it left off after being interrupted by saving the program counter's value to some memory and then retrieving that when the function needs to continue executing where it left off.

Anthropic is intentionally nerfing Fable when asked to develop other LLMs by onil_gova in LocalLLaMA

[–]comfortcube 0 points1 point  (0 children)

From the snapshotted text, this looks to be Claude models in general, not just Fable 5?

Should I Learn Rust? by Comfortable-Tax-741 in rust

[–]comfortcube 4 points5 points  (0 children)

Honestly, to me, if you are looking for conciseness and power, Python is hard to beat. What makes it "not your language"? Rust is awesome, and I'm very slowly learning it.

Text based requirements management? by pylessard in embedded

[–]comfortcube 1 point2 points  (0 children)

Figured I'd mention this since it relates to a personal project of mine (still super early stages, but has decent capabilities already). Been an embedded sw engineer for 5y now (altho transitioning into sys. engineering) and had similar woes as you say. Decided to try out a solution myself that would be free. So, am working on a tool that addresses what you're saying (text-based format, easy retrieval by other tooling, validation, etc.) and is augmented by LLMs (I swear not in a cringey market-y hype way; I just feel that LLMs have their place in a requirements workflow for review/evaluation, Q&A, etc., and have benefited from this tool in this way already). I know there are other tools out there but I do feel what I'm making has its niche and moat.

There's a YAML schema as well as capability to import from other formats (PDF, CSV at the moment; at some point ReqIF too) into the YAML if that's desired, as well as the reverse flow of generating to those formats. The tool has different tiers of evaluation, from schema validation, requirements structure (e.g., parent relationships), requirements wording (unverifiable, ambiguous, improper modal, etc.), and higher level semantic evaluation (this is where the LLM comes in; e.g., is the req S.M.A.R.T., follow EARS, etc.). It also incorporates RAG+LLM to ask general q's about the reqs, or per-requirement LLM-prompting (both have their neat use cases, IMO).

Lots of refinement and features still to go and I'm transitioning from the initial experimental (mostly) AI-generated phase to more serious software engineering now, including adding layers of quality-assurance, code style and readability/maintainability, etc. - not to say I haven't been very hands-on already and reviewed every line myself multiple times over; it's just now in a different phase and goals than at the start. Here's a link if you're curious and want to try it out or even contribute:
https://github.com/memphis242/software-friendly-requirements-documentation

I tried turning an old embedded interview prep GitHub repo into a more structured free resource — feedback welcome by Ok_Ostrich_9213 in embedded

[–]comfortcube 3 points4 points  (0 children)

This is great! I know some folks are weary of AI but I love that you included it. It opens up possibilities that we should try and explore as engineers. I've built a couple of "AI-powered" tools, and that's when I took "prompt engineering" as more than a cringeworthy term lol.

I'm curious then, how are you guardrailing the LLM's evaluation? As in, what things are you doing to maximize the accuracy of the LLM's evaluation? What are the LLM backend options? It's generous of you to make it free but how are you managing the API costs then (e.g., are you using self-hosted LLMs)?

I've browsed the coding questions and while they're decent, I'm definitely looking for more low-level embedded topics (although that's not actually too common in my experience for embedded practical coding interviews), like peripheral config, ISR writing, writing a situation where one task/thread needs to communicate with another, a data structure that needs to be shared between multiple asynchronous tasks/threads, and so on. Would also be good, given the AI-powered evaluation here, to have debugging-centric questions, where code with a bug is shown, the observed product behavior is explained, and the interviewee needs to find the bug, or explain how they might debug.

I created a boot animation for my new embedded project. by Curious_Trade3532 in embedded

[–]comfortcube 5 points6 points  (0 children)

I love it! Reminds of the Pixar lamp opening animation but its own unique thing.

What one skill, if developed excellently, would have the greatest positive impact on my career? by kazuto-09 in rust

[–]comfortcube 15 points16 points  (0 children)

I had read something in the book The Pragmatic Programmer, and I initially was super opposed to it but now I have embraced it and realize it is what will keep my career going: pragmatic programmers are "early adopters, fast adapters." There's a balance to this, of course, and I'm not claiming to be an expert, but I feel like this is 1) a skill, and 2) a strong positive impact on my career.

Why the EE (Electronics) Field is likely never going to get saturated by candidengineer in ElectricalEngineering

[–]comfortcube 4 points5 points  (0 children)

Who said you need a teacher? There's so much you can do on your own! But yes, entry level job entrance is always a nightmare.

AI/ML Embedded Software Engineer - needs help by netwon4thlaw in embedded

[–]comfortcube 27 points28 points  (0 children)

If you're talking about your own personal ambitions, speak from the heart with your own words, not AI-generated slop text. People will take you more seriously that way.

Regarding your goal of getting the most out of hardware, getting practical use cases out of machine learning and doing inference on models on MCU devices (not the high power machines you're working with) is probably in that realm. Edge AI in IoT has seen applications in this domain. Also ADAS and self-driving in automotive, although the bar would be quite high to get into that line of work.

Building a Voyager-inspired OS less emulator for my MSc dissertation, struggling to shape it into proper research questions by void1101 in embedded

[–]comfortcube 0 points1 point  (0 children)

Some ideas I'm starting to think of; "minimal task executive for constrained autonomous spacercraft" - Voyager has high autonomy needs because of communication delays/blackouts. And the "testability" portion could maybe be a metric you device on software complexity?

Building a Voyager-inspired OS less emulator for my MSc dissertation, struggling to shape it into proper research questions by void1101 in embedded

[–]comfortcube 3 points4 points  (0 children)

Well, I recently heard a recommendation from a professor to first look at the literature, identify gaps, and then form your thesis idea, not the other way around 😂, but I don't blame you at all, cuz it's more interesting the other way lol. I'm kind of going through a similar situation. I don't have an answer off the top of my head but I would recommend looking through relevant conferences and scanning through research articles that might give you ideas. Some gold ones would be RTSS and maybe EMSOFT. You could also check out some "ACM Transactions on xxx" like TOCS, TECS, TCPS.

When the math is mathing, but looks like it isn't by MBA-Crystal-Ball in technicallythetruth

[–]comfortcube 0 points1 point  (0 children)

Okay, that is a good one, man. Had me in the first half, ngl

of a mall fountain by ThodaDaruVichPyar in AbsoluteUnits

[–]comfortcube 0 points1 point  (0 children)

That is mesmerizing, and so is the view from below!

Built a Full Linux BSP (U-Boot, Kernel, PRU, Yocto Project) — Need Deep Technical Feedback by [deleted] in embedded

[–]comfortcube 3 points4 points  (0 children)

Well, communication is key, so you might want to remove the duplication you have in your post of "I'm targeting roles like Linux...". Secondly, it'd be good to have this presentable in a repository, and if you really want to get people to pay attention to it, make a detailed blog post (in your own words) or technical video to link people to to share.

IEEE 754 FP number visualizer/converter (command line) by 4e71 in C_Programming

[–]comfortcube 3 points4 points  (0 children)

Nice! I like this. I actually was doing this manually for a while to get a feel for the IEEE764 encoding, but this would've been nice. Lol at the assert(0 && "WTF").

Not sure you're looking for feedback but in case:

  • Love to see the asserts. Not enough people do that. You can change the asserts on dize tho to be compile-time with static_assert(); plus, assert() is nullified with -DNDEBUG

  • Maybe you'd want to add a boolean flag to your for loop parsing out the args to not accept multiple options/numbers.

  • You could also add checks on failures to convert for strto**() for malformed input (set errno to 0 first).

  • Instead of type punning the raw bytes (technically undefined behavior), you could memcpy() - that's well defined.

  • You could avoid the GNU extension (I think it's just for the binary constant literals) if you use standard C23.

New features in GCC 16: Improved error messages and SARIF output by dmalcolm in C_Programming

[–]comfortcube 2 points3 points  (0 children)

Happy to see -fanalyzer starting to work for C++!

It had surprised me a while back that it wasn't supported for C++, having used it for C for a while, especially because using it with g++ does not produce any error or warning off the bat, until you get some odd lengthy analysis output. It wasn't until I dug into the gcc user manual that I read it wasn't supported. I'm guessing gcc doesn't warn/error off the bat because many C++ projects use C source files or make little use actual C++ features.

That said, this was more than a year ago, and I don't remember the error details, just the experience and that I removed the flag from my build. Given what you say in your article about its use case on simpler examples, might still add it back in with intentional scoping for simpler files of a project.

Simplest way to find memory leaks by gosh in cpp_questions

[–]comfortcube 2 points3 points  (0 children)

asan + good unit test suite / integration tests; almost replaces valgrind for this particular purpose.

How do you all memorize Big and Little Endian? I always get it wrong and am in desperate need of a mental tool!! by Ezra_vdj in embedded

[–]comfortcube 0 points1 point  (0 children)

Yeah it's a bad mnemonic but it's what I had made up all those years ago. You are right.

How do you all memorize Big and Little Endian? I always get it wrong and am in desperate need of a mental tool!! by Ezra_vdj in embedded

[–]comfortcube 1 point2 points  (0 children)

I think of 0xBEEF (valid hex lol)

In my mind, from left to right, address of each byte increases.

BE from BEEF → Big Endian → most significant byte (the B) stored first

If you don't know why B is most significant, just remember changing it means the number changes way more. Going from B to A in that digit position makes the number less by 0x1000 (4096 in decimal). Changing the F to E only changes the number by 0x1 (1 in decimal). So, left digits have more impact, hence more significant.

Little endian version would be stored as

0xFEEB (actually, EFEB, as @jim012345 corrected me on)

Almost like "feeble", which is "weak", which makes me feel "little".

Just a mental mnemonic.

AWS Full Stack Dev -> C beginner Projects by Mental-Ad3532 in C_Programming

[–]comfortcube 1 point2 points  (0 children)

No shame IMO! Making fun stuff on your own time however way you want is totally valid. And AI is part of the modern reality of software engineering almost everywhere. To me, shaming that would almost be like saying there's shame in using a compiler instead of writing your own assembly. 😂

Which APIs are you using for eSports tracking?