DSPRelated.com
Forums

TMS320C6727 Help

Started by Chsekhar Prattipati June 7, 2008
Hi

this is chandrasekhar.. my board is having TMS320C6727 DSP with EEPROM(8k), RTC etc. i have written secondary bootloader code to read my application code from EEPROM and copy it to External RAM. After copying, it should jump to that location and execute my application code.

the assembly instructions i used are,

unsigned int jump_addr;
asm(" MVKL .S1 _jump_addr, A10");
asm(" MVKH .S1 _jump_addr, A10");
asm(" LDW .D1 *A10, A11");
asm(" B .S1 A11");

if i use this code, the memory location of _jump_addr is moved to A10 Register instead of jump location of application code. can anyone tell me how to move the value of the variable(_jump_addr) to a register?
Best Regards
Chandrasekhar
Chandrasekhar,

On Sat, Jun 7, 2008 at 5:22 AM, Chsekhar Prattipati
wrote:
> Hi
>
> this is chandrasekhar.. my board is having TMS320C6727 DSP with
> EEPROM(8k), RTC etc. i have written secondary bootloader code to read my
> application code from EEPROM and copy it to External RAM. After copying, it
> should jump to that location and execute my application code.
>
> the assembly instructions i used are,
>
> unsigned int jump_addr;
> asm(" MVKL .S1 _jump_addr, A10");
> asm(" MVKH .S1 _jump_addr, A10");
> asm(" LDW .D1 *A10, A11");
> asm(" B .S1 A11");
>
> if i use this code, the memory location of _jump_addr is moved to A10
> Register instead of jump location of application code. can anyone tell me
> how to move the value of the variable(_jump_addr) to a register?

1. Add NOPs after the branch to fill the 4 delay slots.
2. Set a breakpoint at 'unsigned int jump_addr;'.
3. Perform asm single step and monitor registers A10 and A11.

mikedunn
> Best Regards
> Chandrasekhar

--
www.dsprelated.com/blogs-1/nf/Mike_Dunn.php
Mike--
I assume it was a typo; isnt it 5 delay slots?

--Bhooshan

On Mon, Jun 9, 2008 at 8:43 AM, Michael Dunn wrote:
> Chandrasekhar,
>
> On Sat, Jun 7, 2008 at 5:22 AM, Chsekhar Prattipati
> wrote:
>> Hi
>>
>> this is chandrasekhar.. my board is having TMS320C6727 DSP with
>> EEPROM(8k), RTC etc. i have written secondary bootloader code to read my
>> application code from EEPROM and copy it to External RAM. After copying,
>> it
>> should jump to that location and execute my application code.
>>
>> the assembly instructions i used are,
>>
>> unsigned int jump_addr;
>> asm(" MVKL .S1 _jump_addr, A10");
>> asm(" MVKH .S1 _jump_addr, A10");
>> asm(" LDW .D1 *A10, A11");
>> asm(" B .S1 A11");
>>
>> if i use this code, the memory location of _jump_addr is moved to A10
>> Register instead of jump location of application code. can anyone tell me
>> how to move the value of the variable(_jump_addr) to a register?
>
> 1. Add NOPs after the branch to fill the 4 delay slots.
> 2. Set a breakpoint at 'unsigned int jump_addr;'.
> 3. Perform asm single step and monitor registers A10 and A11.
>
> mikedunn
>> Best Regards
>> Chandrasekhar
>>
>> --
> www.dsprelated.com/blogs-1/nf/Mike_Dunn.php

--
-----------------------
"I've missed more than 9000 shots in my career.
I've lost almost 300 games. 26 times I've been trusted to take the
game winning shot and missed.
I've failed over and over again in my life.
And that is why I succeed."
-- Michael Jordan
-----------------------
> > 1. Add NOPs after the branch to fill the 4 delay slots.

OK. I thought, you asked him to NOPs to branch and not load...

--Bhooshan

