219 karma · joined August 8, 2017
Something that should be noted for anyone who actually reads this is that the level of vulnerability is wildly different between automakers. No universal solution exists.
I worked in this space (auto RE, including keyless entry) for a while, and there's almost no way this would work at scale without a top-down platform redo for automakers.
I doubt anyone is using an off the shelf Pi with SD card for an actual safety critical deployment and expect to get it certified. There are options like the Revolution Pi which is half PLC and uses the Pi's Broadcom SOC for non-safety calculations. Some even support CODESYS.
I agree that most ARM embedded Linux SOC's can be absolute dumpster fires when it comes to peripheral documentation and poorly maintained device trees (looking at you, Texas Instruments!!!) but that's nothing new in embedded dev. Learning how each manufacturer/platform do hardware peripherals is half the battle.
So I agree that the pi isn't always the best device for an application. Cost and power savings on an ESP32, better processing on your old laptop-turned-server, and so on. But the Pi does have excellent documentation, and was lucky enough to gain enough traction to create an ecosystem that reduces friction to just get something running for beginners, which is literally its original design intention.
I've used Rust for *nix based IOT programs to ingest data from different sources (network I/O, serial, CAN, files, etc), as well as for bare-metal embedded development. I've also made some dinky webservers as an exercise and various random tooling.
It's a very, very flexible language, once you get over its quirks. I found myself using it to make tools that I would usually turn to Python for. I'm quite impressed with how "high level" the language feels despite being able to work with low-level concepts. Simple stuff like mapping iterators and the Option<T> type while working without an OS is a fantastic feeling.
As most people will likely say, take Rust for a test drive with a basic project to decide for yourself. I would say to keep it simple and not go down the async route as your first foray, though.
Good HAL crates don't have the entire register set as one struct, thank goodness. And for something like printing a message to serial in a panic handler, there are still unsafe options to yank control of registers, same as C.
What I really like about some of the HAL crates is the usage of builder patterns while configuring a peripheral. Setting up timer parameters before starting it by design is chef’s kiss wonderful.
But if you want to put the whole peripheral set in a static global, you can do that with a RefCell<Mutex<T>> or something similar. Or just yolo it and use unsafe blocks to ditch the mutex.
Creating a heap in Rust on a cortex M is safe and cheap-ish with a crate supported by the rust-lang developers. Much easier than implementing your own free() method on a memory pool.
I think you would like rtic. Not a pre-emptive rtos, but a way to manage context between ISR's without relying on some kind of module or global variable that can get corrupted by multiple accessors. Very minimal overhead compared to FreeRTOS
It's very hard to unlatch your brain from some of the common C/C++ embedded principles of static context variables and thinking of the hardware registers as "owned" memory, which you have to do in Rust. The auto-generated HAL crates aren't that great unless you're using the most common ones like stm32f4 or RP2040. Even then, it's hard to create a portable device driver without delving into generic-hell.
That all said, the ecosystem is moving fast, and a lot of my gripes above are just a product of the embedded rust ecosystem being very new in comparison to C. I do love rtic as a framework, and while I've given embassy a try I think it's trying to do too much aside from being a good async runtime, it should just focus on the runtime and not with stuff like creating its own entire HAL. Hubris and humility are fascinating but I just haven't gotten around to tinkering with them yet.
Lots of good tooling too, and the fact that most of your original C/C++ debugging tools are compatible with rust binaries is just the icing on the cake.
I know that there's the whole Ferrocene project, but until that produces results, stick with C if you're doing safety-critical applications, especially if they need to be certified
This of course has two huge caveats:
1. I didn't have a gaming addiction in the first place, evidenced by the fact that I have a Nintendo Switch that gets played in short bursts, rather than constantly.
2. I work with embedded systems/hardware, so I need to have an actual workstation area to keep the tools (debugger probes, power supply, oscilloscope, etc) on. The embedded systems curse of always needing more ports has been a pretty effective anchor for keeping my workspace in the same place as my PC, and if it wasn't, then I'd probably get more "I should spend all day today playing games" desires
My first job out of university reqiured networking a small Linux device to an FPGA running a UDP stack, with nothing else. I'd never done anything with networking in C before, and this guide just made everything click
But this study clarifies so much of my behaviour and self-image from when I was a kid to now. I bully myself fiercely, and never understood why I should be praised for high grades, when it was something expected of me. That definitely extends to now, where I can finish/deliver a product, but feel _nothing_ about it. No sense of accomplishment, no relief that something's shipped. Nothing. It stops me from taking on hobbies or really doing anything with the material that I learn. Leads to regular burnout and cycles of depression.
The article references methylphenidate as a good drug for ADHD, specifically for motivation. This makes me sad, because I'm on it, and not feeling very motivated.
Pay on average is lower, but comes with a higher degree of social security and stability. Of course, Canada is not without its own racist past or present, but it's not quite as "on display" as the US. Our previous prime minister tried to have a "barbaric cultural practices" hotline which was essentially a dogwhistle to more Islamophobic elements of the Conservative party base.
That being said, I'm thankful that our police aren't tear gassing protesters in Ottawa so that Trudeau can have a photoshoot.
The tech industry in general isn't as large as the US, but does carry a lot of talent. Places to note are Kitchener-Waterloo, Toronto, Ottawa, Vancouver, Montreal and...maybe Calgary? I'm not so sure about the data science field myself, but I do know that most large tech firms around here do carry an analytics team.
Edit to add: like others have noted, COL is high in Toronto and Vancouver. That being said, I absolutely loved living in Vancouver and would move back there from Waterloo in a heartbeat. If you're able to land a job and afford living there (or more likely in another Lower Mainland city), I would recommend it.
Do I feel like I missed anything about the people I care about? Yeah I kind of do, but mostly it's FOMO from seeing all my friends continue to do backpacking trips while I'm working in southern Ontario, so that's circumstantial. But on the whole? I couldn't care less. I had to turn off the localhost rule to sell some stuff on Marketplace, and I browsed my news feed for the first time in over a year, and it was a nightmare hellscape of stuff I just couldn't care less about. Better off with the filter.
I've used a Fitbit and a couple friends have Apple watches, but the entire concept of charging an always connected timepiece just makes no sense to me.
We have access to nearly unlimited information, but even then, I don't think most internet users are using it to exchange great works of thought or even 'surfing' as the internet was intended to be used. Instead we have these massive FAANG silos that don't offer anything less vapid than the media described in the book. Even some of the more "idea-exchange" styled websites (Reddit, Twitter) are cesspools of low-effort thought, injokes, and memes.
We have too much information, and a worrying amount of it is untrue or misleading. But that's addressed by Faber in the novel as well, about the centrifuge throwing off all unnecessary thought. If there's so much media blasting in from all directions it gets hard to distinguish and the frequency of it all takes away the will to sift through fact from fiction. This is what leads to the 'fake news' aspect you mentioned. This is also addressed in the book. It's been a while since I've read it, but at one point Montag's wife stays glued to her televisor walls with Jesus himself on the screen telling her about how only his true followers buy some companie's product. Now, Montag's wife would surely have known that Jesus would not have been alive during the time of CorpCo's Wonderful Bottled Drink (or whatever it was called), but she doesn't think about it, she's too wrapped up in the overwhelming pressure applied by the media environment and believes it. It's the same when you surround yourself with this manufactured outrage stuff, and start buying into more and more outrageous 'fake news' claims because it justifies your anger, plays into your new opinions. It feels good, a positive feedback loop. It's the same.