EmbeddedRelated.com
Forums

Flashing problem

Started by venki October 4, 2005
Hello all,

While flashing I am getting the error "Fash programming error around
address 0x000000" we are using Lauterbach TRACE32 debugger.Linker file
is using far text Segments(+seg .ftext).
If I use text segments for another project absolutely there is no
problem, but I can't use text segments for my project.

Your help would be appreceited

Thanks & Regards,
Venkateshwarlu K ----------------------------------
Email From ""venki" <venki@venk...>" was security checked by 3.93 version of CxProtect(tm)
On: deiserver at: 18:44:58, 04-Oct-2005 Tuesday
Engine: 4.125.23, sign.def:4-Oct-2005, sign2.def:4-Oct-2005, macro.def:28-Sep-2005
----------------------------------



In my opinion the problem is with the linearization of the paged memory. As
I remember the Trace32 treats e.g. 0x003E1234 as 0x1234 on page 0x3E. This
is the format what for example Metrowerks is using by default but differs
from the linearized addressing what P&E is using (and what is so unnatural
for me).
> -----Original Message-----
> From: 68HC12@68HC... [mailto:68HC12@68HC...] On Behalf Of
> venki
> Sent: 04 October 2005 15:14
> To: 68HC12@68HC...
> Subject: [68HC12] Flashing problem [license expired]
>
> Hello all,
>
> While flashing I am getting the error "Fash programming error around
> address 0x000000" we are using Lauterbach TRACE32 debugger.Linker file
> is using far text Segments(+seg .ftext).
> If I use text segments for another project absolutely there is no
> problem, but I can't use text segments for my project.
>
> Your help would be appreceited
>
> Thanks & Regards,
> Venkateshwarlu K > ----------------------------------
> Email From ""venki" <venki@venk...>" was security checked by 3.93
> version of CxProtect(tm)
> On: deiserver at: 18:44:58, 04-Oct-2005 Tuesday
> Engine: 4.125.23, sign.def:4-Oct-2005, sign2.def:4-Oct-2005, macro.def:28-
> Sep-2005
> ---------------------------------- >
>
> Yahoo! Groups Links >
>




Hello Karoly Molnar,

Thanks for the replay.

I am working on MC9S12DJ128 microcontroller. I am using COSMIC compiler
for compiling the source code and TRACE32 debugger.I am using linker
file like this

# LINK FILE FOR 9s12xx32 On-chip application (64K Flash and 4K RAM)
# The +def things are used in the startup code
+seg .data -b0x1000 -nIRAM -m0x1000 -sRAM # 4K Bytes RAM for Variable
storage
+seg .bss -aIRAM -sRAM
+def __sbss=@.bss # Section where unitialized vars are put

#we have 64k flash, 1k eeprom 4k ram

+seg .ftext -x -b0x4000 -m 0x3000 -nCODE -sFLASH -ck # Flash
-ck= include this in cksum
+seg .const -aCODE -nCONST # -x = allow seg to overflow into next
.txt
+seg .cksum -aCONST -ncksum -ik
can_drv.o
cangen_drv_test_app.o
diag.o
gmlcal.o
gmlvers.o
gmnm.o
il.o
ilpar.o
otim.o
tpmc.o
vstdlib.o
Crtsi_s32.o

+seg .ftext -x -b0xC000 -m 0x3F7F -nCODE2 -sFLASH -ck # Flash -ck=
include this in cksum

# "C:\COSMIC\CX12\Lib\libe.h12" # HCS12 Byte EEPROM Libraries (byte EE
not availble on C32)
"C:\Program Files\COSMIC\CX12\LIB\libi.h12" # Integer Library
"C:\Program Files\COSMIC\CX12\LIB\libm.h12" # Cosmic HC12/HCS12 Machine
Library (required) +seg .const -b 0xFF80 -sFLASH # Vectors at logical address 0xFF80
vect_HCS12C.o

+def <mailto:__memory=@.bss> __memory=@.bss # End of Global RAM
Space
+def __stack=0x1FFF # Top of stack address

With this settings compilation is successful but am unable to flash the
code into target board by using TRACE32 & BDM MULTILINK(It is not
converting all logical records to physical records).For all other
projects if i dont select +seg .ftext everything is fine.