On Mon, Jun 9, 2008 at 5:46 PM, Michael Dunn wrote:
> Bhooshan,
>
> On 6/9/08, Bhooshan Iyer wrote:
>> Mike--
>> I assume it was a typo; isnt it 5 delay slots?
>>
> I believe that the LDW is 5 cycles total, four of which are delay
> slots to get the loaded value.
>
> ref: spru733
>
> mikedunn
>
>> --Bhooshan
>>
>> On Mon, Jun 9, 2008 at 8:43 AM, Michael Dunn wrote:
>> > Chandrasekhar,
>> >
>> > On Sat, Jun 7, 2008 at 5:22 AM, Chsekhar Prattipati
>> > wrote:
>> >> Hi
>> >>
>> >> this is chandrasekhar.. my board is having TMS320C6727 DSP with
>> >> EEPROM(8k), RTC etc. i have written secondary bootloader code to read my
>> >> application code from EEPROM and copy it to External RAM. After copying,
>> >> it
>> >> should jump to that location and execute my application code.
>> >>
>> >> the assembly instructions i used are,
>> >>
>> >> unsigned int jump_addr;
>> >> asm(" MVKL .S1 _jump_addr, A10");
>> >> asm(" MVKH .S1 _jump_addr, A10");
>> >> asm(" LDW .D1 *A10, A11");
>> >> asm(" B .S1 A11");
>> >>
>> >> if i use this code, the memory location of _jump_addr is moved to A10
>> >> Register instead of jump location of application code. can anyone tell me
>> >> how to move the value of the variable(_jump_addr) to a register?
>> >
>> > 1. Add NOPs after the branch to fill the 4 delay slots.
>> > 2. Set a breakpoint at 'unsigned int jump_addr;'.
>> > 3. Perform asm single step and monitor registers A10 and A11.
>> >
>> > mikedunn
>> >>
>> >>
>> >> Best Regards
>> >> Chandrasekhar
>> >>
>> >>
>> >
>> > --
>> > www.dsprelated.com/blogs-1/nf/Mike_Dunn.php
>> >
>> >
>>
>> --
>> -----------------------
>> "I've missed more than 9000 shots in my career.
>> I've lost almost 300 games. 26 times I've been trusted to take the
>> game winning shot and missed.
>> I've failed over and over again in my life.
>> And that is why I succeed."
>> -- Michael Jordan
>> -----------------------
>>
> --
> www.dsprelated.com/blogs-1/nf/Mike_Dunn.php
>

--
-----------------------
"I've missed more than 9000 shots in my career.
I've lost almost 300 games. 26 times I've been trusted to take the
game winning shot and missed.
I've failed over and over again in my life.
And that is why I succeed."
-- Michael Jordan
-----------------------
Bhooshan,

On 6/9/08, Bhooshan Iyer wrote:
> Mike--
> I assume it was a typo; isnt it 5 delay slots?
>
I believe that the LDW is 5 cycles total, four of which are delay
slots to get the loaded value.

ref: spru733

mikedunn

> --Bhooshan
>
> On Mon, Jun 9, 2008 at 8:43 AM, Michael Dunn wrote:
> > Chandrasekhar,
> >
> > On Sat, Jun 7, 2008 at 5:22 AM, Chsekhar Prattipati
> > wrote:
> >> Hi
> >>
> >> this is chandrasekhar.. my board is having TMS320C6727 DSP with
> >> EEPROM(8k), RTC etc. i have written secondary bootloader code to read my
> >> application code from EEPROM and copy it to External RAM. After copying,
> >> it
> >> should jump to that location and execute my application code.
> >>
> >> the assembly instructions i used are,
> >>
> >> unsigned int jump_addr;
> >> asm(" MVKL .S1 _jump_addr, A10");
> >> asm(" MVKH .S1 _jump_addr, A10");
> >> asm(" LDW .D1 *A10, A11");
> >> asm(" B .S1 A11");
> >>
> >> if i use this code, the memory location of _jump_addr is moved to A10
> >> Register instead of jump location of application code. can anyone tell me
> >> how to move the value of the variable(_jump_addr) to a register?
> >
> > 1. Add NOPs after the branch to fill the 4 delay slots.
> > 2. Set a breakpoint at 'unsigned int jump_addr;'.
> > 3. Perform asm single step and monitor registers A10 and A11.
> >
> > mikedunn
> >>
> >>
> >> Best Regards
> >> Chandrasekhar
> >>
> >>
> >
> > --
> > www.dsprelated.com/blogs-1/nf/Mike_Dunn.php
> >
> > --
> -----------------------
> "I've missed more than 9000 shots in my career.
> I've lost almost 300 games. 26 times I've been trusted to take the
> game winning shot and missed.
> I've failed over and over again in my life.
> And that is why I succeed."
> -- Michael Jordan
> -----------------------
>
--
www.dsprelated.com/blogs-1/nf/Mike_Dunn.php
Bhooshan,

