Setting CLK_OSC32M_DIV to 0 results in runtime error

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

Setting CLK_OSC32M_DIV to 0 results in runtime error

ソリューションへジャンプ
2,688件の閲覧回数
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,527件の閲覧回数
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,527件の閲覧回数
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,527件の閲覧回数
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,527件の閲覧回数
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,527件の閲覧回数
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,528件の閲覧回数
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,527件の閲覧回数
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,527件の閲覧回数
urban_sharon
Contributor III

I an using QN9080 DK

0 件の賞賛
返信
2,527件の閲覧回数
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!

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