1
\$\begingroup\$

I'm using STM32L152RTC6 (link to similar MCU line) with a built-in EEPROM (8k). I wonder if there's any tool that allows me to read/write the EEPROM from the host side, other than programming the MCU using ST library code, i.e.:

STM32L1xx_StdPeriph_Lib_V1.2.0\Project\STM32L1xx_StdPeriph_Examples\FLASH\Data_Program

I did some search online. For Atmel MCUs, people use avrdude terminal to dump the EEPROM message, but I haven't found a good tool for STMicroelectronics MCU.

\$\endgroup\$
  • 2
    \$\begingroup\$ I don't have an ST part with EEPROM to verify this, but I'd be very surprised if the STM32 ST-LINK utility didn't let you inspect internal EEPROM contents in any STM32 that has it. \$\endgroup\$ – markt May 6 '14 at 8:02
  • \$\begingroup\$ Thanks markt for pointing out ST-LINK Utility software. I didn't notice that it has such functionality. :) \$\endgroup\$ – Shan May 7 '14 at 2:48
  • \$\begingroup\$ Refer to ST-LINK Utility: st.com/st-web-ui/static/active/en/resource/technical/document/… \$\endgroup\$ – Shan May 7 '14 at 2:49
  • \$\begingroup\$ In principle this should be fairly simple; if it cannot be directly done via JTAG/SWD operations, then you use that to upload a tiny program to RAM and start it to do the operations for you. \$\endgroup\$ – Chris Stratton Jun 30 '14 at 13:45
1
\$\begingroup\$

Yes there is a tool called STM32 ST-LINK utility. Using this one can view and edit the EEPROM memory contents. It can also used to program and erase the flash memory.I am using this for my STM32L151VBT6 MCU. Please note that it's used only for STM32 series MCUs but not used for other than STM32 like STM8 etc..

here is the downloadable link:http://www.st.com/web/en/catalog/tools/PF258168

\$\endgroup\$
  • \$\begingroup\$ Will this work with a J-Link?? \$\endgroup\$ – Scott Seidman Jun 30 '14 at 13:13
  • \$\begingroup\$ No. It works only with ST-LINK/V2 debugger. \$\endgroup\$ – Myanju Jun 30 '14 at 13:33
  • \$\begingroup\$ Any tools that might work w/ a J-Link?? \$\endgroup\$ – Scott Seidman Jun 30 '14 at 13:56
  • \$\begingroup\$ I think while debugging the code also you can change the EEPROM contents. That is right in the memory watch. \$\endgroup\$ – Myanju Jun 30 '14 at 14:17
  • \$\begingroup\$ yes openocd works with jlink. stlink is just one way to get at the arm swd (think jtag but different), it is not ST specific it is arm cortex-m generic. you can certainly come in with a jlink and debug ST and other cortex-m parts using openocd. I have not tried using any other software with jlink. you can use generic ftdi mpsse based chips or if you add a backend you can use ftdi or other usb to parallel devices to bit bang the swd. \$\endgroup\$ – old_timer Mar 3 '17 at 13:44
0
\$\begingroup\$

The cortex-m which is used in the STM32 products, has an SWD (single wire debug, which is really two signals clock and a bidirectional data), think JTAG but fewer signals and different protocol at the pins. It provides the same functionality as a JTAG interface to an on chip debugger, stop the processor take over the bus(es) and look at things so you could most definitely come in through SWD and look at the contents of the flash as well as ram or muck with peripherals, whatever the processor can do you can do.

St provides a usb to SWD debug design called st-link where they have defined the usb interface to this debugger, it is present on most/all of their eval boards which you can remove jumpers and use those front ends on other chips (even of other brands) or break off the debugger and use it as a generic stlink. often cheaper to buy one of the NUCLEO boards and break off or just use the stlink than to buy a dedicated stlink debugger module/dongle. You can use st software or open source software including openocd to talk to the target chip through an stlink debugger.

You are not limited in any way to st-link the chips have the SWD pins exposed (as gpios but so far all the ones I have tried default in a way that you can come in swd) so anything that you can find that supports SWD should work. This includes the myriad of usb to SWD supporting devices including j-link and many others as well as FTDI break out boards for FTDI devices with mpsse. (ft2232 modules, ft4232 modules, etc). Whatever you use needs to be voltage matched or needs to have a sense line (link the stlink and j-link and other generic jtag-like modules) and ideally isolated so that you dont harm the target and that you can sense the targets output in case it is for example a 1.8v part and not a 5.0 or 3.3v. this is very typical normally you power your target device, the debugger connects both swd signals as well as ground for a reference and a sense line to your voltage rail assuming you have one, if you have multiple (unlikely for mcus, other than the analog reference which is not what I am talking about) the one related to the SWD I/O. And then you have to have software that knows how to speak SWD through your debugger (openocd is a very good choice, esp for arm targets, and the price is right and you get way more than you pay for).

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.