Total Downloads

2,702,031

Total Files

9,210

Latest Update

10

Dumping EEPROM via Two-Wire Interface using Windows IoT Core and Windows Runtime APIs

Posted December 10, 2017 | Raspberry Pi 2 | UWP | Windows | Windows 10 | Windows 10 IoT Core | Windows Runtime


I revisited Windows IoT Core a few weekends ago and found it to be useful in a quick project that involved dumping my wireless headset’s electrically erasable programmable read-only memory (EEPROM). In other words, just another weekend at Rafael’s place.

Let me walk you through what I did.

Hardware Setup

First, I pulled down the Windows IoT Core Dashboard and set up a new device. I flashed a MicroSD card with the latest build of Windows IoT Core and popped it straight into the Raspberry Pi 2 (Amazon, ~$40). After a bit of configuration, the device was online and ready to receive instructions from Visual Studio.

I then skimmed through the datasheet and attached some test clips to the EEPROM chip (ACE24C256) for Ground, Serial Clock and Serial Data access. I routed those to the Raspberry Pi’s GPIO2, GPIO3 and Ground pins where Two-Wire Serial (TWI)/Inter-integrated Circuit (I2C) communication is expected to occur.

That was the extent of the hardware configuration I performed.

(Two-Wire Interface is mostly identical to I2C, cleverly created to sidestep trademark issues with I2C. I say mostly because it’s missing a few niceties like 10-bit addressing.)

Software Setup

Windows IoT Core runs apps targeting the Universal Windows Platform (UWP), but the templates that ship with Visual Studio are way overkill for what I needed. So, I instead installed the Background Application Template from the Visual Studio Marketplace. This template creates a simpler project with a bare-bones implementation of a Background Task.

Using that starter code, I followed the usual deferral pattern (to prevent the app from killing my asynchronous tasks) and started laying down the code I needed:

  • Retrieved an instance of the I2cController class, corresponding to the default I2C controller (and set of pins) on the Raspberry Pi.
  • Retrieved an instance of the I2cDevice class, representing the chip I wanted to dump. This requires an I2cConnectionSettings object that points to the chip via a 7-bit numerical address. In this chip’s case, the address is crafted by setting its first 4 significant bits to [1010] and the next 3 to [000]. That becomes [1010000] or 50 in hexadecimal. (The I2C classes manage the 8th bit on the fly.)
  • Took advantage of the faster clock speeds supported by the chip by setting the device Bus Speed to FastMode (400kHz).
  • Prepared a file for holding the EEPROM contents

I paused at calling the I2cDevice.Read method for a moment, because it only took one parameter – a buffer to store data clocked out of the chip. It doesn’t support addressing. But I remembered I2C/TWI isn’t limited to just storage applications – it’s higher level than that. So I needed to review the datasheet again to understand the protocol implemented on top of I2C/TWI to read data correctly from the chip.

Here’s what I picked up from the datasheet:

  • A Current Address Read is performed by clocking in a read bit (0). The chip responds by clocking out the byte of data at the current address.
  • A Sequential Read is performed by looping a Current Address Read, paired with an acknowledgement, to effectively move the address pointer forward by 1 byte each iteration.
  • A Random Read is performed by first preparing the chip for a dummy write operation, to set its internal address pointer, then switching mid-way to a Current Address Read operation. Sneaky!

I implemented this logic using the I2CDevice.Read and I2CDevice.Write methods on the Device object I created earlier. Because the I2cDevice class handles I2C/TWI addressing and other minutia (in green) for me, I only had to worry about the data portion of the protocol (in purple). In this case, to set the internal address pointer to 0, I had to write two zeros (8 bits each). Got it.

With the dummy write out of the way, I switched to using the I2CDevice.Read method to complete the Random Read operation. The I2C classes did the heavy lifting while I dumped my buffer to disk. I then come behind the app to scoop up the file with the IoT Dashboard.

With a fresh EEPROM dump in hand, I was done.

tada.wav

Tagged with , , ,



