Open
Description
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