DSPRelated.com
Forums

edma $ mcbsp configuration and sequence problems

Started by fx-7...@163.com April 15, 2010
hello everyone!

I'm now doing a project focus on transmission of data thru mcbsp that controlled by edma.the project is based on the 'app_dsk' demo.in the demo project,it uses mcbsp2 in both receiving and transmitting,in my project I just use mcbsp0 to transmit,no receiving,the data for transmission is prepared in the program.I just configure the registers of mcbsp0 and edma as required,mcbsp0 Xmt port is configured as output clk generated by internal clk.because i don't use mcbsp as input port,i remove the setting of input event and relevant definition in edma configuration.but when i'm running the program,it has the problems as follow:

1.it halts as soon as it begin to run,and i don't do anything to stop it,neither the program has any breakpoits or probe
2.i observe the registers of mcbsp,and find that the SPCR remains zeros after all the initializtion,but i'm sure the program entered the intMcbsp() function,because i use &trace to print sth,and it show up in the message log.

but when i re-move all the "Rcv-side" configuration of the edma back,the problems above would all disappear.

so I just wonder:
1.did the mcbsp & edma configuration has some sequence?
2.if i only want to use the Xmt port of mcbsp,and controlled by edma,how should i start the first mcbsp Xmt_event interrupt to edma?
i guess maybe i didn't make the first interrupt,so it can't go ahead.

could there be anyone to help me with my problems, appreciate your help so much
sincerely
cathy

_____________________________________
cathy,

I do not have access to:
"'app_dsk' demo.in the demo project"
so I have no idea what that demo project is doing.

have you gotten the demo project to work?

To help, I need a few details:

What is the relationship, if any, between the 'clock' output of McBSP0 and the data flow into/out of McBSP1?

I would start with:
using McBSP0, to produce the 'clock'
When that works,
add: using McBSP1, to receive the data.
When that works,
add: using McBSP1, to transmit the data.

In general, starting with the simple things then progressively adding complexity/features gives the best chance of the final product working.

When you say that the system stops, do you mean the CPU quits executing instructions? of do you mean the desired data I/O and clock output stops?

Do you have the target system connected to CCS (or similar)?
Are you running the BIOS?
has the code 'went into the weeds' and hit a 'halt' instruction or something similar.
It seems to my memory that all the default interrupt handlers have either a 'halt' instruction of a 'forever' loop. Is execution stopping in one of those default interrupt handlers?
A question: where, exactly, does execution stop and why?

R. Williams

---------- Original Message -----------
From: f...@163.com
To: c...
Sent: Thu, 15 Apr 2010 03:45:30 -0400
Subject: [c6x] edma $ mcbsp configuration and sequence problems

>
>
> hello everyone!
>
> I'm now doing a project focus on transmission of data thru mcbsp that controlled by edma.the project is based on the 'app_dsk' demo.in the demo project,it uses mcbsp2 in both receiving and transmitting,in my project I just use mcbsp0 to transmit,no receiving,the data for transmission is prepared in the program.I just configure the registers of mcbsp0 and edma as required,mcbsp0 Xmt port is configured as output clk generated by internal clk.because i don't use mcbsp as input port,i remove the setting of input event and relevant definition in edma configuration.but when i'm running the program,it has the problems as follow:
>
> 1.it halts as soon as it begin to run,and i don't do anything to stop it,neither the program has any breakpoits or probe
> 2.i observe the registers of mcbsp,and find that the SPCR remains zeros after all the initializtion,but i'm sure the program entered the intMcbsp() function,because i use &trace to print sth,and it show up in the message log.
>
> but when i re-move all the "Rcv-side" configuration of the edma back,the problems above would all disappear.
>
> so I just wonder:
> 1.did the mcbsp & edma configuration has some sequence?
> 2.if i only want to use the Xmt port of mcbsp,and controlled by edma,how should i start the first mcbsp Xmt_event interrupt to edma?
> i guess maybe i didn't make the first interrupt,so it can't go ahead.
>
> could there be anyone to help me with my problems, appreciate your help so much
> sincerely
> cathy
------- End of Original Message -------
Hello R. Williams

first,thanks so much for answering.

I made a mistake,the name of the demo is dsk_app,and it is under the root as follows(the board i work with is tms320c6416):
(install dir)\CCStudio_v3.1\examples\dsk6416\bsl\dsk_app
and when i'm working with it,it's works normally.in the demo project,only mcbsp2 is used,for both reception and transmission.

