Page 1 of 1

Debugging - Breakpoint at xTaskCreate() does not work

Posted: Wed Jul 10, 2019 8:14 am
by mikbeng
Hello,

I'm currently trying out the Debugging features on ESP32 and have been following this guide successfully:
https://docs.espressif.com/projects/esp ... mmand-line

However, I have some issues/questions regarding breakpoints on Freertos functions. I'm currently testing on the example project blink under examples/get-started/blink.

Setting breakpoints in the code works fine for all the places except on row 46 at xTaskCreate:

Code: Select all

void blink_task(void *pvParameter)
{
    /* Configure the IOMUX register for pad BLINK_GPIO (some pads are
       muxed to GPIO on reset already, but some default to other
       functions and need to be switched to GPIO. Consult the
       Technical Reference for a list of pads and their default
       functions.)
    */
    gpio_pad_select_gpio(BLINK_GPIO);
    /* Set the GPIO as a push/pull output */
    gpio_set_direction(BLINK_GPIO, GPIO_MODE_OUTPUT);
    while(1) {
        /* Blink off (output low) */
        gpio_set_level(BLINK_GPIO, 0);
        vTaskDelay(1000 / portTICK_PERIOD_MS);
        /* Blink on (output high) */
        gpio_set_level(BLINK_GPIO, 1);
        vTaskDelay(1000 / portTICK_PERIOD_MS);
    }
}

void app_main()
{   
    printf("Hello testing..\n");
    xTaskCreate(&blink_task, "blink_task", configMINIMAL_STACK_SIZE, NULL, 5, NULL);
}

When i do this in GDB terminal with the command break 46, I get "No line 46 in the current file":

Target halted. PRO_CPU: PC=0x400D1E23 (active) APP_CPU: PC=0x400E2736

Temporary breakpoint 1, app_main () at ../main/blink.c:45
45 printf("Hello testing..\n");
(gdb) break 46
No line 46 in the current file.
Make breakpoint pending on future shared library load? (y or [n])


Why is it that gdb can't find line 46?? When I type "list" in gdb I can clearly see it's there:

(gdb) list
40 }
41 }
42
43 void app_main()
44 {
45 printf("Hello testing..\n");
46 xTaskCreate(&blink_task, "blink_task", configMINIMAL_STACK_SIZE, NULL, 5, NULL);
47 }
(gdb)


I'm using esp-idf v3.2.2 (stable) with OpenOCD v0.10.0-esp32-20190708

Any info on this would be much appreciated!

Re: Debugging - Breakpoint at xTaskCreate() does not work

Posted: Sun Jul 14, 2019 8:47 am
by Ritesh
mikbeng wrote:
Wed Jul 10, 2019 8:14 am
Hello,

I'm currently trying out the Debugging features on ESP32 and have been following this guide successfully:
https://docs.espressif.com/projects/esp ... mmand-line

However, I have some issues/questions regarding breakpoints on Freertos functions. I'm currently testing on the example project blink under examples/get-started/blink.

Setting breakpoints in the code works fine for all the places except on row 46 at xTaskCreate:

Code: Select all

void blink_task(void *pvParameter)
{
    /* Configure the IOMUX register for pad BLINK_GPIO (some pads are
       muxed to GPIO on reset already, but some default to other
       functions and need to be switched to GPIO. Consult the
       Technical Reference for a list of pads and their default
       functions.)
    */
    gpio_pad_select_gpio(BLINK_GPIO);
    /* Set the GPIO as a push/pull output */
    gpio_set_direction(BLINK_GPIO, GPIO_MODE_OUTPUT);
    while(1) {
        /* Blink off (output low) */
        gpio_set_level(BLINK_GPIO, 0);
        vTaskDelay(1000 / portTICK_PERIOD_MS);
        /* Blink on (output high) */
        gpio_set_level(BLINK_GPIO, 1);
        vTaskDelay(1000 / portTICK_PERIOD_MS);
    }
}

void app_main()
{   
    printf("Hello testing..\n");
    xTaskCreate(&blink_task, "blink_task", configMINIMAL_STACK_SIZE, NULL, 5, NULL);
}

When i do this in GDB terminal with the command break 46, I get "No line 46 in the current file":

Target halted. PRO_CPU: PC=0x400D1E23 (active) APP_CPU: PC=0x400E2736

Temporary breakpoint 1, app_main () at ../main/blink.c:45
45 printf("Hello testing..\n");
(gdb) break 46
No line 46 in the current file.
Make breakpoint pending on future shared library load? (y or [n])


Why is it that gdb can't find line 46?? When I type "list" in gdb I can clearly see it's there:

(gdb) list
40 }
41 }
42
43 void app_main()
44 {
45 printf("Hello testing..\n");
46 xTaskCreate(&blink_task, "blink_task", configMINIMAL_STACK_SIZE, NULL, 5, NULL);
47 }
(gdb)


I'm using esp-idf v3.2.2 (stable) with OpenOCD v0.10.0-esp32-20190708

Any info on this would be much appreciated!
Hello,

Can you please try with Master branch as well? Also did you check with upto 45 lines you are able to put break points correctly without any issue?