On 03/28/2011 03:11 AM, Benjamin Henrion wrote:
On Sun, Mar 27, 2011 at 2:22 PM, Benjamin Henrionbh@udev.org wrote:
On Sun, Mar 27, 2011 at 2:10 PM, Stefan Tauner stefan.tauner@student.tuwien.ac.at wrote:
On Sun, 27 Mar 2011 13:25:05 +0200 Benjamin Henrionbh@udev.org wrote:
Hi,
I am trying to port this code to an Arduino Duemilanove (atmega328p):
http://mikestirling.co.uk/2010/08/programming-an-lpc-flash-with-an-avr-and-f...
When I change the chip to atmega168, I have the following error:
avr-gcc -c -mmcu=atmega168 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=uart.lst -std=gnu99 -DF_CPU=7372800 -Wp,-M,-MP,-MT,uart.o,-MF,.dep/uart.o.d uart.c -o uart.o uart.c: In function ‘__vector_18’: uart.c:65: error: ‘_UDR’ undeclared (first use in this function) uart.c:65: error: (Each undeclared identifier is reported only once uart.c:65: error: for each function it appears in.) uart.c: In function ‘__vector_19’: uart.c:83: error: ‘_UDR’ undeclared (first use in this function) uart.c: In function ‘uart_init’: uart.c:281: error: ‘_UBRR’ undeclared (first use in this function) make: *** [uart.o] Error 1
Any idea what to change?
Having a simple Arduino being able to flash BIOS chips would be awesome...
the register names for the uart are probably different. e.g. for my atmega32u2 i would have to use UDR1 and UBRR1[H|L]. just look it up in the datasheet or /usr/lib/avr/include/avr/. HTH
I have replaced all the _UDR references directly by UDR0, the same for _UBRR, and it compiles fine now.
Now the Arduino Duemilanove can work in 3.3V if I am not mistaken, I tried in 5V, it gives me the following error:
# flashrom -p serprog:/dev/ttyUSB0:115200 flashrom v0.9.2-r1028 on Linux 2.6.35-27-generic (x86_64), built with libpci 3.0.0, GCC 4.4.4, little endian flashrom is free software, get the source code at http://www.flashrom.org
Calibrating delay loop... OK. Error: cannot synchronize protocol
- check communications and reset device?
It founds now the arduino, but not the LPC chip:
======================================================== flashrom -p serprog:/dev/ttyUSB0:115200 flashrom v0.9.2-r1028 on Linux 2.6.35-27-generic (x86_64), built with libpci 3.0.0, GCC 4.4.4, little endian flashrom is free software, get the source code at http://www.flashrom.org
Calibrating delay loop... OK. serprog:Programmer name "ATMega88 LPC " No EEPROM/flash device found. Note: flashrom can never write if the flash chip isn't found automatically. ========================================================
I am probably wrong in my pinout matching:
http://www.zoobab.com/arduino-as-a-bios-lpc-flasher
If someone knows more about LPC...
Cool project :-) I have been eyeing the UBW32 for a while for same purpose. One thing I noticed on your link is you have LAD2 and LAD3 open ended. You WILL need all 4 LAD lines. There is no way to even detect the chip without it. Here is a good reference on LPC and FWH I/O operations:
http://www.intel.com/design/chipsets/industry/lpc.htm
As far as the rest of the LPC pins as long as you have them connected to a arduino gpio they should work fine (as long as the data signal is no greater than 3.3v). As far as what LPC pins, power pins, and ground pins need to be connected on the chip google around and research the Cheapmod for xbox. If your lucky you may find a schematic. Hope that helps.