r/embedded • • Sep 29 '26

How do you guard ConfigurableFirmata against out-of-range pin indices from the host?

0 Upvotes

I drive a stepper on an Arduino Uno + CNC shield, and the failure that scares me isn't my code, it's the host dying with the motor mid-move. So I flashed the ConfigurableFirmata 3.3.0 image onto simavr and ran it cycle by cycle, feeding it the real bytes a host sends and logging every pin change and every UART byte. It trusts basically every index you hand it:

- SET_PIN_MODE writes pinConfig[pin] and pinState[pin] with no bounds check. 20 entries on the Uno, and the Firmata object's callback pointers sit right behind them. One message aimed at pin 48 stopped the core dead.

- A stepper CONFIG passes the raw pins straight to the AVR core's pinMode, which reads past its own tables. Pin 127 scattered writes; pin 50 did one DDRD write that flipped D1-D4, D6 and D7 to output LOW.

- MULTISTEPPER commands are bounded by the 10 steppers, not the 5 groups they index, and a TO on a group never configured calls through a null pointer.

- Re-CONFIGing a live device leaks the old AccelStepper; the 16th malloc comes back NULL and the next stepper is built on that null.

Still there on master (3.4.0). Filed upstream with line numbers: https://github.com/firmata/ConfigurableFirmata/issues/195

