cancel
Showing results for 
Search instead for 
Did you mean: 

FCCU configuration

stefanodimascio9
Associate II
Posted on November 14, 2015 at 15:56

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 #spc56
This discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
25 REPLIES 25
Erwan YVIN
ST Employee
Posted on November 24, 2015 at 16:22

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
stefanodimascio9
Associate II
Posted on November 25, 2015 at 15:18

Thanks a lot, now it works.

Best regards

simone
Associate II
Posted on February 02, 2016 at 14:04

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=false
simone
Associate II
Posted on February 02, 2016 at 15:34

I think the problem in my case is the use of componentsInit()

Erwan YVIN
ST Employee
Posted on February 02, 2016 at 16:43

Hello Simon ,

Did you try the patch that i have provided (above) ?

(configuration.xml)

     Best regards

                Erwan

simone
Associate II
Posted on February 02, 2016 at 18:11

Yes, but it doesn't work if I add the components initialization function. Without is fine.

simone
Associate II
Posted on February 03, 2016 at 16:01

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=false
stefanodimascio9
Associate II
Posted on February 04, 2016 at 11:03

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=false

main.c : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hzg5&d=%2Fa%2F0X0000000ba8%2FBv0MxD5bNEFGa0ljoFr5ibJsLZtPXRUBC.XhVFLZbZY&asPdf=false
stefanodimascio9
Associate II
Posted on February 08, 2016 at 14:21

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.

Erwan YVIN
ST Employee
Posted on February 09, 2016 at 11:07

Hello Stefano ,

you can find the MSC linked to the Serial port.

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