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

Undefined refernce to esp pthread set cfg #4

Closed
enelson1001 opened this issue Nov 9, 2018 · 10 comments
Closed

Undefined refernce to esp pthread set cfg #4

enelson1001 opened this issue Nov 9, 2018 · 10 comments

Comments

@enelson1001
Copy link
Contributor

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

@PerMalmberg
Copy link
Owner

What version of ESP-IDF are you using? I'm developing against the latest master.

@enelson1001
Copy link
Contributor Author

enelson1001 commented Nov 9, 2018 via email

@PerMalmberg
Copy link
Owner

PerMalmberg commented Nov 10, 2018

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?

@enelson1001
Copy link
Contributor Author

enelson1001 commented Nov 11, 2018 via email

@PerMalmberg
Copy link
Owner

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.

@enelson1001
Copy link
Contributor Author

enelson1001 commented Nov 13, 2018 via email

PerMalmberg added a commit that referenced this issue Nov 13, 2018
@PerMalmberg
Copy link
Owner

  1. Looks like the main task is starved of CPU cycles. Are you running with the sdconfig that comes with smooth or a custom one?
  2. No? What does sdcard.cpp have to do with the queue example?
  3. As expected.
  4. The idle task easily gets starved of CPU cycles and unless you actually utilize it to perform work, it is nothing to worry about.
  5. That's a mistake Fixed in this commit

I'll try to remember to run the queue example when I get back home to double check that it works.

@PerMalmberg
Copy link
Owner

@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

@enelson1001
Copy link
Contributor Author

enelson1001 commented Nov 14, 2018 via email

@PerMalmberg
Copy link
Owner

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.

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

2 participants