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

FreeRTOS Clock Config Macros Unsuited to Support Apollo3 #8

Open
oclyke opened this issue Jun 25, 2020 · 1 comment
Open

FreeRTOS Clock Config Macros Unsuited to Support Apollo3 #8

oclyke opened this issue Jun 25, 2020 · 1 comment
Labels

Comments

@oclyke
Copy link
Contributor

oclyke commented Jun 25, 2020

Originally raised by a user of the SparkFun BSPs repo: FreeRTOS example code clock-rate error?

Many FreeRTOS example files use this FreeRTOSConfig.h preprocessor definition of clock speed:

#ifdef AM_PART_APOLLO2
    #define configCPU_CLOCK_HZ                  48000000UL
#else
    #define configCPU_CLOCK_HZ                  24000000UL
#endif

This suggests that the Apollo2 runs at 48 MHz and anything else runs at 24 MHz. Since the Apollo2, Apollo3, and possibly other future boards run at 48 MHz this could/would cause timing errors within FreeRTOS. A suggested fix is to replace all those definitions with this alternate which more accurately reflects the default clock settings for Ambiq Apollo MCUs:

#ifdef AM_PART_APOLLO
    #define configCPU_CLOCK_HZ                  24000000UL
#else
    #define configCPU_CLOCK_HZ                  48000000UL
#endif
oclyke added a commit that referenced this issue Jun 25, 2020
oclyke added a commit that referenced this issue Jun 30, 2020
oclyke pushed a commit that referenced this issue Oct 5, 2020
@oclyke oclyke added the 2.5.1 label Oct 5, 2020
@oclyke
Copy link
Contributor Author

oclyke commented Oct 5, 2020

This issue persists in the AmbiqSuite SDK 2.5.1 and has a corresponding patch branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant