A lot of new issue with my platformIO on mac

Hello All,

I was using PlatformIo in windows Bootcamp with no issue.
Recently I migrated from windows Bootcamp to the MAC OS and mistakenly I wiped out the windows bootcamp.
I used platformIO on my MAC OS before, but now I have a bunch of problems.
Immediately after I switch to Mac OS, It ask me to upgrade to the new version of OS Monterey.
Because of that, I’m not sure if these problems are related to the OS upgrade or not.

These are my problems:
1- I get this error at first:


My VS code is located on my Desktop and it is not in the Download folder since this is the solution in the error massage suggested.

2- When I open my project 1 different errors and 1 warning show up.

3- In the windows version of VScode I can hover over the header or source file and with Ctrl+Click on that header or source file it opens the corresponding file. But here it shows initializing and nothing happened


If I try to go to the address with “Go to definition” or F12, I get this message in the picture:

Do I need to install something on my OS?

Any help would be appreciated.

This VSCode version looks ancient judging by the icons on the left side. The PlatformIO extension seems completely outdated too.

To check this what does Help → About VSCode say in regards to the version number? Can you cleanly reinstall the latest version of VSCode and the PlatformIO extension?

Indeed, the PlatformIO extension is incompatible with the Arduino extension – uninstall or deactivate the Arduino one.

1 Like

Possibly not your issue but I found that I needed to delete the “~/Library/Application\ Support.Code” folder as well as the ~/.vscode folder (and possibly others that have a leading ‘.’) when I was having issues (M1 iMac, latest versions of software for everything).
Try deleting those and then re-installing from scratch.
Susan

@maxgerhardt and @aussiesusan
Thank you so much.
It is fixed by uninstalling the VScode and reinstalling platformIO.

Thank you
Iman

Hello again,
@aussiesusan and @maxgerhardt Thank you again for solving my last issue.
Now I’m facing a new issue.
When I try to compile my project from my Github account, I’m getting a strange error.
For instance, I get this error:

/Users/Myname/.platformio/packages/framework-arduinoespressif32/libraries/SD_MMC/src/SD_MMC.h:24:1: error: expected unqualified-id before '/' token

This code was working when I was using windows Bootcamp.
It seems that some libraries do not exist on my Mac.
This is what my platform.ini look like if it helps:

[env:esp32dev]

platform = espressif32

board = esp32dev

framework = arduino

lib_deps =

adafruit/Adafruit MCP23017 Arduino Library @ ^1.2.0

moononournation/GFX Library for Arduino @ ^1.2.3

earlephilhower/ESP8266Audio @ ^1.9.7

#bodmer/TJpg_Decoder @ ^0.2.0

#moononournation/GFX Library for Arduino @ ^1.2.3

monitor_speed = 115200

debug_tool = esp-prog

debug_init_break = tbreak setup

debug_speed = 10

Thank you for your support

Close VSCode, remove all folders in /Users/Myname/.platformio/packages/, restart VSCode and build again. Does the issue persist?

Then with what code can the issue be replicated?

Thanks for the quick reply:

When I did what you asked, I got the new error:

src/main.cpp: In function 'void setup()':
src/main.cpp:116:53: warning: 'I2S_COMM_FORMAT_PCM' is deprecated [-Wdeprecated-declarations]
         .communication_format = (i2s_comm_format_t)(I2S_COMM_FORMAT_PCM | I2S_COMM_FORMAT_I2S_MSB),
                                                     ^~~~~~~~~~~~~~~~~~~
In file included from /Users/imanyazdansepas/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/include/driver/include/driver/i2s.h:16,
                 from include/Audio.h:17,
                 from src/main.cpp:9:
/Users/imanyazdansepas/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/include/hal/include/hal/i2s_types.h:90:5: note: declared here
     I2S_COMM_FORMAT_PCM       __attribute__((deprecated)) = 0x04, /*!< I2S communication format PCM, correspond to `I2S_COMM_FORMAT_STAND_PCM_SHORT`*/
     ^~~~~~~~~~~~~~~~~~~
src/main.cpp:116:75: warning: 'I2S_COMM_FORMAT_I2S_MSB' is deprecated [-Wdeprecated-declarations]
         .communication_format = (i2s_comm_format_t)(I2S_COMM_FORMAT_PCM | I2S_COMM_FORMAT_I2S_MSB),
                                                                           ^~~~~~~~~~~~~~~~~~~~~~~
