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
Solved! Go to Solution.
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
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 */
__asm( ".syntax unified\n"
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
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...
Hi Sharon,
That's great to hear, please let us know if you need any further information or have further issues.
Best regards,
Sebastian
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
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.
I an using QN9080 DK
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!
-----------------------------------------------------------------------------------------------------------------------