Project

General

Profile

DSP software sometimes does not start

Added by Steven Hill almost 11 years ago

I have a strange problem with starting up some software on bootup. I have followed the instructions in this link:
[[http://support.criticallink.com/redmine/projects/arm9-platforms/wiki/ARM_Software_FAQs]]

with a line that looks like: "ARMApp DSPApp.out > logfile.txt" in my script.

Here is the startup code in ARMApp:

int main(int argc, char* argv[])
{
    struct timespec start, stop;
    float gainDB;

    initDone = false;
    gainDB = STARTING_GAIN;
    setvbuf(stdout, NULL, _IONBF, 0);

    tcDspApp*         lpDspApp = NULL;
    char            startMessage[] = "Hello DSP";
    char            loadMessage[] = "FPGA_loaded";

    if (argc < 2)
    {
        printf("usage: DopplerARM dsp_image.out\n");
        return -1;
    }
    lpDspApp = new tcDspApp();
#ifdef MYDEBUG
    printf("Loading file %s\n", argv[1]);
#endif
    lpDspApp->LoadApp(argv[1]);

#ifdef MYDEBUG
    printf("Starting application.\n");
#endif


If the debug comments are enabled, on a successful startup we see:

Loading file DSPApp.out
PROC Load successful
Starting application.

This happens sometimes, and the application runs with no problems. But often the only thing that is seen in the output is:

Loading file DSPApp.out
PROC Load successful

and the app does not continue to run - I don't really know what it is doing because if I kill the process I don't get the usual dump of information that occurs when this happens and if I do a "poweroff" I get messages saying that user file system can't be unmounted because it is busy. It's like after the ARM has loaded the DSP code (successfully apparently) something happens to it during that load, because it does not get to the next printf after the loadApp(), but the code is still running somehow.

If I try to duplicate the situation while connected to the DSP through the emulator, it cannot connect to the DSP - seems to indicate that it is in reset.

Obviously this is a pretty serious situation - the app should start every time the system is powered up, but only starts up every two or three power-ups.
What could be causing this, and how can I fix it?


Replies (2)

RE: DSP software sometimes does not start - Added by Michael Williamson almost 11 years ago

I suspect that you may have a race condition between the ARM and the DSP setting up inbound and outbound message Qs.

The inbound message queues create local message q structures. The outbound message queues attempt to continuously attach to the remote side inbound q.s Normally you should create all of your inbound Q's first. We have seen deadlocks where both the ARM app and the DSP app come up and try to initialize their outbound q's prior to creating all their inbound queues and you can get into a race condition. Beyond that, we would need to reproduce your problem here to help further troubleshoot.

-Mike

RE: DSP software sometimes does not start - Added by Steven Hill almost 11 years ago

Thanks for the reply Mike - I took a look at my code and the Debug outbound is created before the inbound in the DSP software. In any case, the problem "went away" - after a couple of glitches after first loading the software in the /mnt/user_nand directory, it seems to start up reliably every time. If I had to do this again, I don't think I would use Linux for the ARM system - DSP/BIOS would have been a lot simpler, at least for my application.

    (1-2/2)
    Go to top
    Add picture from clipboard (Maximum size: 1 GB)