EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

Problem compiling HC12 code to flash onto Wytec Minidragon

Started by thomasfong May 25, 2006
Hello,

I have a Wytec MC9S12DP256 MiniDragon Development board. I have
written a simple program that uses the RTI interrupt to update the
status of PORTM and the rest of the program waits and sends messages
via the serial port (SCI0) to the computer and toggles the ports as
necessary.

The code is fully debugged and works perfectly when using the board in
EVB mode with the DBug12 Monitor.

I have tried a couple methods to recompile the code for flash
programming. I have tried taking a preexisting project that compiles
for flash programming and replacing that code with my code to see if
it will work. It does not.

My current project is based off the sample code given by Feaser.
(AN1002.zip @ http://www.feaser.com/store/appnotes.php). I have
simply combined main.c and main.h into a single file and added the
functionality that I need. I have also changed the command in "build
extra" to automatically convert the code to provide an even format s19.

How do I recompile my code so that it can be flashed onto my
microcontroller via the Bootloader mode?

Note: I am using the latest version of Freescale Codewarrior and
MiniIDE to interface with the microcontroller. I have a MC9S12DP256
MiniDRAGON+ Rev. C Development Board.

Thanks,
Thomas Fong





Dear Thomas,

I had the same problem when I used the RTI. I was using a sample code from
an HCS12 book by Barret and Pack. My IDE was ICC12. The problem as I later
found out was with the address of the RTI.

The address that was provided in the book was wrong . I later used the
address provided in the D-Bug12 errata PDF file which came along with the
Wytec Minidragon. 0x3e70 is the correct address for the RTI.

try it and dont forget that the RTI's function prototype belongs in the main
file and the interrupt service routine should be under the main() method.

good luck.

Mohammed El Korek
American University of Sharjah
m...@ieee.org
b...@aus.edu

On 5/26/06, thomasfong wrote:
>
> Hello,
>
> I have a Wytec MC9S12DP256 MiniDragon Development board. I have
> written a simple program that uses the RTI interrupt to update the
> status of PORTM and the rest of the program waits and sends messages
> via the serial port (SCI0) to the computer and toggles the ports as
> necessary.
>
> The code is fully debugged and works perfectly when using the board in
> EVB mode with the DBug12 Monitor.
>
> I have tried a couple methods to recompile the code for flash
> programming. I have tried taking a preexisting project that compiles
> for flash programming and replacing that code with my code to see if
> it will work. It does not.
>
> My current project is based off the sample code given by Feaser.
> (AN1002.zip @ http://www.feaser.com/store/appnotes.php). I have
> simply combined main.c and main.h into a single file and added the
> functionality that I need. I have also changed the command in "build
> extra" to automatically convert the code to provide an even format s19.
>
> How do I recompile my code so that it can be flashed onto my
> microcontroller via the Bootloader mode?
>
> Note: I am using the latest version of Freescale Codewarrior and
> MiniIDE to interface with the microcontroller. I have a MC9S12DP256
> MiniDRAGON+ Rev. C Development Board.
>
> Thanks,
> Thomas Fong
Dear Thomas,

All you have to do is make a few changes in the memory.x file. If you
are using the DBUG12 bootloader to program the remainder of flash then
the following will work:

==========MEMORY
{
page0 (rwx) : org = 0x0000, l = 0x00ff
eeprom (!i) : org = 0x0000, l = 0x0000
data (rwx) : org = 0x1000, l = 0x3000
text (rx) : org = 0xc000, l = 0x3000
}

PROVIDE (_stack = 0x3fff);
vectors_addr = 0xef80;
==========
If you are not using the DBUG12 bootloader but a BDM to program the
entire flash then use "vectors_addr = 0xff80;" instead.

Kind regards,

-Frank
----
Feaser LLC
http://www.feaser.com - HCS12 Bootloader and Device Drivers
----


The 2024 Embedded Online Conference