cancel
Showing results for 
Search instead for 
Did you mean: 

Programming an M24C02 with ST-Link/V2

TBodi.1
Associate

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

1 ACCEPTED SOLUTION

Accepted Solutions
andy2399
Senior

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

View solution in original post

4 REPLIES 4
andy2399
Senior

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

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?

andy2399
Senior

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

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.