Thank you, you are correct and my explaination is not.

I was thinking about the load problem and wrote about the branch -
another problem. :-).

I will try to get it correct below.

Chandrasekhar,

Please see my rewritten explanation below. I was in a hurry and did
not write it correctly. This is not the most efficient, but it is the
easiest to understand.

In your code, the Branch was occuring before the load finished.

asm(" MVKL .S1 _jump_addr, A10");
asm(" MVKH .S1 _jump_addr, A10");
asm(" LDW .D1 *A10, A11"); ///The load will not be valid for 4 cycles
asm(" NOP 4");
asm(" B .S1 A11"); ///The branch will take 5 cycles and will continue
/// executing the following instructions
asm(" NOP 5");

mikedunn

On 6/9/08, Bhooshan Iyer wrote:
> > > 1. Add NOPs after the branch to fill the 4 delay slots.
>
> OK. I thought, you asked him to NOPs to branch and not load...
>
> --Bhooshan
>
> On Mon, Jun 9, 2008 at 5:46 PM, Michael Dunn wrote:
> > Bhooshan,
> >
> > On 6/9/08, Bhooshan Iyer wrote:
> >> Mike--
> >> I assume it was a typo; isnt it 5 delay slots?
> >>
> > I believe that the LDW is 5 cycles total, four of which are delay
> > slots to get the loaded value.
> >
> > ref: spru733
> >
> > mikedunn
> >
> >> --Bhooshan
> >>
> >> On Mon, Jun 9, 2008 at 8:43 AM, Michael Dunn wrote:
> >> > Chandrasekhar,
> >> >
> >> > On Sat, Jun 7, 2008 at 5:22 AM, Chsekhar Prattipati
> >> > wrote:
> >> >> Hi
> >> >>
> >> >> this is chandrasekhar.. my board is having TMS320C6727 DSP with
> >> >> EEPROM(8k), RTC etc. i have written secondary bootloader code to read my
> >> >> application code from EEPROM and copy it to External RAM. After copying,
> >> >> it
> >> >> should jump to that location and execute my application code.
> >> >>
> >> >> the assembly instructions i used are,
> >> >>
> >> >> unsigned int jump_addr;
> >> >> asm(" MVKL .S1 _jump_addr, A10");
> >> >> asm(" MVKH .S1 _jump_addr, A10");
> >> >> asm(" LDW .D1 *A10, A11");
> >> >> asm(" B .S1 A11");
> >> >>
> >> >> if i use this code, the memory location of _jump_addr is moved to A10
> >> >> Register instead of jump location of application code. can anyone tell me
> >> >> how to move the value of the variable(_jump_addr) to a register?
> >> >
> >> > 1. Add NOPs after the branch to fill the 4 delay slots.
> >> > 2. Set a breakpoint at 'unsigned int jump_addr;'.
> >> > 3. Perform asm single step and monitor registers A10 and A11.
> >> >
> >> > mikedunn
> >> >>
> >> >>
> >> >> Best Regards
> >> >> Chandrasekhar
> >> >>
> >> >>
> >> >
> >> > --
> >> > www.dsprelated.com/blogs-1/nf/Mike_Dunn.php
> >> >
> >> >
> >>
> >>
> >>
> >> --
> >> -----------------------
> >> "I've missed more than 9000 shots in my career.
> >> I've lost almost 300 games. 26 times I've been trusted to take the
> >> game winning shot and missed.
> >> I've failed over and over again in my life.
> >> And that is why I succeed."
> >> -- Michael Jordan
> >> -----------------------
> >>
> >
> >
> > --
> > www.dsprelated.com/blogs-1/nf/Mike_Dunn.php
> > --
> -----------------------
> "I've missed more than 9000 shots in my career.
> I've lost almost 300 games. 26 times I've been trusted to take the
> game winning shot and missed.
> I've failed over and over again in my life.
> And that is why I succeed."
> -- Michael Jordan
> -----------------------
>
--
www.dsprelated.com/blogs-1/nf/Mike_Dunn.php
Hi bhooshan and mikedunn
Thanks for your reply.. i introduced 4 delay slots after LDW instruction. now the branch was happening...
Thanks and Regards
Chandrasekhar