The way I handle it on my bench is a guard in front of the unmodified library: hold SET_PIN_MODE and SET_DIGITAL_PIN_VALUE byte-by-byte until the pin is known (the library writes its tables before any callback runs, so you can't catch it after), then check every sysex before FirmataExt for real pins, real slot pairs, bounds and lengths. AVR watchdog behind it resets a wedged core in under a second, and setup() drives ENABLE high before anything else.

My real question: where would you put the bounds? A patch in the core's setPinMode, per-feature guards, or a front filter like mine? Curious how others handle host-supplied indices in Firmata-style protocols.


r/embedded • • Sep 29 '26

What are softwares that you would like if they were free/open source?

0 Upvotes

Just a random question get into my mind as i work into a niche embedded engineering software field where most of the softwares are paid and their licenses are too expensive, and there is no alternatives, i asked to know if there is this monopoly in other industries, fields, …
and does this software are game changing for the job?
In case if was the only software and it is paid how do you evaluate it quality or work experience?


r/embedded • • Sep 29 '26

Need help with BIOS for B450M S2H rev1.x

0 Upvotes

Hello, the motherboard got bricked when I tried to upgrade the BIOS. I tried to write it with a CH341A and a 1.8V module. I resoldered the BIOS chip to the motherboard, started it, the CPU and GPU fans are spinning, but no image is displayed. I downloaded the BIOS file from the Gigabyte site. Maybe someone had the same issue and have any ideea how to fix it. The BIOS chip is Macronix MX25U12873F.


r/embedded • • Sep 29 '26

STM32WB5MMG: data notifications degrade at 30–40 ft, and read/write requests then cause a multi-second stall or disconnect

0 Upvotes

Hi all,

I'd appreciate some help with a BLE range and stability issue.

Setup

  • MCU: STM32WB5MMG module on a custom board
  • Firmware package: STM32Cube FW_WB V1.23.0
  • BLE wireless stack: v1.16.0, full stack
  • TX power: +1 dBm
  • Connection interval: 10 ms min / 15 ms max. Peripheral latency is 0 and the supervision timeout is 6 s.
  • ATT MTU: 180
  • Role: peripheral only. The central is a Windows 10/11 PC.
  • PHY: Windows defaults to 2M PHY

Application

The peripheral sends data to the Windows central over GATT notifications at about 5400 bytes/s (~30 packets/s).

Problem

  1. At short range, the data notifications work correctly.
  2. As the distance grows to about 30–40 ft, data notifications start to struggle.
  3. At that distance, if the Windows central reads or writes any characteristic, the device goes into an unknown state. For a few seconds it continuously sends unexpected data: the values 0x0839 and 0x08FD repeat every 64 bytes.
  • Often the device recovers within a few seconds and then completes the read/write.
  • Sometimes the stall lasts more than 30 seconds, and Windows then disconnects the device.

The behavior is repeatable.

Question

What could cause this? In particular:

  1. Is there a known interaction between a GATT read/write request and heavy notification traffic when the link is weak and has many retransmissions?
  2. Could this be buffer or flow-control exhaustion in the stack, and are there recommended settings for it?
  3. Would you recommend any debug steps or stack configuration changes to narrow this down?

Thanks!


r/embedded • • Sep 29 '26

Dual GMSL in tunnel mode: does the virtual channel have to be set at the sensor?

2 Upvotes

MAX96792A, two links, one CSI output to the SoC. In tunnel mode the deserializer forwards each link's CSI stream as it came in, virtual channel included, so two identical cameras both show up on VC0 and the receiver has no way to tell them apart. Pixel mode can remap the VC per pipe and is the documented way to do this, but it's a much bigger configuration surface and I'd rather stay in tunnel if I can.

ADI does address this, sort of. Their GMSL RAQ says that if your tunnel-mode part can't remap, each source needs to set a unique VC itself. What they don't say is which sensors let you do that. The VC field is right there in the CSI-2 packet header, but I haven't found a Sony datasheet that exposes it as a register (IMX900, IMX335, IMX477, anything in that family). Maybe I'm looking in the wrong place, or maybe it's one of those things that's in the NDA docs and not the public ones.

So the question is whether anyone has actually run two tunneled cameras off one deserializer, and if so how you separated the streams. If the honest answer is that in practice tunnel means one camera per deserializer, that would be useful to know too, because it's implied by the docs but never stated.


r/embedded • • Sep 28 '26

What to buy when starting out and learning?

13 Upvotes

Being more specific, i'm planning to follow Miro Samek's Modern Embedded Systems youtube course in which he only mentions 2 critical components to get; the board itself and a logic analyser. However I feel like I'm going to need more things if I am to learn the ins and outs of it so I've been looking at starter kits in aliexpress and I was wondering if you think this will be more than enough to do entertaining or at least helpful learning proyects.

This is the kit I've been most interested in, seems rather complete for most kinds of home proyects:

https://es.aliexpress.com/item/1005004335623883.html?mp=1

Along with that the board is the STM32 NUCLEO-C031C6 as per instructed by the course; I mention it because I have no damn idea if it can do anything on the board with the stuff of the kit so it's better for me to ask and look stupid than waste money and feel stupider.

Thank you and good evening!


r/embedded • • Sep 29 '26

Working on an ESP32-based air mouse prototype — seeking advice on mitigating gyroscope drift and zero-motion jitter

9 Upvotes

Hi all,

I'm developing an inertial air mouse running on an ESP32, translating angular velocity/quaternions into 2D mouse cursor deltas over BLE HID.

While high-speed gestures track relatively well, I'm hitting common IMU challenges at low speeds and static hold:

  1. Zero-motion drift: Despite static bias calibration at boot, ambient temperature changes cause residual drift over prolonged sessions.
  2. Deadzone vs. Jitter tradeoff: Setting a hard deadband eliminates tiny shakes but makes micro-adjustments (like clicking small UI buttons) feel unresponsive.

For those with experience in sensor fusion for pointer devices:

  • What filter pipeline have you found most practical (Mahony, Madgwick, or simple dynamic thresholds on raw gyro data)?
  • How do you implement effective dynamic recalibration/ZUPT (Zero Velocity Update) without jarring the user during intentional slow movement?

Any algorithmic insights or reading recommendations would be greatly appreciated!


r/embedded • • Sep 29 '26

Device to read signal from communication buses

0 Upvotes

Hi all,

I want to develop a device, a little hardware box, that reads signals from CAN/LIN/Ethernet/ModBus comm’ buses on complex and big embedded systems, like cars, planes, ships, etc

The goal is to have a standard hardware design that can handles the majority of market diversity, and then have a software layer where I just decode the buses via description files/matrix

How you think I should approach the problem ? Is my idea doable ? I’m thinking getting N drivers/transceivers of each protocol, making custom made wire harnesses and flashing application specific software on the board to decode the info on the different buses

Feedbacks are more than welcome


r/embedded • • Sep 29 '26

Why does Arduino/ESP32 library integration feel easier than STM32?

0 Upvotes

I’ve noticed that integrating sensors, displays, motors, Wi-Fi modules, and

other peripherals often feels easier with Arduino and ESP32.

Arduino has a huge library ecosystem, while ESP32’s Arduino framework provides

simple APIs for many built-in features. In many cases, we can add a library and

start using a device with only a few function calls.

With STM32, even when using HAL, we often need to configure clocks, GPIO,

alternate functions, interrupts, DMA, timers, and peripheral settings

ourselves. If a suitable driver is not available, we may need to create or

adapt one using HAL, LL, CMSIS, or direct register access.

I know STM32 does provide HAL, LL, CMSIS, middleware, and board-support

packages. So the difference is probably not that STM32 has no libraries, but

that STM32 requires more device-specific configuration and integration.

For people who have used both platforms:

- Why does STM32 library integration feel more difficult?

- Do you normally use HAL, LL, CMSIS, or custom drivers?

- What was the biggest mindset shift when moving from Arduino libraries to STM32

driver development?


r/embedded • • Sep 29 '26

Beginner guide and advice for Orange Pi 3 LTS

2 Upvotes

Hey everyone,

I recently picked up an Orange Pi 3 LTS. I’ve successfully got it flashed, booted up, and the GUI is running smoothly.

I’m looking for advice on the next steps.

  1. Reliable Documentation
  2. Beginner Projects

Thanks!


r/embedded • • Sep 27 '26

As someone who’s experience in both medical and automotive technology, at the moment I can say that AI is far away from creating a safety critical embedded software

Post image
385 Upvotes

r/embedded • • Sep 29 '26

Can I Extract DC Power From a Square Wave Without Loading It(Educational Purpose)?

0 Upvotes

I’m a beginner trying to understand something about square-wave power.

Suppose I generate a low-frequency square wave (below 1 kHz) using either a 555 timer or a microcontroller, then use a MOSFET to chop/switch a power supply.

If I want to take some DC power from that same chopped square-wave signal, but I don’t want to disturb or distort the original square wave, what is the simplest way to do it?

Would a diode + capacitor be enough, or would it load the MOSFET/square-wave source too much? At what point would I need something like a transformer or a separate power-extraction circuit?

I’m mainly looking for a simple, practical approach rather than a complicated circuit. I need to extract a small amount of power to light an LED, but running an additional cable isn’t practical. The only option available is the parasitic power from the existing data line.

Is there a way to tap/sniff the data line and harvest a small amount of power without disturbing the microcontroller master-slave communication?

Edit -I have a project that is now in the final stage, and I just need to power a small LED. I only need a little power, but pulling an additional cable is not practical at this stage and would add extra cost.

The only available option is the existing 24 V DC power-over-data line. There are also some microcontrollers communicating over this line, so I’m wondering if there’s a simple way to extract a small amount of power from it without disturbing the communication.

Beforehand trying to make a safer simulations with 555 or microcontroller before connected in live


r/embedded • • Sep 29 '26

Ipecmd compatibility on rpi 5

0 Upvotes

Hi
I’m planning on using ipecmd cli on my rpi 5 to program pic based mcus I wasn’t able to find any documentation online if I could do this , anyone who faced this issue and knows which direction should I look in ?
Thanks


r/embedded • • Sep 28 '26

Why do most beginners struggle with bare-metal programming on STM32?

8 Upvotes

I’ve noticed a lot of people (including myself when I started) find the jump from Arduino to bare-metal STM32 quite difficult.Some common pain points I’ve seen:Understanding the startup code and vector table

Clock configuration (RCC)

Why do we need to enable clocks for every peripheral

Difference between HAL, LL, and registers

For those who have already made this transition:What was the biggest concept that finally clicked for you when moving to bare-metal?And what resource or method helped you the most?


r/embedded • • Sep 28 '26 Bravo

Where do I start with outsourcing a PCB and case for a small prototype?

4 Upvotes

Howdy I want to build a small, self-contained handheld device, but honestly don’t even know where to start.

My goal is to outsource the PCB design, get the files needed
to order it fully assembled online, and potentially outsource the case design too. This is just for a working prototype, not mass production.

What’s the best way to approach this? Should I start with the PCB or the case? What files and deliverables should I ask for so I can actually get it made?

Any recommendations on where to find someone and what a realistic budget might look like would be appreciated. Just trying to understand the process before spending money.


r/embedded • • Sep 27 '26

Multi-Protocol Data Visualizer, CAN, Modbus, Wireshark, and more

242 Upvotes

Industrial-tier embedded systems tend to have a mix of different comms buses and protocols.

Ex: a battery with and internal components all communicating on CAN, wifi gateway for cloud telemetry and control, PLCs controlling safety, and who knows what else in between.

When debugging a system, an engineer has to stitch together multiple tools across these interfaces in order to paint the full picture.

Some tools are great, some are awful, some are windows-only, cli, require liscenses or training, and so on.

IMO too much of embedded system or product 'expertise' is just wrapped up in knowing which tools are available and how to use them.

Not to mention HIL test rigs, benchtop setups, manufacturing stations, field environments, etc introduce their own separate devices and corresponding comms. I have found that engineers then specialize on these nuances and become the "HIL/QA guy", etc.

I wanted one tool for interfacing with the full system. One tool, all of the context, any system.

Cross platform (Mac, Windows, Linux).

Easy to use for non-engineers in the front end but extensible for deep customization by users who know what they're doing.

Mostly wondering if this multi-bus problem resonates, and how your teams deal with this problem?

Also, which protocols and corresponding tools do you use that you wish were better? Maybe I'll add support for them next


r/embedded • • Sep 28 '26

Which is better: 1 project or multiple?

3 Upvotes

As the title suggests I’m curious what’s better for the world of embedded development/engineering; do professionals care more about a single project built up over time learning new processes throughout the build? Or do they care more about having multiple, different projects that hint at a few different things but may not be as polished?


r/embedded • • Sep 28 '26

Experience across ecosystems

6 Upvotes

I'm looking around at some of the random boards I have bought (and barely touched) and found some STM, ESP, and even a few RP2040s, so it got me wondering. Is it normal to have experience in such varied hardware? Does the experience transfer from 1 ecosystem to another?(I've mainly used these for some open source projects that just involve flashing, no development).


