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-17 02:06 AM
2015-11-17 02:37 AM
Hello Stephano ,
could you try this application note ? it should help you http://www.st.com/web/en/resource/technical/document/application_note/DM00057153.pdf Best regards Erwan2015-11-17 02:43 AM
Hello Stephano ,
in the application note : the CFG Timout is increasing into ~8msFCCU.CFG_TO.R = 0x7;
/* Set Timer Out CCONFIG STATE to 8.192 ms */
Could you try this ??
BR
Erwan
2015-11-17 03:23 AM
Yes, i'm already using it and it's very useful.
I think I partially solved my problems (please correct me if I'm wrong): I assumed that debugger would stop timeouts too, but if I execute the code step by step I will get the error. Executing all instructions without breaks in between seems to work with correct configuration.I've another side issue that I'm trying to solve, I'll ask you later if i will not be able to solve that.Thanks for the help and for the prompt reply.2015-11-17 05:16 AM
#define CTRLK_OP1 0x913756AF
#define CTRLK_OP2 0x825A132B //keys needed for operation
#define CTRL_OPR1 1
#define CTRL_OPS3 3
#define CTRL_OPS15 15
uint32_t FCCU_CONFIG_STATE(
void
){
/* 01111 Clear the operation status (OPS = Idle, NVML = 0) [OP15]. */
FCCU.CTRL.R = CTRL_OPR15;
/* ----------------- 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;
}
Best Regards
Erwan
2015-11-17 05:42 AM
Thanks for the suggestions, but behaviour keeps the same as I described even using the suggested improvements.
2015-11-18 02:05 AM
The other problem that is troubling me a lot is that, even following indications about ''FCCU critical fault injection (no NMI assertion)'' in the application note, the system does not successfully recover. After the injection there is a reset and a successful assertion of SAFE state in ME_GS, but then MCU hangs during the following while in osal.c
#if !defined(__DOXYGEN__)__attribute__((weak, noreturn))#endifvoid osalSysHalt(const char *reason) { osalIsrDisable(); osal_halt_msg = reason; while (1); }with the reason 0x1F50 -> ''clock failure''.I have done several tries but I can't fix it and I have basically no documentation about that.Thanks in advance for the help.2015-11-24 02:40 AM
Hello Stefano ,
i confirm that using the debugger (step by step) during the FCCU configuration is goint to generate OPS Aborted. About your issue , could you send me your stack function and your code example (SPC5Studio Example) ? Best Regards Erwan2015-11-24 04:29 AM
Thanks, your confirmation really helps me to gain confidence with the device.
I attached the code I'm using and the call stack when the hang occurs (please warn me if this is not what you asked for, I'm not sure) Thanks again for the help. ________________ Attachments : main.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0J2&d=%2Fa%2F0X0000000baB%2FCbM1Hc51zKNrwoMWG2oBaVAOtRKroIB9FD218ZGfHvo&asPdf=falsescreen.png : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0Xq&d=%2Fa%2F0X0000000baD%2FZbCLQuewBPbIgP7i0mIc5O7SCGBlBwOEj.cJVh4c6T4&asPdf=false