[Tutorial] Printing Spla2n Posts with an Arduino/Teensy Board!

Discussion in 'Switch - Hacking & Homebrew' started by dj505, Aug 25, 2017.

?

Which AVR are you using?

  1. An atmega32u4 based board

    14.3%
  2. An at90usb1286 based board

    33.3%
  3. An Arduino Uno R3 board

    52.4%
  1. dj505
    OP

    dj505 Inexperienced Romhacker

    Member
    525
    120
    Oct 4, 2014
    Canada
    Most likely at the arcade
    Ah I see. Sorry for the misunderstanding haha. I thought you meant you couldn't find the make instructions or anything in the guide :P
     
  2. Vverg

    Vverg Member

    Newcomer
    22
    8
    Jan 5, 2017
    Netherlands
    Well.. the only issue I know face is that I can't reprogram it. Cause it opens as Pokken Controller now under Windows... since I don't have a reset button on it (that's at least my guess for reprogramming it).

    Maybe anyone here knows how to reset? Since I can't find any documentation about it.

    (I got the Beetle ATMEGA32U4)
     
  3. NanniKirby

    NanniKirby Newbie

    Newcomer
    4
    0
    Sep 7, 2017
    Italy
    First, thank you for this guide.
    I'm having a problem and I was wondering if someone could help me.

    When I run the "mingw32-make" command, I get the error :
    "No rule to make target 'LUFA/Drivers/USB/Class/Common/HIDParser.c', needed by 'obj/HIDParser.o'. Stop.

    I used the mingw32-make command because I couldn't find the command "make" (Same problem as GomiHiko),
    then I had a problem with the LUFA path and edited it in the makefile.
    After that fix, it couldn't find "avr-gcc", and I added "C:\Program Files (x86)\Arduino\hardware\tools\avr\bin" to my system Path.
    Now, after extracting the "obj" folder in my "SwitchFightStick" folder, the build ends with this errror and I don't know what to do.

    I'm trying to use it on the Arduino Uno R3 board, if this helps.

    And crk14341, I think you should upgrade your avr-gcc, because as I was troubleshooting my error I tried your version, and it gave me the same error.
     
    Last edited by NanniKirby, Sep 7, 2017
  4. dj505
    OP

    dj505 Inexperienced Romhacker

    Member
    525
    120
    Oct 4, 2014
    Canada
    Most likely at the arcade
    Look for the GND and RST pins, solder a button on so that those get bridged when you press it. That should allow you to reprogram it.
     
  5. Vverg

    Vverg Member

    Newcomer
    22
    8
    Jan 5, 2017
    Netherlands
    Stupid, I actually already tried to connect the RST with GND... (i just "shortcutted" it like you do to turn motherboards on without the chassis). It seemed I had to "shortcut" it for like 6 seconds... Bit noob of me :)

    Well thanks again for the help!
     
  6. dj505
    OP

    dj505 Inexperienced Romhacker

    Member
    525
    120
    Oct 4, 2014
    Canada
    Most likely at the arcade
    No problem lol. Had to do the same with my Teensy since it's inside a SNES controller where I can't reach the button; had to solder a button on to GND/RST which sticks out the top of the controller shell
     
  7. NanniKirby

    NanniKirby Newbie

    Newcomer
    4
    0
    Sep 7, 2017
    Italy
    Okay, I got it working. If someone is having the same problem, there's an issue on the github repository explaining how to fix that. I had an outdated AVR installation (i somehow installed another package instead of the one shown in the guide -.-"). Also if you don't want to fiddle with LUFA's path in the makefile you should put your LUFA folder and your splatmeme code folder in the same folder.
    Something like this:

    FOLDER
    LUFA
    SPLATMEME​

    And use the make command inside the splatmeme folder.
     
    Last edited by NanniKirby, Sep 7, 2017
  8. zaxman22

    zaxman22 Newbie

    Newcomer
    4
    0
    Sep 9, 2017
    Canada
    I'm having the same issue you had with "No rule to make target 'LUFA/Drivers/USB/Class/Common/HIDParser.c', needed by 'obj/HIDParser.o'. Stop.".

    You said you fixed this by updating your AVR installation, but mine is up to date.. can anyone else provide some help with this for me? This is what I'm getting.
    Code:
     mingw32-make
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    ' [INFO]    :' Begin compilation of project \"Joystick\"...
    ""
    avr-gcc (AVR_8_bit_GNU_Toolchain_3.5.4_1709) 4.9.2
    Copyright (C) 2014 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    
    mingw32-make: *** No rule to make target 'LUFA/Drivers/USB/Class/Common/HIDParser.c', needed by 'obj/HIDParser.o'.  Stop
     
  9. NanniKirby

    NanniKirby Newbie

    Newcomer
    4
    0
    Sep 7, 2017
    Italy
    Did you edit your makefile to change the directory of the "LUFA" folder?
    Try rearranging the folders and using the original path. (../LUFA/LUFA)

    I've tried editing the path, and it gives me the same error again, so I guess this should be the cause of your problem.

    Try arranging them like this:
    FOLDER_A
    -LUFA FOLDER
    -FIGHTSTICK FOLDER
    And use the mingw32-make command inside the fightstick folder.
    Also don't download the obj folder, because it should be generated automatically during the compilation.
     
  10. dj505
    OP

    dj505 Inexperienced Romhacker

    Member
    525
    120
    Oct 4, 2014
    Canada
    Most likely at the arcade
    This is true. Didn't realize at first that it was automatically generated. Gonna take down the link just in case.
     
  11. zaxman22

    zaxman22 Newbie

    Newcomer
    4
    0
    Sep 9, 2017
    Canada
    So I rearranged my folders like this, and changed the path back to how it was before. I executed mingw32-make inside the flightstick folder and got this again:
    Code:
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    ' [INFO]    :' Begin compilation of project \"Joystick\"...
    ""
    avr-gcc (AVR_8_bit_GNU_Toolchain_3.5.4_1709) 4.9.2
    Copyright (C) 2014 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    
    ' [GCC]     :' Compiling C file \"Joystick.c\"
    avr-gcc -c -pipe -gdwarf-2 -g2 -mmcu=at90usb1286 -fshort-enums -fno-inline-small-functions -fpack-struct -Wall -fno-strict-aliasing -funsigned-char -funsigned-bitfields -ffunction-sections -I. -DARCH=ARCH_AVR8 -DF_CPU=16000000UL -mrelax -fno-jump-tables -x c -Os -std=gnu99 -Wstrict-prototypes -DUSE_LUFA_CONFIG_HEADER -IConfig/  -I. -I../LUFA/LUFA/.. -DARCH=ARCH_AVR8 -DBOARD=BOARD_NONE -DF_USB=16000000UL  -MMD -MP -MF obj/Joystick.d Joystick.c -o obj/Joystick.o
    Assembler messages:
    Fatal error: can't create obj/Joystick.o: No such file or directory
    Joystick.c:269:1: fatal error: error writing to -: Invalid argument
     }
     ^
    compilation terminated.
    ../LUFA/LUFA/Build/DMBS/DMBS/gcc.mk:213: recipe for target 'obj/Joystick.o' failed
    mingw32-make: *** [obj/Joystick.o] Error 1
    
     
    Last edited by zaxman22, Sep 10, 2017
  12. NanniKirby

    NanniKirby Newbie

    Newcomer
    4
    0
    Sep 7, 2017
    Italy
    Okay, I managed to reproduce your error.

    Try adding
    C:\MinGW\msys\1.0\bin (your path may be different, look for the msys bin folder inside your Mingw directory).
    to your system Path.

    The three "The system cannot find the path specified." should go away and (hopefully) it should compile without other problems.
    If you run into other problems, just ask ;)

    P.s. If you don't have this folder, use MinGW's installation manager to install some msys packages.
    (if you need to know, the packages installed on my computer are: base, bash, bzip2, core, diffutils, dos2unix, file, findutils, gawk, grep, gzip, less, make, sed, tar, termcap, texinfo,xz, even though you probably don't need all of them, i don't know which ones are needed.)
     
    Last edited by NanniKirby, Sep 10, 2017
  13. zaxman22

    zaxman22 Newbie

    Newcomer
    4
    0
    Sep 9, 2017
    Canada
    I just tried adding it to my path, it didn't fix the problem :/ ended up getting the same error.
    Code:
    The system cannot find the path specified.
    The system cannot find the path specified.
    The system cannot find the path specified.
    ' [INFO]    :' Begin compilation of project \"Joystick\"...
    ""
    avr-gcc (AVR_8_bit_GNU_Toolchain_3.5.4_1709) 4.9.2
    Copyright (C) 2014 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions.  There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
    
    ' [GCC]     :' Compiling C file \"Joystick.c\"
    avr-gcc -c -pipe -gdwarf-2 -g2 -mmcu=at90usb1286 -fshort-enums -fno-inline-small-functions -fpack-struct -Wall -fno-strict-aliasing -funsigned-char -funsigned-bitfields -ffunction-sections -I. -DARCH=ARCH_AVR8 -DF_CPU=16000000UL -mrelax -fno-jump-tables -x c -Os -std=gnu99 -Wstrict-prototypes -DUSE_LUFA_CONFIG_HEADER -IConfig/  -I. -I../LUFA/LUFA/.. -DARCH=ARCH_AVR8 -DBOARD=BOARD_NONE -DF_USB=16000000UL  -MMD -MP -MF obj/Joystick.d Joystick.c -o obj/Joystick.o
    Assembler messages:
    Fatal error: can't create obj/Joystick.o: No such file or directory
    Joystick.c:269:1: fatal error: error writing to -: Invalid argument
     }
     ^
    compilation terminated.
    ../LUFA/LUFA/Build/DMBS/DMBS/gcc.mk:213: recipe for target 'obj/Joystick.o' failed
    mingw32-make: *** [obj/Joystick.o] Error 1
     
  14. dpad_5678

    dpad_5678 GBAtemp's Memelord

    Member
    1,750
    1,299
    Nov 19, 2015
    United States
    Anyone have any luck importing this project into the Arduino IDE? Would be great for custom controllers so we could use functions such as digitalRead, etc.
     
  15. zaxman22

    zaxman22 Newbie

    Newcomer
    4
    0
    Sep 9, 2017
    Canada
    After completely restarting I FINALLY found a fix for my error. Instead of going through command line, I installed MSYS. Using the MinGW Shell I navigated to my printer directory and just executed "make" and everything worked perfectly. I think it just really doesn't like using mingw32-make instead of make.
     
    Last edited by zaxman22, Sep 17, 2017
  16. HBMTCD

    HBMTCD Member

    Newcomer
    15
    1
    Jun 16, 2016
    Mexico
    Hey everyone, I got an Arduino UNO and loaded de joystick.hex file with FLIP. I think everything went right (it's my first time using arduino).
    But when I plug the Arduino to the Switch nothing happens, I go to the drawing post option and set the cursor on top left and connect the arduino but nothing happens, I'm not sure if I'm doing this correctly.
     
  17. dj505
    OP

    dj505 Inexperienced Romhacker

    Member
    525
    120
    Oct 4, 2014
    Canada
    Most likely at the arcade
    Just wait a few moments, it takes some time to start
     
  18. HBMTCD

    HBMTCD Member

    Newcomer
    15
    1
    Jun 16, 2016
    Mexico
    Nothing happens, I left it for minutes and nope. I'm not sure when's the moment I should connect the arduino.

    Should my PC recognize the Arduino as something specifically? Just to know if I'm going okay
     
    Last edited by HBMTCD, Sep 20, 2017
  19. TheHomesk1llet

    TheHomesk1llet Also known as "Kupo"

    Member
    185
    148
    Apr 29, 2013
    United States
    Cyberspace
    So an arduino R3 based on ATmega328P won't work, right?
     
  20. dj505
    OP

    dj505 Inexperienced Romhacker

    Member
    525
    120
    Oct 4, 2014
    Canada
    Most likely at the arcade
    It will, since you won't be programming the atmega328p part of the board. Just follow the Arduino Uno R3 part of the guide and you'll be good