Author Topic: FreeRTOS vTaskDelay on A53 doesn't work  (Read 2198 times)

gawrcool

  • Active Member
  • *
  • Posts: 11
FreeRTOS vTaskDelay on A53 doesn't work
« on: September 12, 2018, 09:37:31 AM »
Hi,

I'm using Vivado 2018.2.1 64bits on Win10 system. I use TE0803-01-03EG-1EB on the UltraITX+ (TEBF0808-04) baseboard.
I use the TE0803-Starterkit-vivado_2018.2-build_02_20180814103204 (but same results with the TE0803-test_board-vivado_2018.2-build_02_20180814103105).

Creating a simple hello world app in baremetal works well (A53 and R5: build, debug,...). But when I create the same project using the freertos and debug it, it never go further then the vTaskDelay() in the sending task (see code).

If I remove the vTaskDelay(), everything is ok (it floods the console with text, then the queuing engine of FreeRTOS works well).

I didn't change a word in the example supplied.

Also, when I create the same hello word example but with the R5 target, all works fine (build, debug,...).

Can you help me?

Code: [Select]
static void prvTxTask( void *pvParameters )
{
const TickType_t x1second = pdMS_TO_TICKS( DELAY_1_SECOND );

for( ;; )
{
/* Delay for 1 second. */
vTaskDelay( x1second );    <------- PROBLEM HERE, FREERTOS NEVER GO FURTHER

/* Send the next value on the queue.  The queue should always be
empty at this point so a block time of 0 is used. */
xQueueSend( xQueue, /* The queue being written to. */
HWstring, /* The address of the data being sent. */
0UL ); /* The block time. */
}
}

JH

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1605
Re: FreeRTOS vTaskDelay on A53 doesn't work
« Reply #1 on: September 12, 2018, 02:11:54 PM »
Hi,

i've no experience with freeRTOS and we never checked if the Reference design is freeRTOS ready, but did you checked:

Especially manual BSP modification, maybe some of the SDK settings are wrong. Or the setup to start debugger.

If I understand correctly it stops on vTaskDelay(..) correct? Can you jump with debugger into this function? Or do you see only assembly code? Is it from BSP lib? If yes, you can also change BSP optimization flags to debug this libs.
Other possible issue (but normally it will be stop on initialisation step):SI5338 for CLK will be programmed with modified FSBL. This modification are not included into the generated init script from xilinx.So one way is you disable PCIe, SATA and USB3 on PS and start SDK with this hdf export or boot with modified FSBL from SD (no app or uboot included). Change DIP to JTAG Mode and start JTAG debugger. As long as you did not power off the carrier, it should work 

br
John

gawrcool

  • Active Member
  • *
  • Posts: 11
Re: FreeRTOS vTaskDelay on A53 doesn't work
« Reply #2 on: September 12, 2018, 04:21:07 PM »
Quote
i've no experience with freeRTOS and we never checked if the Reference design is freeRTOS ready, but did you checked:

    https://www.freertos.org/RTOS-ARM-Cortex-R5-Xilinx-UltraScale_MPSoC.html
    https://www.freertos.org/RTOS-Xilinx-UltraScale_MPSoC_64-bit.html

Especially manual BSP modification, maybe some of the SDK settings are wrong. Or the setup to start debugger.

I've checked these but I don't see any relevant information for my problem.

Quote
If I understand correctly it stops on vTaskDelay(..) correct?
In fact, no. The FreeRTOS continue to run. The task that has the vTaskDelay() is never run again after the call of this function (normally, after the delay period in the vTaskDelay(delay), the FreeRTOS scheduler do a context switch to put again the task in the run mode). But the other task (the one that wait for a message via the queue, see the code below) get called via the context switch (the one that occurs when the first task call vTaskDelay() ), and this is normal. Then for me, nothing hangs. The only problem is the timer (tick interrupt?) that never notify the scheduler when the period is elapsed (I've modified the tasks priorities to see this).
Code: [Select]
char Recdstring[15] = "";

for( ;; )
{
/* Block to wait for data arriving on the queue. */
xQueueReceive( xQueue, /* The queue being read. */       <---- THIS TASK IS ON THE RUN STATE AND STUCK HERE (NORMAL SINCE THERE IS NOTHING IN THE QUEUE)
Recdstring, /* Data is read into this address. */
portMAX_DELAY ); /* Wait without a timeout for data. */

/* Print the received data. */
xil_printf( "Rx task received string from Tx task: %s\r\n", Recdstring );
RxtaskCntr++;
}
}

Code: [Select]
Can you jump with debugger into this function? Or do you see only assembly code? Yes I can see the source code.
Code: [Select]
If yes, you can also change BSP optimization flags to debug this libs.I can modify the optimization flags for the project itself but I can't figure out how to change these the for the BSP.
Code: [Select]
So one way is you disable PCIe, SATA and USB3 on PS I don't use these.
Perhaps I've to report this problem to FreeRTOS ?


JH

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1605
Re: FreeRTOS vTaskDelay on A53 doesn't work
« Reply #3 on: September 12, 2018, 05:26:39 PM »
Hi,

Quote

"
So one way is you disable PCIe, SATA and USB3 on PS
"
I don't use these.
Did you use PS configuration from the reference design/ board part file (this with TEBF0808 configuration)? Or own one or this simple board part file with QSPI and DDR only for custom carrier?


to enable lib debugging, try:
open BSP setup, go to drivers -> psu_cortexa53_0 and add -O0 to extra_compiler_flags
https://www.xilinx.com/html_docs/xilinx2016_3/SDK_Doc/index.html?q=/html_docs/xilinx2016_3/SDK_Doc/SDK_references/reference_variablevalueswhiledebugbspcode.html


Quote
Perhaps I've to report this problem to FreeRTOS ?
This or Xilinx forum, maybe they can help faster.

I will also check one time this xilinx example of freeRTOS, but I can't promise if I can help.

br
John