-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Undefined refernce to esp pthread set cfg #4
Comments
What version of ESP-IDF are you using? I'm developing against the latest master. |
Resolved - switched to latest (master branch) of esp-idf and changed IDE to
Eclipse.
Still had to change smooth/include/smooth/core/json/Value.h line #6 from
#include <json/cJSON/cJSON.h> to #include <cJSON.h> or else compiler could
not find the cJSON.h file.
Thanks
…On Fri, Nov 9, 2018 at 1:13 AM Per Malmberg ***@***.***> wrote:
What version of ESP-IDF are you using? I'm developing against the latest
master.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Apd4_2rEV2riWa5U4lg42dfXjnwgXYxGks5utTlEgaJpZM4YV73n>
.
|
That is odd, somehow you have an include path to ${IDF_PATH}/components/json/cJSON instead of ${IDF_PATH}/components. Did you regenerate the project? Also, did you update the IDF submodules? |
Per
I am using Eclipse Photon
To get project to compile without errors and to have the #includes resolved
correctly I had to do the following.
1. To get the #includes to resolve correctly:
a. Projects-> properties -> C/C++ General -> Paths and Symbols -> Go
to Includes tab then click add button and add ${IDF_PATH}/components to GNU
C and GNU C++ "Include directories".
b. If I open smooth/include/smooth/core/json/Value.h and go to
#include <json/cJSON/cJSON> and right click and select Open Declaration I
will see the cJSON.h file.
2. To get The project to compile without the fatal error:
json/cJSON/cJSON.h: No such file or directory I had to do the following.
a. Modify component.mk file located in esp-idf/components/json so it
looked like the following.
#
# Component Makefile
#
COMPONENT_ADD_INCLUDEDIRS := ../ *<-- THIS IS NEW*
#COMPONENT_ADD_INCLUDEDIRS := cJSON *<--- THIS IS ORIG*
COMPONENT_SRCDIRS := cJSON
COMPONENT_SUBMODULES := cJSON
COMPONENT_OBJS := cJSON/cJSON.o cJSON/cJSON_Utils.o
Then in the build directory: build/json the component_project_vars.mk
looked like this.
# Automatically generated build file. Do not edit.
COMPONENT_INCLUDES += $(IDF_PATH)/components *<-- THIS IS WITH MOD*
COMPONENT_LDFLAGS += -L$(BUILD_DIR_BASE)/json -ljson
COMPONENT_LINKER_DEPS +=
COMPONENT_SUBMODULES += $(IDF_PATH)/components/json/cJSON
COMPONENT_LIBRARIES += json
component-json-build:
Before the modification line #1 looked like this
COMPONENT_INCLUDES += $(IDF_PATH)/components/json/cJSON *<--ORIG*
Not sure if this is the correct way to fix the problem but it worked?????
Thanks
…On Sat, Nov 10, 2018 at 1:22 AM Per Malmberg ***@***.***> wrote:
That is odd, somehow you have an include path to
${IDF_PATH}/components/json/cJSON instead of ${IDF_PATH}/components.
Did you regenerate the project?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Apd4_9Jo-0urkmnQMTQnFcT9LwziseCHks5utozQgaJpZM4YV73n>
.
|
Ah, so you're not using it as a CMake-project; that explains why you have to make changes. I use CLion ad my IDE and while IDF's CMake-ish setup isn't yet really finished it works well enough until Espressif release a new version of the CMake support. |
Per
I am trying to go thru the test code you placed under the test folder. The
2nd test program I am trying to run is under "queue" but App::event(const
timer::ElapsedTime& event) never gets called. If I add log.info to
SenderTask::tick() I do see log.info that tic is being called.
1. The terminal displays (without the log.info inside tick())the following.
I (2706828) SocketDispatcher: Minimum free stack: 4700 of 8192 => 3492 used.
I (2706838) SenderTask: Minimum free stack: 7156 of 8192 => 1036 used.
2. Is something missing in sdcard.cpp or queue.h?
3. My main.cpp looks like this.
#include <queue.h>
extern "C" {
void app_main()
{
queue::App app;
app.start();
}
}
4. If I change SenderTask tick interval from 1 millisecond to 500
milliseconds I see the following message on terminal.
E (10424) task_wdt: Task watchdog got triggered. The following tasks did
not reset the watchdog in time:
E (10424) task_wdt: - IDLE1 (CPU 1)
E (10424) task_wdt: Tasks currently running:
E (10424) task_wdt: CPU 0: main
E (10424) task_wdt: CPU 1: pthread
5. Why does QueueNotification.h have #include "QueueNotification.h" inside
the file?
Thanks
…On Sun, Nov 11, 2018 at 2:48 AM Per Malmberg ***@***.***> wrote:
Ah, so you're not using it as a CMake-project; that explains why you have
to make changes. I use CLion ad my IDE and while IDF's CMake-ish setup
isn't yet really finished
<https://www.esp32.com/viewtopic.php?f=13&t=7535> it works well enough
until Espressif release a new version of the CMake support.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Apd4_wHQyY-hQl3s_GqHwt0mpwHmog7bks5ut_J4gaJpZM4YV73n>
.
|
I'll try to remember to run the queue example when I get back home to double check that it works. |
@enelson1001 I just ran the queue example without modifications (using the sdkonfig file included with the Smooth test project) and it behaves as expected with the following output:
|
Per
After downloading the sdkonfig file and partitions.csv file I was able to
get the queue program to work.
I (10) cpu_start: Starting scheduler on APP CPU.
D (290) heap_init: New heap initialised at 0x3ffe0440
D (290) heap_init: New heap initialised at 0x3ffe4350
V (300) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (300) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting
flags 0xE
D (300) intr_alloc: Connected src 16 to int 12 (cpu 0)
V (320) pthread: pthread_once: call init_routine 0x3ffb123c
V (320) pthread: pthread_once: call init_routine 0x3ffb1234
V (330) Queue: Creating queue 'system_event-TaskEventQueue', with 10 items
of size 48.
D (340) nvs: nvs_flash_init_custom partition=nvs start=9 count=6
V (400) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): checking args
V (400) intr_alloc: esp_intr_alloc_intrstatus (cpu 0): Args okay. Resulting
flags 0xE
D (400) intr_alloc: Connected src 22 to int 13 (cpu 0)
V (410) Queue: Creating queue 'string queue-TaskEventQueue', with 10 items
of size 32.
V (420) Task: Initializing task 'MainTask'
V (420) Queue: Creating queue 'SocketDispatcher-TaskEventQueue', with 10
items of size 8.
V (430) Queue: Creating queue 'SocketOperations-TaskEventQueue', with 20
items of size 12.
D (440) SocketDispatcher: Creating worker thread
V (440) pthread: pthread_create
V (450) pthread: Created task 3ffc6ddc
V (450) pthread: pthread_task_func ENTER 0x4011e8ac
V (450) pthread: pthread_task_func START 0x4011e8ac
D (460) SocketDispatcher: Waiting for worker to start
D (470) SenderTask: Creating worker thread
V (470) pthread: pthread_create
V (470) Task: Initializing task 'SocketDispatcher'
V (480) pthread: Created task 3ffc700c
V (480) Task: Task 'SocketDispatcher' initialized
D (490) SenderTask: Waiting for worker to start
V (480) pthread: pthread_task_func ENTER 0x4011e8ac
V (500) pthread: pthread_task_func START 0x4011e8ac
V (500) Task: Task 'MainTask' initialized
V (500) Task: Initializing task 'SenderTask'
V (510) Task: Task 'SenderTask' initialized
D (1480) Stats: Avg: 393.52us per message, Count: 100, Last msg: 318us
D (2470) Stats: Avg: 382.06us per message, Count: 200, Last msg: 374us
D (3470) Stats: Avg: 379.36us per message, Count: 300, Last msg: 377us
D (4450) Stats: Avg: 385.74us per message, Count: 400, Last msg: 392us
D (5410) Stats: Avg: 396.00us per message, Count: 500, Last msg: 382us
D (6340) Stats: Avg: 398.67us per message, Count: 600, Last msg: 130us
D (7330) Stats: Avg: 394.96us per message, Count: 700, Last msg: 382us
D (8270) Stats: Avg: 393.06us per message, Count: 800, Last msg: 382us
D (9210) Stats: Avg: 400.03us per message, Count: 900, Last msg: 383us
Thanks
…On Tue, Nov 13, 2018 at 12:32 PM Per Malmberg ***@***.***> wrote:
@enelson1001 <https://github.com/enelson1001> I just ran the queue
example without modifications (using the sdkonfig file included with the
Smooth test project) and it behaves as expected with the following output:
(V)Queue: Creating queue 'string queue-TaskEventQueue', with 10 items of
size 32.
(D)MainTask: Running as attached thread
(D)MainTask: Executing...
(V)MainTask: Initializing...
(V)Queue: Creating queue 'SocketDispatcher-TaskEventQueue', with 10 items
of size 8.
(V)Queue: Creating queue 'SocketOperations-TaskEventQueue', with 20 items
of size 12.
(D)SocketDispatcher: Creating worker thread
(D)SocketDispatcher: Waiting for worker to start
(D)SocketDispatcher: Executing...
(D)SocketDispatcher: Notify start_mutex
(D)SenderTask: Creating worker thread
(D)SenderTask: Waiting for worker to start
(V)SocketDispatcher: Initializing...
(V)SocketDispatcher: Initialized
(D)SenderTask: Executing...
(D)SenderTask: Notify start_mutex
(V)SenderTask: Initializing...
(V)SenderTask: Initialized
(V)MainTask: Initialized
(D)Stats: Avg: 226.03us per message, Count: 100, Last msg: 130us
(D)Stats: Avg: 312.69us per message, Count: 200, Last msg: 129us
(D)Stats: Avg: 290.99us per message, Count: 300, Last msg: 129us
(D)Stats: Avg: 310.39us per message, Count: 400, Last msg: 129us
(D)Stats: Avg: 279.65us per message, Count: 500, Last msg: 130us
(D)Stats: Avg: 288.78us per message, Count: 600, Last msg: 130us
(D)Stats: Avg: 288.39us per message, Count: 700, Last msg: 129us
(D)Stats: Avg: 272.25us per message, Count: 800, Last msg: 130us
(D)Stats: Avg: 308.07us per message, Count: 900, Last msg: 1000us
(D)Stats: Avg: 297.42us per message, Count: 1000, Last msg: 129us
(D)Stats: Avg: 288.01us per message, Count: 1100, Last msg: 129us
(D)Stats: Avg: 289.48us per message, Count: 1200, Last msg: 129us
(D)Stats: Avg: 283.30us per message, Count: 1300, Last msg: 129us
(D)Stats: Avg: 280.42us per message, Count: 1400, Last msg: 129us
(D)Stats: Avg: 275.51us per message, Count: 1500, Last msg: 130us
(D)Stats: Avg: 269.08us per message, Count: 1600, Last msg: 129us
(D)Stats: Avg: 267.06us per message, Count: 1700, Last msg: 129us
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/Apd4_4ML3zOcyj49hTEyAvt0br2CbMp2ks5uux5pgaJpZM4YV73n>
.
|
Great. I'm guessing it is the FreeRTOS tick that was different. I think I set it to the maximum 1000 to be able to get the highest possible timer resolution. |
I am trying to build a simple hello world. I am using VSCode for IDE and have been using nkolban esp32 snippets without any problem. This is the error I am seeing on the build.
LD build/hello_world.elf
/home/ed/esp32/projects/sandbox/hello_world/build/smooth/libsmooth.a(Task.o):(.literal._ZN6smooth4core4Task5startEv+0x10): undefined reference to
esp_pthread_set_cfg(esp_pthread_cfg_t const*)' /home/ed/esp32/projects/sandbox/hello_world/build/smooth/libsmooth.a(Task.o): In function
smooth::core::Task::start()':/home/ed/esp32/esp-idf/components/smooth/include/smooth/core/Task.h:78: undefined reference to `esp_pthread_set_cfg(esp_pthread_cfg_t const*)'
collect2: error: ld returned 1 exit status
/home/ed/esp32/esp-idf/make/project.mk:405: recipe for target '/home/ed/esp32/projects/sandbox/hello_world/build/hello_world.elf' failed
make: *** [/home/ed/esp32/projects/sandbox/hello_world/build/hello_world.elf] Error 1
The terminal process terminated with exit code: 2
Any idea what is going on?
I am using commit 2f32356. as I was having problems with the latest commit. Even with this commit I had to change smooth/include/smooth/core/json/Value.h line #6 from #include <json/cJSON/cJSON.h> to #include <cJSON.h> or else compiler could not find thecJSON.h file.
Thanks
The text was updated successfully, but these errors were encountered: