Seems to me that you have a RobotDyn Mega + WiFi board. The referenced page shows you how to configure the DIP switches to upload to each board. There’s just one CH340G chip which can be switched to being connected to the Mega2560 or ESP8266. There’s also a setting where the two chips are connected with each other. For PlatformIO, the configurations should be pretty standard. Either two projects with one target board each, as in
Indeed, a two-chip board, just as the linked documentation and schematics show. The ESP can talk to the Mega through its Serial3 port, and in reverse. These docs are also crucial because they show how to get the ESP into bootloader mode for uploading.
I think I’m ready to ask what this means.
The lesson I want is “What does ‘src_filter’ do?”
There’s a big hole in my understanding of the .ini file which fluent knowledge of a programming language would certainly help fill. That’s one ‘word’. Why? What is the derivation of this word?
Set up one project with both the ESP and Arduino environments.
Each has its own project folder?
Why would one do that? Would you toggle between them?
Is there stuff that these characters strung into a processor in the ESP environment can do that the same characters can’t get from an Arduino processor?
I mean, the ESP obviously has incomparably higher specs, but C++ into a machine should always cause the same events, regardless of platform, no? Assuming capacities are comparable. Atmel can’t do BLE, and ESP has two processors, and one isn’t open source. So they’re different animals altogether.
Can you give me an example of a scenario where you’d write these two programs and how they coexist?
You have a board with two MCUs on it… an ESP8266, and an ATMega2560.
Those two MCUs to not use the same code.
So you need to write the code for each, compile the code for each, and upload the code for each.
You can either:
Create two projects - one configured for the ATMega2560 with code to suit, and one configured for the ESP8266 with code to suit it; or
Create a single project, with two source code directories, which has both environments configured, and you use the src_filter directive to ensure the correct source code is used for each environment.
If you are only using the ESP8266 chip on the board, you don’t need to do anything with the ATMega2560. But why would you get a board with both MCUs on board if you don’t intend to use both?
You might have the ATMega2560 connecting to multiple sensors, or multiple outputs, and be using the ESP8266 to provide WiFi control. Or the ATMega2560 might be monitoring multiple things, and uses the ESP8266 to upload that to a online dashboard. The possibilities are endless.
I linked the documentation for you in the first post – you have to do a special switch configuration and reset method to get the ESP8266 into bootloader mode, otherwise it will not accept a firmware. Tripple check that that procedure is correct.