EmbeddedRelated.com
Forums

hc12mem v1.1

Started by Michal Konieczny November 17, 2005
http://cml.mfk.net.pl/hc12mem/

I made some improvements to my hc12mem program for HCS12 MCUs.
hc12mem is a command line tool for erasing, reading and writing FLASH
and EEPROM internal memories, it can also protect/unprotect whole MCU.
Works under unix derivatives (FreeBSD and GNU/linux tested), and MS
Windows (as native win32 binary, not cygwin).

What's new:

- support for almost every HCS12 derivative, there's universal code for
all devices, although derivatives with multiple FLASH blocks were not
tested yet. Should work with <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

- support for Freescale's LRAE (Load RAM And Execute) serial bootloader,
see Application Note AN2546. hc12mem can use LRAE to erase, read and
write target FLASH memory, with option to erase LRAE or leave it in
place for subsequent use (although that's tricky because LRAE doesn't
support any load/run switch and it must be implemented in loaded
program, entering LRAE on user request)

- included S-record files for target agents, so no need to have gcc for
hc11/12 available when compiling/installing hc12mem.

Any feedback is very appreciated, especially regarding usage on MCUs
with multiple FLASH blocks.

Best regards,

--
Michal Konieczny
mk@mk@....



--- In 68HC12@68HC..., Michal Konieczny <mk@c...> wrote:
>
> http://cml.mfk.net.pl/hc12mem/
>
> I made some improvements to my hc12mem program for HCS12 MCUs.
> hc12mem is a command line tool for erasing, reading and writing FLASH
> and EEPROM internal memories, it can also protect/unprotect whole MCU.
> Works under unix derivatives (FreeBSD and GNU/linux tested), and MS
> Windows (as native win32 binary, not cygwin).

Very interesting project! I didn't notice this before...maybe I just
missed it of you posted here before.

Did you use the VC++ compiler on Windows, or Borland, or ???

I'm working on a debugger now and this looks like it would be helpful
to me. I'm using C# on the .NET Framework, but C code is quite similar.

Eric



> Very interesting project! I didn't notice this before...maybe I just
> missed it of you posted here before.
>
> Did you use the VC++ compiler on Windows, or Borland, or ???

I used MS VC Studio 6.0, because that's what was "within my reach" at
that moment. But the code isn't particularly specific to this compiler.
My main development environment is most of the time FreeBSD, sometimes
Solaris, sometimes linux, and code is written as portable and platform
independent. Should also work with cygwin, but I didn't test it. System
specific code is separated into single place, and used conditionally,
depending on the platform.
Port for MS Windows was done as an extra benefit for users working under
this system, I don't use it :)

> I'm working on a debugger now and this looks like it would be helpful
> to me. I'm using C# on the .NET Framework, but C code is quite similar.

You're welcome to reuse it in any way, or interface it with your
debugger. I can offer help in extending and tailoring it to some
specific needs, if there are any.

I currently plan to extend it to inteface with FreeGeeks TBDML POD and
Freescale's AN2548 serial monitor.

Best regards,

--
Michal Konieczny
mk@mk@....



--- In 68HC12@68HC..., Michal Konieczny <mk@c...> wrote:

> I currently plan to extend it to inteface with FreeGeeks TBDML POD and
> Freescale's AN2548 serial monitor.

I've already got C# code for the serial monitor but I need to polish
it a bit more. I want to establish an open standard for low-level
drivers so people can plug different drivers into different IDEs. My
first release will be within 2 months, I hope.

I think 2006 will see some major developments in free tools for the
hc12 family. I am expecting someone to provide Eclipse support (which
uses Java) for this platform (I don't know who, but it's inevitable),
and I'll be approaching this arena from the .NET side.

There's already ports of Eclipse for msp430 and Arm. Due to it's
exponential growth, it's going to support all major platforms before
long. For those who don't know anything about it, it is quite similar
to Visual Studio, but it's open source and cross platform.