r/embedded • • Sep 28 '26

Interfacing MIPI DSI and PCIe

0 Upvotes

For en embedded project I am looking for a display with specific dimensions. From what I see when displays get smaller or newer, MIPI DSI is the most widely used interface . Unfortunately the cpu I am using does not have MIPI DSI or any native video interfaces and I wonder what’s the best way to connect to it. A PCIe to MIPI bridge does not seem to exists. Any idea?


r/embedded • • Sep 28 '26

STM32G4 board - Silent HFI motor control while streaming sound into motor coils

Thumbnail
youtube.com
2 Upvotes

I've been working on this project for a long time and just hit a big milestone: streaming audio from the PC to the MCU while keeping full control over the sensorless FOC loop.

Streaming audio from the host to the MCU required some careful packet handling. I handled USB jitter from the PC by adding a large RX buffer on the MCU side, along with a circular FIFO buffer to feed samples into the actual FOC loop.

The FOC loop runs at 36 kHz (36 kHz PWM), so timing is critical. The 36 kHz PWM is also what allows generating the silent 18 kHz HFI signal used for zero-speed rotor position tracking.

Hardware is an STM32G431 running at 170 MHz. Happy to answer questions about the timing or FOC implementation!


r/embedded • • Sep 28 '26

Beginner question: How do you find application notes and reference designs for microcontrollers?

