In case anyone else has this problem: if for some reason your code doesn't run, (i.e. you get a hardfault, or debug terminates immediately), please make sure the NVIC priority Group is set to "4 bits for preemption". You can do this by going to the System Core menu and selecting NVIC. On the top left you have a drop-down menu called Priority Group. Here, select "4 bits for pre-emption priority 0 bits for subpriority" As a beginner, this was pretty frustrating to figure out, and I wasted a good 3 hours before I finally found the solution
After reading many theories about RTOS that I was unable to figure out how it works on the MCU. But just a Basic video clip of RTOS, I understand how it works and will confidently know how to apply when learning through your video clip ! Thanks so much!
Wow very nice, this really ilustrates how one wuold intuitively want to develop an operating system, simply an easier way to manage many processes after starting with one, which is how most of start with when programming MCU's. An even handler is another way I was just reading about, which i guess an Operating system is just a big fancey event handler. There was someone who made an event handler librarby for MCU's to get around main loop issue which solves the same problem it looks like albiet an even more stripped down solution with less overhaed then an OS, but some would even complain that the overhead of an event handler is too much. I was just watching Mitch Davis's bare metal programming series with MCU's and he showed the LED blink sketch blink almost 20x faster by accessing the register directly as opposed to calling DigitalWrite(), almost 20x!! thats huge, so theres something to be said about the bare metal approach if you really need it, and
Whilst i understand about the priority system, i dont understand that when the tasks were the same priority it didnt function as intended? What happens if i want the two tasks to have the same priority? Secondly, could this problem have been solved with MUTEX's?
In case of same priority tasks, the preemption will not take place. So one task have to wait for other to finish. What problem exactly? Plz watch the mutex video to understand what it is and where should we use it
I am using the stm32f103c8 and I am facing a problem in debugging in both open OCD and GDB server connecting (problem- Please that latest version of GDB-server is used for connection.). Please help me.
oh right you later got a warning and then you changed it. I commented before watching it completely. Btw, you say use any timer, but I prefer TIM6 and TIM7. I am sure people who read my comment -- most of them know why its better to spare other timers.
I'm Newbie about FreeRTOS, In example at 12:25 and 13:30 , you explained that "delay is large" so I think this here reason is you were using the same UART ( UART2) and all task's priority are the same ( Normal ). There aren't "delay is large". Please explain to me ?? Please Rep me !
Yeah you are right. I was trying to show the abnormal behaviour of tasks with same priorities. When the suspension time is large, they get enough time to send the string to the uart.
hello, thank you for your videos , i had this error : "Error: Flash Download failed - Could not load file 'RTOS_1\RTOS_1.axf'" i'm using nucleo-f401re with 512kbytes flash memory. could anyone help me please ?
Thank You for such a great video kindly make a video about max30102 with bluepill using cube ide. Because it does have any proper reference in youtube THANK YOU
yes you are right. I don't know why it was showing 5 ms.. I don't remember but i think the oscilloscope video was pre recorded... Anyway you got the point of that demonstration I hope.
Thanks for the effort, great video. I personally find the narration quite annoying, would've preferred a human even with a broken accent, or even just slides. However that maybe just me.
Thanks for your sharing. Could you tell me how to open the tool used to watch messages from UART in your video? I have followed your video until I get stuck there. Thanks :)
Hello, thanks for the video. I have started to learn RTOS recently. I did everything you had done in this video but serial terminal sends fx`ffxfxfx`fx`f message instead of "hello from ..." message via UART constantly. What is the wrong thing I am going?
Could be the baud rate issue. Check if the baud rate is same in the serial terminal also And if you are using uart with RTOS, probably you should learn uart first.. or use LED blinking or increment some variable for simpler process.
@@ControllersTech Baud rate is correct.Yes, my UART knowledge is not good. I am trying to understand my mistake. I can send this array of ascii code and it prints EMRULLAH uint8_t data[9]={69,77,82,85,76,76,65,72,1}; HAL_UART_Transmit(&huart2, data, 9, 1000); But I cant send this string uint8_t data[]= "Hello from DefTask "; HAL_UART_Transmit(&huart2, data, sizeof(data), 500);
Because if we do that, the systick might be busy with some hal delay and might miss the task delay. If you don't have any other functions that require delays, you can use systick also
Question: Hi, first of all thanks for your teaching videos. I have a question in relation with task and how to call a data from model, I mean, I'm using touchgfxdesigner, there you know that it is used a MVP software architecture, so I'm looking the way to refresh a data in the model using a RTOS task every second (I'm using a date class to store the date, so I want to use the this data date to be used in all of the program), so my problem would be how could I call model inside a task in order to refresh the date every second. Thank you very much.
@@ControllersTech HI, I'm using an external module RTC that offer a high precision and stable clock, this piece of hardware feature an i2c communication protocol, also a battery backup, so I need to ask periodically the date to this module and update it in the rest of the system, I had thought that throughout a task could be a good way, how do you see it? Thanks.
Yeah you can use it. Just call the get time or get date functions from a task. It doesn't matter if u call every 100 ms or 1 sec or 10 sec, the clock will be always correct
Sir, at 3:26 TIM1 has been selected instead of SysTick. Is TIM1 configuration not required? Code generator handles that and configures it to get 1ms system tick?
Hello. Million thank for the amazing embedded videos you are making. I would be grateful if you could make one, or at least explain how to use the USB host with freeRTOS. It works perfectly bare-metal, but when I try with freeRTOS, I end up with gState HOST_ABORT_STATE. It is unable to actually connect to the device. In the defaultTask I have the following code: MX_USB_HOST_Init(); vTaskSuspend(Task2); for(;;){ USBH_Process (&hUsbHostHS); if(hUsbHostHS.gState == HOST_CLASS) //device connected and ready for communication vTaskResume(Task2); } osDelay(1); Could you explain to me what I am doing wrong?
Thank you for such good tutorials !!! I have a small problem. Everything works fine when I run the code. But when I try to debug the code line by line in the CubeIDE, after HAL_Init() and SystemClock_Config(), the program always gets stuck in the IRQ handler (stm32fxx_it.c file) of the respective timer that I use. Could you let me know what the issue might be.