Be Warned, New VS Code Ext. along side other ESP-IDF versions
Posted: Sat Jan 11, 2020 11:39 am
Well guys, This issue bit me in the rear end hard. The short version.... Don't (at least at the time of this writing) install the VS Code extension if you are using other IDE's with other ESP-IDF versions. Things will still compile but it will NOT operate as before.
The Long version... (or you can just jump to "---- Final Conclusion ----" at the end)
I use 3 IDE's because I am still torn between features from all of them, and as they evolve I want to stick with what I think is the best for me. I use Visual GDB, Platform IO, and VS Code (with my own setup, much like the new VSCode extension except mine works).
Visual GDB is awesome, but you have to pay for it, and it is a tab bit slower to compile even when using CMake. I am not fond of Visual Studio its just to dam bloated and IMHO VS Code just is way cleaner, and reacts faster for me.
PlatformIO is also great, but (at the time of this writing) cannot use menuconfig which is a HUGE loss.
VS Code is good as well. The only downside is that updates for the ESP-IDF are manual (not a deal breaker), But what i don't really care for is that I have not discovered any way for code completion, or for it to tell show me things like "variable such and such is unused" you have to watch the log output when compiling, and other code hints.
OK, now you know why i bounce between these 3.
Here is the real trouble that I ran into today. I designed a 12 port battery charger tester for a client. It sits on a 12" x 12" PCB with an OLED display, 12 RGB leds for each port, 2 heat sinks with fans, each with its own temp sensor, 12 individual channels each with their own IC's and circuitry to test 12 chargers off the production floor at one time. There are several devices using I2C and SPI.
Basically, the user plugs in the 12 chargers, and when they press the start button it measures and tests many things like under / over voltage. Ramps up and down the load current and other things to give a go/no go test for each charger.
This was working flawlessly for months on the bench as i developed the code for it. These last few days I was just making small tweaks here and there to the code like adjusting time's things were on the OLED, properly centering text on the OLED, code comments and others. Nothing major. Each day I would zip my project and save it as a backup.
Over the weekend I decided to give the "Official Visual Studio Code Extension for ESP-IDF Projects" a try.
I created a new folder, and installed a portable version of VS Code to check it out. Went though its install process selecting the master branch, and selected "blink" as the project. It was unable to do a few things like menuconfig, and know about the #includes. So its quite not there yet.
Now here comes monday. I forgot to put a reverse protection diode on the board for the 12 ports. So I soldered them on the backside of the 12 input jacks. Before powering it on, I just didn't remember if I uploaded the last changes on friday. I opened Visual GDB and did a quick make clean and re-compiled. Powered on the board and clicked flash. It booted up just fine, and when I pressed start everything (but the OLED and RGB leds) started working crazy.
It was unable to take proper voltage measurements and adjust the current. I was pissed because we are supposed to deliver the project to the customer in a week. Sooooo... I thought it must be some code change i did. Going to the backups from the day before and trying that gave same results. Then went to each daily backup from the last 2 weeks trying each all with same results. I then switched to my version of VS Code trying it as well with all its backups, all with the same results. OK... i though then the only thing left is that it got static zapped when soldering the diodes on. I changed the ESP32 module, still same problem, So I ordered new IC's for each of the 12 ports. The next day put all them on and it still acted the same. $89 bucks gone. The only things left were the 12 large FETS that act as a load. Ordered them, put them on. Same problems. $57 bucks gone.
---- Final Conclusion ----
Starring at this problem wondering what the hell could be the issue, I decided the only other thing i did from Friday to today was install "Official Visual Studio Code Extension for ESP-IDF Projects" So i restored my computer from an image of last month. After the new re-boot of the PC I copied back the latest version of the code from Friday. Compiled it, and uploaded it to the board. It worked perfect!!!
I was both PISSED and RELIEVED. Pissed that some other install did something to mess with my other IDE's install, and the loss of my money and time. Relieved that its all working now. Soooo be warned that (at the time of this writing) if you are trying out the new "Official Visual Studio Code Extension for ESP-IDF Projects" with other installed IDE's it WILL interfere with them as well.
The Long version... (or you can just jump to "---- Final Conclusion ----" at the end)
I use 3 IDE's because I am still torn between features from all of them, and as they evolve I want to stick with what I think is the best for me. I use Visual GDB, Platform IO, and VS Code (with my own setup, much like the new VSCode extension except mine works).
Visual GDB is awesome, but you have to pay for it, and it is a tab bit slower to compile even when using CMake. I am not fond of Visual Studio its just to dam bloated and IMHO VS Code just is way cleaner, and reacts faster for me.
PlatformIO is also great, but (at the time of this writing) cannot use menuconfig which is a HUGE loss.
VS Code is good as well. The only downside is that updates for the ESP-IDF are manual (not a deal breaker), But what i don't really care for is that I have not discovered any way for code completion, or for it to tell show me things like "variable such and such is unused" you have to watch the log output when compiling, and other code hints.
OK, now you know why i bounce between these 3.
Here is the real trouble that I ran into today. I designed a 12 port battery charger tester for a client. It sits on a 12" x 12" PCB with an OLED display, 12 RGB leds for each port, 2 heat sinks with fans, each with its own temp sensor, 12 individual channels each with their own IC's and circuitry to test 12 chargers off the production floor at one time. There are several devices using I2C and SPI.
Basically, the user plugs in the 12 chargers, and when they press the start button it measures and tests many things like under / over voltage. Ramps up and down the load current and other things to give a go/no go test for each charger.
This was working flawlessly for months on the bench as i developed the code for it. These last few days I was just making small tweaks here and there to the code like adjusting time's things were on the OLED, properly centering text on the OLED, code comments and others. Nothing major. Each day I would zip my project and save it as a backup.
Over the weekend I decided to give the "Official Visual Studio Code Extension for ESP-IDF Projects" a try.
I created a new folder, and installed a portable version of VS Code to check it out. Went though its install process selecting the master branch, and selected "blink" as the project. It was unable to do a few things like menuconfig, and know about the #includes. So its quite not there yet.
Now here comes monday. I forgot to put a reverse protection diode on the board for the 12 ports. So I soldered them on the backside of the 12 input jacks. Before powering it on, I just didn't remember if I uploaded the last changes on friday. I opened Visual GDB and did a quick make clean and re-compiled. Powered on the board and clicked flash. It booted up just fine, and when I pressed start everything (but the OLED and RGB leds) started working crazy.
It was unable to take proper voltage measurements and adjust the current. I was pissed because we are supposed to deliver the project to the customer in a week. Sooooo... I thought it must be some code change i did. Going to the backups from the day before and trying that gave same results. Then went to each daily backup from the last 2 weeks trying each all with same results. I then switched to my version of VS Code trying it as well with all its backups, all with the same results. OK... i though then the only thing left is that it got static zapped when soldering the diodes on. I changed the ESP32 module, still same problem, So I ordered new IC's for each of the 12 ports. The next day put all them on and it still acted the same. $89 bucks gone. The only things left were the 12 large FETS that act as a load. Ordered them, put them on. Same problems. $57 bucks gone.
---- Final Conclusion ----
Starring at this problem wondering what the hell could be the issue, I decided the only other thing i did from Friday to today was install "Official Visual Studio Code Extension for ESP-IDF Projects" So i restored my computer from an image of last month. After the new re-boot of the PC I copied back the latest version of the code from Friday. Compiled it, and uploaded it to the board. It worked perfect!!!
I was both PISSED and RELIEVED. Pissed that some other install did something to mess with my other IDE's install, and the loss of my money and time. Relieved that its all working now. Soooo be warned that (at the time of this writing) if you are trying out the new "Official Visual Studio Code Extension for ESP-IDF Projects" with other installed IDE's it WILL interfere with them as well.