[ 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 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:
- load any program into HC12 RAM and execute it
- erase, read, write EEPROM, set EEPROM protection
- erase, read, write FLASH
- secure/unsecure MCU
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:
- Marek Peca's PODEX,
- my own improved version of PODEX with some firmware bugfixes,
- Kevin Ross's BDM12 POD,
- Daniel Malik's TBDML (Turbo BDM Light) USB POD.
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
- go to SourceForge file release system
- click green "Download" bar
- select appropriate version:
- hcs12mem-1.4.1.tar.gz - source code, to be compiled on your own (see "Installation" instructions below)
- hcs12mem-1.4.1-linux.deb - binary packet for linux systems
- hcs12mem-1.4.1-win32.zip - binary packet for MS Windows systems
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)
- 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
version 1.3.2 (2007-04-10)
- bug fix: proper setting of extended speed (other than 1/2/4/8MHz) for new PODEX version using ATTINY2313
version 1.3.1 (2006-02-08)
- relaxed timing for PODEX - handshake timeout increased, because on slower computers or even with heavy task switching timeouts happened
- bug fix: FPROT was read directly from memory, thus when the MCU was secured, false readouts occured - now it is accessed via register, with proper FLASH bank selection
- bug fix: bits of FPROT were misinterpreted, depending on bits pattern
- non-programmed FLASH area detection has changed block threshold size from 2 to 4 bytes, so less non-contiguous blocks are reported (2 bytes of 0xff were quite common in the code)
version 1.3 (2005-12-16)
- support for Daniel Malik's TBDML - Turbo BDM Light USB POD
bulk USB transfers with TBDML are also supported, although not by default, because they are violating USB specification. To activate them, --tbdml-bulk option is required, giving faster data transfer rates (works under FreeBSD and MS Windows, linux rejects it, but Your Mileage May Vary) - more improvements to reporting FLASH address ranges to program
- long options supported on MS Windows
- some minor bugfixes affecting all interfaces, so users of previous versions should upgrade even if new functionality is of no importance
version 1.2 (2005-11-23)
- support for Freescale's serial monitor - Application Note AN2548,
using this monitor, hc12mem can:
- erase,read,write,protect EEPROM
- erase,read,write FLASH
- reset target
- no support for securing/unsecuring whole MCU
- detailed report for FLASH writing with list of address ranges defined for programming
- improved FLASH writing logic - skipping empty areas even if defined in S-record file
version 1.1 (2005-11-17)
- support for Freescale's LRAE (Load RAM And Execute) bootloader, see Application Note AN2546 from Freescale. LRAE currently can erase, read and write FLASH memory, with option to leave or erase LRAE itself
- support for much more chips - almost every HCS12 MCU is supported, but not all are tested, though. Especially parts with multiple FLASH blocks were not tested yet
- resolved some problems with serial port timing under unix systems
- changed option -V for --verify into -v
- included S-record files for target loadable RAM agents, so no more requirement for GNU gcc for hc11/12 for installation from sources
version 1.0 (2005-11-08)
- first version released
- support for Kevin Ross's BDM12 POD, Marek Peca's PODEX and my own improved version of PODEX
- supported targets: MC9S12A64, MC9S12NE64
- tested under FreeBSD, GNU/linux and MS Windows