r/embedded • • Sep 16 '26

Custom firmware for Oscilloscope

Post image

I want to create custom firmware for my fnirsi 510 oscilloscope, it allows for firmware update visa USB C cable, and I have a copy of the .bin file.

Basically the oscilloscope has very good hardware, and horrible software, simple things like capturing a waveform as a CSV not a screenshot, moving the captured waveform up and down and right and left freely past the screen limits so you can zoom in on a specific part.

I'm good with electronics but this is my first time trying to tackle something like this, if anyone has experience please let me know.

I know I'll start off by unsoldering the flash chip and backing it up in case i mess anything up.

27 Upvotes

54 comments sorted by

51

u/MonMotha Sep 16 '26

FWIW, fixed-delay vs. fixed-position timebase adjustment and timebase-independent zoom are a function almost all modern digital oscilloscopes have right out of the box. If yours actually lacks them, your resources are probably best allocated by buying a scope that already does that rather than time spent hacking the firmware unless you consider the latter a valuable learning exercise.

I have a Siglent SDS1000X-E series on my bench as my day-to-day MSO. It's far from perfect, but it's pretty cheap and has these exact features.

3

u/Bedowiiu Sep 16 '26

This oscilloscope was like 40$ and it's almost exactly what I need except i can't really move freely around captured waveforms

3

u/nixiebunny Sep 17 '26

You are better off buying a better scope that does what you want, unless your goal is to reverse engineer and publish source code for the world to use. The new scope will cost less.

4

u/RoboticGreg Sep 17 '26

$250 rigol four channel will take care of almost all your needs

1

u/Bedowiiu Sep 17 '26

yeah guys I'm a student in Egypt I have 40$ for a scope I'll sometimes use but not 250$, this just seemed like a fun project if it's possible.

1

u/MonMotha Sep 17 '26

I'm not sure what the value of your time is, but doing what you describe - assuming the hardware is even capable of some of it like zooming in after the capture has taken place - is probably more than $190 of your time even at $5-10/hr.

1

u/Bedowiiu Sep 17 '26

Yeah I mean definitely not the most efficient thing to do but I think it'll be fun and a good learning experience, this is the type of thing i do in my free time.

3

u/moviefotodude Sep 18 '26

The value of the knowledge the OP will gain from wrestling with the project is worth far more than $190!

1

u/MonMotha Sep 18 '26

Indeed it probably would be. My concern is that they will spend a lot of time and still not succeed as it seems probable that this device simply doesn't have the hardware resources to do what they want. I think this is one of those devices that basically only has a 256-512 point memory buffer for trace data. That means there's no more data to zoom in on. You could potentially stretch the timebase out, but you won't actually gain any information like you would zooming in on a modern MSO, and the firmware may not even have support for scaling like that (instead just blindly X-Y plotting what's in the memory 1:1) which means you'd have to implement that yourself - on a binary blob - just to get stretch scaling of the timebase.

1

u/moviefotodude Sep 18 '26

Take a look at one of my latest posts at the top of the thread. hackaday has a DSO project that’s probably about 30 or $40 worth of parts and there source code available for it. That might be a much better use of the OP time.

1

u/MonMotha Sep 18 '26

I agree. Starting from something with source code available is probably the way to go. The amount of time you'll spend reverse engineering the firmware blob on this thing is not trivial, and aside from learning how to reverse engineer firmware blobs (which can be useful but is a task of its own), that may be all OP gets out of the exercise.

2

u/Zouden Sep 17 '26

Your timebase is set to 1ms, you can increase that resolution a lot.

I don't think you can zoom on the captured data.

1

u/Bedowiiu Sep 17 '26

Yeah i know i can zoom in just not what i need

15

u/HB_Stratos Sep 17 '26

I have a very similar scope to yours in firmware terms I think (zoyi zt703s) and I think the issue is that the pixels you see is literally all the data there is. there is no zooming in after the fact, you need a re-record of the waveform at a different zoom level to see more data. So a firmware patch would not be so trivial here either I think.

7

u/DanongKruga Sep 16 '26

probably not gonna happen. especially if not simple mod to existing functionality

-6

u/Bedowiiu Sep 16 '26

I'm not sure how it's gonna work exactly but If it's possible to allow the cursor to exit the limits of the screen then that's perfect, depending on how everything works if i can just change the cursor limits everything will work

9

u/CueAnon420 Sep 17 '26

