Embedded Rust: Adding a Type-safe SNTP callback (to esp-idf-svc)

From my work on rued, I wanted to use the callback defined in esp-idf-sys, but these are the C bindings. The esp-idf-sys crate implements type-safe Rust wrappers.
My initial use and testing in rued involved manipulating the raw-C bindings themselves, along the lines of unsafe extern "C" fn sync_cb(tv: *mut esp_idf_sys::timeval). While I did this just to "get things to work", there is a reason why there is a HAL (hardware-abstraction layer) provided in Rust.
So, it was time to contribute back to the community effort of a Rust-based HAL. To this effort, I created a PR called Add wrapper to specify callback for SNTP. ...(continued)

Initial LED Driver functional verification

Posted in Hobbies > PCB Designs > Cree LED Strip

Having received the previously designed low-side LED driver PCBs, it was time to perform some initial functional tests.  The usual process here is to check for potential shorts and waveforms on the board, essentially checking components/stages 'block' by block.
The initial setup took some time as I not only had to solder the PTH components (Plated-through hole) such as the jumper headers but also various power, test and output leads as well. Ideally I would have not used my DC electronic load for initial testing but I sadly ran out of high-wattage wirewound resistors on hand.

Building an Embedded Rust Stack for ESP32

Posted in Hobbies > Electronics Projects > ESP32-based IoT Stack in Rust

I wanted to take my Rust skills into the Embedded eco-system and for a good long time, spent way too much time trying to re-invent a certain wheel (nothing to do with Rust, though) - more to do with choosing the 'right' MCU SOC for the job.
RTC module is the smaller board at the top (which has a small battery) and connects via I2C with the ESP32 that's on the smaller board in the M.2 socket.
My biggest issue is I wanted it to be capable of everything and anything, but in the embedded world, constraints are always part of the designing stage.  It's hard to say optimise for work-horse performance and say ...(continued)

Rust for Embedded is Better on x86

Having recently picked up a M1 Max MacBook Pro, in hindsight I expected to run into some issues due to the change in CPU architecture.
For some the idea of 64GB RAM is excessive, but if you've been pushing Mac's to their limit as long as I have - I've been running 32GB RAM defacto for over a decade.  It doesn't take many tabs in Chrome to exhaust 16GB RAM.
Here's a snap of running some heavy IO in Docker:
Running both Glances and Htop

Designing the LED Driver PCB

Posted in Hobbies > PCB Designs > Cree LED Strip

Updated: Nov 18th: Here's a quick update from the Fab house as they are performing QC on the assembly of the new boards
SMT parts have been populated
I decided to make this a MicroMod Function board, and also threw in an extra footprint to stack on a RTC board as well. The RTC board is the SparkFun Real Time Clock Module - RV-8803.
Here are some progress snaps of the board layout:

Troubleshooting Cross-account VPC Peering

Posted in Work > AWS: Cloud Solutions > VPC Peering

On Tuesday I was setting up VPC Peering and even had a colleague double check my setup.  This one was a tricky one as I had got everything correct, but missing one small configuration.
Here's the Requester side of the connection:
And the Accepter side.  Notice that I've used separate CIDR blocks (as per the requirements) to establish the connection.

Let's build a gRPC server and client in Rust with tonic

I found an excellent article on this very topic and decided to extend this a bit further with a client in NodeJS as well.  Make sure you run the (Rust) server first.
We will need to use Tonic
Tonic is a super lightweight gRPC implementation with batteries (prost, hyper, and protobuf) included to build both gRPC servers and clients. The server and client can leverage HTTP/2 and code generation to generate the necessary code for ...(continued)

Buying the Apple 16.2-inch MacBook Pro with M1 Max at Apple Orchard Road in Singapore

Having just landed wee past 8am, local time, we headed first to our hotel on Orchard Road, as per the usual, and checked in to relax and rest up before heading...out across the street!
Haha, yes, as crazy as it sounds our hotel was right across from the flagship Apple store, which is also conveniently next to Takashimaya/Ngee Ann City and Paragon (again, across the street). Just a block down and you reach CK Tangs/Marriott and ION mall.  All our shopping needs, nicely packed in a short-distance, utterly safe, and many many malls and food courts as well.
Well over 100 people lined up for the ...(continued)

Post Archive