----- Original Message ----
From: Michael Dunn
To: Bhooshan Iyer
Cc: c...
Sent: Monday, June 9, 2008 6:15:47 PM
Subject: Re: [c6x] TMS320C6727 Help
Bhooshan,

Thank you, you are correct and my explaination is not.

I was thinking about the load problem and wrote about the branch -
another problem. :-).

I will try to get it correct below.

Chandrasekhar,

Please see my rewritten explanation below. I was in a hurry and did
not write it correctly. This is not the most efficient, but it is the
easiest to understand.

In your code, the Branch was occuring before the load finished.

asm(" MVKL .S1 _jump_addr, A10");
asm(" MVKH .S1 _jump_addr, A10");
asm(" LDW .D1 *A10, A11"); ///The load will not be valid for 4 cycles
asm(" NOP 4");
asm(" B .S1 A11"); ///The branch will take 5 cycles and will continue
/// executing the following instructions
asm(" NOP 5");

mikedunn

On 6/9/08, Bhooshan Iyer wrote:
> > > 1. Add NOPs after the branch to fill the 4 delay slots.
>
> OK. I thought, you asked him to NOPs to branch and not load...
>
> --Bhooshan
>
> On Mon, Jun 9, 2008 at 5:46 PM, Michael Dunn wrote:
> > Bhooshan,
> >
> > On 6/9/08, Bhooshan Iyer wrote:
> >> Mike--
> >> I assume it was a typo; isnt it 5 delay slots?
> >>
> > I believe that the LDW is 5 cycles total, four of which are delay
> > slots to get the loaded value.
> >
> > ref: spru733
> >
> > mikedunn
> >
> >> --Bhooshan
> >>
> >> On Mon, Jun 9, 2008 at 8:43 AM, Michael Dunn wrote:
> >> > Chandrasekhar,
> >> >
> >> > On Sat, Jun 7, 2008 at 5:22 AM, Chsekhar Prattipati
> >> > wrote:
> >> >> Hi
> >> >>
> >> >> this is chandrasekhar. . my board is having TMS320C6727 DSP with
> >> >> EEPROM(8k), RTC etc. i have written secondary bootloader code to read my
> >> >> application code from EEPROM and copy it to External RAM. After copying,
> >> >> it
> >> >> should jump to that location and execute my application code.
> >> >>
> >> >> the assembly instructions i used are,
> >> >>
> >> >> unsigned int jump_addr;
> >> >> asm(" MVKL .S1 _jump_addr, A10");
> >> >> asm(" MVKH .S1 _jump_addr, A10");
> >> >> asm(" LDW .D1 *A10, A11");
> >> >> asm(" B .S1 A11");
> >> >>
> >> >> if i use this code, the memory location of _jump_addr is moved to A10
> >> >> Register instead of jump location of application code. can anyone tell me
> >> >> how to move the value of the variable(_jump_ addr) to a register?
> >> >
> >> > 1. Add NOPs after the branch to fill the 4 delay slots.
> >> > 2. Set a breakpoint at 'unsigned int jump_addr;'.
> >> > 3. Perform asm single step and monitor registers A10 and A11.
> >> >
> >> > mikedunn
> >> >>
> >> >>
> >> >> Best Regards
> >> >> Chandrasekhar
> >> >>
> >> >>
> >> >
> >> > --
> >> > www.dsprelated. com/blogs- 1/nf/Mike_ Dunn.php