I (44) boot: ESP-IDF v2.0-rc1-73-g61c7bd3 2nd stage bootloader
I (44) boot: compile time 12:27:30
I (45) boot: Enabling RNG early entropy source...
I (64) boot: SPI Speed : 40MHz
I (77) boot: SPI Mode : DIO
I (89) boot: SPI Flash Size : 4MB
I (102) boot: Partition Table:
I (113) boot: ## Label Usage Type ST Offset Length
I (136) boot: 0 nvs WiFi data 01 02 00009000 00006000
I (159) boot: 1 phy_init RF data 01 01 0000f000 00001000
I (182) boot: 2 factory factory app 00 00 00010000 00100000
I (206) boot: End of partition table
I (219) boot: Disabling RNG early entropy source...
I (236) boot: Loading app partition at offset 00010000
I (518) boot: segment 0: paddr=0x00010018 vaddr=0x00000000 size=0x0ffe8 ( 65512)
I (518) boot: segment 1: paddr=0x00020008 vaddr=0x3f400010 size=0x02eb4 ( 11956) map
I (534) boot: segment 2: paddr=0x00022ec4 vaddr=0x3ffb0000 size=0x01af0 ( 6896) load
I (564) boot: segment 3: paddr=0x000249bc vaddr=0x40080000 size=0x00400 ( 1024) load
I (588) boot: segment 4: paddr=0x00024dc4 vaddr=0x40080400 size=0x08858 ( 34904) load
I (630) boot: segment 5: paddr=0x0002d624 vaddr=0x400c0000 size=0x00000 ( 0) load
I (639) boot: segment 6: paddr=0x0002d62c vaddr=0x00000000 size=0x029dc ( 10716)
I (664) boot: segment 7: paddr=0x00030010 vaddr=0x400d0018 size=0x0e008 ( 57352) map
I (691) heap_alloc_caps: Initializing. RAM available for dynamic allocation:
I (714) heap_alloc_caps: At 3FFB22F8 len 0002DD08 (183 KiB): DRAM
I (735) heap_alloc_caps: At 3FFE8000 len 00018000 (96 KiB): D/IRAM
I (756) heap_alloc_caps: At 40088C58 len 000173A8 (92 KiB): IRAM
I (776) cpu_start: Pro cpu up.
I (788) cpu_start: Starting app cpu, entry point is 0x40080a5c
I (0) cpu_start: App cpu up.
I (819) cpu_start: Pro cpu start user code
I (880) cpu_start: Starting scheduler on PRO CPU.
I (81) cpu_start: Starting scheduler on APP CPU.
Hello world from core 0!
Hello world from core 1!
Hello world from core 0!
Hello world from core 1!
Hello world from core 0!
Hello world from core 0!
Hello world from core 1!
Code: Select all
/* Hello World Example
This example code is in the Public Domain (or CC0 licensed, at your option.)
Unless required by applicable law or agreed to in writing, this
software is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied.
*/
#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_system.h"
#include "nvs_flash.h"
#define core_0 0
#define core_1 1
void hello_task_core_1(void *pvParameter)
{
while(1){
printf("Hello world from core %d!\n", xPortGetCoreID() );
vTaskDelay(872 / portTICK_PERIOD_MS);
fflush(stdout);
}
}
void hello_task_core_0(void *pvParameter)
{
while(1) {
printf("Hello world from core %d!\n", xPortGetCoreID() );
vTaskDelay(1323 / portTICK_PERIOD_MS);
fflush(stdout);
}
}
void app_main()
{
nvs_flash_init();
xTaskCreatePinnedToCore(&hello_task_core_0, "core1_task", 1024*4, NULL, configMAX_PRIORITIES - 1, NULL, core_0);
xTaskCreatePinnedToCore(&hello_task_core_1, "core0_task", 1024*4, NULL, configMAX_PRIORITIES - 1, NULL, core_1);
}
best wishes
rudi
edit:
if you have tested and wounder why your process hang up
posted hand made code here with a mistake on core numbers core_0, core_1 and the print messages to "core1_task", "core0_task"
Code: Select all
xTaskCreatePinnedToCore(&hello_task_core_1, "core1_task", 1024*4, NULL, configMAX_PRIORITIES - 1, NULL, core_0);
xTaskCreatePinnedToCore(&hello_task_core_0, "core0_task", 1024*4, NULL, configMAX_PRIORITIES - 1, NULL, core_1);
and have edit by hand only the last param ( core_0 , core_1 to core_1, core_0 ) after i have seen
that was difference code to my running example,
Code: Select all
xTaskCreatePinnedToCore(&hello_task_core_1, "core1_task", 1024*4, NULL, configMAX_PRIORITIES - 1, NULL, core_1);
xTaskCreatePinnedToCore(&hello_task_core_0, "core0_task", 1024*4, NULL, configMAX_PRIORITIES - 1, NULL, core_0);
but have posted my running outputs
I (880) cpu_start: Starting scheduler on PRO CPU.
I (81) cpu_start: Starting scheduler on APP CPU.
( it runs because the core_0 was start as first ..( mistake printf..core1_task )
Code: Select all
xTaskCreatePinnedToCore(&hello_task_core_1, "core1_task", 1024*4, NULL, configMAX_PRIORITIES - 1, NULL, core_0);
xTaskCreatePinnedToCore(&hello_task_core_0, "core0_task", 1024*4, NULL, configMAX_PRIORITIES - 1, NULL, core_1);
now have changed on posted code the enumeration on TaskCreatedPinnedToCore
from ( just in time not running code )
Code: Select all
xTaskCreatePinnedToCore(&hello_task_core_1, "core1_task", 1024*4, NULL, configMAX_PRIORITIES - 1, NULL, core_1);
xTaskCreatePinnedToCore(&hello_task_core_0, "core0_task", 1024*4, NULL, configMAX_PRIORITIES - 1, NULL, core_0);
to ( running code )
I (880) cpu_start: Starting scheduler on PRO CPU.
I (81) cpu_start: Starting scheduler on APP CPU.
Code: Select all
xTaskCreatePinnedToCore(&hello_task_core_0, "core1_task", 1024*4, NULL, configMAX_PRIORITIES - 1, NULL, core_0);
xTaskCreatePinnedToCore(&hello_task_core_1, "core0_task", 1024*4, NULL, configMAX_PRIORITIES - 1, NULL, core_1);
now it is same code like here at my desk the code and output run.
further info see here
btw..
No one noticed the wrong mistake in code posting from me?