Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TW#12796] example aws_iot - subscribe_publish crash if using xTaskCreatePinnedToCore #624

Closed
WilliamFrasson opened this issue May 18, 2017 · 1 comment

Comments

@WilliamFrasson
Copy link

using the AWS_IoT example "subscribe_publish"
for creating the aws_iot_task task, it is used xTaskCreatePinnedToCore

using my DevKitC it crash when application call the xTaskCreatePinnedToCore
while using
xTaskCreate(&aws_iot_task, "aws_iot_task", stack_size, NULL, 5, xHandle);

the fw works.

why xTaskCreatePinnedToCore create this problem?

@FayeY FayeY changed the title example aws_iot - subscribe_publish crash if using xTaskCreatePinnedToCore [TW#12796] example aws_iot - subscribe_publish crash if using xTaskCreatePinnedToCore May 23, 2017
@FayeY FayeY closed this as completed Nov 21, 2017
@FayeY FayeY reopened this Nov 21, 2017
@ustccw
Copy link
Collaborator

ustccw commented Nov 22, 2017

@WilliamFrasson
plz try the latest code, we have used the xTaskCreatePinnedToCore at the beginning of the app_main()

but you need to replace the total app_main() with the following code:

void app_main()
{
    // Initialize NVS.
    esp_err_t err = nvs_flash_init();
    if (err == ESP_ERR_NVS_NO_FREE_PAGES) {
        // app partition table has a smaller NVS partition size than the non-OTA
        // partition table. This size mismatch may cause NVS initialization to fail.
        // If this happens, we erase NVS partition and initialize NVS again.
        ESP_ERROR_CHECK(nvs_flash_erase());
        err = nvs_flash_init();
    }
    ESP_ERROR_CHECK( err );


    initialise_wifi();
#ifdef CONFIG_MBEDTLS_DEBUG
    const size_t stack_size = 36*1024;
#else
    const size_t stack_size = 36*1024;
#endif
    xTaskCreatePinnedToCore(&aws_iot_task, "aws_iot_task", stack_size, NULL, 5, NULL, 1);
}

@FayeY FayeY closed this as completed Nov 22, 2017
igrr pushed a commit that referenced this issue Nov 23, 2017
WiFi used to initialise nvs automatically, but it doesn't now.
see more info: #624

Closes #624
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants