Please add some info about your setup, as requested in https://retropie.org.uk/forum/topic/3/read-this-first.
Did you configure your gamepad in EmulationStation ? Usually this is all what's needed in order for the correct auto-configuration profile for RetroArch to be generated. Did you reset/changed your RetroArch configuration so that the configuration profile cannot be changed ?