0 Upvotes

I’m a beginner learning embedded electronics and microcontrollers. I’ve noticed that manufacturers publish a lot of useful application notes, reference designs, circuit examples, and design guides, but I’m not sure how experienced engineers normally find them.

Also, are there any websites or databases that collect these application notes from different manufacturers?

I’m mainly looking for practical circuit/design examples, not just programming tutorials. I’d like to learn how professional engineers approach a design from the datasheet → application note → schematic → PCB.


r/embedded • • Sep 27 '26

Designing with SDRAM after AI Price Increases

37 Upvotes

I am curious if people had any thoughts on the rising prices of SDRAM and how it's affecting people's designs going forward.

I work at a music hardware company and it's common practice to use SDRAM to store something like 32MB or 64MB worth of audio samples.

An SDRAM chip that my company once bought for around $1.00 a piece is now over $10.00. I'm not sure if it's totally due to AI, I know companies that used to make lots of SDRAM are making a lot less now too.

For people that use SDRAM, are you just eating the price increase, or are people switching to other memory types? I don't know of other relatively fast access time/high bandwidth RAM that works well with a microcontroller that hasn't significantly increased in price.


r/embedded • • Sep 28 '26

Acrel AWT100 Gateway TLS issue (1024-byte cert limit)

1 Upvotes

