Настройка lpt для spipgm

Содержание:

SPIPGM не записывает флешку

Собрал программатор по этой статье: rayer.g6.cz/elektro/spipgm.htm

Кто сталкивался, подскажите, в чем проблема?

Сам таким «проггером» пользуюсь уж более 3-х лет. Напряжение питания у меня всегда 3,3В (от БП компа). и на сегодня, чтобы писалось: 1. cmd 2. spipgmw /i 3. spipgmw /d old.bin 4. spipgmw /u 5. spipgmw /e 6. spipgmw /p new.bin 7. spipgmw /v new.bin ну, думаю, понятно. Или нужно разжевать.

Спасибо, не нужно Я подкидывал 3,3В от БП, но напряжение на флешке при этом почему-то возрастает до 3,7 — 3,9 В, пытался подбирать резистор в нагрузку, но замаялся и бросил, поставил батарейку, тем более, что так часто и делают

Возможно это важно: я подключаю программатор к старенькому ноуту Compaq Evo N610c — это единственная железка с LPT по близости. Пытался «замедлить» через параметр /d=delay — ничего не изменилось

Проверьте LPT-порт Вашего N610C любым принтером с LPT интерфейсом или любым другим способом. Работает ? Должно работать. Берем любою 25-тку, ну с видео-карты или еще с чего (к примеру модем, роутер, . ), и проверяем на нашем железе. Но предварительно (и это неукоснительно — делаем бекап с флешки

spipgmw /d Если теже тараканы — проверяем нашу чучу (т.е. то что мы там напаяли) на сегодня все. Иду спать.

была подобная проблема, что ни делал через spipgm ни хотела прошивать случайно нашел комментарий что можно попробовать софт flashrom

под линуксом прошил, использовал команды flashrom -p rayer_spi -w /mnt/usb/SPIPGM/w316original.bin

в первый раз выдало что запись была с ошибкой (после вывода ошибки предлагали решить проблему обратившись на IRC канал) на IRC канале посоветовали укоротить провода (я это и планировал в принципе — слишком долго мучился, но все равно спасибо за помощь)

потом прошил снова используя flashrom запись прошла успешно, только верификация не прошла я попробовал запустить верификацию через SPIPGM /V — все прошло успешно

на IRC канале ответили — lucky (т.е. мне повезло как я понял)

вернул память на место девайс поднялся (роутер tenda W268R — прошику брал здесь)

источник

Устранение сбоев работы микроконтроллеров

Когда пользователь начинает работать с микроконтроллерами, он, вероятно, столкнется с проблемами при программировании, на решение которых потребуются часы или дни, а иногда они просто неразрешимы. Опытные программисты поделились своими наработками устранения различных нарушений, вот некоторые из них:

  1. При любом сбое вначале проверяют блок питания. Иногда случается так, что источник питания не подходит к программатору и требуется внешний источник питания.
  2. Выбирают правильный последовательный порт в программном обеспечении.
  3. Прежде чем использовать программатор, необходимо установить драйверы, необходимые для его функционирования. Когда подключается программатор в первый раз, он автоматически устанавливает их, если есть соединение с интернетом, иногда потребуется указать расположение драйверов.
  4. Повышение напряжения. Многие микроконтроллеры требуют подтягивания в своей цепи, прежде чем могут быть запрограммированы, так микроконтроллер пикасе требует 10 кОм подтягивающего резистора на последовательном выводе, иначе показывает ошибку.
  5. Программное обеспечение для программирования не обнаруживает микроконтроллер — это опять-таки проблема с блоком питания, проверяют БП снова и подключают программатор к компьютеру.

После выполнения своими руками USB программатора Spi Flash пользователь получит SF, выполненную собственноручно для системного программирования. Она будет легко управляться компьютером через шину USB благодаря удобному интерфейсу и мощным функциями.

Connection Methods

The following article assumes that there is a basic understanding of what an SPI flash is.
There are two major concepts of connecting an SPI flash to a MCU, where this article mainly refers to the latter one (Quad Mode):

Pinout

All SPI flashes provide the following pins for communication:

Pin Description
CLK Serial Clock. Clock for the SPI flash.
MOSI Master-Out-Slave-In. Output of CPU and input of SPI flash.Used to transmit data + command from CPU to SPI flash device. 1-bit is transmitted per clock.
MISO Master-In-Slave-Out. Output of SPI flash and input of CPU.Used to transmit data SPI flash device to CPU.
nCS Chip-select (active low). Controlled by CPU, input for SPI flash.While HIGH, all commands + data is ignored by SPI flash.

Many modern SPI flashes also provide the following (additional) pins:

Pin Description
DQ0 (MOSI) Used as I/O pin in address, dummy cycle and data phase of commands that support quad mode.Used as MOSI during command phase and for commands that only work in serial mode.
DQ1 (MISO) Used as I/O pin in address, dummy cycle and data phase of commands that support quad mode.Used as MISO during command phase and for commands that only work in serial mode.
DQ2 Used as I/O pin in address, dummy cycle and data phase of commands that support quad mode.May have reset or other functionality for commands that do not use/support quad mode.
DQ3 Used as I/O pin in address, dummy cycle and data phase of commands that support quad mode.May have reset or other functionality for commands that do not use/support quad mode.

Serial Mode — 4-pin Interface (Traditional)

The SPI flash is connected to an SPI unit of the CPU via CLK, MOSI, MISO, nCS pins. This is the minimum connection needed to store data on the SPI flash and get data from it.
This connection actually works with any CPU that provides an SPI unit. The SPI flash can only be accessed by explicitly sending commands to it via the SPI unit, in order to erase/program or read the flash.
The user software needs to manually copy SPI flash contents over to RAM and jump to them, in case code stored in the SPI flash, shall be executed.

Quad Mode (QSPI) — 6-pin Interface (Modern)

The SPI flash is connected to a dedicated QSPI unit of the CPU via CLK, DQ0, DQ1, DQ2, DQ3, nCS pins. The specific QSPI unit contains some logic that handles the communication with the SPI flash and makes it readable through the normal address space of the CPU. This way, the CPU can directly fetch instructions from the SPI flash, without manually need to care about reading out and copying over contents from the SPI flash. Usually, the QSPI unit is configured by the application or CPU at startup, to match the command set and requirements (dummy cycles etc.) of the connected SPI flash. From there on, it can be accessed like normal read-only memory (ROM) by the CPU. This combines the advantages of a parallel flash memory (accessible via address space of CPU) and a SPI flash (low pin count). As almost all SPI flashes nowadays can handle >= 100 MHz SPI clock frequencies (allowing an theoretically transfer speed of 400 MBit/s when using the SPI flash in quad mode where 4 data bits are transmitted per SPI clock) of and the dedicated QSPI controller usually provides some caching mechanisms to allow efficient instruction fetching and data loading from the SPI flash, the advantages of parallel flashes (even higher speed) is not that important anymore. Note that it depends on the actual MCU if a flash can be connected that way because a dedicated QSPI controller which makes the SPI flash memory-mapped visible, needs to be provided by the MCU.

Программирование SPI FlashROM.

Опубликовал(а): Кот_ДаWINчи
в: 20.03.2013

Недавно мне приносили в ремонт материнскую плату MSI-7529 v.2. Как оказалось неисправность классическая — поврежден BIOS, и его необходимо просто перепрошить… НО … Оказывается, что на современных материнских платах теперь вместо обычной Flash ROM установлена «флешка» с последовательным интерфейсом Winbond 25X40VSIG (SPI Flash ROM). и сама микросхема значительно уменьшилась в размерах (см. первую фотографию данной статьи). К таким нововведениям я был естественно не готов. Мой старенький программатор был не готов совладать с этой штукой. Пришлось срочно лезть в интернет, и искать способ прошить BIOS, как говорится «на коленке».

Информация была найдена быстро. Прошить ее было можно, подключив к компьютеру через LPT-разъем.

Да и программа для прошивки тоже нашлась на одном из европейских сайтов (http://rayer.g6.cz/elektro/spipgm.htm). Осталась одна проблема — подать на микросхему питающее напряжение 3.3 вольта. Это для меня тоже не проблема. Напряжение в 5 вольт есть на стандартном USB, а преобразовать его в 3.3 можно при помощи APL1117-3.3, которые очень часто встречаются на материских платах, видеокартах и других компьютерных комплектующих (коих в моем распоряжении целая полка).

В результате получилась следующая схема:

Программа для прошивки:

Она работает как под DOS, так и под Windows XP. Команды для программирования:

SPI FlashROM Programmer 2.1 (C) 2008-2012 by Martin Rehak;
Compiled by GCC 4.6.2 at 02:07:49, Apr 19 2012
(Win9x/NT/2K/XP compatability)

SYNTAX: spipgm /<command>     
commands: i - identify SPI FlashROM
          r address size - read & display data block (0x prefix = hexa number)
          d filename - dump entire FlashROM to file
          p filename - program entire FlashROM from file (without erase)
          v filename - verify FlashROM content against file
          e - erase entire FlashROM
          eb address count - erase 64kB blocks from address (0x prefix = hexn.)
          u - unlock write protection bits (may depend on WP# level)
          l=* - LPT port I/O base address (default is 378h - LPT1)
          d=* - additional delay for SPI clock pulse width  (default = 0)

Сразу же предупреждаю, что данная схема без гальванической развязки, и ее применение может вывести из строя ваш LPT-порт. Поэтому, лучше всего сперва сделать все подключения при выключенном компьютере, а потом произвести включение компьютера и прошивку. По окончании прошивки необходимо сперва всё отключить, а уже потом отсоединить ваш «прошивальшик» от компьютера.

Not yet supported

  • Dual- and Quad-SPI (issue #1)
  • Multiple pins (issue #7)
  • Fast read command (issue #1)
  • Erase/Write emulation (issue #12)
  • Status registers (partially supported, could be better)
  • Block protection bits (maybe worth it, probably not)
  • Linux RISC-V core in the FPGA
    • Ethernet over USB-CDC-EEM ()
    • Default flash image on SD card
    • A decent API for TOCTOU exploration

Wiring

Typical 8-SOIC and 8-DIP flash chips ( and Vcc are optional):

Typical 16-SOIC flash chips ( and Vcc are optional):

If there is a series resistor on the pin, it might be possible to clip
directly to the chip with a Pomona 8-SOIC «chip clip» and use TOCTOU mode to
override the signal from the PCH. However, this doesn’t always work so sometimes
it is necessary to desolder pin 1 from the board, bend the leg upwards and solder
a jumper wire to the pad on the maiboard as shown in the above photo.

If the board has a «Dediprog» or programming header it might be possible to attach
directly to the header and also override the chip select pin, although more
testing is necessary.

IMPORTANT NOTE the system defaults to using 3.3v signalling for the SPI bus.
If you have more modern system, it might use 1.8v and driving it at the higher
voltage can cause problems. It is possible to remove the RV3 resistor from the
board and provide power to the FPGA GPIO bank through the + pin on the left side
connector (J1, pin labeled «2.5/3.3V»); you can connect this pin to the Vcc pin
on the SPI flash, which will allow the FPGA to output the same voltage.
More details are in issue #10.

Usage

If using the spispy with a 3.3V chip and a clip you can leave the pin
disconnected; otherwise be sure to see the important note above about
hardware changes to support lower voltage flash chips.
Be sure to set the flag in the file so that the spispy will
prevent the real flash from responding (or use the pin; need to
document when this works).

When you plug in the spispy it should show up as a USB-CDC-ACM device with
a device file like . You might have to start or some
other terminal program to configure the control lines correctly (and to prevent
from screwing with it).

Install the image into the top of DRAM to tell the PCH that the flash
only supports single read commands at the slowest speed:

Install the ROM image into the bottom of DRAM ( is optional to provide a bargraph
and bandwidth measurement):

If you want to update part of the ROM image, such as the top 8 MB of the coreboot image,
you can use to extract that part:

Protocol

Unfortunately, most microcontroller CPUs aren’t able to respond to an
incoming SPI byte on the next SPI cycle due to internal muxes and buses,
so they aren’t able to reply in time. Even if the CPU could do it,
most DRAM memory has a 100ns or longer latency for a random read, so
it won’t be able to answer quickly enough. Additionally, DRAM requires
a refresh cycle that takes it offline during the refresh, which adds a
random latency.

These difficulties can be overcome with an FPGA using a custom DRAM
controller. The FPGA is able to inhibit refresh cycles during the SPI
critical sections, which reduces the latency jitter, and it can split
the DRAM access into two parts: the «row activation» once 16 of the
24 address bits are known, and then a «column read» of two bytes worth
of data once 7 of the last 8 bits are known. The correct byte is selected
once the last bit of the address has been received.

The row activation command requires at least four DRAM clock cycles,
but can be stretched arbitrarily long with a special control signal wired
into the FPGA’s sdram controller from the SPI bus interface. This allows
the FPGA to overlap the activation with the reception of the last bits,
and the final column read requires only two clock cycles when the DRAM
is configured with a CAS latency of two.

Subsequent bytes are «easy» at 20 MHz for single SPI since the full
SDRAM read cycle (7 FPGA clocks) fits into the 8 clocks of the SPI bus
(roughly 24 FPGA clocks). For dual or quad-SPI it will be necessary
to configure a burst mode on the SDRAM controller or allow new column
addresses to be provided dynamically.

DIY: универсальные программы создания

Это лучший для микроконтроллеров PIC и AVR программатор Spi Flash, своими руками, может быть, его создать не получится, но устройство не дорогое, стоит меньше 10 $ и выполняется из легко доступных компонентов.

Преимущества:

  1. Бесплатное ПО с открытым исходным кодом.
  2. Нет необходимости устанавливать дополнительные драйверы, использует драйвер HID (Human Interface Device), который обычно применяется для клавиатуры и мыши.
  3. Поддерживает много устройств PIC и AVR.
  4. Поддерживает платформы Windows и Linux.
  5. Состоит из микроконтроллера PIC18F2550 — мозга программатора Spi Flash.
  6. Разъем USB-B подключается к компьютеру.
  7. Имеется два светодиодных индикаторов, один для индикации подключения программатора, другой показывает статус программирования.
Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *