S32K3 Clock init too long time

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K3 Clock init too long time

Jump to solution
2,169 Views
simonliu
Contributor III

单独App测试,或单独Boot测试时钟初始化时间也不长,但是在Boot跳转App后,App时钟初始化时间就比较久。

系统流程如下:

     MCU上电,进boot,然后配置时钟,检查App程序完整性,然后程序无问题,看门狗复位。复位后,Boot里面检测到标志位后,不初始化时钟,直接跳转App。

    (晶振16MHz,无HSE功能)

0 Kudos
Reply
1 Solution
2,162 Views
simonliu
Contributor III

在RM里面描述, MUX_0_CSC/CSS ~ MUX_20_CSC/CSS这个42个寄存器都是”reset on destructive reset only”。

在应用里面,需要判定当前复位类型,且需要确认功能性复位时,无需对时钟MUX-x进行再次设置,可以跳过再次“复位-设置”的过程。
但这带来的软件复杂度需要和超时的影响及RTD的完整性进行平衡。
可关注Clock_Ip_Selector.c 里面Clock_Ip_axSelectorCallbacks的宏开关CLOCK_IP_CGM_X_CSC_CSS_CS_GRIP。

View solution in original post

0 Kudos
Reply
2 Replies
2,163 Views
simonliu
Contributor III

在RM里面描述, MUX_0_CSC/CSS ~ MUX_20_CSC/CSS这个42个寄存器都是”reset on destructive reset only”。

在应用里面,需要判定当前复位类型,且需要确认功能性复位时,无需对时钟MUX-x进行再次设置,可以跳过再次“复位-设置”的过程。
但这带来的软件复杂度需要和超时的影响及RTD的完整性进行平衡。
可关注Clock_Ip_Selector.c 里面Clock_Ip_axSelectorCallbacks的宏开关CLOCK_IP_CGM_X_CSC_CSS_CS_GRIP。

0 Kudos
Reply
2,164 Views
simonliu
Contributor III

经过测试出来发现是复位类型的影响,使用功能性复位就会出现时钟初始化时间过长问题。

  不使用看门狗复位,改成破坏性复位,时钟初始化就不会时间变长。

 经过进一步的测试,发现是这个时钟复位函数这里超时。

      对应到寄存器,是MUX_6_CSS寄存器。

     同时发现clock这部分寄存器复位会区分破坏性复位和功能性复位,寄存器仅在破坏性复位下复位,功能性复位是保持不变的。

     所以实测时发现调用破坏性复位,时钟初始化的时间是正常的。

   

 

 

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-1970988%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%3ES32K3%20Clock%20init%20too%20long%20time%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1970988%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%3E%3CDIV%3E%3CP%20class%3D%22%22%3E%3CSPAN%3EThe%20clock%20initialization%20time%20for%20a%20single%20App%20test%20or%20a%20single%20Boot%20test%20is%20not%20long%2C%20but%20after%20the%20Boot%20jumps%20to%20the%20App%2C%20the%20App%20clock%20initialization%20time%20is%20longer.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FDIV%3E%3CDIV%3E%3CP%20class%3D%22%22%3E%3CSPAN%3EThe%20system%20process%20is%20as%20follows%3A%3C%2FSPAN%3E%3C%2FP%3E%3C%2FDIV%3E%3CDIV%3E%3CP%20class%3D%22%22%3E%3CSPAN%3EThe%20MCU%3C%2FSPAN%3E%20%3CSPAN%3Eis%20powered%20on%2C%20enters%20the%20boot%2C%20and%20then%20configures%20the%20clock%2C%20checks%20the%20integrity%20of%20the%20App%20program%2C%20and%20then%20resets%20the%20watchdog%20if%20the%20program%20is%20OK.%20After%20the%20reset%2C%20the%20Boot%20detects%20the%20flag%20bit%2C%20does%20not%20initialize%20the%20clock%2C%20and%20directly%20jumps%20to%20the%20App.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FDIV%3E%3CDIV%3E%3CP%20class%3D%22%22%3E%3CSPAN%3E%26nbsp%3B%20%26nbsp%3B%20%3C%2FSPAN%3E%3CSPAN%3E(Crystal%20oscillator%2016MHz%2C%20no%20HSE%20function)%3C%2FSPAN%3E%3C%2FP%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1970991%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%3ERe%3A%20S32K3%20Clock%20init%20too%20long%20time%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1970991%22%20slang%3D%22zh-CN%22%20mode%3D%22CREATE%22%3E%3CP%3EIt%20is%20described%20in%20RM%20that%20the%2042%20registers%20MUX_0_CSC%2FCSS%20~%20MUX_20_CSC%2FCSS%20are%20all%20%22reset%20on%20destructive%20reset%20only%22.%3CBR%20%2F%3E%3CBR%20%2F%3E%20In%20the%20application%2C%20when%20the%20current%20reset%20type%20needs%20to%20be%20determined%20and%20a%20functional%20reset%20needs%20to%20be%20confirmed%2C%20there%20is%20no%20need%20to%20set%20the%20clock%20MUX-x%20again%2C%20and%20the%20%22reset-set%22%20process%20can%20be%20skipped.%3CBR%20%2F%3E%20However%2C%20the%20software%20complexity%20this%20brings%20needs%20to%20be%20balanced%20with%20the%20impact%20of%20timeout%20and%20the%20integrity%20of%20RTD.%3CBR%20%2F%3E%20You%20can%20pay%20attention%20to%20the%20macro%20switch%20CLOCK_IP_CGM_X_CSC_CSS_CS_GRIP%20in%20Clock_Ip_axSelectorCallbacks%20in%20Clock_Ip_Selector.c.%3C%2FP%3E%3C%2FLINGO-BODY%3E