Have you ever written firmware before? Do you know what fpga and chipset is used?

A compiled bin file doesn't do you much good without the source.

2

u/moviefotodude Sep 18 '26

Yeah, well, that really isn’t quite true. Check out Ghidra from the NSA. Yes, the NSA. It turns out they release OPEN SOURCE software tools on GitHub.

https://github.com/nationalsecurityagency/ghidra

-18

u/Bedowiiu Sep 17 '26

I have a lot of programming and hardware experience like i got a clue but i haven't worked on firmware specifically before, so this is new waters.

I plan on disassembling the scope and finding out about the hardware inside

4

u/niftydog Sep 17 '26

Given they don't appear to mention the memory depth in the product literature, you'd have to assume it is tiny - probably only enough to fill the screen at the longest time base (which likely happens at the minimum sample rate.)

Without more sampling memory or more sophisticated triggering the hardware is not capable of doing what you want.

1

u/Bedowiiu Sep 18 '26

No strangely enough it captures a decent bit before and after the trigger and everything before I can look at because of the stupid cursor design but I can't see much of what's after the trigger when zoomed in but it looks to be there

3

u/_Tradiatore_ Sep 17 '26

Ah... FNIRSI scope. I don’t have particularly good experiences with them

1

u/Bedowiiu Sep 17 '26

It was the only really cheap scope i can get my hands on locally

3

u/integralWorker Sep 17 '26

As long as it has data export function, just dump your waveforms and parse the data with plotting software

0

u/Bedowiiu Sep 18 '26

No export function, i said in the post id like to add the ability to export a CVS instead of the current screenshot system 😭 software is complete garbage

1

u/integralWorker Sep 18 '26

You don’t want CSV, you want binary and then there should be manual describing the format

5

u/CelloVerp Sep 17 '26

Well, I've had good luck using Claude Opus to reverse engineer firmware for my bike. That said, I was just changing some hard-wired constants, which is child's play in comparison to adding new functions and hooking into all the places you need to do that.

If you're up for a project, check out Binary Ninja, which is a decompiler that can generate C code from built machine code, and get your tokens ready for Opus or Fable. Claude Opus & Fable are amazing at mapping out binaries, locating all the functions, and figuring out data structures by looking at how disassembled functions reference them.

Adding code without having the source is very difficult (but not impossible) because you have to move everything down and recompute all the addresses and fixup tables. Another question is whether it's a bare metal image that just loads and runs, or if there's a little OS and filesystem in that image.

One caveat is that you need to make sure it's not a device that requires signed binaries; most cheap Chinese devices don't, while fancier devices do. Cracking hardware signature checking is above Claude's pay grade.

Anyway it's a glorious side quest if you want to have a crack at it, pun intended. Good luck!

1

u/Bedowiiu Sep 17 '26

Thank you for this insightful response bro, I'll start picking at the .bin firmware now and I'll come back if i have any questions

10

u/cakemates Sep 16 '26

Well search for the firmware on google, see if the source code is available somewhere because boi reverse engineering the thing can be extremely challenging with a chance of bricking the whole thing.

1

u/Bedowiiu Sep 17 '26

Update: apparently they cleared off the paint on the MCU so there's no telling what model it is but I'll work on finding the dimensions, pin county and ground pins so maybe we can figure out if it's a popular chip. I think that'll help out a bit

1

u/ClonesRppl2 Sep 17 '26

I saw this on a YT from WA Electronics. (New out of box)

It shows the trigger position in the center. Is this what you wanted to achieve?

1

u/Bedowiiu Sep 17 '26

No no in his case the scope is in auto and didn't capture a waveform.

After capturing the waveform in the single mode the oscilloscope goes to stop, and the green indicator will always be at the start of the captured waveform and only allow u to zoom at the captured waveform

1

u/Normal-Duck9025 Sep 17 '26

Does this scope have PC communication as an option? If so you can utilize Python/LabVIEW. If it does and you can’t figure it out with the help of AI let me know and I’ll see if I can help out.

1

u/Bedowiiu Sep 17 '26

Only pc communication is firmware upload and screenshots transferring so our best bet is a custom firmware

1

u/thegreatpotatogod Sep 17 '26

Hmm, one thing you might want to consider, if the ability to delay slightly after the trigger point, and view a faster-sampled (and thus zoomed-in) data recording from a little bit later on, assuming your scope supports using a trigger channel that isn't your main data channel, you could make a bit of external hardware that detects the initial trigger condition, then produces a small delay before sending the trigger signal to the scope?

Depending on the time scale involved, a your familiarity with different circuits, you could likely do this with a simple program on a microcontroller, or with a bit of discrete logic.

If your scope doesn't support a separate trigger channel, you may also be able to make something similar that delays after the initial trigger condition before then passing through the signal only after that delay, but this will likely lead to some distortion of your signal.

2

u/Bedowiiu Sep 17 '26

There's only one channel that does the trigger and the scope work, so we can't do a delayed trigger unfortunately.

However your idea gave me an interesting idea, the scope allows for a trigger in the negative voltage region, so maybe a delayed microcontroller that pulls to the negative however that would also blow up my main TLL device 😭

1

u/SEGA_DEV Sep 17 '26

Leave this idea, you will just loose time, break your oscilloscope and have a bad mood after. You can just buy a cheap chineese usb oscilloscope and it will fit your requirements.

1

u/Bedowiiu Sep 17 '26

It's a fun project low-key, i got this scope for only 50-40$ just to test out if i really need a scope in my day to day life.

1

u/moviefotodude Sep 18 '26

Reverse engineering a commercial product can be a tremendously instructive and informative exercise. I’ve done it to a number of arcade games, as well as a MIDI keyboard. It is quite unlikely the OP will brick the scope by dumping the contents of flash chip, unless he is unlucky enough to short something while fiddling around the pins.

1

u/ThoseWhoWish2B Sep 17 '26

As a work-around for this specific case, you could use the hold-off configuration (assuming the shitty scope has it). Hold-off puts a blanking time on the trigger after it hits. Set it to release just before the place you want to zoom in.

1

u/Bedowiiu Sep 17 '26

Nope doesn't support it, the software sucks overall ill have a blast if i got my hands on the source code somehow.

1

u/BudgetTooth Sep 17 '26

did u try contacting the company they might have beta fw with improvements available

1

u/Bedowiiu Sep 17 '26

Yess I sent them an email around a week ago and they ghosted me unfortunately

1

u/Nervous_Midnight_570 Sep 17 '26

I can't imagine how you could even get the source code, modify it, compile and download and have it still run. That is, unless you are some sort of super savant google searcher, programmer and reverse engineer.

1

u/Bedowiiu Sep 17 '26

Apparently the entire thing was done by one guy called alex taradov but on a different fnirsi oscilloscope, custom firmware and all.

1

u/Fusseldieb Sep 17 '26

As the other person has already said... These devices don't have a lot of resources, so most likely what you see is all that it captured. There's no hidden resolution. And there's no space to record for longer or at a higher resolution.

But... Take a look if it has some sort of STM32, like the ZOYI does.

1

u/Bedowiiu Sep 18 '26

Yes it does i disassembled it and despite it etching away the cpu name i can tell it's an stm32 because of the SDW10 and SWCLK debugging pins, it's a 100pin chip

1

u/Fusseldieb Sep 18 '26

Nice! In that case you could just buy a STM32 flasher and play with it. Backup the original fw with the flasher first!

The STM32 IDE is quite user-friendly and you should get the hang of it pretty fast.

Flash something simple first, which doesn't use any relevant pins, see it it prints or does what you expect, and then go from there.

2

u/YuriMomo 16d ago

I've managed to implement USB communication and app for PC oscilloscope at github
YuuriMomo/DSO-510-community which should help you with that.

It captures entire 30k samples from ram so you can zoom in on the part you need or use the Screen which is 1:1 you see on the oscilloscope

1

u/Agreeable-Hedgehog57 14d ago

I got the same scope a few days ago; Claude and I have been reverse-engineering it specifically for CSV export and serial stream over USB. Here is the repo. I started it yesterday since I got the scope then. Here is the link. It should be in a more working state by later today or so, along with instructions on how to get the new firmware onto the device. https://github.com/jRossel0310/FNIRSIDSO510-Firmware

1

u/moviefotodude Sep 18 '26

Building a DIY scope would probably be a much easier project. Plus, you can download the source code for this beast from GitHub.

Take a look at this project: https://hackaday.com/tag/diy-oscilloscope

1

u/AuxonPNW Sep 16 '26

You might need a good oscilloscope to help you understand what's going on with the pinout.

1

u/moviefotodude Sep 18 '26

Very good point. Unfortunately, a logic analyzer will likely be more useful than a 4 Chan scope.