DesignSpark Electrical Logo
  • Brought to you by
  • RS Components
  • Allied Electronics
kenboak

August 15, 2016 15:13

Mystorm - Creating an Open Source FPGA Development Platform

title
Brothers in ARMS - Relaxing with a pint and the newly completed pcb at our Saturday “Office”

There is a tide in the affairs of men.
Which, taken at the flood, leads on to fortune;
Omitted, all the voyage of their life
Is bound in shallows and in miseries.
On such a full sea are we now afloat,
And we must take the current when it serves,
Or lose our ventures.

Julius Cesar, Act 4 Scene 3.

The open source community is currently blessed with such a flood-tide of ideas and innovation.

title

Never before have there been so many convergent opportunities – like the alignment of the planets of open source software, firmware and hardware and now programmable hardware in the form of low cost, accessible FPGAs.

The first spark of an idea to create an open source dev-board for a popular FPGA occurred in chat following the May OSHUG meetup.

Alan (Wood) had just given a talk on FPGAs, giving a lightning tour of their uses and capabilities and I had the rash idea that we, as the Open Source Hardware Users Group, could do our own, open source FPGA platform for the benefit of OSHUG members and others.

However, what clinched it, was that Vienna based engineer Clifford Wolf had recently managed to reverse engineer the structure of the bit file used to program the Lattice ICE40 range of FPGAs - and his work "Project IceStorm" had lit quite a fire under the open source hardware community. 

And so into this tempest of activity and interest, myStorm was born.

title

A Storm Brewing?

FPGAs had recently become a lot more affordable, and several companies were selling development boards for around the $100 mark.

As an engineer who has been shaving cents off BOMs for the last 20 years, I realised that we had to do a board that hit the sweet spot of around $30 (£25) selling price.

At that price it would offer youngsters and enthusiasts the means to explore new technology – without breaking the bank. But with a $12.50 BOM - it would need some tough decisions on what to put on the board and what to leave off.

Shenzhen Express

Fortunately, I have a good friend in Shenzhen, Toby Yu, who is well connected to the electronics industry over there and can get amazing things done quickly and cheaply - in particular specialising in modest volume production for the open source community.

So the three of us have embarked on a high speed enterprise – to fast track a new design into production, pulling out all the stops to achieve a radically different FPGA dev-board, - at a price point that had yet to be seen.

I had seen the USB based Lattice Icestick - which used the ICE40 HX1K part - but apart for the simplest of designs, this board was limited both in terms of logic elements and connectivity.

The Lattice parts were available in 1K 4K and 8K versions, but the 8K part unfortunately used a BGA package. We wanted a design that fitted onto a 2 layer board and meet the constraints of EagleCAD, which could be built or modified by anyone who had reasonable SMT soldering skills. The BGA package would be a non-starter.

My good friend James Bowman, over in Northern California, - who devised the J1 Forth processor - had demonstrated last September his J1a design running on a Lattice 1K part - and this motivated me to want to put together a design that could host this open source open core processor - and have some fast external SRAM - so that a 16 bit 64K architecture could be created.

So after an initial enthusiastic discussion in the "Coal Hole" - the pub in the Strand, opposite the British Computer Society - where OSHUG meets monthly, Alan and I decided that we would have a crack at the pcb, and have it ready in time for an FPGA workshop - to be held in early September, at OSHcamp - OSHUG's annual get together in Hebden Bridge, Yorkshire.

So - the race was on - to create a new FPGA dev-board in approximately 16 weeks.

Early Beginnings

I started the following day by creating the footprint for the 144 pin LQFP FPGA package in EagleCAD, checking carefully that all the power and ground pins were correctly connected.

With this done, I connected to a fast 10nS 512Kx16 SRAM - in a very tightly coupled arrangement - where the RAM chip is placed on the underside of the PCB - directly beneath the FPGA.

With the FPGA and RAM, providing the core of the design, Alan and I then had several iterations of ideas on what else should be on the board - hardware that would best suit the needs of the OSHUG members.

We decided that there should be a microcontroller on-board - as this could be used to program the bit file into the FPGA, and the usual FT2232 dual USB to serial converter device, common on a lot of FPGA boards - at about £3, was deemed to be way too expensive for our application.

Alan had come from a background with the XMOS devices - so this was an early contender, but dismissed on grounds of cost. I had been designing ARM based pcbs for a couple of years - and was quite keen on getting an ARM chip into the mix. We also briefly looked at AT-Tiny and other 8 bit devices.

I had heard that there were some very economical ARM Cortex M3 parts available from a Beijing based company called Giga Devices - and these appeared to be pin compatible, and code compatible with the popular STM32 range of ARM microcontrollers.

Giga Devices are actually well known as manufacturers of large flash memories, and the GD32 was their first foray into producing a low cost ARM M3 for the cost sensitive Chinese market.

The GD32 is not as you might have thought, just a copy of the STM32 - it is unique in it's own right. Coming from a flash memory background, the chip design engineers at Giga Devices had found a clever solution - packaging a flash memory die inside the same package as their own ARM core. On boot-up - the contents of the flash memory are copied into on chip SRAM of the ARM and executed - resulting in a high performance M3 core - unhampered by the slow access time of flash - or any of the buffering needed to increase the access time of reading the flash.

This article shows the Chinese Solution.

Now that two parts of the jigsaw were in place, I headed off on a 2500 mile, 2 week tour of the UK and it's maker community, with my friend from Shenzhen, Toby Yu.

title
Toby meets the Pi Moroni Crew in Sheffield

Meanwhile Alan, was hatching out some brilliant schemes - so when I returned from the UkmegaTour, he had 90% of the design finished - and explained it over a pint at the Shepherd Flock pub - our regular Saturday meetup "Office".

