upload problems about melzi board

Hi!

I installed the arduino in newest version 1.8.12 using MAC pro.

Nowdays I play with a 3D printer, what has a Melzi main board with an ATMEGA 1284p chip on it, so I downloaded the sanguino bootloader from here, and copied the sanguino folder into Arduino/hardware. When I started the Arduino ide, the new board showed up in Tools/Board menu, the Melzi 1284p 16 mhz. When I try to compile some code, I get the following error message:

warning: Board sanguino1284p-master:Sanguino:atmega644 doesn't define a 'build.board' preference. Auto-set to: SANGUINO_ATMEGA644
Warning: Board sanguino1284p-master:Sanguino:atmega12848m doesn't define a 'build.board' preference. Auto-set to: SANGUINO_ATMEGA12848M
Warning: Board sanguino1284p-master:Sanguino:atmega1284 doesn't define a 'build.board' preference. Auto-set to: SANGUINO_ATMEGA1284
Detecting libraries used...
recipe.preproc.macros pattern is missing

Error compiling for board Sanguino W/ ATmega1284p 16mhz.

can anyone please help me with that!!

It looks like you installed the Sanguino package incorrectly. I suspect your folder structure looks like this:

Arduino
|_hardware
|_sanguino1284p-master
|_Sanguino
|_boards.txt
|_etc.
|_avr
|_boards.txt

The correct installation folder structure would look like this:

Arduino
|_hardware
|_Sanguino
|_boards.txt
|_etc.
|_avr
|_boards.txt

So you just need to move the Sanguino folder up one level.

The situation is that Arduino changed the platform folder structure in Arduino IDE 1.5. In Arduino 1.0, the structure looked like:

Arduino
|hardware
|
{vendor folder}
|_boards.txt

That worked OK back in the days when the Arduino company and community only used the AVR architecture. But once we started expanding into new architectures, it became desirable to have a new folder level:

Arduino
|hardware
|
{vendor folder}
|_{architecture folder}
|_boards.txt

In order to provide backwards compatibility, the author of the Sanguino platform created a structure that allows the platform to work for both Arduino 1.0 and 1.5+. In your current installation, the 1.0 version of Sanguino is at Arduino/hardware/sanguino1284p-master/Sanguino, while the 1.5 version is at Arduino/hardware/sanguino1284p-master/Sanguino/avr. So the Arduino IDE thinks you are using a platform with vendor "sanguino1284p-master" and architecture "Sanguino", and is attempting to use the files for Arduino IDE 1.0, thus the error.

Complicated, I know, but it doesn't need to be. If you had followed the installation instructions you would have installed it via Boards Manager, which makes sure the platform is always installed correctly without you needing to even know about its folder structure.