coretex-m4(STM32F407VG discovery) Questions about implementing vTaskDelay and Delay

Hello. I am new to FreeRTOS. I have analyzed and understood the Scheduling method using Task. I want to run the PID control source through FreeRTOS scheduling. I included several functions in the FreeRTOS, such as the libraries tmstm32f4delay.h and tmstm32f4delay.c, which were imported from outside, and found that SysTickHandler duplicated. tmstm32f4_delay.c defines the millis and delay functions we need to do the PID. To solve this problem, I commented out the SysTickHandler in the section of tmstm32f4delay.c and solved the compilation problem. I understood that [[#define xPortSysTickHandler SysTickHandler]], which is embedded in FreeRTOS, is used for interrupts and is absolutely necessary. After all, we need to implement the Delay function needed for the PID. The tool I am using is IAR. The above is a description of the situation I experienced, and the questions are as follows.
  1. I want to use the function defined in the header file included in TaskFunction via vTaskDelay. Can this header file serve as a delay through a function called vTaskDelay?
  2. I read the contents of https://www.freertos.org/FreeRTOSSupportForumArchive/November2013/freertosconfigTICKRATEHZ8fc54ac4j.html, but I do not understand. We implemented a delay using the vTaskDelay function, but this did not allow accurate ms Delay. I set it to #define configTICKRATEHZ ((TickTypet) 1000) and I wanted a delay of 500ms, but when I measured it with an oscilloscope, it took about 2 seconds of delay. There is only one externalLED_TASK task to operate.
//delay.h function void externaldelaytest (void) { // const TickTypet xDelay = 500 / portTICKPERIODMS;        unsigned int niCnt = 0;     for (;;)     { // vTaskList (ptrTaskList); // printf (“ptrTaskList n”);         if ((niCnt% 2) == 0)         {             GPIOSetBits (GPIOD, GPIOPin4);         }         else if ((niCnt% 2) == 1)         {             GPIOResetBits (GPIOD, GPIOPin4);         }         // puts (“LED2”);         printf (“PD4 ::::% d n”, n_iCnt);         vTaskDelay (500);         n_iCnt ++;     } } //main.c Taskfunction void externalLEDTASK (void * pvParameter) {   externaldelaytest ();   / *   for (;;)   {     externaldelaytest ();   }   * / }
  1. Is the structure I think is wrong? If so, can you use vTaskDelay to delay for exactly one second? Or can I re-implement Delay?
I need help.

coretex-m4(STM32F407VG discovery) Questions about implementing vTaskDelay and Delay

Think this is a duplicate of https://sourceforge.net/p/freertos/discussion/382005/thread/6ee2acb9/ that for some reason got stuck in the moderation queue that is not supposed to exist.