Hi,
It was simpler than I though... still learning this platform...
To anyone that is interested, the following works.
1. Setup GPT module from SDK + GPT instance in peripherals.
The following setup will create 1MHz which is started at system boot.
instance:
- name: 'GPT1'
- type: 'gpt'
- mode: 'general'
- functional_group: 'BOARD_InitPeripherals'
- peripheral: 'GPT1'
- config_sets:
- fsl_gpt:
- gpt_config:
- clockSource: 'kGPT_ClockSource_Periph'
- clockSourceFreq: 'ClocksTool_DefaultInit'
- oscDivider: '1'
- divider: '24'
- enableFreeRun: 'true'
- enableRunInWait: 'false'
- enableRunInStop: 'false'
- enableRunInDoze: 'false'
- enableRunInDbg: 'false'
- enableMode: 'true'
- isInterruptEnabled: 'false'
- EnableTimerInInit: 'true'
2. Configure the following in FreeRTOSConfig.h:
#include "fsl_gpt.h"
#define portCONFIGURE_TIMER_FOR_RUN_TIME_STATS()
#define portGET_RUN_TIME_COUNTER_VALUE() GPT_GetCurrentTimerCount(GPT1)
* I could not include peripherals.h due to some conflicts in its definition with other modules, so I used symbols GPT1 directly instead of GPT1_PERIPHERAL.
And that's It.
Of course this can be extended/enhanced, but is trivial and takes no CPU to count.
Regards,