Setting CLK_OSC32M_DIV to 0 results in runtime error

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

Setting CLK_OSC32M_DIV to 0 results in runtime error

跳至解决方案
2,669 次查看
urban_sharon
Contributor III

Hi, 

I am trying to set the CLK_OSC32M_DIV bit of the System Clock Divider Register to 0, in order to use the original 32 MHz clock, undivided.

After importing from the "GPIO led output" SDK example project, I am trying to change this line: 

CLOCK_SetClkDiv(kCLOCK_DivOsc32mClk, 1U);

Into this line:

CLOCK_SetClkDiv(kCLOCK_DivOsc32mClk, 0U);

This results in a runtime error.

What could be going wrong here?

Thanks

标签 (1)
0 项奖励
回复
1 解答
2,508 次查看
Sebastian_Del_Rio
NXP Employee
NXP Employee

Hi Sharon, I hope you're doing well!

 

Unfortunately, I wasn't able to replicate the issue you're having.

 

I changed the call to the CLOCK_SetClkDiv inside of the BOARD_BootClockRUN function (which is called of main, in the gpio_led_output.c source file) to the following:

 

CLOCK_SetClkDiv(kCLOCK_DivOsc32mClk, 0U);

 

Could you please tell me where was this line changed? Or if any other changes were done to the code?

 

Best regards,

Sebastian

在原帖中查看解决方案

8 回复数
2,508 次查看
urban_sharon
Contributor III

The issue now reproduces.

After using the clock configuration tool to generate the clock configuration block of the source code, and while tracing over it, a 'step over' action over this command:

CLOCK_SetClkDiv(kCLOCK_DivAhbClk, 0U);                  /*!< Set AHB_DIV divider to value 1 */

Results in this:

    __asm(  ".syntax unified\n"

0 项奖励
回复
2,508 次查看
Sebastian_Del_Rio
NXP Employee
NXP Employee

Hi Sharon,

Is the QN9080DK being debugged using the USB SWD/JTAG port? Or is it being debugged using the JTAG connector marked "P1"?

Best regards,

Sebastian

2,508 次查看
urban_sharon
Contributor III

Thanks Sebastián, I was able to resolve this by comparing the generated code of the broken project and another one that worked... I did manage to find a difference in the generated code and once I applied the change manually things started to work...

0 项奖励
回复
2,508 次查看
Sebastian_Del_Rio
NXP Employee
NXP Employee

Hi Sharon,

That's great to hear, please let us know if you need any further information or have further issues.

Best regards,

Sebastian

0 项奖励
回复
2,509 次查看
Sebastian_Del_Rio
NXP Employee
NXP Employee

Hi Sharon, I hope you're doing well!

 

Unfortunately, I wasn't able to replicate the issue you're having.

 

I changed the call to the CLOCK_SetClkDiv inside of the BOARD_BootClockRUN function (which is called of main, in the gpio_led_output.c source file) to the following:

 

CLOCK_SetClkDiv(kCLOCK_DivOsc32mClk, 0U);

 

Could you please tell me where was this line changed? Or if any other changes were done to the code?

 

Best regards,

Sebastian

2,508 次查看
urban_sharon
Contributor III

Thank you all for the kind help.

I managed to resolve this by using the GUI code generator of the IDE for the clocks configuration. I am not sure what was to source of the issue, originally.

0 项奖励
回复
2,508 次查看
urban_sharon
Contributor III

I an using QN9080 DK

0 项奖励
回复
2,508 次查看
Sabina_Bruce
NXP Employee
NXP Employee

Hello Sharon,

Hope you are doing well.

Could you please tell us the microcontroller you are using so we can assign the correct engineer to help you?

Best Regards,

Sabina

-----------------------------------------------------------------------------------------------------------------------

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

-----------------------------------------------------------------------------------------------------------------------