Recalbox Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • recalbox.com
    • Gitlab repository
    • Documentation
    • Discord

    Xmas Beta cannot take in custom GPIO pin mapping as additional parameters when loading module mk_arcade_joystick_rpi.ko.

    Testers's corner
    gpio contoller tft pwm
    1
    2
    1231
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • cheungbx
      cheungbx last edited by cheungbx

      I built a recalbox portable console with Pi 0 W; 2.2" il9341 TFT LCD with SPI using GPIO 9,10,11,25 supported by the adafruit drivers and GPIO controllers ( mk_arcade_joystick_rpi.ko) and the PWM 2 channel audio output using GPIO 18, 13. As the LCD and Audio GPIO overlaps with the default GPIO pins map parameters of
      mk_arcade_joystick_rpi.ko module. i.e. "map=1" or "map =3", I have to create a custom pin mapping using the parameter of "map=4 gpio=21,24,26,19,5,6,22,4,20,17,27,16,12" to avoid the conflicts of pins used by the joystick buttons , LCD and audio output.
      I found that the boot up script file (/recalbox/scripts/recalbox-config.sh) cannot take in the second parameter I put into the recalbox.conf file:
      controllers.gpio.enabled=1
      controllers.gpio.arg=map=4 gpio=21,24,26,19,5,6,22,4,20,17,27,16,12

      To fix the issue, please help to consider the following in the new release.
      add the following lines to the top of the /recalbox/scripts/recalbox-config.sh. file to take in one additional parameter as $extra3.
      extra3=$5

      Change the line in the section for GPIO controllers
      from
      map="$extra2"
      to
      map="$extra2 $extra3"

      Once the above is done, I can happily make my recalbox console works with TFT LCD; GPIO buttons soldered onto my circuit board, and stereo analog audio output driven by PWM through GPIO pin 13 and 18 and Ground.

      Here are the parameters I used in the config files to make this work. With the modification I mentioned about for the recalbox-config.sh to take in one extra parameter for GPIO controllers.

      mount -o remount, rw /boot

      vi /boot/config.txt

      add this to the end of the /boot/config.txt file to enable GPIO TFT

      hdmi_group=2
      hdmi_mode=87
      hdmi_cvt=320 240 60 1 0 0 0
      dtparam=spi=on
      dtparam=i2c1=on
      dtparam=i2c_arm=on
      dtoverlay=pitft22,rotate=270,speed=64000000,fps=30

      also need to edit recalbox.conf to set system.fbcp.enabled=1 and global.videomode=default

      #add this to end of the /boot/config.txt file to enable GPIOs analog audio
      dtoverlay=pwm-2chan,pin=18,func=2,pin2=13,func2=4

      # edit recalbox.conf to enable fbp and TFT LCD and GPIO controllers

      mount -o remount, rw /
      cd ~
      vi recalbox.conf

      change the following parameters as follows

      #Tips for using vi: use “/word” to search for the word.
      then press ENTER to jump to the first match.
      then press "a" to add or modify. ESC to stop and “:x!” to save

      system.fbcp.enabled=1
      global.videomode=default

      system.power.switch=PIN56PUSH
      controllers.gpio.enabled=1
      controllers.gpio.arg=map=4 gpio=21,24,26,19,5,6,22,4,20,17,27,16,12

      cheungbx 1 Reply Last reply Reply Quote 0
      • cheungbx
        cheungbx @cheungbx last edited by cheungbx

        @cheungbx
        Note: the last two lines in the recalbox.conf appeared as two lines on this forum but is actually one single line.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post

        Want to support us ?

        86
        Online

        98.6k
        Users

        28.1k
        Topics

        187.0k
        Posts

        Copyright © 2021 recalbox.com