I'm working from the GNU SharpDevelop base, which is similar to
Eclipse, but uses C# instead of Java. These are both fine languages
and they are both related to C at their roots, and they've been
updated to support modern OOP concepts. OOP offers a lot of benefits
for large memory computers like PC's.

Most of us still consider assembler and C to be better choices to
target limited-memory embedded devices, so people who port
SharpDevelop and Eclipse will focus on wrapping assemblers and C
compilers.

None of this will affect commercial vendors, because there's a strong
need for commercial tools. But it will make free tools more attractive
for hobbiests and students. Ease-of-use is the biggest stumbling block
that makes it hard for newbies to learn gcc.

Eric



> I've already got C# code for the serial monitor but I need to polish
> it a bit more. I want to establish an open standard for low-level
> drivers so people can plug different drivers into different IDEs. My
> first release will be within 2 months, I hope.
>
> I think 2006 will see some major developments in free tools for the
> hc12 family. I am expecting someone to provide Eclipse support (which
> uses Java) for this platform (I don't know who, but it's inevitable),
> and I'll be approaching this arena from the .NET side.

Great effort !
But all this .NET is targeting mainly windows, and this leaves all free
operating systems somewhat in a shadow, again and again.
As an additional note, there're two types of programmers: ones that use
flashy IDEs, with all these wizards, project managers, auto-this,
automagic-that, sometimes more often using mouse than typing on the
keyboard.
And there're "old school" programmers, that use emacs or some other
"just editor" of choice, Makefiles and command line tools, and consider
such environment as homeland. Don't forget about us :)

Back to the matter - I'm slowly approaching mentally making my program
some kind of a "plugin" for gdb, that will enable adding support for
more target connections (especially various bdm pods) much more easily
than putting support code directly into main gdb source tree - to do it
externally to gdb. I see that we have many common things to think about.
If you could describe me the architecture of your project (I'm real
stranger to all these IDEs), especially what components are involved and
how it all works, maybe we can share some work. But for this, I think we
can move off this list, to private email.

Best regards,

--
Michal Konieczny
mk@mk@....



It would be nice to know if it worked using MONO for LINUX - after all,
one of the aims of .NET was platform independence.

-----Original Message-----
From: 68HC12@68HC... [mailto:68HC12@68HC...] On Behalf
Of Michal Konieczny
Sent: Saturday, 19 November 2005 9:57 PM
To: 68HC12@68HC...
Subject: Re: [68HC12] Re: hc12mem v1.1

> I've already got C# code for the serial monitor but I need to polish
> it a bit more. I want to establish an open standard for low-level
> drivers so people can plug different drivers into different IDEs. My
> first release will be within 2 months, I hope.
>
> I think 2006 will see some major developments in free tools for the
> hc12 family. I am expecting someone to provide Eclipse support (which
> uses Java) for this platform (I don't know who, but it's inevitable),
> and I'll be approaching this arena from the .NET side.

Great effort !
But all this .NET is targeting mainly windows, and this leaves all free
operating systems somewhat in a shadow, again and again.
As an additional note, there're two types of programmers: ones that use
flashy IDEs, with all these wizards, project managers, auto-this,
automagic-that, sometimes more often using mouse than typing on the
keyboard.
And there're "old school" programmers, that use emacs or some other
"just editor" of choice, Makefiles and command line tools, and consider
such environment as homeland. Don't forget about us :)

Back to the matter - I'm slowly approaching mentally making my program
some kind of a "plugin" for gdb, that will enable adding support for
more target connections (especially various bdm pods) much more easily
than putting support code directly into main gdb source tree - to do it
externally to gdb. I see that we have many common things to think about.

If you could describe me the architecture of your project (I'm real
stranger to all these IDEs), especially what components are involved and

how it all works, maybe we can share some work. But for this, I think we

can move off this list, to private email.

Best regards,

--
Michal Konieczny
mk@mk@.... _____

> Terms of Service.

_____


--- In 68HC12@68HC..., "Jonathan Masters" <jon@j...> wrote:

> It would be nice to know if it worked using MONO for LINUX - after all,
> one of the aims of .NET was platform independence.

It should work for mono on linux, and rotor on BSD (which may also
work for Mac OSX). But like any "platform agnostic" code, it might
need small tweaks. The only 100% platform neutral programs are ones
that don't do much!

Java and .NET are more portable than traditional C, but some tweaks
are probably inevitable. The portability comes from the strong OOP
libraries that abstract many of the low-level API differences. If the
libraries are perfect, then no tweaks will be needed. But we don't
live in a perfect world, of course!

All C# programs can be compiled on Windows with great tools that are
100% free. Microsoft's best compilers and libraries have been free
since 2002 (in the .NET SDK download), and these are the same full
versions used by Visual Studio. These aren't limited in any way, you
don't have to register with Microsoft, and they're not "trialware".

Just this month Microsoft announced that its .NET 2.0 Express IDEs
will be free for one year. These are all based on Visual Studio and
they have all the best features of VS. They mostly lack the extensive
database integration needed in a corporate IT setting. But they do
work with databases, and SQL Express is one of the free offerings.

SharpDevelop is an open source IDE for Windows. The mono port is
called MonoDevelop. My editor code derives from SharpDevelop, so it
will have some cool functionality (code folding is one of the coolest
features that wasn't supported in my past IDEs). However, I'll create
my own IDE that is simpler because my users prefer ease-of-use over
extensive features, and it will be specifically designed for embedded
targets. My users are students and hobbiests who want to become
productive quickly without spending a lot of time learning how to use
the tools.

My current assembler IDE is about 5 times more popular than my C IDE
(because of its use in colleges), so my first project under the new
code base is a debugger for assembler programs. This will be called
from AsmIDE at first, but later the entire assembler IDE will be
re-implemented using the new C# code base.

I have not yet decided on how to proceed on the gcc side of things so
this will wait until I have a better vision of where to go and how to
get there. There's a chance that others might "beat me to the punch"
by porting Eclipse to work with the HC11/HC12 family to support
embedded C, and that would be a great choice. I would not see a need
to compete with Eclipse if that were to happen.

Having said all this, my free time is limited and I won't have time to
do the linux ports of my C# code by myself. I use Visual Studio on
Windows because I'm most familiar with it. I'm hoping that others will
assist in linux porting.

Eric



--- In 68HC12@68HC..., Michal Konieczny <mk@c...> wrote:
> Great effort !
> But all this .NET is targeting mainly windows, and this leaves all free
> operating systems somewhat in a shadow, again and again.
> As an additional note, there're two types of programmers: ones that use
> flashy IDEs, with all these wizards, project managers, auto-this,
> automagic-that, sometimes more often using mouse than typing on the
> keyboard.
> And there're "old school" programmers, that use emacs or some other
> "just editor" of choice, Makefiles and command line tools, and consider
> such environment as homeland. Don't forget about us :)

Eclipse... that's the effor to cover that end, except I guess Java
itself might never be really Open Source.


--- In 68HC12@68HC..., "Eric Engler" <englere.geo@y...> wrote:

> Just this month Microsoft announced that its .NET 2.0 Express IDEs
> will be free for one year. These are all based on Visual Studio and
> they have all the best features of VS. They mostly lack the extensive
> database integration needed in a corporate IT setting. But they do
> work with databases, and SQL Express is one of the free offerings.

"free for one year", interresting definition of the word free?


--- In 68HC12@68HC..., "Eric Engler" <englere.geo@y...> wrote:

> get there. There's a chance that others might "beat me to the punch"
> by porting Eclipse to work with the HC11/HC12 family to support
> embedded C, and that would be a great choice. I would not see a need
> to compete with Eclipse if that were to happen.

Any idea what part of HC11/HC12 programming is not supported by
Eclipse/CDT already? I've been developing with it for a year with HC12
and it works great.

Only problem is I hadn't got gdb working well enough so I can't use it
for GUI debugging.