News for hackers. Stuff that matters.
Re:Memory Mapping an FPGA from an STM32 by Already__Taken on Thursday July 25, 2024 @11:25AM (#41069781)
real quite high level sorry, most of your embedded projects going forward are MCU+fpga to do what? I thought a custom router but 284mbps isn't nearly fast for a network.
Re:Memory Mapping an FPGA from an STM32 by UncleOxidant on Thursday July 25, 2024 @11:57AM (#41070143)
It's a good question. A lot of FPGA projects I see (including some real life products I've looked into recently) don't really need an FPGA. One I examined recently could easily have been done with a microcontroller with PWM outputs. The frequencies involved were well under 40MHz. Yes, there were a couple of multiplications going on in the FPGA, but there those could've been easily handled by a micorcontroller. An RP2040 would've sufficed instead of what they had - a microcontroller + an FPGA.
Re:Memory Mapping an FPGA from an STM32 by azonenberg on Thursday July 25, 2024 @12:29PM (#41070553)
The projects in question include things like a 48 port gigabit Ethernet switch with packet datapath in the FPGA, and dual 10/25G SFP28 uplinks. You're not doing that on a MCU. Also higher end oscilloscope work (e.g. 10 Gsps 12-bit JESD204B)

But a STM32 is more than sufficient for the management interface on both.

Re:Memory Mapping an FPGA from an STM32 by rvense on Thursday July 25, 2024 @02:21PM (#41071707)
I think a lot of people don't fully appreciate how fast a modern "microcontroller" is. That 'H735 is probably faster than every computer I had up to and including the iBook G4 I until early 2009.
Re:Memory Mapping an FPGA from an STM32 by buescher on Thursday July 25, 2024 @02:43PM (#41071962)
I keep running into that also. It's like the common mental model of a microcontroller froze around Y2K as a sort of headless VIC-20. I had an FAE, and a good one, from a major supplier tell me "you can't implement a filter" on a low-end micro that was roughly as powerful as an early nineties DSP.
Re:Memory Mapping an FPGA from an STM32 by rvense on Thursday July 25, 2024 @05:17PM (#41073505)
Cortex-Ms, man. A lot of 'em you just give 3.3V and a couple of bypass caps, and GCC will use the single-cycle hardware MAC (for M4 and above) if you just write the straight-forward C code and you can put it on there in 600ms with DFU. I'm a hobbyist, not an embedded wizard, but it really seems *pretty* good compared to what I understand about the old days.

(Like I like retro stuff and during COVID I bought an old DSP56k dev board with a book about the assembly language but oh boy, oh dear)

Re:Memory Mapping an FPGA from an STM32 by buescher on Thursday July 25, 2024 @06:08PM (#41073896)
They're amazing. And - you can run a PC emulator on an ESP32. Sure, you need the fancy ram. OK. And then people will tell me an ESP32 can't do things that people definitely were doing on bare-bones PCs in the eighties.
Re:Memory Mapping an FPGA from an STM32 by 15155 on Thursday July 25, 2024 @04:52PM (#41073256)
Zynq 7010s are $2.50 and are a hell of a lot more chip than an RP2040. If you already have the design (or copy one of the 50 available), it's a good option when you don't want to fight the chip.

PIO has extraordinarily sloppy timing (skew in all categories) compared to the cheapest and smallest FPGAs.

Re:Memory Mapping an FPGA from an STM32 by azonenberg on Thursday July 25, 2024 @05:02PM (#41073351)
Where are you getting them for $2.50?? The XC7Z010-1CLG225C is $74.83 at Digikey in qty 1.

Checking sketchier places Win-Source has the CLG400 package for $22.20 and even the cheapest aliexpress seller wants $4.84 for something marked as a 7Z010 that may or may not be legit.

Also "fight the chip" is pretty much the definition of what I did last time I did a zynq project. Just give me a plain FPGA and MCU with no wizards or GUIs or automatic code generation.

Re:Memory Mapping an FPGA from an STM32 by 15155 on Thursday July 25, 2024 @05:08PM (#41073408)
https://www.aliexpress.us/item/3256803970893483.html

I've ordered trays (and they send the OEM tray) - unique barcodes, legit.

> Just give me a plain FPGA and MCU with no wizards or GUIs or automatic code generation.

You can pretty much cut out all of their tools and get a pure Yocto/Vivado TCL build for the bitstream for the 7 series Zynqs. Very low touch.

Their IO planner (in the Vivado IP integrator) is somewhat necessary for complex peripheral scenarios and is one of the few things I ever use Xilinx GUI applications for anymore.

Re:Memory Mapping an FPGA from an STM32 by anyfoo on Thursday July 25, 2024 @09:58PM (#41075250)
I don’t even find Vivado that bad, but maybe I have Stockholm syndrome. Or maybe it’s because I’m forced to use Intel Quartus right now and wish it was Vivado every time.
Re:Memory Mapping an FPGA from an STM32 by scottapotamas on Thursday July 25, 2024 @10:20PM (#41075328)
I was interested to see, or at least what state they're in so I grabbed a couple. Might try to compare them against some genuine ones with CT and destructive inspection.

On the chance they're half reasonable, thanks for the link.

Re:Memory Mapping an FPGA from an STM32 by 15155 on Thursday July 25, 2024 @10:32PM (#41075394)
Let me know if the barcodes are anything but unique/perfect. This has been the case with many vendors, but these chips are cheap enough that you can try 50 vendors.
Re:Memory Mapping an FPGA from an STM32 by scottapotamas on Friday July 26, 2024 @04:15AM (#41076779)
Will do. Not too worried about trying low cost parts to gain some minimal confidence in a possible source, they're compelling for weekend side-projects at least.

I've previously struggled to roll the dice for higher end parts as the cost difference isn't as extreme and had some obvious reballed parts a few years ago. If they're OK then their $20 XC7K325T will be at the top of my list...

Re:Memory Mapping an FPGA from an STM32 by 15155 on Friday July 26, 2024 @08:14AM (#41077955)
Re:Memory Mapping an FPGA from an STM32 by scottapotamas on Friday July 26, 2024 @08:50AM (#41078192)
That's low-end Zynq and Artix and I'm thinking more >676 Kintex, though I appreciate any discussion on sourcing.

In the way that that Aliexpress vendor lists the 7010 parts at 1/10th the price of LCSC, some of their $20-60 listings are also shockingly cheap in comparison.

Re:Memory Mapping an FPGA from an STM32 by 15155 on Friday July 26, 2024 @09:04AM (#41078285)
Ah, missed the K! For the K420T, I pay around $30-45 from CN (not Aliexpress) sources with original barcodes (but these vendors are quite a bit harder to deal with.)
Re:Memory Mapping an FPGA from an STM32 by azonenberg on Friday July 26, 2024 @11:37AM (#41079509)
I have some obviously reballed (but well done) aliexpress XCKU5P's that I got for $55 a while back. Haven't tested yet but the price was so good I couldn't resist.
Re:Memory Mapping an FPGA from an STM32 by scottapotamas on Saturday July 27, 2024 @12:07AM (#41084390)
I’ve been bitten before but the risk/reward is probably worth it for parts like that.

Thanks for your write-ups btw, been following glScope development for a while.

Re:Memory Mapping an FPGA from an STM32 by Yoofie on Thursday July 25, 2024 @11:25PM (#41075541)
How do you assemble your board with BGA packages? Or do you procure the parts and then send them somewhere for assembly?
Re:Memory Mapping an FPGA from an STM32 by 15155 on Thursday July 25, 2024 @11:28PM (#41075554)
Vapor phase reflow.
Re:Memory Mapping an FPGA from an STM32 by anyfoo on Thursday July 25, 2024 @09:57PM (#41075246)
What parts do you have to fight? I’ve been using Zynqs for about almost a decade or so, and I really enjoy them. But that’s for personal projects with a lot of freedom, so I’m curious what problems arise in more commercial/professional settings.

Nowadays, I only often wish I had their ARMv8 chips instead of the old ARMv7 32bit architecture because that’s just showing its age, but that’s par for the course of using ARMv7, and doesn’t affect the PL side (much, except for interfacing sometimes).

Re:Memory Mapping an FPGA from an STM32 by bschwindHN on Thursday July 25, 2024 @11:06PM (#41075484)
> Zynq 7010

I've always wanted to do an FPGA project but haven't looked seriously into where to start. Can the Zynq 7010 handle something like data transfer from a 4K image sensor to a USB 3 transceiver?

> PIO has extraordinarily sloppy timing

Do you have any data on this? I was under the impression the PIO has fairly precise timing if you set up your clocks right, but maybe I've been misled here.

Re:Memory Mapping an FPGA from an STM32 by 15155 on Thursday July 25, 2024 @11:48PM (#41075630)
> Can the Zynq 7010 handle something like data transfer from a 4K image sensor to a USB 3 transceiver?

The Zynq 7010 is less-than-ideal for this because you'd have to use some kind of USB3 interface PHY - which would increase cost and be pretty limited functionality-wise.

If you use an FPGA with transceivers (some 7 series Artix chips - https://www.lcsc.com/product-detail/Programmable-Logic-Devic..., most 7 series Virtex/Kintex chips, all US/US+ chips), you can implement USB3 without an external PHY: https://github.com/enjoy-digital/usb3_pipe

The Z7010 probably has the area to do this type of translation but not the transceivers. There are other chips in the 7 series Zynq family with capable transceivers, but they are much more expensive ($15-$35 from CN).

> I was under the impression the PIO has fairly precise timing if you set up your clocks right, but maybe I've been misled here.

No measured data, but when I was once implementing JTAG and SPI at 50MHz+ with an extremely overclocked chip, the edges were very inconsistent in relation to each other and in pulse width - 5-15ns (estimating from memory, they were sloppy.)

PIO is very precise within its specified capabilities, this range is just very low compared to cheap FPGAs.

Re:Memory Mapping an FPGA from an STM32 by bschwindHN on Friday July 26, 2024 @12:39AM (#41075799)
Thanks for the reply and the links! I'm okay with a more expensive FPGA chip if it significantly simplifies the implementation. I'm probably biting off more than I can chew trying to start FPGA dev with something like this, so I'll also look into simpler starter projects.

> PIO is very precise within its specified capabilities, this range is just very low compared to cheap FPGAs.

Good to know, I don't plan on pushing RP2040s to their limit any time soon. They're still excellent for lower speed projects.

Re:Memory Mapping an FPGA from an STM32 by azonenberg on Thursday July 25, 2024 @12:23PM (#41070479)
The intent is for the high performance datapath to live entirely in FPGA (and the project you're probably thinking of is switching, not routing).

The MCU is for control plane only. Several hundred Mbps between the control and data plane is more than enough for a SSH management CLI and poking registers on the FPGA to move a port to a different VLAN in response to a CLI command or add an ACL rule or something.

Re:Memory Mapping an FPGA from an STM32 by dragontamer on Thursday July 25, 2024 @04:55PM (#41073279)
Embedded projects are never about doing things as fast as computers: we have full scale computers (and routers, and firewalls, and switches) for that.

Embedded is about solving problems more physical in nature, as you are physically closer to reality in nearly all aspects.

--------

An MCU + FPGA project could implement... say... the VFIR IrDA (Infrared) protocol at 16Mbit.

Traditional IrDA is widely supported at SIR and MIR levels (upto 1.152MBit or so). Anything faster and the equipment has basically been lost to the 1990s (and never was very popular anyway).

IrDA I'd explain as a remote-controller on steroids. Its infrared based (like TV Remote Controllers), so you need to line up both devices and have them looking at each other. Infrared can reliably travel about 3 meters over the open air in a variety of conditions. IrDA allows for bidirectional communications. Its a truly wireless protocol, albeit one that requires significant alignment to function correctly. But ~3 meters is good range and practical for many applications.

Nominally, you could use an entire MCU to handle the encoding / decoding of these light-pulses. However, that's a bit redundant. Its far more cost efficient to dedicate a few LUTs in an FPGA to the task.

Yes, the MCU is needed for the final application-level / OSI layer 4/5/6/7 aspects of IrDA protocol. But the lowest PHY and MAC levels of the protocol can and (probably) should be a small section of FPGA.

Upgrading from standard MCU 1MBit to 16MBit would be a 1600% improvement to communications compared to what's readily available with commercial-off-the-shelf solutions. If you've determined that IR Communications is good for whatever purpose you're using, maybe the 1600% improvement is going to be useful.

------------

EDIT: The "physicality" of this is because photodiodes react very quickly to light pulses. And an expensive enough transistor can amplify that at the ~100MHz speeds needed to run VFIR (at least in theory. I've never done this).

The FPGA (or MCU if you go that route...) just needs to clock at 100MHz or so, and interpret the start-of-frame and end-of-frame signals, while also interpreting a few other low-level details. Overall, this turns the sequence of light pulses into bits-and-bytes for higher-level processing (which code can and should handle).

Re:Memory Mapping an FPGA from an STM32 by rkangel on Friday July 26, 2024 @08:19AM (#41077981)
> Embedded projects are never about doing things as fast as computers: we have full scale computers (and routers, and firewalls, and switches) for that.

That's a bit of an overly broad statement.

I have several times at work done projects that use FPGAs to do things faster than a computer can do, e.g. some specific processing of a full 10Gbps UDP stream, which is much easier to get 100% reliable without packet drop in digital logic than it is in software land.

The FPGA+CPU combo allows you to do a LOT of things. I tend to use just a straight Zynq so I already have my memory buses wired up from processing system to digital logic, but this is an interesting architecture.