Error: Unknown environment names 'mega2560'. Valid names are 'include_tree'

Greetings and happy new year!

I’m new to I downloaded with Marlin 2 and was able to upload to my RAMPS 1.4 for about a week. Something changed in my environment, although I can’t track down what. Does this error mean anything to anyone?



My guess: you’re doing pio run -e mega2560 (or VScode is, on your behalf). There needs to be a line [env:mega2560] in the platformio.ini file for this to work. There isn’t, but somehow PlatformIO found an ini file with [env:include_tree] in it? IOW, you’re asking for a build with a specific name which isn’t found in your current context.

My hunch is that you’re not building from the correct directory. I know nothing about Marlin or its build setup. Just throwing in my .02 cents as to what is going on here.

1 Like

Thank you for the reply. Following your guidance I discovered that the [env:include_tree] is out-of-the box configuration for Marlin. I’m not sure how the project is supposed to work but it manages a lot of different potential envs, so it’s probably an intelligent management scheme of some sort. Mine, the mega2560, is the default. While I was futzing with it the error cleared up, so it must have been some cached state.

Thanks for the assist.