panic_abort and dirty second stage bootloader.

ujurmsde
Posts: 38
Joined: Tue Jan 19, 2021 6:37 am

panic_abort and dirty second stage bootloader.

Postby ujurmsde » Sat Jul 31, 2021 3:47 am

I have an ESP-IDF project which is causing a panic abort. I know that one of the task which I have is causing such abord but the reason is still unclear. The following code is that task.

Code: Select all

void task(void *pvParameters)
{
    float bus_voltage, shunt_voltage, current, power;
    ina219_t dev;
    memset(&dev, 0, sizeof(ina219_t));

    ESP_ERROR_CHECK(ina219_init_desc(&dev, I2C_ADDR, I2C_PORT, SDA_GPIO, SCL_GPIO));
    ESP_LOGI(TAG1, "Initializing INA219");
    ESP_ERROR_CHECK(ina219_init(&dev));

    ESP_LOGI(TAG1, "Configuring INA219");
    ESP_ERROR_CHECK(ina219_configure(&dev, INA219_BUS_RANGE_16V, INA219_GAIN_0_125,
            INA219_RES_12BIT_1S, INA219_RES_12BIT_1S, INA219_MODE_CONT_SHUNT_BUS));

    ESP_LOGI(TAG1, "Calibrating INA219");
    ESP_ERROR_CHECK(ina219_calibrate(&dev, 5.0, 0.1)); // 5A max current, 0.1 Ohm shunt resistance


    ESP_LOGI(TAG1, "Starting the loop");
    
    while (1)
    {
    ESP_ERROR_CHECK(ina219_get_bus_voltage(&dev, &bus_voltage));
        ESP_ERROR_CHECK(ina219_get_shunt_voltage(&dev, &shunt_voltage));
        ESP_ERROR_CHECK(ina219_get_current(&dev, &current));
        ESP_ERROR_CHECK(ina219_get_power(&dev, &power));
        /* Using float in printf() requires non-default configuration in
         * sdkconfig. See sdkconfig.defaults.esp32 and
         * sdkconfig.defaults.esp8266  */
        printf("VBUS: %.04f V, VSHUNT: %.04f mV, IBUS: %.04f mA, PBUS: %.04f mW\n",
                bus_voltage, shunt_voltage * 1000, current * 1000, power * 1000);

        vTaskDelay(pdMS_TO_TICKS(500));
        
    }
}
The error is the following. Also, in the project I have two tasks and the first one is pinned to core 1.

Code: Select all

xTaskCreatePinnedToCore(&aws_iot_task, "aws_iot_task", 9216, NULL, 5, NULL, 1);
abort() was called at PC 0x4008b941 on core 0
0x4008b941: xQueueGenericReceive at /user/esp/esp-idf/components/freertos/queue.c:1447 (discriminator 1)

load:0x40080400,len:4568
0x40080400: _init at ??:?

entry 0x400806f4
I (31) boot: ESP-IDF v4.2-dirty 2nd stage bootloader
I (31) boot: compile time 21:14:15
I (31) boot: chip revision: 1
I (35) boot_comm: chip revision: 1, min. bootloader chip revision: 0
I (42) boot.esp32: SPI Speed : 40MHz
I (46) boot.esp32: SPI Mode : DIO
I (51) boot.esp32: SPI Flash Size : 2MB
I (55) boot: Enabling RNG early entropy source...
I (61) boot: Partition Table:
I (64) boot: ## Label Usage Type ST Offset Length
I (72) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (79) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (87) boot: 2 factory factory app 00 00 00010000 00100000
I (94) boot: End of partition table
I (98) boot_comm: chip revision: 1, min. application chip revision: 0
I (105) esp_image: segment 0: paddr=0x00010020 vaddr=0x3f400020 size=0x1d6fc (120572) map
I (160) esp_image: segment 1: paddr=0x0002d724 vaddr=0x3ffb0000 size=0x028f4 ( 10484) load
I (165) esp_image: segment 2: paddr=0x00030020 vaddr=0x400d0020 size=0x892d4 (561876) map
0x400d0020: _stext at ??:?

ujurmsde
Posts: 38
Joined: Tue Jan 19, 2021 6:37 am

Re: panic_abort and dirty second stage bootloader.

Postby ujurmsde » Mon Aug 02, 2021 9:47 am

I solved the problem. The solution was that to initialize the I2C API properly.

Usually, the panic abort and dirty second stage bootloader error occurs when there is problem with hardware wiring or some damage etc.

Who is online

Users browsing this forum: No registered users and 53 guests