Arduino flasher 3.3v: Difference between revisions

From flashrom
Jump to navigation Jump to search
Line 19: Line 19:


== HOWTO ==
== HOWTO ==
=== Build the code and flash it ===
First download  frser-duino:
First download  frser-duino:
  git clone --recursive https://github.com/urjaman/frser-duino.git
  git clone --recursive https://github.com/urjaman/frser-duino.git
cd frser-duino
Then modify the F_CPU value in main.h to be 12Mhz instead of 16Mhz:
Then modify the F_CPU value in main.h to be 12Mhz instead of 16Mhz:
F_CPU will look like that:
F_CPU will look like that:
Line 29: Line 31:
  # make ftdi
  # make ftdi
  # make flash-ftdi
  # make flash-ftdi
=== Build the programmer ===
* Connect the FTDI adapter to RX and TX of the arduino
* Connect the FTDI adapter to RX and TX of the arduino
* Connect the 3V3 of the FTDI adapter to the 5V pin of the Arduino
* Connect the 3V3 of the FTDI adapter to the 5V pin of the Arduino

Revision as of 13:11, 27 February 2018

Introduction

This explains how to:

  • Easily lower the voltage of an arduino
  • Use that arduino to flash a coreboot image on a GM45 Thinkpad with a SOIC16 chip

It requires:

  • An AVR Arduino at 5v
  • An USB<->Serial adapter capable of providing enough current to power up:
    • The arduino
    • The flash chip
    • The circuits around the flash chip

It was tested with:

  • An Arduino.org "nano version 3.3"
  • A Sparkfun "FTDI Basic 3v3" (Uses an FTDI FT232R)

Theory

In the Atmega328/P datasheet, the "32.3. Speed Grades" chapter describes (pages 368 and 369) the link between maximum frequency of the microcontroller and the voltage. At 3.3v, the maximum frequency is 12Mhz.

HOWTO

Build the code and flash it

First download frser-duino:

git clone --recursive https://github.com/urjaman/frser-duino.git
cd frser-duino

Then modify the F_CPU value in main.h to be 12Mhz instead of 16Mhz: F_CPU will look like that:

#define F_CPU 16000000UL

Change it to:

#define F_CPU 12000000UL
  • Flash the Arduino with frser-duino
# make ftdi
# make flash-ftdi

Build the programmer

  • Connect the FTDI adapter to RX and TX of the arduino
  • Connect the 3V3 of the FTDI adapter to the 5V pin of the Arduino
  • Connect the GND of the FTDI adapter to the GDN of the arduino.
  • Get an USB cable and don't connect it to the computer
  • Connect it to the FTDI adapter
  • If you use a clip (Like a SOIC-8 or SOIC16 Pomona clip), connect it to the arduino
  • Connect the chip to the clip, or if you don't use a clip, the chip to the arduino
  • Connect the USB cable to the computer.

Flashing

Run flashrom like that:

flashrom -p serprog:dev=/dev/ttyUSB0:2000000

With some strange macronix flash chip (that are present in the Thinkpad X200) you might need to add spispeed=100k like that:

flashrom -p serprog:dev=/dev/ttyUSB0:2000000,spispeed=100k

Thanks

Thanks a lot to SwiftGeek on IRC (#libreboot on Freenode) for finding the first workaround to make it detect flash chips at lower voltage. This project would not have been possible without that.