This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

HardFault_Handler problem in Tiva C series

Hi,

    I am using TM4C123GXL and Keil IDE to generate 8 PWM signals.I had initialized eight timer based PWM's and my aim is to vary the duty cycle as per my input on every 1us. There is no errors occurred during the compilation and building. But when I tried to run this in the hardware the program is going to an endless loop called hardfault handler and waits at the instruction B and also I can't able to step this instruction

HardFault_Handler\
                PROC
                EXPORT  HardFault_Handler         [WEAK]
                B       .
                ENDP 

I am attaching my rar file with this. Actually my project is little bit in complete because I had trying to vary the duty cycle for only one signal even though I want 8 PWM's.What I am done here is to just check the first condition and failed to execute want solution.

Timer0APWM_4F120.rar
  • Hello Nithin,

    Did you check the cause of the Fault by reading the register FAULTSTAT and FAULTADDR at locations 0xE000ED28 and 0xE000ED38.

    Also I noticed that the code you have has 8 integer arrays of ~15905 entrues. This will amount to huge amount of SRAM being used. No wonder it may cause Stack corruption of it turns out to be anything other than a Peripheral Access Fault.

    Regards

    Amit

  • Hello Amit,

     Thanks for your comments. I had reduced the array size and code worked successfully. I want to generate 8 PWM signals. Is there any idea to store the variables other than stack.Also I want to know whether the variables can be stored in the heap memory instead of stack.

  • Hello Nithin,

    Instead of storing in in arrays, why don't you compute the same on the fly and then use it with the interrupt from timer to send the value?

    Regards

    Amit

  • Hello Amit,

                 I had successfully generated 8 PWM's on my hardware and varied the duty cycle on every 1us. But still I can't able to view this signal in the logic analyzer of Keil MDK. In the setup option of the logic analyzer I put the signal name as portb.6 for one pwm signal like wise other signal also.But can't able to view the signals. I just want to know is there any particular command  for viewing the pwm signals in the logic analyzer

  • Hello Nithin,

    I haven't used the LA on Keil MDK. Can you see the same on a scope?

    I would need to relook at the Source code to see if the GPIO and PWM is configured correctly for output on the Pins.

    Regards

    Amit