Hi Marc,
Following are some of the common scenarios where a core hang can occur.
i. Core hang could occur when the code tries to read the inactive buffer(a receive/tranmit buffer) of a sport configured as transmitter/receivef.
ii. If the BHD(buffer hang disable) of certain peripherals such as SPORT, IDP,TWI is cleared core hang occurs when the code tries to read from an empty buffer or write to a full buffer. you could avoid core hang by setting the BHD bit of the peripheral is set.
Thanks,
Divya
Hi Divya,
thank you for your fast answer. I have solved the Problem today by commenting different parts of my code, but I do not understand the solution.
Here is the piece of code which causes the error:
lcntr=r5, do zero until lce; /* initialize delay line to zero */
zero: dm(i0,m1)=0;
rts;
nop;
nop;
When I comment "rts;" the error no longer occurs. Perhaps you are able to explain this to me.
Regards,
Marc
Hi Marc,
The code snippet that you sent is fine as it is. Since you are having issues with the RTS I would suggest you to check the PCSTK value just before RTS. From what you describe it looks like the PCSTK is corrupted. Checking the PCSTK value would let you know if the PCSTK is loaded with the corresponding call location or is corrupted. Also could you please tell me what processor you are running the code in.
Thanks,
Divya
Hi Divya,
I'm working with the ADSP 21469.
Yesterday I had a further problem with "rts", in this case with "rts(db)". Perhaps you can explain to me how "rts" works or give me a hint where I can find a good explanation. I searched for it, but I did not find anything useable.
I think my knowledge about working with loops is not large enough at the moment to understand the whole problem.
Thanks,
Marc
Hi Mark,
Usually a Call to a subroutine is matched with the RTS or RTS(DB) instruction in the subroutine. The CALL instruction pushes the return address on the PC STACK which is the next instruction address after the call instruction. The RTS instruction causes the sequences to fetch the return address at the top of PCSTACK and pops the PCSTACK address at the top.
The difference between RTS and RTS(DB) is that RTS (DB) instruction extecutes the next two instructions after the RTS before returning to the return address instruction.
You can find this information in the programming reference manaul available online at the following link . please refer to page 4-20 of the manual.
http://www.analog.com/static/imported-files/processor_manuals/ADSP_2136x_PGR_rev2-0.pdf
If you still have issues could you please send your code so that we could have a look here.
Thanks,
Divya