This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

code works on stepping but goes to interrupt when run

Hi,

Iam working on a luminary micro based cortex M3 processor. Iam not using any RTOS. Iam trying to use system timer tick (luminary software based) packet transmitter code.

The code works on stepping using debugger but goes to interrupt when run (which is just going to the same place). Because of this i couldnt test my code at all.

Please help me understand why this problem is happening and how to solve it.

Thanks,
vivek

Parents Reply Children
  • i tried to enable the interrupts after calling the third party TCP stack routine.

    even when the interrupts were not enabled, when i run the code again, i found the program counter pointing to the default interrupt handler.

    The third party stack didnt have many initialization to do, i just have to pass, IP address, subnet mask and default gateway.

  • Note that the ARM doesn't just have normal interrupts. It can also produce an exception for an invalid instruction (for example as result of a stack over/underflow), unaligned data access, access to protected memory, ...

  • Which is precisely why You need to determine which interrupt is actually occurring!

  • Hi,

    I am also facing the INTDEFAULTHANDLER problem while dealing with LM3S6911.
    While I started debugging my code in single steps, my program didn't go into the Interrupt default handler routine or in other words my program not stuck any where but whenever I had tried to run the program it went into Interrupt default handler (went to halt state as it enters into an infinite loop). I had done many combination to over come and to find out the problem but from where this external or internal interrupt is being created, not able to find as yet. I had also checked my code with different delay duration but all in vain.

    So any one give a proper suggestion to deal with this scenario or to over come the fault.

  • The proper suggestion is (again): You need to determine which interrupt is actually occurring!

    Once you know which interrupt is actually occurring, then you can start thinking about how to determine what causes that interrupt to occur.

    Once you know what causes that interrupt to occur, then you can start thinking about how to stop it occurring!

  • HI,

    Which start up file are you using? There are many interrupts which are not handled (no routines declared). In such a case the code flows to default interrupt. The PC will definitely go into defsult handler if you get some interrupt routine which is unhandled. Systick interrupt was the one which gave me trouble. check for the interrupt status registers to find out which interrupt has occurred.
    You might not be expecting the interrupt. You can try putting zero instead of a routine name(this might not be a good solution, but good for a trial) or declare a routine.

  • hi Vivek

    Would u give me your contact details so that we may be in touch to solve our problem regarding Luminary. By the way which controller you are using now?

  • how do you solve the problem?
    My include headers are

    #include <stdio.h>
    #include <string.h>
    #include <math.h>
    #include <malloc.h>
    #include <stdlib.h>
    #include <time.h>

    #include "limits.h"
    #include "driverlib/loc_time.h"

    #include "inc/hw_ints.h"
    #include "inc/hw_memmap.h"
    #include "inc/hw_nvic.h"
    #include "inc/hw_types.h"
    #include "driverlib/ethernet.h"
    #include "driverlib/flash.h"
    #include "driverlib/gpio.h"
    #include "driverlib/uart.h"
    #include "driverlib/interrupt.h"
    #include "driverlib/sysctl.h"
    #include "driverlib/systick.h"
    #include "utils/lwiplib.h"
    #include "utils/uartstdio.h"
    #include "utils/ustdlib.h"

  • What is the code of SysTickIntEnable(); function?
    When ever I just disable the SysTickIntEnable(); my program comes out from the Interrupt Default Handler but I couldn't able to get the proper result from my program. Despite providing the delays LCD display scrolls randomly. Is there any other thing to be added with or need to modify? Suggest me please.

  • Hi,
    You must have some *.s file (say startup_lm3s.s). You could modify the start up file similar to this.

    EXTERN Systick_handler
    ...
    ...
    ...

    DCD <some_handler1>
    DCD <some_handler2>
    DCD Systick_handler

    and you can declare Systick_handler in some other file.

    void Systick_handler (void){
    <dummy function>
    }

  • sysTick is a periodic interrupt generated using a peripheral timer.

    replace IntDefaultHandler to Systick_handler or any other handler in appropriate place.

    If it is not directed to default handler and you handle it yourself, then you avoid this problem.

    Hope this helps.

    Best Regards,
    -vivek

  • I am also have the problem with SysTickIntEnable();
    When I disable this function I am able to run my program but it gives a continuous scrolling display (I am using LCD display) despite providing delays.
    To handle SysTickIntEnable(); properly what should I do? When I am doing any changes in IntDefaulHandler it gives me error in compilation time.