Could you help to provide an example of 5744P watchdog function? I have tried for days but never create the reset...
Both Greenhills and S32DS are fine.
Appreciate your support!
I have uploaded 2 examples how to trigger reset with SWT on MPC5744P.
Have in mind that on MPC5744P SWT is not directly wired to RGM (reset generation module) as it was on MPC56xx devices.
SWT is wired to FCCU module which is connected to RGM. In FCCU there is default reaction on SWT timeout no reaction.
Follow my examples to see how to configured correctly FCCU in order to get reset from SWT.
Example MPC5744P SWT Short reset GHS614
Example MPC5744P SWT Long reset GHS614
The example works on my side. Thank you very much!
I used your example,It always stay in this line of code from function FCCU_Init（）:
while (FCCU.CTRL.B.OPS != 0x3)
It can't enter config mode. I use Trace32 and lauterbach.
1. Do not step in debugger while in FCCU config mode. It has internal watchdog which will abort mode change operation and you will never get into any mode than normal.
2. Make sure your faults are all cleared before entering FCCU config mode.
For more details read FCCU chapter in reference manual or my application notes dealing with how to configure FCCU which are on our web site.
I don't step in debugger according to your answer,and I called the function FCCU_clear_faults() at the start of main function,but it return 1 of ret_val that shows it can't cleared all FCCU errors. So it still can't enter config state. I don't know the reason or there are other errors in my codes?The following codes are three functions of FCCU.
As I already explained.
No fault must be latched in FCCU_NCFSn registers in order to successfully execute FCCU state change.
There is no other issue.
Load my example and test it.
Example MPC5744P FCCU fault injection GHS614
One question appended.
In the reference manual there are 5 NCFS_CFG registers, so in header file there are NCFS_CFG[0~4] declared accordingly.
And every FCCU channel should be configured with two bits, in other words every NCFS_CFG[x] register should be mapped to 16 channels.
However in your demo code, NCFS_CFG.B.NCFSC14 is used to setup SWT reset, where SWT should be channel 14.
So how to link an FCCU channel with its NCFS_CFG bit?
Could you provide some more examples to show this?
Appreciate your help!
This is quite simple.
Open header file and check how FCCU_NCFS_CFG structure is defined.
You will instantly see that there are 2 bits assigned to each NCFSCxx.
I added the following code to your project's startup file(crt0.ppc), it work well and the result without debug tool is that the mcu is reset periodically.But it can’t reset without the part code.In your project,there is not the part code,so it can't work when I use your demo project directly. I would like to know whether there is any risk if I add the part code.I use ghs and trace32.
;#SWT0 e_lis r4, 0xFC05 e_or2i r4, 0x0000
e_li r3, 0xC520 e_stw r3, 0x10(r4)
e_li r3, 0xD928 e_stw r3, 0x10(r4)
e_lis r3, 0xFF00 e_or2i r3, 0x010A e_stw r3, 0(r4)
#if defined(__ghs_asm) .need exit
I have enabled SWT by default in this example.
Just run it and check the Reset source. It will be FCCU soft reset.
And in FCCU you will see NCF14 -> SWT.
飞思卡尔有几版CPU 本身就有问题，上电自检就会出错，直接导致FCCU进入Fault 模式， 所以你根本配置不了。
MPC5744P 这款MCU ，的前几个型号是有问题的， 飞思卡尔不厚道，一直在市场上卖不回收，无法做安全功能。 我不知道你用的是那一版MPC5744P。 但你最好查一下你那一版的勘误表。 如果对应的FCCU 错误过多。还是换最新的MCU吧。 还有就是给你一个招，把MCU的startup -self test 给禁止掉。 就会少报很多错到FCCU。 而且上电自检的不一定稳定，还覆盖率低。
Retrieving data ...