ve3wwg / esp32_freertos

ESP32 FreeRTOS Demonstrations
MIT License
5 stars 5 forks source link

[Bug]: `semaphores.ino` example gets stuck in task one #2

Open GogoVega opened 1 year ago

GogoVega commented 1 year ago

Dear @ve3wwg,

Thank you for your semaphores.ino example. But I tried your code on esp32 and it doesn't work anymore: It gets stuck in task one. Is it possible to control? Thanks a lot, GogoVega.

Tested on Platformio:

[env:esp32doit-devkit-v1]
platform = espressif32
board = esp32doit-devkit-v1
framework = arduino
ve3wwg commented 1 year ago

I'll need more information in order to help:

  1. Re "But I tried your code on esp32 and it doesn't work anymore". Does this mean that it did work before, but not now?
  2. Re "It gets stuck in task one" do you mean the first created "led_task"? (line 39?)
  3. Do the LEDs blink?
  4. Are you certain the setup() creates both tasks ok? DId you put a print in there (line 62) to prove this?
  5. Did you change the priorities of either task?

Assuming you are using the original task priorities:

If you changed the priority of either task, know that the priorities are critical. In this example both are created with priority 1. If you made either task a different priority, you will have trouble.

Warren

On Sun, Nov 27, 2022 at 3:22 PM Gauthier Dandele @.***> wrote:

Dear @ve3wwg https://github.com/ve3wwg,

Thank you for your semaphores.ino example. But I tried your code on esp32 and it doesn't work anymore: It gets stuck in task one. Is it possible to control? Thanks a lot, GogoVega.

Tested on Platformio:

[env:esp32doit-devkit-v1]platform = espressif32board = esp32doit-devkit-v1framework = arduino

— Reply to this email directly, view it on GitHub https://github.com/ve3wwg/esp32_freertos/issues/2, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA47P6GBM3Q4NYS3PCF3ZY3WKO7JLANCNFSM6AAAAAAR44HTIY . You are receiving this because you were mentioned.Message ID: @.***>

GogoVega commented 1 year ago

I took your code without modifying it.

  1. We use your example in the school setting and according to my teacher it worked last year.
  2. The two tasks are well created but the code remains blocked in the first task.
  3. Only the first led flashes permanently, the second stays off.
  4. Yes, the rc response is ok.
  5. No, I haven't changed anything.

I don't think so because the two tasks were created. Both tasks have a priority of 1.

GogoVega.

ve3wwg commented 1 year ago

Something in the environment has changed.

In the following code: [image: image.png] try commenting out line 24 (the call to delay()). Obviously it will blink fast after this but note if the other LED now flashes.

I wonder if Arduino has done something fishy with that delay() call.

Warren

On Mon, Nov 28, 2022 at 9:37 AM Gauthier Dandele @.***> wrote:

I took your code without modifying it.

  1. We use your example in the school setting and according to my teacher it worked last year.
  2. The two tasks are well created but the code remains blocked in the first task.
  3. Only the first led flashes permanently, the second stays off.
  4. Yes, the rc response is ok.
  5. No, I haven't changed anything.

I don't think so because the two tasks were created. Both tasks have a priority of 1.

GogoVega.

— Reply to this email directly, view it on GitHub https://github.com/ve3wwg/esp32_freertos/issues/2#issuecomment-1329219432, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA47P6CLINN5MKITBZ4CTZLWKS7R7ANCNFSM6AAAAAAR44HTIY . You are receiving this because you were mentioned.Message ID: @.***>