<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://w.electrodragon.com/w/index.php?action=history&amp;feed=atom&amp;title=RPI_PROG</id>
	<title>RPI PROG - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://w.electrodragon.com/w/index.php?action=history&amp;feed=atom&amp;title=RPI_PROG"/>
	<link rel="alternate" type="text/html" href="https://w.electrodragon.com/w/index.php?title=RPI_PROG&amp;action=history"/>
	<updated>2026-06-04T21:08:36Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.37.2</generator>
	<entry>
		<id>https://w.electrodragon.com/w/index.php?title=RPI_PROG&amp;diff=32840&amp;oldid=prev</id>
		<title>Chao at 09:32, 31 August 2023</title>
		<link rel="alternate" type="text/html" href="https://w.electrodragon.com/w/index.php?title=RPI_PROG&amp;diff=32840&amp;oldid=prev"/>
		<updated>2023-08-31T09:32:47Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Setup ==&lt;br /&gt;
* $sudo apt-get install openocd&lt;br /&gt;
* $sudo apt-get install avrdude&lt;br /&gt;
* $sudo apt-get install flashrom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== OPENOCD ==&lt;br /&gt;
* Read more information here: [[OpenOCD]]&lt;br /&gt;
== AVR ==&lt;br /&gt;
[[File:2019-06-04 141936.png|thumb]]&lt;br /&gt;
* Install avrdude by: sudo apt-get install avrdude&lt;br /&gt;
* reference https://www.monocilindro.com/2017/03/20/flashing-arduino-using-raspberry-pi-shell/&lt;br /&gt;
* Download the avrdude.conf from our bitbucket.&lt;br /&gt;
* Use the following commands &lt;br /&gt;
	env.sh configure chip type &lt;br /&gt;
	probe.sh detect the chip and connections &lt;br /&gt;
	flash_dump.sh read flash  &lt;br /&gt;
	flash_write.sh flash flash  &lt;br /&gt;
==== Modify avrdude.conf for RPI ====&lt;br /&gt;
# Linux GPIO configuration for avrdude.&lt;br /&gt;
# Change the lines below to the GPIO pins connected to the AVR.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
programmer&lt;br /&gt;
  id    = &amp;quot;linuxgpio&amp;quot;;&lt;br /&gt;
  desc  = &amp;quot;Use the Linux sysfs interface to bitbang GPIO lines&amp;quot;;&lt;br /&gt;
  type  = &amp;quot;linuxgpio&amp;quot;;&lt;br /&gt;
  reset = 12;&lt;br /&gt;
  sck   = 24;&lt;br /&gt;
  mosi  = 23;&lt;br /&gt;
  miso  = 18;&lt;br /&gt;
;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== SWD - STM32 ==&lt;br /&gt;
* env.sh Configure the platform to which the chip belongs, such as stm32f1x, stm32f2x, etc. When calling other scripts, you need to execute source ./env.sh first to initialize the environment variables, the same below.&lt;br /&gt;
* probe.sh is used to detect the existence of the chip&lt;br /&gt;
* attach.sh attach to the chip, then another window can call $telnet localhost 4444 for single step debugging&lt;br /&gt;
* flash_dump.sh dumps the flash data from the chip&lt;br /&gt;
* flash_erase.sh erase flash data in the chip&lt;br /&gt;
* flash_write.sh Flash inside the chip&lt;br /&gt;
* lock.sh stm32 series chip provides flash write protection. After the write protection is turned on, the chip cannot be debugged. The flash data is read. The product commercial recommendation is to open the write protection function.&lt;br /&gt;
* unlock.sh cancels write protection.&lt;br /&gt;
&lt;br /&gt;
== I2C and SPI ==&lt;br /&gt;
=== Flash ===&lt;br /&gt;
* probe.sh detect the flash type&lt;br /&gt;
* flash_dump.sh read flash    &lt;br /&gt;
* flash_write.sh write flash  &lt;br /&gt;
&lt;br /&gt;
=== EEPROM ===&lt;br /&gt;
Please notice V1 version use I2C0, V2 version add selection to I2C1&lt;br /&gt;
&lt;br /&gt;
* env.sh Configure the chip model, you can call avrdude -p ? to view the currently supported chips.&lt;br /&gt;
* probe.sh probes the i2c bus&lt;br /&gt;
* flash_dump.sh read flash&lt;br /&gt;
* flash_write.sh flashing flash&lt;br /&gt;
OR use [[I2CDetect]] to direct dump, write, and read&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[category: RPI Shield]]&lt;br /&gt;
&lt;br /&gt;
[[category: PROG]]&lt;/div&gt;</summary>
		<author><name>Chao</name></author>
	</entry>
</feed>