Just create a project and run it and it will report an error message.
Please show the content of your platformio.ini
and a smallest possible example to reproduce the error.
Please use preformatted-text when posting file-content or code
This is a duplicate of èżæŻä»äčæ
ć”ïŒäžșä»äčć€±èŽ„ïŒwhy?
Please ask questions just once.
[env:esp01]
platform = espressif8266
board = esp01
framework = arduino
Verbose mode can be enabled via -v, --verbose
option
CONFIGURATION: Redirecting...
PLATFORM: Espressif 8266 (4.2.1) > Espressif Generic ESP8266 ESP-01 512k
HARDWARE: ESP8266 80MHz, 80KB RAM, 512KB Flash
PACKAGES:
- framework-arduinoespressif8266 @ 3.30102.0 (3.1.2)
- tool-esptool @ 1.413.0 (4.13)
- tool-esptoolpy @ 1.30000.201119 (3.0.0)
- toolchain-xtensa @ 2.100300.220621 (10.3.0)
LDF: Library Dependency Finder â Library Dependency Finder (LDF) â PlatformIO latest documentation
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 37 compatible libraries
Scanning dependenciesâŠ
No dependencies
Building in release mode
Compiling .pio\build\esp01\FrameworkArduino\core_esp8266_timer.cpp.o
Compiling .pio\build\esp01\FrameworkArduino\core_esp8266_wiring.cpp.o
Compiling .pio\build\esp01\FrameworkArduino\core_esp8266_wiring_analog.cpp.o
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp:32:17: error: âtimercallbackâ does not name a type
32 | static volatile timercallback timer1_user_cb = NULL;
| ^~~~~~~~~~~~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp: In function âvoid timer1_isr_handler(void*, void*)â:
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp:37:10: error: âT1Câ was not declared in this scope
37 | if ((T1C & ((1 << TCAR) | (1 << TCIT))) == 0) TEIE &= ~TEIE1;//edge int disable
| ^~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp:37:23: error: âTCARâ was not declared in this scope
37 | if ((T1C & ((1 << TCAR) | (1 << TCIT))) == 0) TEIE &= ~TEIE1;//edge int disable
| ^~~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp:37:37: error: âTCITâ was not declared in this scope
37 | if ((T1C & ((1 << TCAR) | (1 << TCIT))) == 0) TEIE &= ~TEIE1;//edge int disable
| ^~~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp:37:51: error: âTEIEâ was not declared in this scope
37 | if ((T1C & ((1 << TCAR) | (1 << TCIT))) == 0) TEIE &= ~TEIE1;//edge int disable
| ^~~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp:37:60: error: âTEIE1â was not declared in this scope
37 | if ((T1C & ((1 << TCAR) | (1 << TCIT))) == 0) TEIE &= ~TEIE1;//edge int disable
| ^~~~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp:38:5: error: âT1Iâ was not declared in this scope
38 | T1I = 0;
| ^~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp:39:9: error: âtimer1_user_cbâ was not declared in this scope
39 | if (timer1_user_cb) {
| ^~~~~~~~~~~~~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp:42:28: error: âxt_rsilâ was not declared in this scope
42 | uint32_t savedPS = xt_rsil(15); // stop other interrupts
| ^~~~~~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp:44:9: error: âxt_wsr_psâ was not declared in this scope
44 | xt_wsr_ps(savedPS);
| ^~~~~~~~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp: At global scope:
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp:52:16: error: variable or field âtimer1_attachInterruptâ declared
void
52 | void IRAM_ATTR timer1_attachInterrupt(timercallback userFunc) {
| ^~~~~~~~~~~~~~~~~~~~~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp:52:39: error: âtimercallbackâ was not declared in this scope
52 | void IRAM_ATTR timer1_attachInterrupt(timercallback userFunc) {
| ^~~~~~~~~~~~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp: In function âvoid timer1_detachInterrupt()â:
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp:58:5: error: âtimer1_user_cbâ was not declared in this scope
58 | timer1_user_cb = 0;
| ^~~~~~~~~~~~~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp:59:5: error: âTEIEâ was not declared in this scope
59 | TEIE &= ~TEIE1;//edge int disable
| ^~~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp:59:14: error: âTEIE1â was not declared in this scope
59 | TEIE &= ~TEIE1;//edge int disable
| ^~~~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp: In function âvoid timer1_enable(uint8_t, uint8_t, uint8_t)â:
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp:64:5: error: âT1Câ was not declared in this scope
64 | T1C = (1 << TCTE) | ((divider & 3) << TCPD) | ((int_type & 1) << TCIT) | ((reload & 1) << TCAR);
| ^~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp:64:17: error: âTCTEâ was not declared in this scope
64 | T1C = (1 << TCTE) | ((divider & 3) << TCPD) | ((int_type & 1) << TCIT) | ((reload & 1) << TCAR);
| ^~~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp:64:43: error: âTCPDâ was not declared in this scope
64 | T1C = (1 << TCTE) | ((divider & 3) << TCPD) | ((int_type & 1) << TCIT) | ((reload & 1) << TCAR);
| ^~~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp:64:70: error: âTCITâ was not declared in this scope
64 | T1C = (1 << TCTE) | ((divider & 3) << TCPD) | ((int_type & 1) << TCIT) | ((reload & 1) << TCAR);
| ^~~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp:64:95: error: âTCARâ was not declared in this scope
64 | T1C = (1 << TCTE) | ((divider & 3) << TCPD) | ((int_type & 1) << TCIT) | ((reload & 1) << TCAR);
| ^~~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp:65:5: error: âT1Iâ was not declared in this scope
65 | T1I = 0;
| ^~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp: In function âvoid timer1_write(uint32_t)â:
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp:69:5: error: âT1Lâ was not declared in this scope
69 | T1L = ((ticks)& 0x7FFFFF);
| ^~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp:70:10: error: âT1Câ was not declared in this scope
70 | if ((T1C & (1 << TCIT)) == 0) TEIE |= TEIE1;//edge int enable
| ^~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp:70:22: error: âTCITâ was not declared in this scope
70 | if ((T1C & (1 << TCIT)) == 0) TEIE |= TEIE1;//edge int enable
| ^~~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp:70:35: error: âTEIEâ was not declared in this scope
70 | if ((T1C & (1 << TCIT)) == 0) TEIE |= TEIE1;//edge int enable
| ^~~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp:70:43: error: âTEIE1â was not declared in this scope
70 | if ((T1C & (1 << TCIT)) == 0) TEIE |= TEIE1;//edge int enable
| ^~~~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp: In function âvoid timer1_disable()â:
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp:74:5: error: âT1Câ was not declared in this scope
74 | T1C = 0;
| ^~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp:75:5: error: âT1Iâ was not declared in this scope
75 | T1I = 0;
| ^~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp: At global scope:
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp:81:17: error: âtimercallbackâ does not name a type
81 | static volatile timercallback timer0_user_cb = NULL;
| ^~~~~~~~~~~~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp: In function âvoid timer0_isr_handler(void*, void*)â:
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp:86:9: error: âtimer0_user_cbâ was not declared in this scope
86 | if (timer0_user_cb) {
| ^~~~~~~~~~~~~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp:89:28: error: âxt_rsilâ was not declared in this scope
89 | uint32_t savedPS = xt_rsil(15); // stop other interrupts
| ^~~~~~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp:91:9: error: âxt_wsr_psâ was not declared in this scope
91 | xt_wsr_ps(savedPS);
| ^~~~~~~~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp: At global scope:
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp:99:16: error: variable or field âtimer0_attachInterruptâ declared
void
99 | void IRAM_ATTR timer0_attachInterrupt(timercallback userFunc) {
| ^~~~~~~~~~~~~~~~~~~~~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp:99:39: error: âtimercallbackâ was not declared in this scope
99 | void IRAM_ATTR timer0_attachInterrupt(timercallback userFunc) {
| ^~~~~~~~~~~~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp: In function âvoid timer0_detachInterrupt()â:
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_timer.cpp:105:5: error: âtimer0_user_cbâ was not declared in this scope
105 | timer0_user_cb = NULL;
| ^~~~~~~~~~~~~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_wiring_analog.cpp: In function âint __analogRead(uint8_t)â:
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_wiring_analog.cpp:37:12: error: âdigitalReadâ was not declared in this scop
e
37 | return digitalRead(pin) * 1023;
| ^~~~~~~~~~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_wiring_analog.cpp: In function âvoid __analogReference(uint8_t)â:
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_wiring_analog.cpp:46:17: error: âDEFAULTâ was not declared in this scope
46 | if (mode != DEFAULT) {
| ^~~~~~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_wiring_analog.cpp:47:9: error: âDEBUGVâ was not declared in this scope; did
you mean âUDEBUGâ?
47 | DEBUGV(âanalogReference called with illegal modeâ);
| ^~~~~~
| UDEBUG
*** [.pio\build\esp01\FrameworkArduino\core_esp8266_timer.cpp.o] Error 1
*** [.pio\build\esp01\FrameworkArduino\core_esp8266_wiring_analog.cpp.o] Error 1
In file included from D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_wiring.cpp:24:
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_wiring.cpp: In function âvoid delayMicroseconds(unsigned int)â:
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\tools\sdk\include/osapi.h:36:21: error: âets_delay_usâ was not declared in this scope; did you mean âo
s_delay_usâ?
36 | #define os_delay_us ets_delay_us
| ^~~~~~~~~~~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_wiring.cpp:192:5: note: in expansion of macro âos_delay_usâ
192 | os_delay_us(us);
| ^~~~~~~~~~~
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_wiring.cpp: In function âvoid init()â:
D:\PlatformIO_Core\packages\framework-arduinoespressif8266\cores\esp8266\core_esp8266_wiring.cpp:197:5: error: âtimer1_isr_initâ was not declared in this scope
197 | timer1_isr_init();
| ^~~~~~~~~~~~~~~
*** [.pio\build\esp01\FrameworkArduino\core_esp8266_wiring.cpp.o] Error 1
================================================================== [FAILED] Took 3.41 seconds ==================================================================
Thanks for sharing the content of your platformio.ini
.
But Iâm still missing the codeâŠ
And⊠please use preformatted-text as statet above.
Nobody wants to type code from a screenshot
main.c:
#include <Arduino.h>
// put function declarations here:
int myFunction(int, int);
void setup() {
// put your setup code here, to run once:
int result = myFunction(2, 3);
}
void loop() {
// put your main code here, to run repeatedly:
}
// put function definitions here:
int myFunction(int x, int y) {
return x + y;
}
It looks like your platform or the platform packages are broken.
- Close VS Code
- Delete the content of
D:\PlatformIO_Core\packages
- Delete the content of
D:\PlatformIO_Core\platforms
- Start VS Code
- Wait until PlatformIO performed all necessary tasks
Note: Your path âD:\PlatformIO_Core
â is very unusual!
Usually this folder is located at âC:\Users\<username>\.platformio
â.
Maybe your whole PlatformIO installation is broken and should be reinstalled.
Again: When you post code, logs ini-files etc, please use the preformatted-text feature!
This makes your code much more readable and avoids error in formatting.
Thanks in advance!
ok,i got it,in fact,I am used to downloading the installed stuff to a place other than the C drive, so that I can keep enough space on the C drive to make the computer run smoothly.But I didnât expect it would cause this series of problems
You can use environment varialbles to change some destination folders when installing PlatformIO or Platforms. But those must be set before installing PlatformIO or the platforms and pacakges.
See Environment Variables â PlatformIO latest documentation
I would call this as âadvanced stuffâ and you should know what youâre doing.
For beginners, I recommend: keep it simple and use the default settings.