Hi, It’s my first time using free rtos, and I got a problem while trying to run my tasks with vTaskDelay inside it, when i comment vTaskDelay() from the tasks I get no errors and it works, and when I get the vTaskDelay back to the code proteus pauses,
after i hit continue it crashes saying “can’t fetch op code 0x61000000”
here is the whole project i made in cube ide in a github repo
/T1t4n25/Traffic-light
Sorry I think I deleted a section by accident while writing the post, now it’s edited to the right context, when I comment vTaskDelay the code works, when I get it back the problem appears
Is it also true for the task code snippet I shared? In other words, if you create 2 task with the task function set to the above definition, does it still crash?
Could you put a break point at the vTaskDelay call and step through it. There is going to be a lot of things going on but the important one is that you should see the task transition to the ‘Blocked’ state (this is done through placing the task on a delayed list) and that the next highest priority task in turn executes. If you try this with only a single application task, rather than two, this will be the IDLE task which gets automatically created.
I can’t debug using a debugger because I don’t have one yet, and proteus just crashes when you use .elf file which supports debugging, so I have no means of doing this, however, I tried one task only and got the same issue, it seems to get to vTaskDelay and crashes, because it never transitioned from green led to any other, nor using the 7 segment only made the counter count anything, just reaches vTaskDelay and stops
Nothing seems wrong with your code at a glance. So we need to isolate if the problem is with your simulation tool or the code itself? Is it possible for you to create a simulation for another hardware? The reason I ask if because I have NUCLEO-H743ZI2 board from ST and if you can create a simulation project for that, then we can see if I can run the same code on the real hardware or not.