I dont know how to allocate memory for different segments like for
text,.ftext.
Please suggest me i had struck up here.

your help would be appreceited.

Thanks and Regards,
venki.

-----Original Message-----
From: 68HC12@68HC... [mailto:68HC12@68HC...] On Behalf
Of Karoly Molnar
Sent: Tuesday, October 04, 2005 8:34 PM
To: 68HC12@68HC...
Subject: RE: [68HC12] Flashing problem
In my opinion the problem is with the linearization of the paged memory.
As
I remember the Trace32 treats e.g. 0x003E1234 as 0x1234 on page 0x3E.
This
is the format what for example Metrowerks is using by default but
differs
from the linearized addressing what P&E is using (and what is so
unnatural
for me).
> -----Original Message-----
> From: 68HC12@68HC... [mailto:68HC12@68HC...] On Behalf
Of
> venki
> Sent: 04 October 2005 15:14
> To: 68HC12@68HC...
> Subject: [68HC12] Flashing problem [license expired]
>
> Hello all,
>
> While flashing I am getting the error "Fash programming error around
> address 0x000000" we are using Lauterbach TRACE32 debugger.Linker file
> is using far text Segments(+seg .ftext).
> If I use text segments for another project absolutely there is no
> problem, but I can't use text segments for my project.
>
> Your help would be appreceited
>
> Thanks & Regards,
> Venkateshwarlu K > ----------------------------------
> Email From ""venki" <venki@venk...>" was security checked by 3.93
> version of CxProtect(tm)
> On: deiserver at: 18:44:58, 04-Oct-2005 Tuesday
> Engine: 4.125.23, sign.def:4-Oct-2005, sign2.def:4-Oct-2005,
macro.def:28-
> Sep-2005
> ---------------------------------- >
>
> > .


_____ ----------------------------------
Email From ""Karoly Molnar" " was security checked by 3.93 version of
CxProtect(tm) On: deiserver at: 20:44:57, 04-Oct-2005 Tuesday
---------------------------------- ----------------------------------
Email From ""venki" <venki@venk...>" was security checked by 3.93 version of CxProtect(tm)
On: deiserver at: 14:55:09, 05-Oct-2005 Wednesday
Engine: 4.125.23, sign.def:4-Oct-2005, sign2.def:4-Oct-2005, macro.def:28-Sep-2005
----------------------------------



Hi,

Now I changed linker file so I am able to flash the code but it is not
working when I say run in the debugger.I hope the code is not mapped
correctly into the memory.
Now my linker file

+seg .const -b 0xfc000 -o 0xc000 -n .const -s flash # constants unbanked
(page 7)
+seg .text -a .const -n .common -s flash # Page 7 unbanked
+seg .vector -b 0xfff80 -o 0xff80 -s flash # vectors start address
+seg .data -b 0x2000 -m 0x2000 # data start address
+seg .eeprom -b 0x800 -m0x800 # eeprom start address if needed
+def <mailto:__sbss=@.bss> __sbss=@.bss # start address of bss

+seg .ftext -b 0xf4000 -o 0x8000 -w 0x4000 -m 0x18000 -n .pages -s flash
# Pages 0 to 5
# enter object files for banked pages 0 to 5 here
can_drv.o
cangen_drv_test_app.o
diag.o
gmlcal.o
gmlvers.o
gmnm.o
il.o
ilpar.o
otim.o
tpmc.o
vstdlib.o

+seg .text -b 0xf8000 -o 0x4000 -m 0x4000 -n .page6 -s flash # Page 6
unbanked
# enter object files for page 6 here
+seg .text -a .common -n .common7 -it -s flash # Page 7 unbanked
"C:\Program Files\COSMIC\CX12\Lib\crtsi.h12" # startup file (or
crtsi.h12)
# enter object files for page 7 here

vect_HCS12C.o # interrupt vectors
"C:\Program Files\COSMIC\CX12\Lib\libi.h12" # C Library (if needed)
"C:\Program Files\COSMIC\CX12\Lib\libm.h12" # Machine Library

+def <mailto:__memory=@.bss> __memory=@.bss # symbol used by library
+def __stack=0x4000 # stack pointer initial value

