A bit late answer, but I only recently purchased a 'Coolbaby' handheld with a raspberry pi 3 compute module in it (https://www.aliexpress.com/item/4000281 ... 6b016jo9dA
). The handheld comes with an SD card loaded with retropie. However, the image is not very good and everything is in chinese. So I burned my own image (based on Retrorama Rampage v2, 128GB, tweaked to my liking). When I started the device the image was loading fine, but none of the buttons where working. This meant that the controls where not hooked up with a standard usb, otherwise it would have worked out of the box. So I had to do some reverse engineering on the image that came with it and in the end I got everything working, so I thought I'd share the instructions so others can benefit.
First you need a way to connect the device to internet. The device has no ethernet port nor wifi, so you either need a usb-to-ethernet converter or a wifi usb-dongle to connect to the internet. I used a usb-to-ethernet converter and hooked it up to one of the usb ports of the device. Second, you need a keyboard with usb connection and hook it up to the device. Then burn your favorite retropie image to the sd card and start the device. You will notice that none of the controls work. You can use the keyboard to navigate to 'Retropie' and then to 'Retropie Setup'. Then navigate to 'Manage Packages' and 'Manage driver packages'. Then in the next menu install both 'mkarcade joystick' and 'xpad'. Once both are installed hit F4 on the keyboard to go to the command line. Next we have to set the configuration files for both mk_arcade_joystick_rpi and xpad. To do this type the command:
sudo nano /etc/modprobe.d/mk_arcade_joystick_rpi.conf
With the editor add:
options mk_arcade_joystick_rpi map=1
Then press Ctrl+X, Y and hit Enter to save and exit the file editor.
Then from the command line type:
sudo nano /etc/modprobe.d/xpad.conf
again, with the editor add:
options xpad triggers_to_buttons=1
Again press Ctrl+X, Y and hit Enter to save and exit. Then from the command line enter:
The device will reboot and once rebooted you can enter the add controller with the keyboard and register all buttons of the device as they are now recognized by retropie.