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 #spc562016-02-09 02:45 AM
Before the exception, in sdStart(), ME_PCTL48 (LINFLEX0) is anyway set to 0x11.
But linflexp->LINCR1.R = 1; /* INIT bit. */0x00001FCE: 48 10 SE_LI R0,0x10x00001FD0: B1 0F SE_STH R0,0x2(R31)still causes the exception after the reset.2016-02-09 08:07 AM
2016-02-09 09:24 AM
I don't understand. The device enters RUN0 with hal_lld_init() in both cases.
2016-02-10 02:05 AM
The only difference I've found is that in sdStart()
ME.PCTL[n].R = pctl;0x00001B68: 70 18 E3 FD E_LIS R0,0xC3FD0x00001B6C: 18 06 D1 C0 E_ORI R6,R0,0xC0000x00001B70: C7 01 SE_LWZ R0,0x1C(R1)0x00001B72: 74 07 06 3F E_RLWINM R7,R0,0x0,0x18,0x1F0x00001B76: C6 01 SE_LWZ R0,0x18(R1)0x00001B78: 04 60 SE_ADD R0,R60x00001B7A: 18 00 80 C0 E_ADDI R0,R0,0xC00x00001B7E: 01 06 SE_MR R6,R00x00001B80: 90 76 SE_STB R7,0x0(R6)in the first case sets 0x11 in ME_PCTL48 and then the debugger shows the content of LINFLEX0, while in the second case 0x11 is asserted and the debugger still shows unknown content, as if LINFLEX is not clocked anyway or something. I think I'm not configuring in the right way some other register i need to, but I can't find which ones.2016-02-10 02:28 AM
for
the Pre-Clock Initialization Code
if
(ME.GS.B.S_CURRENT_MODE != 2) {
Post-Clock Initialization Code :
{
2) Add this following code in hal_lld.c, main.c (it is just for test) (cf attachment) it is working in my side.. you have to force the transition SAFE ==> DRUN ==> RUN0 Best regards Erwan
________________
Attachments : hal_lld.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0JC&d=%2Fa%2F0X0000000ba6%2FtfRwcDJRNUSmrPEmtHomRpAembLSXP3K1TGbqqu4V6s&asPdf=falsemain.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0Tu&d=%2Fa%2F0X0000000ba7%2FgNPMc0AdllYARMyC0vhNoVOSr3gZv1ps4kH2mIM5Djk&asPdf=false
2016-02-26 12:39 AM
Yes, now it works perfectly.
Thank you very much.