Please add more info about your system, as detailed in https://retropie.org.uk/forum/topic/3/read-this-first.
When you configure your controller, as detailed in the Docs, RetroPie will create automatically a controller configuration for RetroArch, so you shouldn't need to configure it manually there.