linuxboot / heads

A minimal Linux that runs as a coreboot or LinuxBoot ROM payload to provide a secure, flexible boot environment for laptops, workstations and servers.
https://osresearch.net/
GNU General Public License v2.0
1.4k stars 180 forks source link

SPI programmer recommendation #157

Open jpouellet opened 7 years ago

jpouellet commented 7 years ago

I'm sure your SPI programmer works great, but for those who do not happen to have a teensy on hand and would end up buying some hardware to flash things anyway, I would recommend picking up a CH341A-based (datasheet) programmer. These:

SOIC8 clips can also be acquired (w/ tax & shipping!) for about $3 USD on ebay.

ciaby commented 7 years ago

I second that, I used basically the same programmer. :)

osresearch commented 7 years ago

That sound great. Would you take a photo of it in operation and add details to the Installing Heads page?

I also need to update those instructions for the new flashrom based install; there is a two-phase process of flashing the 4MB image to get a Heads bootstrap image that can then mount a USB device and flash a larger image. This is also how subsequent upgrades can be performed without having to access the hardware again.

tlaurion commented 7 years ago

Actually, it is supported through flashrom. I confirm it works really nicely. ./flashrom -p ch341a_spi

jpouellet commented 7 years ago

@osresearch I see you're linking to external images in the heads-wiki repo instead of hosting them there. Is there a reason to prefer that over having it self-contained?

Anyway, I don't have a fancy camera, but here are some pictures of a ch341a-based programmer in use: flashing-1 flashing-2 flashing-3

osresearch commented 7 years ago

I bought that same SOIC clip on amazon for $10 and it is nowhere near as nice as the $13 Pomona 5250. Unfortunately even those seem to wear out after a few hundred cycles.

You're right that the images should be self contained. They were on flickr when it was hosted on trmm.net so that I didn't have to pay for the bandwidth...

jpouellet commented 7 years ago

I got my clip for ~$3, but it can be quite frustrating to get it to make a good connection. I've just ordered the one you suggest off digikey, hopefully it's better. Clips in general are pretty annoying, and I almost considered soldering some magnet wire to the pins or something.

Images locally here: https://github.com/osresearch/heads-wiki/pull/2

mfc commented 5 months ago

fyi libreboot folks have strong opinions on the ch341a: https://libreboot.org/docs/install/spi.html#do-not-use-ch341a just sharing so folks are aware since in heads documentation ch341a is the default flasher. (i re-purpose an old rpi 3 model B which works fine for me)

tlaurion commented 5 months ago

fyi libreboot folks have strong opinions on the ch341a: https://libreboot.org/docs/install/spi.html#do-not-use-ch341a just sharing so folks are aware since in heads documentation ch341a is the default flasher. (i re-purpose an old rpi 3 model B which works fine for me)

@mfc hey! Thanks for reaching out.

Yeah, had discussions with Leah about that. Main points of her were that assembly is cheap but when confronted about v1.6/1.7 board revision voltage selection, she stayed opinionated outside of the facts. Can you comment on https://github.com/linuxboot/heads-wiki/issues/120#issuecomment-1741039038 ? I plan on streamlining and taking new pictures to properly document this in issue prior of putting it in the wiki.

Facts are exposed there, where rainbow cable pictures are still coupled with ch341a v1.2 old board revision, which I programmed hundreds of x230 without issues. But still risky with 5v on old < v1.5 boards where volt selector resolves the issue altogether on > v1.6 ch341a board revisions.

The reason why we prefer ch341a to rpi setup or multipurpose boards is that if the sole goal is to bootstrap and flash spi, getting those accessories can be expensive for people not having that kind of money, where ch341a can be bought through alibaba, ebay and even amazon shipped at your door for 5/10/30$CAD in kits (most kits are < v.15 boards though), where amazon shipped mine under 2 weeks in the holiday season which was fast considering all possible delays in that time period of the year.

So https://github.com/linuxboot/heads-wiki/issues/120#issuecomment-1741039038 shows how to buy clip, assemble wires and DIY with panoma (clip is narrower and sturdier which would benefit people flashing often, not so much users wanting to flash once. Still recommendation should go with ch341a >v1.6 board to be on cautious side).

zifxify commented 5 months ago

I bought mine years ago after reading recommendations on winraid. It looks just like this one (3.3v) and is good quality. image

This links might be useful: https://winraid.level1techs.com/t/guide-using-ch341a-based-programmer-to-flash-spi-eeprom/30834/82 https://winraid.level1techs.com/t/guide-using-ch341a-based-programmer-to-flash-spi-eeprom/30834/205