But if you want a feel of real world hardware, 100$ is a decent to buy variety good amount. You could start with a any STM32 NUCLEO Board Preferrebly the stm32f0 or f4 There are cheaper alternatives like esp32
also while ‘Making an RTOS’ might seem cooler you are better off ‘sending sensor data to a web dashboard’ which in itself is an iot project. Bonus points if you build everything from scratch (if its for learning purposes)
Hey @everyone, There has been a lot of talk about this, I'm sure you have heard about it, and wanted to get your take—especially from those of you knee-deep in real-world dev work. We keep hearing about the shift toward "safer by design" languages like Rust, particularly in safety-critical software. I can’t help but wonder how much of that translates to the day-to-day realities of embedded development in our cases. Take Google’s Android team, for instance—they’ve ditched unsafe languages for new code, switching to Rust, and they claim a significant drop in memory vulnerabilities as a result. I do think that is impressive. But for those of us who’ve been in the trenches with C/C++ for years, is this push for safety really as transformative as it seems? Or are we trading old problems for new challenges? Do you actively think about moving to safer languages? What are the barriers or benefits in your experience? Are you open to it, or is the idea of leaving C/C++ behind still a bit too wild?
Isn't the answer here it depends, And also when teams switch I wonder like for android the code that is switching is the AOSP code not the applications right? I feel like @Ming and @ke7c2mi would have gone through enough to have an opinion on this. I on the other hand think its trading between dieties
I don't think it's an either/or proposition. There's way too much installed C/C++ for it to 'go away'. In places where it makes sense, and you can realize efficiencies, people will use and learn Rust. But there are going to be multi-language devs and systems.
I think there is a lot of work that still needs to go into making sure those multi-language systems can be built in a way that ensures no rewrites in the future. I say this because last I checked interop isn't at a great place, yet. Especially the interop between Rust and C++, with both having concepts that the other doesn't understand and is hard reconciling like Rust does not understand function overloading and C++ not having traits. I agree with you though I think it will take some time. And this point, it becomes a matter of urgency but eventually the industry is taking that path.
Disclaimer I'm a zealot and spent the last 4 years of my career coding (bare metal and distributed systems, also lots of "multi language interop"), mentoring, and teaching rust. And yes, I think it's about trading old problems for new challenges. The old problem is e.g. a hardfault if you are lucky, the new challenge is a compile error. For me this alone was transformative. Package/dependency mgmt, docs, and how rust does zero cost functional patterns did the rest. Also being able to define asynchronous io on mcus and have it translated to a perfect interrupt-driven state machine. Rust is hard to learn for most, and it stays hard in some ways. And it's immature in some areas compared to others. But it's been so much fun.
Async functions represent an operation to be performed. This is a state machine and it's called a future. Every edge of the state machine is to be taken as a reaction to an event. Rust itself doesn't tell you how to drive the state machine, it only provides some of the required infrastructure(waker trait, future trait). The ecosystem does the rest. Tokio is a futures runtime that relies on epoll, kqueue, or other event loop depending on os. Embassy relies on nvic hardware and doesn't need os or allocator
Worth noting that in theory, by expressing your application with structured concurrency (composing futures together), you can skip the stack. You know the maximum size of your futures statically.
RTIC (formerly RTFM lol) is a similar beast. They do async too now. But their unique point is concurrency with static guarantee no data races (rust), no priority inversion, or deadlock (RTIC guarantee)
Embassy looks like a young Zephyr to be honest. In part I guess because you have embedded_hal traits and you can just move from architecture to architecture with just commands. It's impressive how much the eco system has grown since 2021
The argument I was given was that memory-safe languages like Rust, Go, etc is that it frees up the developer to actually concentrate on solving the problem.
Having the language/compiler do bounds checking, Allocation/Deallocation, type safety, etc means that I don't have to, and like most programmers, I am lazy so I'm quite happy for the system to do things for me!
To write 'safe' code in C/C++ is possible - but it means that you need to constantly be aware of what you are doing with your allocations. That can get tiring and at some point something is going to slip through.
One of the dangers I can see is that developers can then get complacent and don't think about their memory management at all - as even in memory safe languages that are going to be some bits that are not memory-safe.
Static and Dynamic Application Security Testing (SAST & DAST) can help but even they are not going to find every issue and even then I have seen them throw up false positives occasionally.
Hi! I stumbled upon this server on disboard. I am but an average electrical engineering graduate who got interested in embedded systems and systems programming, and now trying to self-learn. Currently learning programming on STM32
"No language is gonna prevent bugs/bad coding practices" I do generally agree, but I think that is an oversimplification. It's like saying "no driving style is safe on the road"
Please elaborate... If I drive drunk it doesn't matter if I'm in a tank or not I'm still not going to drive well and am much more likely to get in an accident.
If I'm in an auto-piloted taxi, then am I really driving?
The driving style is the language. Yes accidents happen even for very conservative drivers, but it just isn't the same likelihood. Not a perfect analogy. But saying the tool doesn't matter is papering over the details
Since they operate on different voltage level, the best way to use level converter or else you can bring the voltage of arduino to 3.3V. This can be done by a voltage divider circuit using one 10k resistors and one 20k resistor at Tx Pin of Arduino.