Setting CLK_OSC32M_DIV to 0 results in runtime error

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

Setting CLK_OSC32M_DIV to 0 results in runtime error

Jump to solution
1,544 Views
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

Labels (1)
0 Kudos
Reply
1 Solution
1,383 Views
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

View solution in original post

8 Replies
1,383 Views
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 Kudos
Reply
1,383 Views
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

1,383 Views
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 Kudos
Reply
1,383 Views
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 Kudos
Reply
1,384 Views
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

1,383 Views
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 Kudos
Reply
1,383 Views
urban_sharon
Contributor III

I an using QN9080 DK

0 Kudos
Reply
1,383 Views
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!

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