Reply by Alex John February 18, 20082008-02-18
I debugged a bit the BIOS assembly code and I found out where the problem is.
Inside GBL_init, there is code that initializes the stack to the value of 0xBEEF.
This code uses the assembly language file gbl.h55 to find the start and length of stack (in order to initialize it).
The start of the stack is given by symbol GBL_stackbeg.
The end of stack is given by symbol GBL_stackend.
So far so good.

Now here where it gets quite funny: if you look at the values of GBL_stackbeg and GBL_stackend in the map file you find that the first one is given as a word address while the second one is given as an absolute byte address. I.e., the value of GBL_stackbeg is twice as small big it's given in number of words. Here's what we we see in the map file:

000042e8 GBL_stackbeg00008dcf GBL_stackend
So in order to find the stack length, we cannot subtract these two values. We first have to convert one of them to be of the same type as the other, then we can subtract the values.
But the code in gbl.h55 treats the two addresses as if they were of the same kind and it obtains a totally bogus stack length. The stack length is too long and hence we initialize a very large memory to 0xBEEF, overwriting useful data, and we crash the program.

This is a major bug. Who to blame? gbl.h55 or the linker? It's hard to tell.
Looking at where GBL_stackbeg and GBL_stackend are defined, they are in clkcmg.cfg or hellocmd.cfg (TI BIOS' own examples). There we see that they are defined as follows:

GBL_stackbeg = .; *(.stack) GBL_stackend = (GBL_stackbeg + 0x800 - 1) ;

It seems that when the linker sees the construct in the first line, " = . ", then it assigns a word address value to the label. But when it sees the construct in the last line, "label2 = label1", then it assigns a byte address value to the label. This completely confuse any code that wishes to use the labels. So I would put more blame on the linker. It should give all addresses as words or all addresses as bytes, and be consistent. It can display in the map file both values but the labels should have a unique type.

Or am I using an incorrect linker or something?
I do work on C6000 platform most often, so could it be a bad interaction between C55xx and C6xx ?

Or the TI BIOS people did not test lately their examples on the C55xx ?

If you think you know what the issue is, please let me know.
Thank you,

Alex

To: b...@hotmail.comCC: c...From: j...@signalogic.comDate: Thu, 7 Feb 2008 11:42:46 -0600Subject: Re: [c55x] BIOS example not working on C55xx simulator

Alex-> Thank you Jeff.> The problem is solved with your suggestion (turning off the page wraparound> detect).> > However, the program still doesn't work. It crashes somewhere in the BIOS init.> Sometimes reporting a fatal error or invalid address and things like that. Perhaps> a wrong BIOS library is being linked in? But I am not making any changes, it's TI's> own example.> > Has TI tested their example clk.pjt on the simulator of C55xx ?I don't know for sure. Yes there could be a library or other file mismatch,especially if your test system (PC) has had multiple CCS versions installed /uninstalled. It's not easy to debug crashes inside BIOS_init() and other non-usercode, although it can be done if you have several years of TI DSP experience and knowwhat to look for. My suggestion would be to try some other TI example projects andsee if they have the same problem. If so, then do a clean install on another machinethat's never seen CCS before, and see what happens.If that doesn't work, then write to the TI Hotline and give exactly what version ofCCS and codegen tools you're using, what project, etc.-Jeff> > > I am trying to run the BIOS example, basic/clk on a C55xx platform,> > > using Code Composer Studio. But it doesn't work.> > >> > > I have BIOS version 5_32_01 and CCS v3.3. Pretty much latest build> > > tools for C55xx (code generation tools). Windows XP platform.> > >> > > I loaded the project> > >> > > C:\CCStudio_v3.3\bios_5_32_01> > > \packages\ti\bios\examples\basic\clk\sim5510\clk.pjt> > >> > > a C55xx Rev 3.0 CPU Cycle Accurate Simulator (or Functional> > > Simulator), and I get a different error:> > > "Error: WARNING: PAGE BOUNDARY CROSSING DETECTED AT PROGRAM COUNTER> > > 0x22bb0".> > > The error is inside BIOS_init, and more specifically, inside GBL_init.> > >> > > I also tried the Rev 2.0 and the Functional Simulator but they all> > > give the same error.> > >> > > Are these examples working for C55xx simulator?> >> > My first thought, although I would think the TI examples accounted for this> already, is that DSP/BIOS depends on a> > timer tick from TIMER0, which is a hardware register (actually a few registers)> so that must be exactly simulated. It> > should be... but possibly there is a simulator setting or config you need to make> to ensure TIMER0 is being simulated> > as needed.> >> > The page boundary crossing warning sounds easier... I recall an exchange of> messages earlier this week where the> > answer appeared to be a simulator option to "detect page wraparound" and setting> it to "NO". You should check the 55x> > group archives for week of 29Jan08.> >> > -Jeff> >> > ----------------------> Helping your favorite cause is as easy as instant messaging. You IM, we give. Learn> more.

_________________________________________________________________
Climb to the top of the charts!Play the word scramble challenge with star power.
http://club.live.com/star_shuffle.aspx?icid=starshuffle_wlmailtextlink_jan
Reply by Alex John February 7, 20082008-02-07
Thank you Jeff.
The problem is solved with your suggestion (turning off the page wraparound detect).

However, the program still doesn't work. It crashes somewhere in the BIOS init. Sometimes reporting a fatal error or invalid address and things like that. Perhaps a wrong BIOS library is being linked in? But I am not making any changes, it's TI's own example.
Has TI tested their example clk.pjt on the simulator of C55xx ?
Thank you,

Alex
> > I am trying to run the BIOS example, basic/clk on a C55xx platform,> > using Code Composer Studio. But it doesn't work.> >> > I have BIOS version 5_32_01 and CCS v3.3. Pretty much latest build> > tools for C55xx (code generation tools). Windows XP platform.> >> > I loaded the project> >> > C:\CCStudio_v3.3\bios_5_32_01> > \packages\ti\bios\examples\basic\clk\sim5510\clk.pjt
> >> > a C55xx Rev 3.0 CPU Cycle Accurate Simulator (or Functional
> > Simulator), and I get a different error:> > "Error: WARNING: PAGE BOUNDARY CROSSING DETECTED AT PROGRAM COUNTER> > 0x22bb0".> > The error is inside BIOS_init, and more specifically, inside GBL_init.> >> > I also tried the Rev 2.0 and the Functional Simulator but they all> > give the same error.> >> > Are these examples working for C55xx simulator?> > My first thought, although I would think the TI examples accounted for this already, is that DSP/BIOS depends on a> timer tick from TIMER0, which is a hardware register (actually a few registers) so that must be exactly simulated. It> should be... but possibly there is a simulator setting or config you need to make to ensure TIMER0 is being simulated> as needed.> > The page boundary crossing warning sounds easier... I recall an exchange of messages earlier this week where the> answer appeared to be a simulator option to "detect page wraparound" and setting it to "NO". You should check the 55x> group archives for week of 29Jan08.> > -Jeff>
_________________________________________________________________
Helping your favorite cause is as easy as instant messaging.You IM, we give.
http://im.live.com/Messenger/IM/Home/?source=text_hotmail_join
Reply by Jeff Brower February 7, 20082008-02-07
Alex-

> Thank you Jeff.
> The problem is solved with your suggestion (turning off the page wraparound
> detect).
>
> However, the program still doesn't work. It crashes somewhere in the BIOS init.
> Sometimes reporting a fatal error or invalid address and things like that. Perhaps
> a wrong BIOS library is being linked in? But I am not making any changes, it's TI's
> own example.
>
> Has TI tested their example clk.pjt on the simulator of C55xx ?

I don't know for sure. Yes there could be a library or other file mismatch,
especially if your test system (PC) has had multiple CCS versions installed /
uninstalled. It's not easy to debug crashes inside BIOS_init() and other non-user
code, although it can be done if you have several years of TI DSP experience and know
what to look for. My suggestion would be to try some other TI example projects and
see if they have the same problem. If so, then do a clean install on another machine
that's never seen CCS before, and see what happens.

If that doesn't work, then write to the TI Hotline and give exactly what version of
CCS and codegen tools you're using, what project, etc.

-Jeff

> > > I am trying to run the BIOS example, basic/clk on a C55xx platform,
> > > using Code Composer Studio. But it doesn't work.
> > >
> > > I have BIOS version 5_32_01 and CCS v3.3. Pretty much latest build
> > > tools for C55xx (code generation tools). Windows XP platform.
> > >
> > > I loaded the project
> > >
> > > C:\CCStudio_v3.3\bios_5_32_01
> > > \packages\ti\bios\examples\basic\clk\sim5510\clk.pjt
> > >
> > > a C55xx Rev 3.0 CPU Cycle Accurate Simulator (or Functional
> > > Simulator), and I get a different error:
> > > "Error: WARNING: PAGE BOUNDARY CROSSING DETECTED AT PROGRAM COUNTER
> > > 0x22bb0".
> > > The error is inside BIOS_init, and more specifically, inside GBL_init.
> > >
> > > I also tried the Rev 2.0 and the Functional Simulator but they all
> > > give the same error.
> > >
> > > Are these examples working for C55xx simulator?
> >
> > My first thought, although I would think the TI examples accounted for this
> already, is that DSP/BIOS depends on a
> > timer tick from TIMER0, which is a hardware register (actually a few registers)
> so that must be exactly simulated. It
> > should be... but possibly there is a simulator setting or config you need to make
> to ensure TIMER0 is being simulated
> > as needed.
> >
> > The page boundary crossing warning sounds easier... I recall an exchange of
> messages earlier this week where the
> > answer appeared to be a simulator option to "detect page wraparound" and setting
> it to "NO". You should check the 55x
> > group archives for week of 29Jan08.
> >
> > -Jeff
> > -----------
> Helping your favorite cause is as easy as instant messaging. You IM, we give. Learn
> more.
Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution for Commercial & Consumer End Equipment: www.ti.com/dm6467
Reply by Jeff Brower February 3, 20082008-02-03
Alex-

> I am trying to run the BIOS example, basic/clk on a C55xx platform,
> using Code Composer Studio. But it doesn't work.
>
> I have BIOS version 5_32_01 and CCS v3.3. Pretty much latest build
> tools for C55xx (code generation tools). Windows XP platform.
>
> I loaded the project
>
> C:\CCStudio_v3.3\bios_5_32_01
> \packages\ti\bios\examples\basic\clk\sim5510\clk.pjt
>
> into several different simulators:
>
> 1) I load it into a C5510 Device Simulator. After building and trying
> to load I get the error: "Trouble Writing Register: Invalid register".
> 2) I also load it into a C55xx Rev 3.0 CPU Cycle Accurate Simulator,
> and I get a different error:
> "Error: WARNING: PAGE BOUNDARY CROSSING DETECTED AT PROGRAM COUNTER
> 0x22bb0".
> The error is inside BIOS_init, and more specifically, inside GBL_init.
>
> I also tried the Rev 2.0 and the Functional Simulator but they all
> give the same error.
>
> Are these examples working for C55xx simulator?