in my own project,that's also what i want the board to do,i was just trying to use mcbsp0 only for transmission.

there isn't any inevitable relationship between Mcbsp2 and Mcbsp0.

and the halting problem:
by "halting",i mean that when it is debugging mode(not release),the program stop execution just as what it does when manually choose debug-> halt.
and I connect the target system all the time when debugging.

the problem is that i can't figure out what makes the program halt,i use DSP/BIOS function such as message log to observe the condition,it seems that the program initialization is completed,but can't enter the HWI of edma.

edma is used as linked mode,does this means what you refer to as "forever" loop?

hello everyone!
>
> I'm now doing a project focus on transmission of data thru mcbsp that controlled by edma.the project is based on the 'app_dsk' demo.in the demo project,it uses mcbsp2 in both receiving and transmitting,in my project I just use mcbsp0 to transmit,no receiving,the data for transmission is prepared in the program.I just configure the registers of mcbsp0 and edma as required,mcbsp0 Xmt port is configured as output clk generated by internal clk.because i don't use mcbsp as input port,i remove the setting of input event and relevant definition in edma configuration.but when i'm running the program,it has the problems as follow:
>
> 1.it halts as soon as it begin to run,and i don't do anything to stop it,neither the program has any breakpoits or probe
> 2.i observe the registers of mcbsp,and find that the SPCR remains zeros after all the initializtion,but i'm sure the program entered the intMcbsp() function,because i use &trace to print sth,and it show up in the message log.
>
>but when i re-move all the "Rcv-side" configuration of the edma back,the problems above would all disappear.
>
>so I just wonder:
> 1.did the mcbsp & edma configuration has some sequence?
> 2.if i only want to use the Xmt port of mcbsp,and controlled by edma,how should i start the first mcbsp Xmt_event interrupt to edma?
>i guess maybe i didn't make the first interrupt,so it can't go ahead.
>
>could there be anyone to help me with my problems, appreciate your help so much
> sincerely
> cathy
>
>_____________________________________

_____________________________________
fx-

it does not matter what the name of the demo app is, because I do not have the development system for the 6416.

Let me try again with the 'halt' problem....

Since you have the CCS connected, when your application halts, you should be able to examine the PC register and compare its' value with the address values in the .map file to determine exactly where it halted.
Also, you should be able to display the specific file/function that contains the address the PC is pointing toward.
Also, using the back trace (stack trace) you should be able to determine the location of the last call sequence to determine how the code execution arrived at the current location/address.
If these (above) things cannot be done, then the stack has been corrupted. (your examination of the actual stack data may help to determine how it became corrupted. use the .map file to determine the location of the stack.)

Examine the dis-assembled instructions where the PC is pointing to determine if the instructions have been corrupted.

If the above does not help to debug the problem, then paste all the code you have written into a post to the C6x e-list. This includes the .cmd linker file.

If you are using the BIOS, then also paste the BIOS config file.

One other thing...
Comment your code so we know what you were trying to do at each step of the execution sequence. (I find it a real time waster having to reverse engineer the code to determine the purpose.)

R. Williams

---------- Original Message -----------
From: f...@163.com
To: c...
Sent: Fri, 16 Apr 2010 07:00:12 -0400
Subject: [c6x] Re: edma $ mcbsp configuration and sequence problems