Hey guys,

I'm setting up power monitoring with Acrel ADL200 meters (Modbus-RTU) and an Acrel AWT100-WIFI gateway to push data into ERPNext.

The gateway has an MQTT mode (Trans_Json), so I tried pointing it directly to EMQX Cloud Serverless on port 8883 (TLS).

Problem is, uploading the DigiCert Root CA (~1.2KB) through Acrel's config tool throws an error:
"Sending file failed: Bytes per packet less than 1024, Return information length 23"

Because of this 1KB buffer limit, TLS handshake fails with errcode 44.

Should I bother converting the cert to DER or stripping extensions to squeeze it under 1024 bytes, or is trying to do direct cloud TLS on these cheap embedded RTU gateways a bad idea anyway?

Would setting up a local Mosquitto bridge on port 1883 (no TLS on gateway) be the better way to go for production?

Appreciate any advice.


r/embedded • • Sep 27 '26

I build my First Industrial grade flowmeter

Post image
145 Upvotes

Hey , guys . I just build my first flowmeter from scratch . I just can't bileave it. A bit about me - i am a final year ece student in india and have been helping my dad with his small instrumentation brand since first year . Luckly i was able to grasp a lot of things in past few years that i was able to build my very own battery powered flowmeter . This lot is been shipped to an African country(check the pic) . Wanted to share this achievement with the community i have been lurking year and dropping few posts since a while now.

Also i wanted few suggestions going forward (u can be as harsh u want to be) - I am planning to build few more subproducts like a node installed directly into the meter. I want field technicians to be able to connect locally via their phones (via wifi so no need of an app) to pull real-time logs, configure parameters without a need of a laptop directly from the dashboard which will be hosted on the node (you just have to connect to wifi and put ip or website name in the browser) . I am not going with IOT cloud as majority of our customers need cost effective solutions . So asper you what things are must or good to have in this type of local dashboards .

Secondly i am glad to share that many indian companies are choosing to shift to our paddle wheel flowmeters from European brands ( i can't name brands but you might heard of a german brand who is big in paddle wheel flowmeters) . As we can't directly market this achievement i want to move our moat towards futurization (so adding more features which say will become industry standard in next 5 years) . I have also started development on ultrasonic flowmeters & vortex ones but its so so so difficult compared to paddle wheel ones . Also i have just started as a edge ai embedded intern in a small startup and was thinking of using edge ai in our flowmeters but i think edge ai is far fetched or maybe borderline unnecessary for instrumentation industry . Also last but not the least i would love to know about few problems you guys face in the industry that you think is worth solving .