Watchdog - TC 397 (automatic password sequencing)

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
_L_J_
Level 3
Level 3
First solution authored 25 sign-ins First like received

can anyone let me know how to enable and implent Automatic password sequencing  where it follows a pseudo- random sequence based upon a 14- bit fibonacci LFSR .

0 Likes
1 Solution
Meet_T
Moderator
Moderator
Moderator
25 likes received 50 solutions authored 100 replies posted

Hi @_L_J_ ,

It seems that there was some issue with the password that I provided earlier and that's why it was resetting after few services. But there is IfxScuWdt_calculateLfsr(uint16 pwd) already available to calculate the LFSR. If you use that for calculating the new password then the issue will be resolved. You can verify the same at your end.

Best Regards,
Meet.

View solution in original post

8 Replies
Meet_T
Moderator
Moderator
Moderator
25 likes received 50 solutions authored 100 replies posted

Hi,

For enabling the automatic password sequencing you can write 1 to bit PAR of WDTCPUyCON1 (or WDTSCON1 for safety watchdog) Register. For example if you want to enable automatic password sequencing for CPU0 the you can do it like this:

IfxScuWdt_clearCpuEndinit(IfxScuWdt_getCpuWatchdogPassword());
WDTCPU0CON1.PAR =1;
IfxScuWdt_setCpuEndinit(IfxScuWdt_getCpuWatchdogPassword());

After enabling this feature the password changes automatically after each password check and follows a pseudorandom sequence based upon a 14-bit Fibonacci LFSR with characteristic polynomial x14+x13+x12+x2+1 as you said. So each time you have to calculate the new password based on this sequence.

Best Regards,
Meet.

0 Likes
_L_J_
Level 3
Level 3
First solution authored 25 sign-ins First like received

Screenshot (85).png

 I have calculated this way but it is not working , micro gets reset.

Iam changing the reload value ,there In password access it gets reset.

0 Likes
Meet_T
Moderator
Moderator
Moderator
25 likes received 50 solutions authored 100 replies posted

Hi,

 

This polynomial assumes little-endianness meaning that it is derived based on number from right to left. You can calculate it as shown below then it should work:

 

bit =(((lfsr >> 0) ^ (lfsr >> 1) ^ (lfsr >> 2) ^ (lfsr >> 12))  & 0x8000u);
lfsr = (lfsr << 1) | (bit >> 13);

 

Best Regards,

Meet.

0 Likes
_L_J_
Level 3
Level 3
First solution authored 25 sign-ins First like received

This works fine but after 4 service in while (1) loop again micro is getting reset.

what issue is this ?is this due to password 

0 Likes
_L_J_
Level 3
Level 3
First solution authored 25 sign-ins First like received

thank you it is working

0 Likes
_L_J_
Level 3
Level 3
First solution authored 25 sign-ins First like received

Screenshot (86).png

 This is my code for password generation, it generates 5 password and repeats the same.  

0 Likes
Meet_T
Moderator
Moderator
Moderator
25 likes received 50 solutions authored 100 replies posted

Hi @_L_J_ ,

It seems that there was some issue with the password that I provided earlier and that's why it was resetting after few services. But there is IfxScuWdt_calculateLfsr(uint16 pwd) already available to calculate the LFSR. If you use that for calculating the new password then the issue will be resolved. You can verify the same at your end.

Best Regards,
Meet.

_L_J_
Level 3
Level 3
First solution authored 25 sign-ins First like received

Thanks @Meet_T , It is working