any comments on this.I am trying with different address ranges.
venki.
-----Original Message-----
From: 68HC12@68HC... [mailto:68HC12@68HC...] On Behalf
Of Karoly Molnar
Sent: Wednesday, October 05, 2005 4:34 PM
To: 68HC12@68HC...
Subject: [**LikelySPAM] RE: [68HC12] Flashing problem Try this:

+seg .ftext -x -b0xf4000 -m 0x3000 -nCODE -sFLASH -ck
+seg .ftext -x -b0xfC000 -m 0x3F00 -nCODE2 -sFLASH -ck

I just barely remember to the cosmic linker format because I use
metrowerks
since years. I think that you shall trick the addressing if you want to
locate the program to the paged area (I mean the values after -b and -m
in
the lines above).
> -----Original Message-----
> From: 68HC12@68HC... [mailto:68HC12@68HC...] On Behalf
Of
> venki
> Sent: 05 October 2005 11:23
> To: 68HC12@68HC...
> Subject: RE: [68HC12] Flashing problem [license expired]
>
> Hello Karoly Molnar,
>
> Thanks for the replay.
>
> I am working on MC9S12DJ128 microcontroller. I am using COSMIC
compiler
> for compiling the source code and TRACE32 debugger.I am using linker
> file like this
>
> # LINK FILE FOR 9s12xx32 On-chip application (64K Flash and 4K RAM)
> # The +def things are used in the startup code
> +seg .data -b0x1000 -nIRAM -m0x1000 -sRAM # 4K Bytes RAM for
Variable
> storage
> +seg .bss -aIRAM -sRAM
> +def __sbss=@.bss # Section where unitialized vars are put
>
> #we have 64k flash, 1k eeprom 4k ram
>
> +seg .ftext -x -b0x4000 -m 0x3000 -nCODE -sFLASH -ck #
Flash
> -ck= include this in cksum
> +seg .const -aCODE -nCONST # -x = allow seg to overflow into
next
> .txt
> +seg .cksum -aCONST -ncksum -ik
> can_drv.o
> cangen_drv_test_app.o
> diag.o
> gmlcal.o
> gmlvers.o
> gmnm.o
> il.o
> ilpar.o
> otim.o
> tpmc.o
> vstdlib.o
> Crtsi_s32.o
>
> +seg .ftext -x -b0xC000 -m 0x3F7F -nCODE2 -sFLASH -ck # Flash -ck=
> include this in cksum
>
> # "C:\COSMIC\CX12\Lib\libe.h12" # HCS12 Byte EEPROM Libraries (byte EE
> not availble on C32)
> "C:\Program Files\COSMIC\CX12\LIB\libi.h12" # Integer Library
> "C:\Program Files\COSMIC\CX12\LIB\libm.h12" # Cosmic HC12/HCS12
Machine
> Library (required) > +seg .const -b 0xFF80 -sFLASH # Vectors at logical address 0xFF80
> vect_HCS12C.o
>
> +def <mailto:__memory=@.bss> __memory=@.bss # End of Global RAM
> Space
> +def __stack=0x1FFF # Top of stack address
>
> With this settings compilation is successful but am unable to flash
the
> code into target board by using TRACE32 & BDM MULTILINK(It is not
> converting all logical records to physical records).For all other
> projects if i dont select +seg .ftext everything is fine.
>
> I dont know how to allocate memory for different segments like for
> text,.ftext.
> Please suggest me i had struck up here.
>
> your help would be appreceited.
>
> Thanks and Regards,
> venki.
>
> -----Original Message-----
> From: 68HC12@68HC... [mailto:68HC12@68HC...] On Behalf
> Of Karoly Molnar
> Sent: Tuesday, October 04, 2005 8:34 PM
> To: 68HC12@68HC...
> Subject: RE: [68HC12] Flashing problem >
> In my opinion the problem is with the linearization of the paged
memory.
> As
> I remember the Trace32 treats e.g. 0x003E1234 as 0x1234 on page 0x3E.
> This
> is the format what for example Metrowerks is using by default but
> differs
> from the linearized addressing what P&E is using (and what is so
> unnatural
> for me). >
> > -----Original Message-----
> > From: 68HC12@68HC... [mailto:68HC12@68HC...] On
Behalf
> Of
> > venki
> > Sent: 04 October 2005 15:14
> > To: 68HC12@68HC...
> > Subject: [68HC12] Flashing problem [license expired]
> >
> > Hello all,
> >
> > While flashing I am getting the error "Fash programming error around
> > address 0x000000" we are using Lauterbach TRACE32 debugger.Linker
file
> > is using far text Segments(+seg .ftext).
> > If I use text segments for another project absolutely there is no
> > problem, but I can't use text segments for my project.
> >
> > Your help would be appreceited
> >
> > Thanks & Regards,
> > Venkateshwarlu K
> >
> >
> >
----------------------------------
> > Email From ""venki" <venki@venk...>" was security checked by
3.93
> > version of CxProtect(tm)
> > On: deiserver at: 18:44:58, 04-Oct-2005 Tuesday
> > Engine: 4.125.23, sign.def:4-Oct-2005, sign2.def:4-Oct-2005,
> macro.def:28-
> > Sep-2005
> >
----------------------------------
> >
> >
> >
> >
> >
> >
> >
> > > . > _____ > ----------------------------------
> Email From ""Karoly Molnar" " was security checked by 3.93 version of
> CxProtect(tm) On: deiserver at: 20:44:57, 04-Oct-2005 Tuesday
> ---------------------------------- > ----------------------------------
> Email From ""venki" <venki@venk...>" was security checked by 3.93
> version of CxProtect(tm)
> On: deiserver at: 14:55:09, 05-Oct-2005 Wednesday
> Engine: 4.125.23, sign.def:4-Oct-2005, sign2.def:4-Oct-2005,
macro.def:28-
> Sep-2005
> ---------------------------------- >
>
> > .


