How to Map a Footpedal to an Audio Insert FX?

I have a footpedal mapped to CC #5.

It works fine in a VST instrument plugin to be mapped to its various controls via the ‘learn’ function of that plugin.

But my VST FX plugin I’ve placed as an audio insert on that instrument can’t see the the footpedal when I activate its ‘learn’ function.

I’m wondering if I have to set up Cubase in some way so the MIDI from the footpedal goes to the audio insert plugin?

Create a MIDI track, assign its input o the Pedal´s MIDI port, assign its output to the FX input.

Thanks that solved it!