>
>
> Hello R. Williams
>
> first,thanks so much for answering.
>
> I made a mistake,the name of the demo is dsk_app,and it is under the root as follows(the board i work with is tms320c6416):
> (install dir)\CCStudio_v3.1\examples\dsk6416\bsl\dsk_app
> and when i'm working with it,it's works normally.in the demo project,only mcbsp2 is used,for both reception and transmission.
>
> in my own project,that's also what i want the board to do,i was just trying to use mcbsp0 only for transmission.
>
> there isn't any inevitable relationship between Mcbsp2 and Mcbsp0.
>
> and the halting problem:
> by "halting",i mean that when it is debugging mode(not release),the program stop execution just as what it does when manually choose debug-> halt.
> and I connect the target system all the time when debugging.
>
> the problem is that i can't figure out what makes the program halt,i use DSP/BIOS function such as message log to observe the condition,it seems that the program initialization is completed,but can't enter the HWI of edma.
>
> edma is used as linked mode,does this means what you refer to as "forever" loop?
>
> hello everyone!
> >
> > I'm now doing a project focus on transmission of data thru mcbsp that controlled by edma.the project is based on the 'app_dsk' demo.in the demo project,it uses mcbsp2 in both receiving and transmitting,in my project I just use mcbsp0 to transmit,no receiving,the data for transmission is prepared in the program.I just configure the registers of mcbsp0 and edma as required,mcbsp0 Xmt port is configured as output clk generated by internal clk.because i don't use mcbsp as input port,i remove the setting of input event and relevant definition in edma configuration.but when i'm running the program,it has the problems as follow:
> >
> > 1.it halts as soon as it begin to run,and i don't do anything to stop it,neither the program has any breakpoits or probe
> > 2.i observe the registers of mcbsp,and find that the SPCR remains zeros after all the initializtion,but i'm sure the program entered the intMcbsp() function,because i use &trace to print sth,and it show up in the message log.
> >
> >but when i re-move all the "Rcv-side" configuration of the edma back,the problems above would all disappear.
> >
> >so I just wonder:
> > 1.did the mcbsp & edma configuration has some sequence?
> > 2.if i only want to use the Xmt port of mcbsp,and controlled by edma,how should i start the first mcbsp Xmt_event interrupt to edma?
> >i guess maybe i didn't make the first interrupt,so it can't go ahead.
> >
> >could there be anyone to help me with my problems, appreciate your help so much
> > sincerely
> > cathy
> >
> >_____________________________________
> >
> >
------- End of Original Message -------
Hi,dear Williams:

you mentioned the stack corrupted question in reply, i think maybe it hit the point, i store two large size of arrays in the .h file, does this take a lot of space in the program storage and make the stack corrupt ? and how can i store the data into the data storage ?

the program now doesn't halt automatically again , but when halt manually,it stops and points at sth. like this in the
=>-------- -------- -- --------- ----------------
=>-------- -------- -- --------- ----------------
=>-------- -------- -- --------- ----------------
=>-------- -------- -- --------- ----------------
=>-------- -------- -- --------- ----------------
=>-------- -------- -- --------- ----------------
=>-------- -------- -- --------- ----------------
=>-------- -------- -- --------- ----------------
=>-------- -------- -- --------- ----------------
=>-------- -------- -- --------- ----------------
=>-------- -------- -- --------- ----------------

i think the program must run flying, maybe has sth to do with the stack corruption.

so,when there are large-size arrays for use in the program,how can i store them?

thanks so much
cathy

hello everyone!
>
> I'm now doing a project focus on transmission of data thru mcbsp that controlled by edma.the project is based on the 'app_dsk' demo.in the demo project,it uses mcbsp2 in both receiving and transmitting,in my project I just use mcbsp0 to transmit,no receiving,the data for transmission is prepared in the program.I just configure the registers of mcbsp0 and edma as required,mcbsp0 Xmt port is configured as output clk generated by internal clk.because i don't use mcbsp as input port,i remove the setting of input event and relevant definition in edma configuration.but when i'm running the program,it has the problems as follow:
>
> 1.it halts as soon as it begin to run,and i don't do anything to stop it,neither the program has any breakpoits or probe
> 2.i observe the registers of mcbsp,and find that the SPCR remains zeros after all the initializtion,but i'm sure the program entered the intMcbsp() function,because i use &trace to print sth,and it show up in the message log.
>
>but when i re-move all the "Rcv-side" configuration of the edma back,the problems above would all disappear.
>
>so I just wonder:
> 1.did the mcbsp & edma configuration has some sequence?
> 2.if i only want to use the Xmt port of mcbsp,and controlled by edma,how should i start the first mcbsp Xmt_event interrupt to edma?
>i guess maybe i didn't make the first interrupt,so it can't go ahead.
>
>could there be anyone to help me with my problems, appreciate your help so much
> sincerely
> cathy
>
>_____________________________________

_____________________________________
FX,

I'm not going to continue guessing, it is just wasting our time.

I do not recognize "sth"! What is it?

Your statements seem to indicate your not familiar with the default 'sections' of code
.text, .data, .bss, .const, nor with the .cmd file and how it is used.

Just post the code, those two .h files for which you have questions, and the .cmd file. in-line in a post.

Then we can proceed to assist you with the problems your having with your application.

Also, please do not clip prior parts of this thread when replying.

R. Williams

---------- Original Message -----------
From: f...@163.com
To: c...
Sent: Fri, 16 Apr 2010 23:37:01 -0400
Subject: [c6x] Re: edma $ mcbsp configuration and sequence problems

