error: expression .... ->CCM_Type::ROOT[0].CCM_Type::<unnamed struct>::TARGET_ROOT' has side-effects kCLOCK_RootM4_1 = (uint32_t)(&((CCM_Type*) ... ->ROOT[0].TARGET_ROOT),

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

error: expression .... ->CCM_Type::ROOT[0].CCM_Type::<unnamed struct>::TARGET_ROOT' has side-effects kCLOCK_RootM4_1 = (uint32_t)(&((CCM_Type*) ... ->ROOT[0].TARGET_ROOT),

2,002件の閲覧回数
tom_orsi1
Contributor II

The solution to this problem is to use the offsetof, review this single line in the fsl_clock.h that needs propagated for both enums that use the CCM macro and all their entries. 

/*! @brief ccm root name used to get clock frequency. */
typedef enum _clock_root_control
{
kCLOCK_RootM4 = (uint32_t)CCM_BASE+offsetof(CCM_Type,ROOT[1].TARGET_ROOT), /*!< ARM Cortex-M4 Clock control name.*/

ラベル(1)
タグ(2)
0 件の賞賛
返信
3 返答(返信)

1,930件の閲覧回数
anton_glukhov
Contributor III

Hello Thomas,

Do you know if this suggestion will be incorporated into SDK? I also have the same problem while I'm compiling with c++ compiler.

I'm compiling with g++ version 8.3 and offsetof doesn't solve the issue. Does it work it for you?

Best regards,

Anton

0 件の賞賛
返信

1,930件の閲覧回数
tom_orsi
Contributor I

Can you paste the error messages into this thread? offsetof is definitely a solution and if its recognized by your compiler it should solve your problem. 

0 件の賞賛
返信

1,930件の閲覧回数
anton_glukhov
Contributor III

Hello Tom,

Sorry for the delay. Everything is fine, it was an error because of cmake cache. It works now. Thank you!

But it's interesting if there is a plan to include it into SDK.

Best regards,

Anton

0 件の賞賛
返信