Skip to content

Commit b9b82d7

Browse files
committed
config: Add description about FVP behaviour
Provide justification for setting `configTICK_RATE_HZ` to `100` to simulate scheduler polling rate of `1000 Hz` or 1 tick per second. Signed-off-by: Devaraj Ranganna <[email protected]>
1 parent 2382c42 commit b9b82d7

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

Config/freertos-config/FreeRTOSConfig.h

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,26 @@ extern uint32_t SystemCoreClock;
5757
#define configENABLE_TRUSTZONE 0
5858
#define configRUN_FREERTOS_SECURE_ONLY 0
5959

60-
/* somehow 100 tick per second gives similar timing (~85%) as 1000 did on the FPGA, so with this 1 ms to 1 tick can be */
61-
/* kept... */
62-
#define configTICK_RATE_HZ ( ( uint32_t ) 100 ) /* Scheduler polling rate of 1000 Hz */
63-
60+
/* From the "Fast Models Reference Guide" (https://developer.arm.com/documentation/100964/1123/About-the-models),
61+
* "Programmer's View (PV) models of processors and devices work at a level
62+
* where functional behavior is equivalent to what a programmer would see using
63+
* the hardware.
64+
*
65+
* They sacrifice timing accuracy to achieve fast simulation execution speeds:
66+
* you can use the PV models for confirming software functionality, but you
67+
* must not rely on the accuracy of cycle counts, low-level component
68+
* interactions, or other hardware-specific behavior."
69+
*
70+
* As described above, FVPs sacrifice timing accuracy to achieve fast
71+
* simulation execution speeds. Therefore, we need this work around of setting
72+
* `configTICK_RATE_HZ` to `100` to simulate scheduler polling rate of
73+
* `1000 Hz` or 1 tick per second.
74+
*
75+
* In addition, the macro `pdMS_TO_TICKS` is defined here to match the 1 tick
76+
* per second instead of using the macro defined in
77+
* `FreeRTOS-kernel/include/projdefs.h`
78+
*/
79+
#define configTICK_RATE_HZ ( ( uint32_t ) 100 )
6480
#define pdMS_TO_TICKS( xTimeInMs ) ( ( TickType_t ) xTimeInMs )
6581
#define TICKS_TO_pdMS( xTicks ) ( ( uint32_t ) xTicks )
6682

0 commit comments

Comments
 (0)