Having a weird problem here.
My program on ADSP-21489 (custom board) runs perfectly fine when uploaded to the DSP from CCES. However, when I boot it, all the program code is nicely put in place, and the program starts running. But the SPORT0 doesn't generate any interrupts.
So, I guess there's some interrupt-related register that's being initialised when uploading the DSP from CCES, but which isn't initialised when booting.
And now it becomes real weird: when I check the contents of the processor memory, using a Debug Configuration in CCES that doesn't upload any code, i can inspect the code that has been installed during the boot process. All that looks perfectly fine. And then after inspecting, everything suddenly starts making sound, the SPORT now starts generating interrupts. So maybe, running an 'inspection-only' Debug Configuration also initialises some registers?
I have been checking and initialising any related register I can see: IRPTL/IMASK, LIRPTL, PICR0-3, the global interrupt switch in MODE1, and I cleaned any errors writing 1's to SPERRCTL0.
Do you have any clue where I could be looking further?
A little more information:
- custom board using ADSP-21489.
- Slave booted with a PIC18 MCU as master.
- Audio output only, using CS4385 DAC.
- After bootup the program is working fine, I can also see that because the clock signals to the DAC show up on the oscilloscope, next to inspecting the Program Memory with a inspect-only Debug Configuration
- I implemented a flag in the audio interrupt service routine: it is actually never called, not a single time...
I'm closing in on the problem.... !
It took me some time to realise this, but every time I run the 'inspection-only' Debug Configuration, the program is at exactly the same address 0x08C526. The console states: 'ERROR: Target halted due to software breakpoint but no breakpoint found at address: 0x08c526'. So I guess the program is loaded correctly, and starts running, but is halted before it can even respond to it's first interrupt. So the problem doesn't have anything to do with interrupt configurations, Sport settings, etc...
However, the instructions at this adress 0x8C526, and a few adresses around seem correct as they should be. I've been checking everywhere for forgotten breakpoints, but I can't seem to find anything.
Is it possible that some kind of breakpoint gets stuck somewhere in the processor, while you can't find it back anywhere... ?
Oops, forget my previous post! The program actually passes many times this 'breakpoint' without stopping. The problem is the fact that the SPORT doesn't generate any interrupts, as I wrote in my first post above!
FYI: this 'breakpoint' was in the main loop. I added a few instructions that put a counter in memory counting how many times the main loop was executed. It's actually executed several thousands of times without stopping, or getting any interrupt.
Why it always breaks at the same spot when I start the 'inspection' Debug Config isn't clear, but it's also not important.
FYI2: I'm working in full assembler only, not using any libraries etc... So probably it's some very basic initialisation I never did.... Is there some documentation on how to put the processor in a know init state after booting?
And moving on: I made a version without interrupts, just polling the right flag in the LIRPTL register. It works! It's just not stable enough (crackles of missed audio samples from time to time => it should be done with interrupts).
But that means that everything works: the slave boot procedure, the Precision Clock Generators, The Sports, ... That's not the problem. It just doesn't want to generate interrupts.... :-/
Hi Marcel, Can you share your code snippet, it will helpful for us to assist you better on this.Please use "adi_int_InstallHandler" to replace "interrupt" function.Ex:adi_int_InstallHandler(ADI_CID_P3I,(ADI_INT_HANDLER_PTR)SPORT1_isr,0,1); Regards,Anand Selvaraj.