Source link

  • vans shoes
  • kyrie 4
  • lebron james shoes
  • kyrie irving shoes
  • puma fenty
  • lebron soldier 11
  • asics shoes
  • stephen curry shoes
  • pg shoes
  • puma fenty slides
  • lebron 14
  • kyrie 4
  • puma rihanna creepers
  • nmd human race
  • curry shoes
  • yeezy shoes
  • adidas nmd
  • lebron soldier 10
  • puma fenty
  • lebron soldier
  • lebron 15
  • kyrie 4
  • kd shoes
  • nike vapormax
  • stephen curry shoes
  • kyrie 4
  • kyrie 1
  • curry shoes
  • kyrie 2
  • adidas nmd shoes
  • stephen curry shoes
  • john wall shoes
  • http://www.kyrie4.us.com
  • adidas yeezy boost
  • yeezy boost
  • nike pg 2
  • kyrie irving shoes
  • adidas john wall
  • yeezy boost
  • j wall shoes
  • http://www.asicsshoes.us.com
  • curry 3 shoes
  • kyrie irving jersey
  • curry 3
  • kd 9
  • kd shoes
  • Kevin Durant shoes
  • http://www.kd-9.org
  • yeezy boost 350 v2
  • kd shoes
  • Curry 3
  • Curry 1
  • kevin durant shoes
  • yeezy boost
  • adidas nmd Runner
  • adidas nmd r1
  • kobe 10
  • adidas crazy explosive
  • air max 90
  • kobe 10 shoes
  • adidas nmd xr1
  • kobe shoes
  • curry one
  • kyrie irving shoes
  • adidas nmd
  • vans outlet
  • vans for sale
  • Curry 3
  • yeezy 350 boost
  • kobe bryant shoes
  • lebron soldier
  • under armour shoes
  • http://www.kyrie4.com
  • nike lebron soldier
  • adidas tubular instinct
  • vibram
  • vibram fivefingers
  • adidas tubular instinct boost
  • adidas ultra boost
  • adidas tubular
  • lebron soldier shoes
  • kids shoes
  • air jordan shoes
  • air max shoes
  • air force 1
  • nike air max
  • air max nike
  • lebron soldier shoes
  • soldier shoes
  • air max 90
  • air max 95
  • adidas nmd human race
  • nmd human race
  • kyrie 4
  • kobe 11
  • Curry One
  • Kobe Shoes
  • harden shoes
  • kobe 11 shoes
  • Curry 2
  • Harden 1
  • Curry 2
  • James Harden Shoes
  • lebron soldier
  • nike epic react
  • nike kyrie flytrap
  • nike epic react flyknit
  • lebron 10 soldier
  • nike lebron soldier
  • Curry Shoes 2015
  • Harden 1 Shoes
  • James Harden Shoes
  • Harden Shoes
  • James Harden 1
  • Under Armour Curry Shoes
  • kobe x
  • Kobe 10
  • Cheap Harden 1
  • kobe bryant shoes
  • kobe shoes
  • Lebron James Shoes
  • Cheap Curry Shoes
  • yeezy 950
  • Curry One Mvp
  • Nike Harden Shoes
  • Nike Kobe Shoes
  • Harden Shoes
  • Under Armour Store
  • Curry 2 Shoes
  • Curry Shoes
  • curry 1
  • curry 5
  • http://www.curry-5.us
  • Stephen Curry Shoes
  • Under Armour curry one
  • James Harden Shoes
  • stephen curry shoes
  • Steph Curry 1
  • Stephen Curry Shoes
  • kobe basketball Shoes
  • Nike Harden Shoes
  • fila shoes
  • fila
  • Nike James Harden Shoes
  • Harden Shoes For sale
  • Harden Shoes Sale
  • yeezy boost
  • new balance shoes
  • kanye west shoes
  • http://www.yeezyshoes.us.com
  • kobe x shoes
  • kd 8
  • adidas nmd xr1
  • balenciaga triple s
  • adidas yeezy boost
  • balenciaga triple s Shoes
  • adidas nmd r1
  • adidas yeezy outlet
  • adidas nmd
  • adidas nmd runner
  • adidas nmd pk
  • adidas nmd footlocker
  • adidas nmd r1 primeknit
  • new era caps
  • kobe bryant shoes
  • lebron soldier 11
  • kobe shoes
  • kyrie 3
  • nike kyrie 3
  • kyrie 3 shoes
  • air max shoes
  • yeezy boost
  • nike air max shoes
  • nike air max
  • kevin durant shoes
  • kd vii
  • kd 7
  • curry 3
  • curry 3 shoes
  • ua curry 3
  • curry 3 low
  • kyrie 3
  • adidas porsche shoes
  • adidas porsche design shoes
  • lebron james shoes
  • kobe shoes 2015
  • nike air shoes
  • nike air max shoes
  • kyrie 3
  • kyrie 3 shoes
  • nike kyire 3
  • cheap air max shoes
  • air max shoes
  • kd vii shoes
  • kd shoes
  • kevin durant shoes
  • adidas zx flux
  • adidas zx
  • jordan retro
  • nike soccer cleats
  • adidas tubular
  • adidas flux
  • cheap kd shoes
  • adidas ultra boost
  • kobe shoes nba
  • palladium boots
  • lebron soldier 10
  • air jordan 32
  • lebron soldier
  • lebron soldier shoes
  • kd 11
  • nike lebron soldier
  • air jordan retro/a>
  • cheap kobe shoes
  • soldier 10
  • adidas ultra boost shoes
  • adidas ultra boost
  • kevin durant shoes
  • kobe bryant shoes
  • jordan retro shoes
  • hyperdunk 2017
  • kd 7 shoes
  • porsche design shoes
  • curry 5
  • adidas porsche design
  • adidas shoes
  • kevin bryant shoes
  • kd shoes store
  • kd 7
  • Cristiano Ronaldo CR7
  • herve leger dresses
  • kobe shoes
  • curry 5 shoes
  • anello backpack
  • kobe bryant shoes
  • kd shoes
  • lebron shoes
  • kd sneaker
  • http://www.curry-5.com
  • adidas alphabounce
  • adidas boost
  • adidas d rose 7
  • jeremy scott adidas
  • nike sb dunk
  • jeremy scott wings
  • Nike CR7
  • jeremy scott shoes
  • js wings
  • lebron shoes
  • kobe shoes
  • balenciaga shoes
  • kobe bryant shoes
  • kyrie irving shoes
  • nike epic react flyknit
  • nike epic react
  • asics gel kayano 23
  • http://www.kyrie3.com
  • canada goose
  • lebron james shoes
  • asics gel kayano 22
  • Nike Lebron James Shoes
  • lebron soldier 12
  • Lebron James Shoes
  • asics gel lyte iii
  • adidas eqt
  • kd 10
  • nike kd 10
  • kyrie 3
  • adidas nmd womens
  • keen uneek sandals
  • prada shoes
  • air jordan 31
  • nike air poresto
  • nike air vapormax
  • nike huarache
  • nike vapormax shoes
  • nike mercurial
  • stephen curry shoes
  • kyrie irving shoes
  • kyrie irving basketball shoes
  • reebok pump fury
  • reebok pump superme
  • air max 270
  • kevin durant jersey
  • adidas iniki
  • adidas porsche design
  • lebron shoes
  • http://www.lebron-shoes.us
  • adidas porsche
  • wholesale hats
  • nike air more uptempo
  • kobe bryant jersey
  • wholesale caps
  • curry 5
  • http://www.curry-5.us
  • adidas superstar
  • curry 4
  • curry 4
  • kd 10
  • air max 270
  • Nike Pegasus 35
  • nike air max 270
  • adidas deerupt
  • supreme yeezys
  • nike kd 10
  • kevin durant 10
  • nike epic react
  • birkenstock sandals
  • nike epic react flyknit
  • nike kids shoes
  • adidas pure boost
  • lebron james shoes
  • calvin klein underwear
  • curry 4
  • birkenstock sandals
  • http://www.kyrie-4.com
  • curry 4 footlocker
  • http://www.birkenstocksandals.us.com
  • nmd r1
  • harden vol 2
  • stephen curry jersey
  • kobe shoes
  • nike roshe run
  • curry 4 shoes
  • new balance running shoes
  • ecco
  • childrens shoes
  • boys shoes
  • girls shoes
  • ecco Shoes
  • asics gel kayano 24
  • puma suede
  • kyrie 4 confetti
  • nike zoom vaporfly
  • birkenstock
  • mizuno shoes
  • ultra boost shoes
  • adidas clothing