Skip to main content
TBodi.1
Associate
May 20, 2020
Solved

Programming an M24C02 with ST-Link/V2

  • May 20, 2020
  • 4 replies
  • 4472 views

I have bunch of M24C02 eeproms in some old equipment that I would like to reprogram. I have an ST-Link/V2 installed on an laptop running Windows 10. It has the STM32 STLink driver installed. I also have installed ST Visual Develop. Using this set of software/hardware how shall I proceed to read/write this memory?

I believe I should hook up the devices according to this diagram

0693W000001cbd5QAA.png

This topic has been closed for replies.
Best answer by andy2399

There are plenty of options:

  • There are lots of boards out there that allow USB to I2C - something akin to the Bus Pirate board.
  • Use a small micro to program it (using a UART to send the bytes to the programming micro which then does the I2C protocol to the EEPROM).
  • FTDI do a MPSSE cable which converts USB to I2C, SPI, UART, Digital I/O etc. (See https://www.ftdichip.com/Products/Cables/USBMPSSE.htm) - you need to write PC code though !

Andy

4 replies

andy2399
Senior
May 20, 2020

What makes you think you can read/write an I2C EEPROM with ST-LINK ?

I am not aware that ST-LINK can provide I2C signals on SWCLK and SWDIO.

Andy

TBodi.1
TBodi.1Author
Associate
May 20, 2020

I am probably mistaken. I googled M24C02 programmer, and this came up.

Have you got a suggestion for a programmer that will do the job?

Andreas Bolsch
Lead III
May 23, 2020

If you really want to employ an ST-Link for this job - well, attach any (yes, any will do, even an STM32G030J6, even a Cortex-M of another manufacturer) STM32 device to your STLink and then use OpenOCD with this patch: http://openocd.zylin.com/#/c/4760/

Although your application was not the original target for this patch, it will do the job. But if you're not familar with building and using OpenOCD on your own, you'll have to invest some amount of time, so other alternatives (as indicated below) might be more feasible.

andy2399
andy2399Best answer
Senior
May 20, 2020

There are plenty of options:

  • There are lots of boards out there that allow USB to I2C - something akin to the Bus Pirate board.
  • Use a small micro to program it (using a UART to send the bytes to the programming micro which then does the I2C protocol to the EEPROM).
  • FTDI do a MPSSE cable which converts USB to I2C, SPI, UART, Digital I/O etc. (See https://www.ftdichip.com/Products/Cables/USBMPSSE.htm) - you need to write PC code though !

Andy