The code here should work. https://github.com/MarlinFirmware/Marlin
But the compile shows the define of MOTHERBOARD value is incorrect in the PINS.h 'if' statement.
I created a new sketch and brought in the code to create an very slim path to the error line in question. This new sketch compiles. I test it by setting the MOTHERBOARD to 34, which is suposed to work. AND IT DOES. Then I set the MB to 01, which reports Motherboard not defined. This is also correct because I deleted those lines in my test sketch.
So this test proves the syntax and logic in the Marlin code are correct. The compiler fails due to dropping the MOTHERBOARD value in the variable collection process. It might have collected it correctly but drops in the passing or linking phases.
How does this get to the IDE developers?