For a biological agent operating under environmental pressure, energyconsumption and reaction times are of critical importance. Similarly,engineered systems also strive for short time-to-solution and lowenergy-to-solution characteristics. At the level of neuronal implementation,this implies achieving the desired results with as few and as early spikes aspossible. In the time-to-first-spike-coding framework, both of these goals areinherently emerging features of learning. Here, we describe a rigorousderivation of learning such first-spike times in networks of leakyintegrate-and-fire neurons, relying solely on input and output spike times, andshow how it can implement error backpropagation in hierarchical spikingnetworks. Furthermore, we emulate our framework on the BrainScaleS-2neuromorphic system and demonstrate its capability of harnessing the chip'sspeed and energy characteristics. Finally, we examine how our approachgeneralizes to other neuromorphic platforms by studying how its performance isaffected by typical distortive effects induced by neuromorphic substrates.