Hallo,
ich habe immer noch Probleme ein Projekt für einen NodeMCU zu bauen.
Ich bin hiernach vorgegangen
https://docs.espressif.com/projects/esp8266-rtos-sdk/en/latest/get-started/
unter C:\msys32\opt liegt xtensa-lx106-elf
unter C:\msys32\home\esp liegt ESP8266_RTOS_SDK und esp-idf
Das Projekt hello-world habe ich mir nach H:\projects\esp kopiert.
Wie in der Anleitung, konnte ich es hier compilieren und flashen.
Jetzt wollte ich ein eigenes Projekt anlegen und das lässt sich nicht
mehr bauen. Ich weiß auch nicht mehr woran es noch liegen könnte.
Ich habe einen Ordner
connect_router
in diesem Ordner ist
CMakeLists.txt
1 | # The following lines of boilerplate have to be in your project's
|
2 | # CMakeLists in this exact order for cmake to work correctly
|
3 | cmake_minimum_required(VERSION 3.5)
|
4 |
|
5 | include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
6 | project(connect-router)
|
Makefile
1 | #
|
2 | # This is a project Makefile. It is assumed the directory this Makefile resides in is a
|
3 | # project subdirectory.
|
4 | #
|
5 |
|
6 | PROJECT_NAME := connect-router
|
7 |
|
8 | include $(IDF_PATH)/make/project.mk
|
eine erstellte sdkonfig
Sowie ein Ordner "main"
Dieser Ordner enthält
component.mk
1 | #
|
2 | # "main" pseudo-component makefile.
|
3 | #
|
4 | # (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.)
|
5 | #
|
sowie
connect_router.c (Diese gibt es nur einmal. Habe sie aber für zwei
verschiedene Möglichkeiten angepasst)
ohne rtos:
1 | #include <stdio.h>
|
2 | #include <stdint.h>
|
3 | //#include "esp_log.h"
|
4 | //#include "esp_idf_version.h"
|
5 |
|
6 |
|
7 | //void __attribute__((weak)) app_main(void)
|
8 | int main(void)
|
9 | {
|
10 | //ESP_LOGI(TAG, "SDK factory test firmware version:%s\n", esp_get_idf_version());
|
11 | while(1)
|
12 | {
|
13 | printf("print\r\n");
|
14 | for(uint8_t x=0; x<=100; x++)
|
15 | {
|
16 | volatile uint8_t y = 0;
|
17 | }
|
18 | }
|
19 |
|
20 | return 1;
|
21 | }
|
mit RTOS
1 | #include <stdio.h>
|
2 | #include <stdint.h>
|
3 | //#include "esp_log.h"
|
4 | //#include "esp_idf_version.h"
|
5 |
|
6 |
|
7 | void __attribute__((weak)) app_main(void)
|
8 | {
|
9 | //ESP_LOGI(TAG, "SDK factory test firmware version:%s\n", esp_get_idf_version());
|
10 | while(1)
|
11 | {
|
12 | printf("print\r\n");
|
13 | for(uint8_t x=0; x<=100; x++)
|
14 | {
|
15 | volatile uint8_t y = 0;
|
16 | }
|
17 | }
|
18 | }
|
Die ganzen files (bis auf connect_router.c) sind aus dem beispielprojekt
hello-world kopiert und mit dem neuen namen angepasst.
Wenn ich das Projekt connect_router.c ohne rtos bauen möchte (habe es im
menuconfig dekatirviert)
bekomme ich von make die rückgabe
1 | C:/msys32/home/esp/ESP8266_RTOS_SDK/components/newlib/newlib/port/locks.c:170: undefined reference to `xTaskGetSchedulerState'
|
2 | C:/msys32/home/esp/ESP8266_RTOS_SDK/components/newlib/newlib/port/locks.c:170: undefined reference to `xQueueCreateMutex'
|
3 | ... ... ...
|
Das sind fehler, die wegen rtos sind. Aber das möchte ich ja auch gar
nciht haben.
Wenn ich es wieder aktiviere und connect_router.c bauen möchte,
bekomme ich den Fehler
1 | H:/Projects/ESP/connect_Router/build/esp8266\libesp8266.a(startup.o):(.literal.user_init_entry+0x1c): undefined reference to `app_main'
|
2 | H:/Projects/ESP/connect_Router/build/esp8266\libesp8266.a(startup.o): In function `user_init_entry':
|
3 | C:/msys32/home/esp/ESP8266_RTOS_SDK/components/esp8266/source/startup.c:87: undefined reference to `app_main'
|
4 | collect2.exe: error: ld returned 1 exit status
|
5 | make: *** [C:/msys32/home/esp/ESP8266_RTOS_SDK/make/project.mk:510: /h/Projects/ESP/connect_Router/build/connect-router.elf] Error 1
|
Warum findet der meine app_main hier nicht? Und im BeipsielCode schon?
Wie kann ich ein Projekt ohne rtos erstellen?