In file included from /Users/imanyazdansepas/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/include/driver/include/driver/i2s.h:16,
                 from include/Audio.h:17,
                 from src/main.cpp:9:
/Users/imanyazdansepas/.platformio/packages/framework-arduinoespressif32/tools/sdk/esp32/include/hal/include/hal/i2s_types.h:88:5: note: declared here
     I2S_COMM_FORMAT_I2S_MSB   __attribute__((deprecated)) = 0x01, /*!< I2S format MSB, (I2S_COMM_FORMAT_I2S |I2S_COMM_FORMAT_I2S_MSB) correspond to `I2S_COMM_FORMAT_STAND_I2S`*/
     ^~~~~~~~~~~~~~~~~~~~~~~
src/main.cpp:183:15: error: 'i2s_write_bytes' was not declared in this scope
               i2s_write_bytes((i2s_port_t)0, (char *)aBuf, 980, 0);
               ^~~~~~~~~~~~~~~
src/main.cpp:183:15: note: suggested alternative: 'i2s_write_expand'
               i2s_write_bytes((i2s_port_t)0, (char *)aBuf, 980, 0);
               ^~~~~~~~~~~~~~~
               i2s_write_expand
*** [.pio/build/esp32dev/src/main.cpp.o] Error 1

For the code how can I attach the project here?
Or if you can provide me your email address
Thank you
Iman

Your project seems to be targeting an ancient Arduino-ESP32 core with an old ESP-IDF version. The function was deprecated. See

https://docs.espressif.com/projects/esp-idf/en/v3.3/api-reference/peripherals/i2s.html#_CPPv415i2s_write_bytes10i2s_port_tPKv6size_t10TickType_t

instead of writing

i2s_write_bytes((i2s_port_t)0, (char *)aBuf, 980, 0);

try writing

size_t num_written = 0;
i2s_write((i2s_port_t)0, (char *)aBuf, 980, &num_written, 0);

instead.

Or, set platform = espressif32@x.y.z in the platformio.ini whereas x.y.z is some older version that your original project used per Releases · platformio/platform-espressif32 · GitHub.

1 Like

Thank you so much.
When I changed it to i2s_write it seems worked and compiled, but I have this message over and over on the serial bus when the code is running.

E (13779) gpio: gpio_set_level(226): GPIO output gpio_num error
E (13787) gpio: gpio_set_level(226): GPIO output gpio_num error
E (13790) gpio: gpio_set_level(226): GPIO output gpio_num error
E (13796) gpio: gpio_set_level(226): GPIO output gpio_num error
E (13801) gpio: gpio_set_level(226): GPIO output gpio_num error
E (13810) gpio: gpio_set_level(226): GPIO output gpio_num error
E (13813) gpio: gpio_set_level(226): GPIO output gpio_num error
E (13818) gpio: gpio_set_level(226): GPIO output gpio_num error
E (13824) gpio: gpio_set_level(226): GPIO output gpio_num error
E (13832) gpio: gpio_set_level(226): GPIO output gpio_num error

I really appreciate that you are helping me to get to this point.
Thank you

Well that’s just a general error message when an invalid pin number is used for a digitalWrite() call. Can e.g. occur when you use or pass -1 as a GPIO pin but the code still tries to write to this pin (SOLUTION to -1 pin assignment causing apps wont start · Issue #6737 · espressif/arduino-esp32 · GitHub).

Hard to say what the exact cause is without seeing the full code. Can you upload the project to Github?

1 Like

Hello,

@maxgerhardt from your shared link above I found out that this problem is related to the

framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32#master

if I rewrite the above to this

framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32#2.0.2

this problem will be fixed but another problem shows up.
It seems that the ESP32 hired new staff for software and the new team messed up the framework-arduinoespressif32 @ version 2.0.3 and above.
Hope ESP’s new software team fixes this problem quickly.

In both cases (master and 2.0.2) The ESP32 keeps resetting.
I will share my code shortly.

Thank you

Have you opened an issue there in regards to with what error it’s failing when a certain piece of code is used? Otherwise they won’t know anything about it.

That’s a good point I will do it shortly.
Would you please tell me which channel I need to put?
Thank you
Iman

@maxgerhardt Thank you.
I posted the issue yesterday but it doesn’t list on the issue list.
Is it needed to approve with admin?
Thank you

No, Github issues don’t need to be pre-approved to show up. I don’t see an issue in Issues · espressif/arduino-esp32 · GitHub either that would match your username.