_____ ----------------------------------
Email From ""Karoly Molnar" " was security checked by 3.93 version of
CxProtect(tm) On: deiserver at: 16:45:01, 05-Oct-2005 Wednesday
---------------------------------- ----------------------------------
Email From ""venki" <venki@venk...>" was security checked by 3.93 version of CxProtect(tm)
On: deiserver at: 17:38:03, 05-Oct-2005 Wednesday
Engine: 4.125.23, sign.def:4-Oct-2005, sign2.def:4-Oct-2005, macro.def:28-Sep-2005
----------------------------------



Try this:

+seg .ftext -x -b0xf4000 -m 0x3000 -nCODE -sFLASH -ck
+seg .ftext -x -b0xfC000 -m 0x3F00 -nCODE2 -sFLASH -ck

I just barely remember to the cosmic linker format because I use metrowerks
since years. I think that you shall trick the addressing if you want to
locate the program to the paged area (I mean the values after -b and -m in
the lines above).
> -----Original Message-----
> From: 68HC12@68HC... [mailto:68HC12@68HC...] On Behalf Of
> venki
> Sent: 05 October 2005 11:23
> To: 68HC12@68HC...
> Subject: RE: [68HC12] Flashing problem [license expired]
>
> Hello Karoly Molnar,
>
> Thanks for the replay.
>
> I am working on MC9S12DJ128 microcontroller. I am using COSMIC compiler
> for compiling the source code and TRACE32 debugger.I am using linker
> file like this
>
> # LINK FILE FOR 9s12xx32 On-chip application (64K Flash and 4K RAM)
> # The +def things are used in the startup code
> +seg .data -b0x1000 -nIRAM -m0x1000 -sRAM # 4K Bytes RAM for Variable
> storage
> +seg .bss -aIRAM -sRAM
> +def __sbss=@.bss # Section where unitialized vars are put
>
> #we have 64k flash, 1k eeprom 4k ram
>
> +seg .ftext -x -b0x4000 -m 0x3000 -nCODE -sFLASH -ck # Flash
> -ck= include this in cksum
> +seg .const -aCODE -nCONST # -x = allow seg to overflow into next
> .txt
> +seg .cksum -aCONST -ncksum -ik
> can_drv.o
> cangen_drv_test_app.o
> diag.o
> gmlcal.o
> gmlvers.o
> gmnm.o
> il.o
> ilpar.o
> otim.o
> tpmc.o
> vstdlib.o
> Crtsi_s32.o
>
> +seg .ftext -x -b0xC000 -m 0x3F7F -nCODE2 -sFLASH -ck # Flash -ck=
> include this in cksum
>
> # "C:\COSMIC\CX12\Lib\libe.h12" # HCS12 Byte EEPROM Libraries (byte EE
> not availble on C32)
> "C:\Program Files\COSMIC\CX12\LIB\libi.h12" # Integer Library
> "C:\Program Files\COSMIC\CX12\LIB\libm.h12" # Cosmic HC12/HCS12 Machine
> Library (required) > +seg .const -b 0xFF80 -sFLASH # Vectors at logical address 0xFF80
> vect_HCS12C.o
>
> +def <mailto:__memory=@.bss> __memory=@.bss # End of Global RAM
> Space
> +def __stack=0x1FFF # Top of stack address
>
> With this settings compilation is successful but am unable to flash the
> code into target board by using TRACE32 & BDM MULTILINK(It is not
> converting all logical records to physical records).For all other
> projects if i dont select +seg .ftext everything is fine.
>
> I dont know how to allocate memory for different segments like for
> text,.ftext.
> Please suggest me i had struck up here.
>
> your help would be appreceited.
>
> Thanks and Regards,
> venki.
>
> -----Original Message-----
> From: 68HC12@68HC... [mailto:68HC12@68HC...] On Behalf
> Of Karoly Molnar
> Sent: Tuesday, October 04, 2005 8:34 PM
> To: 68HC12@68HC...
> Subject: RE: [68HC12] Flashing problem >
> In my opinion the problem is with the linearization of the paged memory.
> As
> I remember the Trace32 treats e.g. 0x003E1234 as 0x1234 on page 0x3E.
> This
> is the format what for example Metrowerks is using by default but
> differs
> from the linearized addressing what P&E is using (and what is so
> unnatural
> for me). >
> > -----Original Message-----
> > From: 68HC12@68HC... [mailto:68HC12@68HC...] On Behalf
> Of
> > venki
> > Sent: 04 October 2005 15:14
> > To: 68HC12@68HC...
> > Subject: [68HC12] Flashing problem [license expired]
> >
> > Hello all,
> >
> > While flashing I am getting the error "Fash programming error around
> > address 0x000000" we are using Lauterbach TRACE32 debugger.Linker file
> > is using far text Segments(+seg .ftext).
> > If I use text segments for another project absolutely there is no
> > problem, but I can't use text segments for my project.
> >
> > Your help would be appreceited
> >
> > Thanks & Regards,
> > Venkateshwarlu K
> >
> >
> > ----------------------------------
> > Email From ""venki" <venki@venk...>" was security checked by 3.93
> > version of CxProtect(tm)
> > On: deiserver at: 18:44:58, 04-Oct-2005 Tuesday
> > Engine: 4.125.23, sign.def:4-Oct-2005, sign2.def:4-Oct-2005,
> macro.def:28-
> > Sep-2005
> > ----------------------------------
> >
> >
> >
> >
> >
> >
> >
> > > . > _____ > ----------------------------------
> Email From ""Karoly Molnar" " was security checked by 3.93 version of
> CxProtect(tm) On: deiserver at: 20:44:57, 04-Oct-2005 Tuesday
> ---------------------------------- > ----------------------------------
> Email From ""venki" <venki@venk...>" was security checked by 3.93
> version of CxProtect(tm)
> On: deiserver at: 14:55:09, 05-Oct-2005 Wednesday
> Engine: 4.125.23, sign.def:4-Oct-2005, sign2.def:4-Oct-2005, macro.def:28-
> Sep-2005
> ---------------------------------- >
>
> Yahoo! Groups Links >
>




Hi Venki,

You did not say that you want to get it run also :-) You have just
complained about the flash programming error...

Just kidding
//Kares

> -----Original Message-----
> From: 68HC12@68HC... [mailto:68HC12@68HC...] On Behalf Of
> venki
> Sent: 05 October 2005 14:07
> To: 68HC12@68HC...
> Subject: RE: [**LikelySPAM] RE: [68HC12] Flashing problem [license
> expired]
>
> Hi,
>
> Now I changed linker file so I am able to flash the code but it is not
> working when I say run in the debugger.I hope the code is not mapped
> correctly into the memory.