Skip to main content
antonius
Associate III
March 27, 2017
Question

RTOS and reading file ?

  • March 27, 2017
  • 2 replies
  • 815 views
Posted on March 27, 2017 at 02:44

Everyone,

I tried to read file and write file in one task on RTOS, but

when I read file it's stopped in the middle ?

What setting do I need to change in the task ? Is it related with timer2 per task ?

Code :

void StartDefaultTask(void const * argument)
{
 /* init code for FATFS */
 MX_FATFS_Init();
 /* init code for USB_DEVICE */
 MX_USB_DEVICE_Init();
 /* USER CODE BEGIN StartDefaultTask */
 /* Infinite loop */
test_fatfs();
reading_file_test(); <== stop in the middle here
 for(;;)
 {
 osDelay(1);
 }
 /* USER CODE END StartDefaultTask */
}
�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?�?

I have tested without RTOS, it can read properly,

I have used timer2 as SYSTICK, and how to configure that for RTOS ?

What do you reckon I missed here ?

Thanks

#sdcard #rtos #timer #firmware #stm32f1xx #sdio
This topic has been closed for replies.

2 replies

antonius
antoniusAuthor
Associate III
March 27, 2017
Posted on March 27, 2017 at 02:54

void SysTick_Handler(void)
{
 /* USER CODE BEGIN SysTick_IRQn 0 */
 /* USER CODE END SysTick_IRQn 0 */
 osSystickHandler();
 /* USER CODE BEGIN SysTick_IRQn 1 */
 /* USER CODE END SysTick_IRQn 1 */
}�?�?�?�?�?�?�?�?�?�?

Is it related with that line ? ( Line 6 )

arun singh
Associate II
June 1, 2017
Posted on June 01, 2017 at 09:06

Do you have only one thread? Actually threads will execute on time basis so it will switch to another thread, and when the control comes back to this one, it will only execute the infinite loop.