Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(PeriphDrivers): Fix UART clock source issues #1168

Merged
merged 3 commits into from
Sep 24, 2024

Conversation

hfakkiz
Copy link
Contributor

@hfakkiz hfakkiz commented Sep 11, 2024

Description

With new UART RevB clock source selection updates, some problems occurred on Zephyr RTOS side. Also, I noticed some problems about MSDK side too. In this PR,

  • Fixed these build issues.
  • Disabled GPIO and clock enablement for Zephyr side.
  • To avoid from duplication, I moved clock source enablement from init function to clock source selection function.
  • Added get function for clock source for ME15 and ME21

Checklist Before Requesting Review

  • PR Title follows correct guidelines.
  • Description of changes and all other relevant information.
  • (Optional) Link any related GitHub issues using a keyword
  • (Optional) Provide info on any relevant functional testing/validation. For API changes or significant features, this is not optional.

@hfakkiz hfakkiz added MAX32655 Related to the MAX32655 (ME17) MAX32670 Related to the MAX32670 (ME15) MAX32672 Related to the MAX32672 (ME21) MAX32675 Related to the MAX32675 (ME16) MAX32680 Related to the MAX32680 (ME20) MAX32690 Related to the MAX32690 (ME18) MAX78000 Related to the MAX78000 (AI85) MAX78002 Related to the MAX78002 (AI87) MAX32662 Related to the MAX32662 (ME12) labels Sep 11, 2024
Copy link
Contributor

@sihyung-maxim sihyung-maxim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh boy, another one lol. Changes looks good, double-check me @Jake-Carter

@ozersa
Copy link
Contributor

ozersa commented Sep 17, 2024

Need to be rebased first.

@hfakkiz
Copy link
Contributor Author

hfakkiz commented Sep 17, 2024

Rebased.

@hfakkiz hfakkiz force-pushed the fix/uart-clock-source-issues branch 3 times, most recently from 7ab6d17 to f090907 Compare September 23, 2024 10:36
Copy link
Contributor

@sihyung-maxim sihyung-maxim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason why the MXC_UART_SetClockSource function for certain parts writes to a clock_option variable within the switch statement, then calls the MXC_UART_RevB_SetClockSource function at the end while other parts follow this setup?

@hfakkiz
Copy link
Contributor Author

hfakkiz commented Sep 24, 2024

Is there a reason why the MXC_UART_SetClockSource function for certain parts writes to a clock_option variable within the switch statement, then calls the MXC_UART_RevB_SetClockSource function at the end while other parts follow this setup?

When I review MXC_UART_SetClockSource functions I noticed that, if UART instances use same clock sources for clock options then MXC_UART_SetClockSource function calls MXC_UART_RevB_SetClockSource function within the switch statement but if UART instances use different clock sources for clock options then it writes to clock_option variable and at the end it calls the MXC_UART_RevB_SetClockSource function. I followed same structure.

- Moved clock source enablement from init function to clock source
selection function.
- Updated clock source selection functions.
- Updated clock source enums for MAX32672 and MAX32675.
- Removed unused clock sources from MXC_UART_SetFrequency function.

Signed-off-by: Furkan Akkiz <[email protected]>
- Added 'MXC_UART_GetClockSource' functions for me15 and me21.
- Called this function to get clock source in init function for ai85.

Signed-off-by: Furkan Akkiz <[email protected]>
Disabled gpio and clock enablement on UART drivers for Zephyr.

Signed-off-by: Furkan Akkiz <[email protected]>
@sihyung-maxim sihyung-maxim merged commit df04760 into main Sep 24, 2024
10 checks passed
sihyung-maxim pushed a commit to analogdevicesinc/hal_adi that referenced this pull request Sep 24, 2024
@Jake-Carter
Copy link
Contributor

Thanks @hfakkiz, my mistake. I didn't consider MSDK_NO_GPIO_CLK_INIT

@Jake-Carter Jake-Carter deleted the fix/uart-clock-source-issues branch September 24, 2024 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
MAX32655 Related to the MAX32655 (ME17) MAX32662 Related to the MAX32662 (ME12) MAX32670 Related to the MAX32670 (ME15) MAX32672 Related to the MAX32672 (ME21) MAX32675 Related to the MAX32675 (ME16) MAX32680 Related to the MAX32680 (ME20) MAX32690 Related to the MAX32690 (ME18) MAX78000 Related to the MAX78000 (AI85) MAX78002 Related to the MAX78002 (AI87)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants