2015-11-14 06:56 AM
Hello everybody,
I'm using the SPC56EL70L5.Trying to configure the FCCU, I coded:&sharpdefine CTRLK_OP1 0x913756AF &sharpdefine CTRLK_OP2 0x825A132B //keys needed for operation&sharpdefine CTRL_OPR1 1 &sharpdefine CTRL_OPS3 3 uint32_t FCCU_CONFIG_STATE(void){ /* ----------------- CONFIG State --------------------- */ FCCU.CTRLK.R = CTRLK_OP1; /* Key for the operation OP1 */ FCCU.CTRL.R = CTRL_OPR1; /* Set the FCCU into the CONFIG state [OP1] */ while(FCCU.CTRL.B.OPS != CTRL_OPS3); /* wait for the completion of the operation */ return 1;}But condition is never verified: FCCU.CTRL.OPS is 0x02 (that means operation is aborted) and MCU hangs in the while.Where is the mistake?Thanks in advance for the help. #leopard #fccu #spc562015-11-24 07:22 AM
Hello Stephano ,
the assert happenned because of in spc_clock_init() in SAFE Mode the DRUN State is waited. /* The system must be in DRUN mode on entry, if this is not the case then it is considered a serious anomaly.*/if
(ME.GS.B.S_CURRENT_MODE != SPC5_RUNMODE_DRUN) {
SPC5_CLOCK_FAILURE_HOOK();
}
according to the figure 305, it is not needed to reinitialize again the clock it is not a destructive reset. in the configuration.xml , you should add : (Cf Screenshot) for the Pre-Clock Initialization Code if (ME.GS.B.S_CURRENT_MODE != 2) { Post-Clock Initialization Code : { with this patch, i think that your test is PASSED ;) Best regards Erwan
________________
Attachments : 2015-11-24_160925.png : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0Xg&d=%2Fa%2F0X0000000baE%2FbOJkN70eJVdNIcviTP0lJ7gf2M4bTv6Oi5Zr19ndJpQ&asPdf=false
2015-11-25 06:18 AM
Thanks a lot, now it works.
Best regards2016-02-02 05:04 AM
I'm trying to do the same, together with the sample of gpios and UART (see attached file). I get
0x027F0 -> ''clock failure''
, even if I added the pre and post lines. Thank you. ________________ Attachments : main.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0Xb&d=%2Fa%2F0X0000000baC%2FyodoxKwCdpe1olPLqBLXb_THDIul1sUQFhU3oIe9Od4&asPdf=false2016-02-02 06:34 AM
I think the problem in my case is the use of componentsInit()
2016-02-02 07:43 AM
Hello Simon ,
Did you try the patch that i have provided (above) ?(configuration.xml) Best regards Erwan2016-02-02 09:11 AM
Yes, but it doesn't work if I add the components initialization function. Without is fine.
2016-02-03 07:01 AM
I attached the call stack. Thank you.
________________ Attachments : failurestack.bmp : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0XW&d=%2Fa%2F0X0000000ba9%2FS8bE3yowKV75VTb17byj4YtdpnsX12p77atM2MDCdlA&asPdf=false2016-02-04 02:03 AM
Simon,
I tried to fix the problem, as I'm working on this architecture too. Apparently clock can be reinizializated only in DRUN mode. So you have to put componentsInit() after the cleaning of FCCU and the transition from safe to DRUN. I attached some code that successfully inject the fault but it hangs during the transition from SAFE to DRUN and it is reset from software watchdog. I don't know what's the problem there, maybe Wan35fr could be more useful. ________________ Attachments : fccu.h : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0WU&d=%2Fa%2F0X0000000baA%2Fcrbqh9IDE6mclmUYbC_hjljaLX3ji__C1ZH1ujDeZC8&asPdf=falsemain.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hzg5&d=%2Fa%2F0X0000000ba8%2FBv0MxD5bNEFGa0ljoFr5ibJsLZtPXRUBC.XhVFLZbZY&asPdf=false2016-02-08 05:21 AM
The other thing that troubles me in this case is the use of sdStart(): on the first run it works but after the reset it causes the microcontroller to have an unhandled exception, even if needed because the serial is in STOP state. I can't understand the reason.
2016-02-09 02:07 AM
http://chibios.sourceforge.net/docs3/hal/group___s_e_r_i_a_l.html
Could you check if your PCTL (LINFLEX0) is still set ?maybe , you are accessing to the address.you have to reenable associated PCTL. Best regards Erwan