Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Real time embedded FreeRTOS mailing list 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem TCP & FAT Training




Loading

The problem of data transfer between the cores on ESP-Wroom-32.

Posted by orangepizero on August 1, 2017

Hello. In this code it is not possible to print correctly the data on each task. I can not understand the reason. The output of the program is below. How do I get the HELLO_WORLD string in each of the tasks in the output? Using the parameter transfer. Thank you. ~~~

include
include "freertos/FreeRTOS.h"
include "freertos/task.h"
include "freertos/event_groups.h"
include "esp_system.h"
include "espeventloop.h"
include "esp_log.h"
include "nvs_flash.h"

const sizet stacksize = 4096;

static void task1(void *pvParameters) { ESPLOGE("TASK", "TASK CORE1: %s", (char *)pvParameters); vTaskDelete(NULL); }

static void taskmain(void *pvParameters) { char *data = (char *)pvParameters; while(1) { ESPLOGI("TASK", "TASK CORE0: %s", data); vTaskDelay(1000 / portTICKRATEMS); xTaskCreatePinnedToCore(&task1, "task1", stacksize, (void*)&data, 2, NULL, 1); } vTaskDelete(NULL); }

void appmain() { char data[12] = "HELLOWORLD"; xTaskCreatePinnedToCore(&taskmain, "taskmain", stack_size, (void*)&data, 1, NULL, 0); } ~~~

OUTPUT: ~~~ E (264246) TASK: TASK CORE1: ��? I (265246) TASK: TASK CORE0: E (265246) TASK: TASK CORE1: ��? I (266246) TASK: TASK CORE0: E (266246) TASK: TASK CORE1: ��? I (267246) TASK: TASK CORE0: E (267246) TASK: TASK CORE1: ��? I (268246) TASK: TASK CORE0: E (268246) TASK: TASK CORE1: ��? I (269246) TASK: TASK CORE0: E (269246) TASK: TASK CORE1: ��? I (270246) TASK: TASK CORE0: E (270246) TASK: TASK CORE_1: ��? ~~~


The problem of data transfer between the cores on ESP-Wroom-32.

Posted by hs2sf on August 1, 2017

Probably because appmain is left and the string is a stack variable at least concerning taskmain. Be careful with the lifetime of data given by pvParameters. Why not using a task local string ? Provided that ESP_LOGI irtself is thread-safe of course ;)


[ Back to the top ]    [ About FreeRTOS ]    [ Sitemap ]    [ ]




Copyright (C) 2004-2010 Richard Barry. Copyright (C) 2010-2016 Real Time Engineers Ltd.
Any and all data, files, source code, html content and documentation included in the FreeRTOSTM distribution or available on this site are the exclusive property of Real Time Engineers Ltd.. See the files license.txt (included in the distribution) and this copyright notice for more information. FreeRTOSTM and FreeRTOS.orgTM are trade marks of Real Time Engineers Ltd.

Latest News:

FreeRTOS V9.0.0 is now available for download.


Free TCP/IP and file system demos for the RTOS


Sponsored Links

⇓ Now With No Code Size Limit! ⇓
⇑ Free Download Without Registering ⇑


FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Renesas Electronics Gold Alliance RTOS Partner.jpg

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Atmel RTOS partner supporting ARM Cortex-M3 and AVR32 microcontrollers

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Xilinx Microblaze and Zynq partner

Silicon Labs low power RTOS partner

Altera RTOS partner for Nios II and Cortex-A9 SoC

Freescale Alliance RTOS Member supporting ARM and ColdFire microcontrollers

Infineon ARM Cortex-M microcontrollers

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

Cypress RTOS partner supporting ARM Cortex-M3

Fujitsu RTOS partner supporting ARM Cortex-M3 and FM3

Microsemi (previously Actel) RTOS partner supporting ARM Cortex-M3

Atollic Partner

IAR Partner

Keil ARM Partner

Embedded Artists