a, Spatial configuration. Step 1: select electrode configurations from single-pulse experiments to target the three hotspots underlying the production of walking in healthy individuals (weight acceptance: L3; propulsion: S1; swing: L1/L4). Step 2: optimize EES amplitude and frequency while delivering EES during standing. Multipolar configurations can be used to refine selectivity of EES protocols. Example shows continuous EES targeting the right L3 posterior root to facilitate right knee extension during standing, and trains (500 ms) of EES targeting the right L1 posterior root stimulation to facilitate hip flexion. Two EES frequencies are shown (P3). b, Temporal configuration. Step 3: decision tree to select the best strategy to configure the temporal structure of EES protocols. If the participant is able to initiate leg movements consistently, use closed-loop EES based on real-time processing of foot trajectory. If the participant is not able to initiate consistent leg movements but can feel when EES is applied, use open-loop EES. If the participant is not able to generate movement and cannot feel EES, use closed-loop EES combined with physiotherapist assistance to move the legs. Step 4: real-time monitoring of the spatiotemporal trajectory of the feet. The trajectory is modelled as a foot rotating in space around the centroid of the movement (updated every 3 s). Angular thresholds determine the onset and end of EES protocols. Step 5: example showing the effect of three different angular thresholds on the onset of EES and resulting kinematics and EMG activity, including the quantification of kinematics for each step and condition that enables selecting the optimal onset of EES trains (P1). The same approach is used to optimize the duration of each train. c, Comparisons between closed-loop and open-loop EES. Plots show the vertical displacements of the left and right feet and successive step heights during walking with spatiotemporal EES delivered in closed loop versus open loop, showing the reduced variability of step height during pre-programmed EES sequences (P1). d, Resulting EMG patterns. Step 6: example of the progressive addition of EES protocols targeting specific hotspots. Plots show the quantification of EMG activity for the displayed muscles (n = 7 gait cycles for no EES and n = 9 gait cycles for each stimulation condition, P2). Step 7: EES amplitudes and frequencies are adjusted to avoid detrimental interactions between the different EES protocols and thus obtain the desired kinematic and EMG activity. Plots report the modulation of EMG activity and kinematics with increases in EES amplitude and frequency (mean ± s.e.m.; amplitude data: n = 10, 12, 12, 30, 19, 12, 11, 10 gait cycles for amplitudes in increasing order, P2; frequency data: n = 20, 15, 16, 17, 15, 16, 15 gait cycles for frequencies in increasing order, P3).