My first thought, although I would think the TI examples accounted for this already, is that DSP/BIOS depends on a
timer tick from TIMER0, which is a hardware register (actually a few registers) so that must be exactly simulated. It
should be... but possibly there is a simulator setting or config you need to make to ensure TIMER0 is being simulated
as needed.

The page boundary crossing warning sounds easier... I recall an exchange of messages earlier this week where the
answer appeared to be a simulator option to "detect page wraparound" and setting it to "NO". You should check the 55x
group archives for week of 29Jan08.

-Jeff

Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution for Commercial & Consumer End Equipment: www.ti.com/dm6467
Reply by bellaciao666 February 2, 20082008-02-02
Hello,

I am trying to run the BIOS example, basic/clk on a C55xx platform,
using Code Composer Studio. But it doesn't work.

I have BIOS version 5_32_01 and CCS v3.3. Pretty much latest build
tools for C55xx (code generation tools). Windows XP platform.

I loaded the project

C:\CCStudio_v3.3\bios_5_32_01
\packages\ti\bios\examples\basic\clk\sim5510\clk.pjt

into several different simulators:

1) I load it into a C5510 Device Simulator. After building and trying
to load I get the error: "Trouble Writing Register: Invalid register".
2) I also load it into a C55xx Rev 3.0 CPU Cycle Accurate Simulator,
and I get a different error:
"Error: WARNING: PAGE BOUNDARY CROSSING DETECTED AT PROGRAM COUNTER
0x22bb0".
The error is inside BIOS_init, and more specifically, inside GBL_init.

I also tried the Rev 2.0 and the Functional Simulator but they all
give the same error.

Are these examples working for C55xx simulator?
Any help would be greatly appreciated.
Thank you,

Alex

Check Out Industry's First Single-Chip, Multi-Format, Real-Time HD Video Transcoding Solution for Commercial & Consumer End Equipment: www.ti.com/dm6467