When accessing the register. An interrupt appears.

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

When accessing the register. An interrupt appears.

跳至解决方案
1,054 次查看
profprogrammer
Contributor III

Hello.

I used MK60DN512.  KSDK 1.2

I want to work with the interface of the RMII.

When accessing the register MMFC

uint32_t* Data_mmfr = (uint32_t *) 0x400c0040;‍
uint32_t tmp = *Data_mmfr;

That program gets interrupted.

/*
** ===================================================================
**     Method      :  Cpu_Cpu_Interrupt (component MK60DN512LL10)
**
**     Description :
**         This ISR services an unused interrupt/exception vector.
**         This method is internal. It is used by Processor Expert only.
** ===================================================================
*/
PE_ISR(Cpu_Interrupt)
{
  /* This code can be changed using the CPU component property "Build Options / Unhandled int code" */
  PE_DEBUGHALT();
}

No possibility to read data from MMFR.

Because of what this can happen?

How to fix it?

0 项奖励
回复
1 解答
907 次查看
danielchen
NXP TechSupport
NXP TechSupport

Hi Prof Programmer

This is a normal behavior. You need to enable the ENET module before you can access enet registers, otherwise,  hard fault will happen.

For example, if you put your code in the lwip_httpsrv_bm demo, after netif_set_up(&fsl_netif0);  then it can work.


Have a great day,
Daniel

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

在原帖中查看解决方案

0 项奖励
回复
1 回复
908 次查看
danielchen
NXP TechSupport
NXP TechSupport

Hi Prof Programmer

This is a normal behavior. You need to enable the ENET module before you can access enet registers, otherwise,  hard fault will happen.

For example, if you put your code in the lwip_httpsrv_bm demo, after netif_set_up(&fsl_netif0);  then it can work.


Have a great day,
Daniel

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复