>
>
> Hi,dear Williams:
>
> you mentioned the stack corrupted question in reply, i think maybe it hit the point, i store two large size of arrays in the .h file, does this take a lot of space in the program storage and make the stack corrupt ? and how can i store the data into the data storage ?
>
> the program now doesn't halt automatically again , but when halt manually,it stops and points at sth. like this in the
> =>-------- -------- -- --------- ----------------
> =>-------- -------- -- --------- ----------------
> =>-------- -------- -- --------- ----------------
> =>-------- -------- -- --------- ----------------
> =>-------- -------- -- --------- ----------------
> =>-------- -------- -- --------- ----------------
> =>-------- -------- -- --------- ----------------
> =>-------- -------- -- --------- ----------------
> =>-------- -------- -- --------- ----------------
> =>-------- -------- -- --------- ----------------
> =>-------- -------- -- --------- ----------------
>
> i think the program must run flying, maybe has sth to do with the stack corruption.
>
> so,when there are large-size arrays for use in the program,how can i store them?
>
> thanks so much
> cathy
>
> hello everyone!
> >
> > I'm now doing a project focus on transmission of data thru mcbsp that controlled by edma.the project is based on the 'app_dsk' demo.in the demo project,it uses mcbsp2 in both receiving and transmitting,in my project I just use mcbsp0 to transmit,no receiving,the data for transmission is prepared in the program.I just configure the registers of mcbsp0 and edma as required,mcbsp0 Xmt port is configured as output clk generated by internal clk.because i don't use mcbsp as input port,i remove the setting of input event and relevant definition in edma configuration.but when i'm running the program,it has the problems as follow:
> >
> > 1.it halts as soon as it begin to run,and i don't do anything to stop it,neither the program has any breakpoits or probe
> > 2.i observe the registers of mcbsp,and find that the SPCR remains zeros after all the initializtion,but i'm sure the program entered the intMcbsp() function,because i use &trace to print sth,and it show up in the message log.
> >
> >but when i re-move all the "Rcv-side" configuration of the edma back,the problems above would all disappear.
> >
> >so I just wonder:
> > 1.did the mcbsp & edma configuration has some sequence?
> > 2.if i only want to use the Xmt port of mcbsp,and controlled by edma,how should i start the first mcbsp Xmt_event interrupt to edma?
> >i guess maybe i didn't make the first interrupt,so it can't go ahead.
> >
> >could there be anyone to help me with my problems, appreciate your help so much
> > sincerely
> > cathy
> >
Cathy,

I forgot to ask..
Are you using the DSK, with the AIC23 codex or some other system?

BTW:
I spotted the 'sth' in the configuration file you sent me, so we do not need to discuss that detail further.

There are several calls to LOG_printf() in the code you sent me.
I have a question: which of those calls are being invoked and how often?

R. Williams
--- In c..., fx-7413@... wrote:
>
> Hi,dear Williams:
>
> you mentioned the stack corrupted question in reply, i think maybe it hit the point, i store two large size of arrays in the .h file, does this take a lot of space in the program storage and make the stack corrupt ? and how can i store the data into the data storage ?
>
> the program now doesn't halt automatically again , but when halt manually,it stops and points at sth. like this in the
> =>-------- -------- -- --------- ----------------
> =>-------- -------- -- --------- ----------------
> =>-------- -------- -- --------- ----------------
> =>-------- -------- -- --------- ----------------
> =>-------- -------- -- --------- ----------------
> =>-------- -------- -- --------- ----------------
> =>-------- -------- -- --------- ----------------
> =>-------- -------- -- --------- ----------------
> =>-------- -------- -- --------- ----------------
> =>-------- -------- -- --------- ----------------
> =>-------- -------- -- --------- ----------------
>
> i think the program must run flying, maybe has sth to do with the stack corruption.
>
> so,when there are large-size arrays for use in the program,how can i store them?
>
> thanks so much
> cathy
>
> hello everyone!
> >
> > I'm now doing a project focus on transmission of data thru mcbsp that controlled by edma.the project is based on the 'app_dsk' demo.in the demo project,it uses mcbsp2 in both receiving and transmitting,in my project I just use mcbsp0 to transmit,no receiving,the data for transmission is prepared in the program.I just configure the registers of mcbsp0 and edma as required,mcbsp0 Xmt port is configured as output clk generated by internal clk.because i don't use mcbsp as input port,i remove the setting of input event and relevant definition in edma configuration.but when i'm running the program,it has the problems as follow:
> >
> > 1.it halts as soon as it begin to run,and i don't do anything to stop it,neither the program has any breakpoits or probe
> > 2.i observe the registers of mcbsp,and find that the SPCR remains zeros after all the initializtion,but i'm sure the program entered the intMcbsp() function,because i use &trace to print sth,and it show up in the message log.
> >
> >but when i re-move all the "Rcv-side" configuration of the edma back,the problems above would all disappear.
> >
> >so I just wonder:
> > 1.did the mcbsp & edma configuration has some sequence?
> > 2.if i only want to use the Xmt port of mcbsp,and controlled by edma,how should i start the first mcbsp Xmt_event interrupt to edma?
> >i guess maybe i didn't make the first interrupt,so it can't go ahead.
> >
> >could there be anyone to help me with my problems, appreciate your help so much
> > sincerely
> > cathy
> >
> >_____________________________________
>

