The most widespread legend has it that a shepherd from Abyssinia (present-day Ethiopia), Kaldi, noticed the toning effect of this shrub on goats who had eaten it. Another version of the legend maintains that this shepherd , having accidentally dropped a branch of this shrub on a stove , noticed the delicious aroma that emanated from it. It is likely that this fable, first published in Rome by Antoine Faustus Nairon ( Maronite and professor of oriental languages in Rome) in 1671 in one of the first treatises on coffee De Saluberrima potione Cahue seu Cafe nuncupata Discursus , was was invented by the Arabs to support the thesis of a coffee spread in the Arab Middle East by the Sufis . Moreover, another legendary story attributes the discovery of the coffee tree to Sheikh Abu Hassan al-Shâdhili , a Sufi who retired to a mountain and who fed on the “coffee tree” .
In reality, genetic studies on the coffee tree Coffee arabica suggest that it probably originated in Ethiopia, in the province of Kaffa where the ancestors of Oromos consumed coffee in different forms (drink but also food). He would have been known there since Prehistory and would only have been transferred to sixth century , in Yemen, in Happy Arabia, towards the port of Mocha.
Farmers in southwest Ethiopia, where coffee originated and dates perhaps from 10th century , more certainly from 13th century , probably roasted the coffee beans in embers, ground them into a slurry in which coffee originally served as a spice with medicinal properties, like cocoa at the Aztecs.
Source: Wikipedia