home » HC12/S12 resources » hcs12mem

hcs12mem - HCS12 MCU memory reader/writer

[ info | download | install | manual | changelog ]

NEWS

2007-12-10

version 1.4.1 alailable.

Changes:
- name change: hc12mem -> hcs12mem, due to confusing suggestion that the tool is for HC12 chips
- allow mixed addresses (banked and non-banked) in banked S-record files
- ignore address from terminating record, if it's not used
- report address from terminating record
- report chip erasure timing
- improved detection of chip security
- terminating record address in FLASH readouts is taken from RESET vector
- detection of BDM connection problems and smarter error messages
- buffer overflow fix in TBDML support code

2007-04-10

version 1.3.2 available, see below, section "changes" for what's new (short: fixed bug in setting extended speed for new PODEX version using ATTINY2313)

2006-02-08

version 1.3.1 available, see below, section "changes" for what's new (small improvements and bug fixes)
project moved onto SourceForge, all SourceForge development support is available

2005-12-16

version 1.3 available, see below, section "changes" for what's new (short: added support for TBDML and long options under Windows).

2005-11-25

hc12mem added to "official" FreeBSD's ports tree, so one can install it from packages or ports.

2005-11-23

version 1.2 available, see below, section "changes" for what's new.

SourceForge.net Logo

SourceForge project page

http://sourceforge.net/projects/hcs12mem - on this page all development support for hcs12mem is available: svn repository, lists, forum, downloads, etc.

General information

hcs12mem is command line tool for operating on internal HC12/S12 MCU memories - EEPROM and FLASH. It can:

hcs12mem is free, open source software, released under GPL license. It can run under FreeBSD, GNU/linux, other unix-like systems, and MS Windows (as native win32 binary, without cygwin).

Target connection

hcs12mem can connect with target via BDM or serial port. First type of connection - BDM requires usege of special interface device, called BDM POD. Connection via serial port requires presence of Freescale's LRAE serial bootloader or serial monitor in target device.

BDM POD

The following types of BDM POD are supported:

TBDML and PODEX are very simple to build on your own, firmware source code and hex file is available. Original Marek's firmware for PODEX has bugs in bulk memory access routines, I corrected this a little bit, also somewhat enhanced the hardware. More info in above links.

hcs12mem is designed in modular fashion, and is very easy to add support for any other POD. Code for accessing POD is separated under strictly defined interface.

LRAE serial bootloader

LRAE is Freescale's serial bootloader (LRAE: Load RAM And Execute). It's documented in Application Note AN2546, and available for many HCS12 MCUs as ready to use S-record file (Freescale www login required). hcs12mem currently can use LRAE to erase, read and write target FLASH memory. Using LRAE in target requires some special layout of code - read AN2546. It's also somewhat tricky to use LRAE when your program is started by LRAE, because it doesn't support any run/load switch, so you have to implement it in your code, and enter LRAE on request to load new code.

Freescale's serial monitor

hcs12mem supports Freescale's serial monitor. It's documented in Application Note AN2548, and available for many HCS12 MCUs. This monitor uses serial port connection (SCI0 on target hardware). Prior to all operations, presence of serial monitor is required in target's FLASH memory. Monitor is available for a wide selection of HCS12 MCUs. My port of the source code of monitor to GNU tools is available too.

hcs12mem with cooperation of serial monitor can: read,write,erase,protect EEPROM; erase,read,write FLASH; reset the target. Securing/unsecuring MCU is not supported.

Supported MCUs (targets)

Although name says hc12, currently it works only for HCS12 MCUs.

hcs12mem utilizes target description files for various targets. Almost every HCS12 derivative is supported, althouhg not all are tested. Especially ones with multiple FLASH blocks were not tested yet. Current list of devices: <MC9S12> A32, A64, A128, A256, A512, C32, C64, C96, C128, GC16, GC32, GC64, GC96, GC128, D32, D64, D128, D256, D512, E32, E64, E128, E256, H128, H256, UF32, NE64.

Every supported MCU has it's own "target description file", and accompanying "target agents" - small pieces of HC12 code that gets loaded into targat RAM to perform some operations. Source code for target agents is included inside distribution file.

Download

Current version

Installation

UNIX

Under FreeBSD, you usually have to substitute make with gmake, because make under BSDs is different from GNU make, and this package requires GNU make.

tar xzf hcs12mem-x.y.z.tar.gz
cd hcs12mem-x.y.z
./configure
make
su
make install

MS Windows

Unzip hcs12mem-x.y.z-win32.zip file to directory of your choice. Add this directory to $PATH, or specify full path to hcs12mem.exe when calling.

Downloadable zip file is compiled binary only. If you're interested in source code for Windows, please get tar.gz file for unix platform, it contains common source code for all platforms. There's workspace file for MS Visual Studio in top directory.

TBDML via USB

If you plan to use TBDML, you need to install libusb for USB bus access. For MS Windows, you can get this in driver form dedicated for TBDML from download section of www.freegeeks.org. For unixes, just install libusb from packages available for your system, or from sources, available from libusb.sourceforge.net.

Manual

More details: hcs12mem man page.

After installation undex UNIX, you get man page describing all the options and usage examples. Just man hcs12mem and read it. Also calling with -h or --help shows usage help. Under Windows, you get hcs12mem.html file with this manual page contents.

Changes

version 1.4.1 (2007-12-10)

version 1.3.2 (2007-04-10)

version 1.3.1 (2006-02-08)

version 1.3 (2005-12-16)

version 1.2 (2005-11-23)

version 1.1 (2005-11-17)

version 1.0 (2005-11-08)