Alan's breakthrough, was to fit a connector at one end of the pcb, into which a Raspberry Pi, or Pi Zero could be plugged - either directly or using a short 40 way IDC cable.  The Pi could host Clifford's Ice Storm Tool Chain, and also be used to download the bit file into the FPGA by way of the flash memory in the ARM chip.

titleIn addition to the SPI programming interface, the PI, the ARM and the FPGA share an 8-bit bus - with handshake signals. This would allow large volumes of data to be transferred rapidly between the three devices.

Additionally the ARM provides a USB interface to a PC or laptop allowing the FPGA to be programmed via the USB port.

myStorm – in a teacup

myStorm is a unique combination Pi Zero, a fast 32-bit ARM microcontroller a versatile low power FPGA tightly coupled to a 4Mbit fast 10nS SRAM.

The Raspberry Pi Zero - which hosts all of the FPGA development tools, provides an integrated design environment for FPGA and ARM - aimed at a new concept in hardware hacking projects.

The Lattice ICE40 series FPGA with a large SRAM attached, connected to an ARM M3/M4 Cortex microcontroller provides the ideal platform for developing FPGA hardware applications including soft core cpu designs.

Connectivity

From the start we wanted a well engineered design which would be attractive to the open source hardware community. This meant that we had to come up with excellent connectivity, to make the new board as versatile as possible.

The standard connector for FPGA boards is that devised by Digilent, known as a PMOD. These are a 6 pin female 2.54mm header that carry Vcc and 0V, plus four I/O signals direct from the FPGA pins. If 2 PMODs are stacked on top of each other - it becomes a "double PMOD" again with power and ground but 8 GPIO signals.

The PMOS, and double PMOD allows hardware to be very simply added to a FPGA board - and there are already dozens of PMOD compatible add-ons from a variety of vendors. As the pitch is 2.54mm - it is easy to make up small designs on stripboard or perfboard, or even on a breadboard.

I had come from a previous background of Arduino compatible hardware and so I was keen to include a set of Arduino style "shield" headers on the board - so that many of the vast range of Arduino accessory shields could be plugged directly in.

The ARM processor has been co-opted into the Arduino community - both in the Arduino Due, but also in the range of STM32F103 based boards that run a variant of the Arduino code - known as STM32-Duino.

Olimex have recently released a FPGA dev board based on the ICE40 HX1K, and have adopted a connector for the low voltage differential signals (LVDS). We have included this connector on the underside of the myStorm board as an alternative to some of the double PMODs.

Finally, for a bit of fun, we include a connector that will allow a 32 x32 RGB LED array to be plugged straight in to the board on an IDC cable.

When the ARM is not actually programming the FPGA, it can be used as a capable 32-bit co-processor complete with several 12-bit ADC channels and a rich-mix of 5V tolerant GPIO and common interfaces for SPI, I2C and UART.

20 of the digital pins from the ARM are brought out to pins on the Arduino headers, plus 6 channels that have access to the 12-bit ADC.

One advantage of using the STM32 range of ARM microcontrollers, is that they have good pin-compatibility across the range, and it is easy to fit a variety of M3, M4 or low power M4 64 pin processors to this board. For a real budget solution, the GD32F103RC sells for less than $2 in 1 off.

Making myStorm

In the third week of July – the design had been completed – now 8 weeks into the 16 week project.

I sent the gerbers across to Toby in Shenzhen, and he had 60 board – in 5 panels of 12 boards produced by his local pcb supplier. At the same time he ordered up 2 sets of solder stencils – one for the UK team and one to be kept in Shenzhen.

Just 4 days after the gerbers were sent, we had the boards and the stencils – Toby packed these up and shipped one set of stencils and one panel of boards back to me via DHL.

Just 7 days after pressing Go on the gerbers we had the boards back in Surrey.

We then spent the last weekend in July making up 3 boards, using the solder stencil, some fine manual placement of the 0402 components and Alan’s low tech aluminium hot plate.

A week later, and after a modest amount of publicity at emfcamp, we were confident that the remainder of the pcbs could be run through pcb assembly in Shenzhen – using a local factory with a modern SMT line.

Toby had been primed with the bill of materials – for the passives and connectors, whilst I set about sourcing the ICs from RS Components.

I had used RS a few months earlier when Toby was involved in another build and needed an FTDI graphic controller IC – not so easily sourced in Shenzhen.

I had contacts in their Export Department – who would ship parts anywhere in the world, and getting ICs to Shenzhen in 3 days was all part of what they do.

In addition, Pete Wood, has kindly sponsored the OSHCamp weekend workshop – and his support through RS Component’s DesignSpark community, has generously contributed the ICs required for the myStorm boards which will be supplied to the FPGA Workshop at OSHCamp.

As I write this on August 10th, we have FPGAs just arrived and more parts coming via RS Export. These will be sent out to Toby in Shenzhen – so that pcb assembly can begin on August 22nd.

The assembled boards will leave Shenzhen on the 24th – and via DHL direct to Andrew Back, who is the kingpin in the OSHCamp organisation.

Alan and I travel to Hebden Bridge on September 1st, and will be presenting an FPGA workshop on Sunday September 4th. based on the myStorm hardware platform.

You can follow our progress on The myStorm Project on Alan’s Blog

Follow me on Twitter - @Monsonite

Event information -

OSHcamp 2016Wuthering Bytes Festival   - 9 day event- Hebden Bridge, UK  - 2nd - 11th Sept 2016

kenboak

Bio coming soon

Comments

MattVenn

August 30, 2016 10:58

I'm excited!