Hi,
I'm using Prosessor Expert for the programmation of the K60D100M tower.
I've added a Timer Unit, and i want to use the GetPeriodTicks function but at the end of that function, after the return,
the programm stuck in the hard fault.
I had a look to the HSFR Register but the of VECTTBL and FORCED bit have value 0
The timers works well, and i can even chanche the frequency by using the SetPeriodTicks function, but when i try to get the
value of tick per period i get stuck in the PE_ISR(Cpu_ivINT_Hard_Fault).
Any advice?
zeno
You might add a special Processor Expert component which helps debugging hard faults:
A Processor Expert Component to Help with Hard Faults | MCU on Eclipse
Beside of that: which timer did you use? You might get a hardfault if you are using a realtime clock timer source and you have it not clocked (no battery attached).
I'm using a TimerUnit_LDD not the RTC_LDD, i'll have a look to the component!
thank you Erich
Hello,
could you please post here some simple project in order to reproduce it on our side? generally such behavior should not occur in case of using LDD components.
Best regards
Vojtech Filip
Processor Expert Support Team
Here's a piece of program that is already enough for get the hadr fault, this program will never reach
the "fcounter=1/TU1_GetInputFrequency(TimerData)*(uint32_t)Period;" command
LDD_TError Error;
LDD_TDeviceData* DACData;
LDD_TDeviceData* TimerData;
LDD_TDeviceData* Led1Data;
TU1_TValueType* Period;
int main(void)
{
PE_low_level_init();
Led1Data = GPIO1_Init(NULL);
DACData = DA1_Init(NULL);
TimerData = TU1_Init(NULL);
Error=TU1_GetPeriodTicks(TimerData,Period);
fcounter=1/TU1_GetInputFrequency(TimerData)*(uint32_t)Period;
#ifdef PEX_RTOS_START
PEX_RTOS_START();
#endif
}
Founded out !
doing like that the pointer 'Period' wasent inizialised,
I've added an ' TU1_TValueType Period ' and chanched the old in ' TU1_TValueType* Periodptr ',
and than just: Periodptr=&Period;
I dont know if its the best way, but it works.