_____________________________________
Cathy,

In looking at your code, there is an instruction to write a '0' to McBSP0.
I think a better way to trigger/initiate the output operation is to use the EDMA_setChannel() function with a parameter of the handle returned when the EDMA_open() function was called.

R. Williams
--- In c..., "rkwill98356" wrote:
>
> Cathy,
>
> I forgot to ask..
> Are you using the DSK, with the AIC23 codex or some other system?
>
> BTW:
> I spotted the 'sth' in the configuration file you sent me, so we do not need to discuss that detail further.
>
> There are several calls to LOG_printf() in the code you sent me.
> I have a question: which of those calls are being invoked and how often?
>
> R. Williams
> --- In c..., fx-7413@ wrote:
> >
> > Hi,dear Williams:
> >
> > you mentioned the stack corrupted question in reply, i think maybe it hit the point, i store two large size of arrays in the .h file, does this take a lot of space in the program storage and make the stack corrupt ? and how can i store the data into the data storage ?
> >
> > the program now doesn't halt automatically again , but when halt manually,it stops and points at sth. like this in the
> > =>-------- -------- -- --------- ----------------
> > =>-------- -------- -- --------- ----------------
> > =>-------- -------- -- --------- ----------------
> > =>-------- -------- -- --------- ----------------
> > =>-------- -------- -- --------- ----------------
> > =>-------- -------- -- --------- ----------------
> > =>-------- -------- -- --------- ----------------
> > =>-------- -------- -- --------- ----------------
> > =>-------- -------- -- --------- ----------------
> > =>-------- -------- -- --------- ----------------
> > =>-------- -------- -- --------- ----------------
> >
> > i think the program must run flying, maybe has sth to do with the stack corruption.
> >
> > so,when there are large-size arrays for use in the program,how can i store them?
> >
> > thanks so much
> > cathy
> >
> > hello everyone!
> > >
> > > I'm now doing a project focus on transmission of data thru mcbsp that controlled by edma.the project is based on the 'app_dsk' demo.in the demo project,it uses mcbsp2 in both receiving and transmitting,in my project I just use mcbsp0 to transmit,no receiving,the data for transmission is prepared in the program.I just configure the registers of mcbsp0 and edma as required,mcbsp0 Xmt port is configured as output clk generated by internal clk.because i don't use mcbsp as input port,i remove the setting of input event and relevant definition in edma configuration.but when i'm running the program,it has the problems as follow:
> > >
> > > 1.it halts as soon as it begin to run,and i don't do anything to stop it,neither the program has any breakpoits or probe
> > > 2.i observe the registers of mcbsp,and find that the SPCR remains zeros after all the initializtion,but i'm sure the program entered the intMcbsp() function,because i use &trace to print sth,and it show up in the message log.
> > >
> > >but when i re-move all the "Rcv-side" configuration of the edma back,the problems above would all disappear.
> > >
> > >so I just wonder:
> > > 1.did the mcbsp & edma configuration has some sequence?
> > > 2.if i only want to use the Xmt port of mcbsp,and controlled by edma,how should i start the first mcbsp Xmt_event interrupt to edma?
> > >i guess maybe i didn't make the first interrupt,so it can't go ahead.
> > >
> > >could there be anyone to help me with my problems, appreciate your help so much
> > > sincerely
> > > cathy
> > >
> > >_____________________________________
>

_____________________________________