Homebrew Raspberry Pi Developing 3DS Homebrew?

WhoAmI?

PASTA's dirty animal
Member
Joined
Mar 15, 2015
Messages
1,276
Trophies
0
Location
Poké Ball
Website
lavanoid.github.io
XP
1,279
Country
I'm pretty sure the gcc that can just be installed normally on a Pi can cross-compile for most other ARM processors? That shouldn't be an issue, but actually getting devkitARM set up and using other utilities would be a pain.

Not sure, never tried. However, the other utilities are incredibly easy to install but the No. 1 frustration is the most expected one: Slow AF xD
 

3xkrazy

Well-Known Member
Member
Joined
Jun 2, 2013
Messages
299
Trophies
0
XP
279
Country
United States
You can actually make and compile homebrew on the Raspberry Pi xD Me and @nastys used a Raspberry Pi to compile rxTools, some time ago.

We had to compile DevkitPro AND ImageMagick, as well as armips and a few other things for a "real" 3DS Dev Environment. We is da awesome!!!!!! WOOT WOOT!!!!!!

Edit: Made this comment without reading all the others.

Care to share your notes on setting this up? I'm running a Pi 2 model B with Raspian Jessie lite.
 

WhoAmI?

PASTA's dirty animal
Member
Joined
Mar 15, 2015
Messages
1,276
Trophies
0
Location
Poké Ball
Website
lavanoid.github.io
XP
1,279
Country
Yes, I did it on a tablet.

ARMv7
Install Ubuntu Vivid ARMHF in a 3772 MB image by using Linux Deploy, then run it and connect to it via VNC.
Download these files: https://mega.nz/#F!BxBzEQwJ!CaC_WHOZx5lJNe7gFA8ThQ
Extract devkitpro.tar.bz2 and extralibs.tar.bz2 in / as root (pun intended)
It should look like this:
/
opt

devkitpro

devkitARM​

Some dependencies are missing from the package. You can find them in dependencies.tar.bz2. Open each directory (don't worry, they're a few) and run sudo make install to install them or copy the needed binaries to /opt/devkitpro/devkitARM/bin.
When done, run the following commands in LXTerm:
Code:
echo "export DEVKITPRO=/opt/devkitpro" >> ~/.bashrc
echo "export DEVKITARM=/opt/devkitpro/devkitARM" >> ~/.bashrc
echo "export PATH=$PATH:/opt/devkitpro/devkitARM/bin" >> ~/.bashrc
source ~/.bashrc
sudo apt-get install build-essential  imagemagick git
cd
git clone --recursive https://github.com/roxas75/rxTools.git
cd rxTools
make release
If any dependencies are missing, install them by using sudo apt-get install.

ARMv6 (e.g. Raspberry Pi)/any CPU
  1. sudo apt-get install build-essential autoconf automake bison flex libncurses5-dev gcc libgmp-dev libmpfr-dev libmpc-dev libfreeimage3 libfreeimage-dev zlib1g zlib1g-dev libusb-dev mesa-common-dev texinfo imagemagick git
  2. git clone https://github.com/devkitPro/buildscripts
  3. Edit build-devkit.sh to skip the first if (change if [ 1 -eq 1 ] to if [ 0 -eq 1 ])
  4. sudo ./build-devkit.sh
  5. First option, install to /opt/devkitpro
  6. It will take several hours before it stops, throwing an error...
  7. cd .devkitARM
  8. cd 3dstools-1.0.3
  9. sudo ./configure
  10. sudo make install
  11. cd general-tools-1.0.0
  12. sudo ./configure
  13. sudo make install
  14. cd grit-0.8.12
  15. sudo ./configure
  16. sudo make install
  17. cd ndstool-1.50.3
  18. sudo ./configure
  19. sudo make install
  20. Extract extralibs.tar.bz2 to / as root (pun intended) and replace any files
  21. echo "export DEVKITPRO=/opt/devkitpro" >> ~/.bashrc
    echo "export DEVKITARM=/opt/devkitpro/devkitARM" >> ~/.bashrc
    echo "export PATH=$PATH:/opt/devkitpro/devkitARM/bin" >> ~/.bashrc
    source ~/.bashrc
  22. cd
  23. git clone --recursive https://github.com/roxas75/rxTools.git
  24. cd rxTools
  25. make release (if it fails because a dependency is missing, install it, enter make clean and try again)
  26. If it works, backup your devkitpro folder... If it doesn't, log out and try to build rxTools again.

There it is.
 

Kaisogen

Member
Newcomer
Joined
Jul 5, 2016
Messages
18
Trophies
0
Age
22
Location
Probably at a PC
XP
51
Country
United States
There it is.



I did every instruction. When I compile an old game of mine (https://github.com/Kaisogen/CookieCollector-3DS-), it gives me these errors: (WARNING, EXTREMELY LONG)

Error Message said:
main.c
arm-none-eabi-gcc -MMD -MP -MF /home/pi/Downloads/CookieCollector-3DS--master/build/main.d -g -Wall -O2 -mword-relocations -fomit-frame-pointer -ffast-math -march=armv6k -mtune=mpcore -mfloat-abi=hard -I/home/pi/Downloads/CookieCollector-3DS--master/include -I/opt/devkitpro/libctru/include -I/home/pi/Downloads/CookieCollector-3DS--master/build -DARM11 -D_3DS -c /home/pi/Downloads/CookieCollector-3DS--master/source/main.c -o main.o
In file included from /opt/devkitpro/libctru/include/sys/select.h:3:0,
from /opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/types.h:68,
from /opt/devkitpro/libctru/include/3ds/util/utf.h:4,
from /opt/devkitpro/libctru/include/3ds.h:16,
from /home/pi/Downloads/CookieCollector-3DS--master/source/main.c:2:
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h:104:34: error: unknown type name 'u_int'
bintime_mul(struct bintime *_bt, u_int _x)
^
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h:145:17: error: unknown type name 'sbintime_t'
sbintime_getsec(sbintime_t _sbt)
^
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h:151:17: error: unknown type name 'sbintime_t'
static __inline sbintime_t
^
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h: In function 'bttosbt':
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h:155:12: error: 'sbintime_t' undeclared (first use in this function)
return (((sbintime_t)_bt.sec << 32) + (_bt.frac >> 32));
^
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h:155:12: note: each undeclared identifier is reported only once for each function it appears in
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h:155:23: error: expected ')' before '_bt'
return (((sbintime_t)_bt.sec << 32) + (_bt.frac >> 32));
^
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h: At top level:
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h:159:9: error: unknown type name 'sbintime_t'
sbttobt(sbintime_t _sbt)
^
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h:218:9: error: unknown type name 'sbintime_t'
sbttots(sbintime_t _sbt)
^
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h:227:17: error: unknown type name 'sbintime_t'
static __inline sbintime_t
^
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h: In function 'tstosbt':
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h:231:12: error: 'sbintime_t' undeclared (first use in this function)
return (((sbintime_t)_ts.tv_sec << 32) +
^
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h:231:23: error: expected ')' before '_ts'
return (((sbintime_t)_ts.tv_sec << 32) +
^
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h: At top level:
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h:236:9: error: unknown type name 'sbintime_t'
sbttotv(sbintime_t _sbt)
^
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h:245:17: error: unknown type name 'sbintime_t'
static __inline sbintime_t
^
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h: In function 'tvtosbt':
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h:249:12: error: 'sbintime_t' undeclared (first use in this function)
return (((sbintime_t)_tv.tv_sec << 32) +
^
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h:249:23: error: expected ')' before '_tv'
return (((sbintime_t)_tv.tv_sec << 32) +
^
In file included from /opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h:268:0,
from /opt/devkitpro/libctru/include/sys/select.h:3,
from /opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/types.h:68,
from /opt/devkitpro/libctru/include/3ds/util/utf.h:4,
from /opt/devkitpro/libctru/include/3ds.h:16,
from /home/pi/Downloads/CookieCollector-3DS--master/source/main.c:2:
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/time.h: At top level:
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/time.h:56:1: error: unknown type name 'clock_t'
clock_t _EXFUN(clock, (void));
^
In file included from /opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/types.h:68:0,
from /opt/devkitpro/libctru/include/3ds/util/utf.h:4,
from /opt/devkitpro/libctru/include/3ds.h:16,
from /home/pi/Downloads/CookieCollector-3DS--master/source/main.c:2:
/opt/devkitpro/libctru/include/sys/select.h:9:23: error: unknown type name 'fd_set'
int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);
^
/opt/devkitpro/libctru/include/sys/select.h:9:40: error: unknown type name 'fd_set'
int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);
^
/opt/devkitpro/libctru/include/sys/select.h:9:58: error: unknown type name 'fd_set'
int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);
^
/opt/devkitpro/devkitARM/base_rules:84: recipe for target 'main.o' failed
make[1]: *** [main.o] Error 1
Makefile:126: recipe for target 'build' failed
make: *** [build] Error 2

I have zero idea where to even start fixing this, can you help me?
 

TarableCode

Well-Known Member
Member
Joined
Mar 2, 2016
Messages
184
Trophies
0
Age
37
XP
319
Country
Canada
Can you successfully build the 3ds examples?

On that note I successfully* compiled devkitARM on a Raspberry Pi Zero using the standard buildscripts.
*dfu-utils Won't compile so it needs to be edited out of build-devkit.sh
*Compiling GCC needs an INSANE amount of RAM, I needed to set up a 2GB swap file to get it to work.

It only took about 18 hours compile :P
 

EventAssistant

Well-Known Member
Member
Joined
Jul 20, 2016
Messages
572
Trophies
0
XP
1,448
Country
Italy
I managed to get a homebrew development environment on my Pi3. Compiling everything from scratch was insanely time consuming and it lead to various crashes during the installation for an entire week, so I decided to move to exagear, which is a paid software who can run x86 applications directly on the Pi. Everything's fine and it takes only some hours to have everything working correctly.
 
  • Like
Reactions: zaksabeast

Kaisogen

Member
Newcomer
Joined
Jul 5, 2016
Messages
18
Trophies
0
Age
22
Location
Probably at a PC
XP
51
Country
United States
Hmmm... Compiling an input example gives this error.

Error Message said:
pi@raspberrypi:~/Downloads/3ds-examples-master/input/read-controls $ make
main.c
arm-none-eabi-gcc -MMD -MP -MF /home/pi/Downloads/3ds-examples-master/input/read-controls/build/main.d -g -Wall -O2 -mword-relocations -fomit-frame-pointer -ffunction-sections -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -I/home/pi/Downloads/3ds-examples-master/input/read-controls/include -I/opt/devkitpro/libctru/include -I/home/pi/Downloads/3ds-examples-master/input/read-controls/build -DARM11 -D_3DS -c /home/pi/Downloads/3ds-examples-master/input/read-controls/source/main.c -o main.o
In file included from /opt/devkitpro/libctru/include/sys/select.h:3:0,
from /opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/types.h:68,
from /opt/devkitpro/libctru/include/3ds/util/utf.h:4,
from /opt/devkitpro/libctru/include/3ds.h:16,
from /home/pi/Downloads/3ds-examples-master/input/read-controls/source/main.c:16:
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h:104:34: error: unknown type name 'u_int'
bintime_mul(struct bintime *_bt, u_int _x)
^
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h:145:17: error: unknown type name 'sbintime_t'
sbintime_getsec(sbintime_t _sbt)
^
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h:151:17: error: unknown type name 'sbintime_t'
static __inline sbintime_t
^
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h: In function 'bttosbt':
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h:155:12: error: 'sbintime_t' undeclared (first use in this function)
return (((sbintime_t)_bt.sec << 32) + (_bt.frac >> 32));
^
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h:155:12: note: each undeclared identifier is reported only once for each function it appears in
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h:155:23: error: expected ')' before '_bt'
return (((sbintime_t)_bt.sec << 32) + (_bt.frac >> 32));
^
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h: At top level:
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h:159:9: error: unknown type name 'sbintime_t'
sbttobt(sbintime_t _sbt)
^
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h:218:9: error: unknown type name 'sbintime_t'
sbttots(sbintime_t _sbt)
^
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h:227:17: error: unknown type name 'sbintime_t'
static __inline sbintime_t
^
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h: In function 'tstosbt':
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h:231:12: error: 'sbintime_t' undeclared (first use in this function)
return (((sbintime_t)_ts.tv_sec << 32) +
^
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h:231:23: error: expected ')' before '_ts'
return (((sbintime_t)_ts.tv_sec << 32) +
^
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h: At top level:
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h:236:9: error: unknown type name 'sbintime_t'
sbttotv(sbintime_t _sbt)
^
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h:245:17: error: unknown type name 'sbintime_t'
static __inline sbintime_t
^
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h: In function 'tvtosbt':
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h:249:12: error: 'sbintime_t' undeclared (first use in this function)
return (((sbintime_t)_tv.tv_sec << 32) +
^
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h:249:23: error: expected ')' before '_tv'
return (((sbintime_t)_tv.tv_sec << 32) +
^
In file included from /opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/time.h:268:0,
from /opt/devkitpro/libctru/include/sys/select.h:3,
from /opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/types.h:68,
from /opt/devkitpro/libctru/include/3ds/util/utf.h:4,
from /opt/devkitpro/libctru/include/3ds.h:16,
from /home/pi/Downloads/3ds-examples-master/input/read-controls/source/main.c:16:
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/time.h: At top level:
/opt/devkitpro/devkitARM/arm-none-eabi/sys-include/time.h:56:1: error: unknown type name 'clock_t'
clock_t _EXFUN(clock, (void));
^
In file included from /opt/devkitpro/devkitARM/arm-none-eabi/sys-include/sys/types.h:68:0,
from /opt/devkitpro/libctru/include/3ds/util/utf.h:4,
from /opt/devkitpro/libctru/include/3ds.h:16,
from /home/pi/Downloads/3ds-examples-master/input/read-controls/source/main.c:16:
/opt/devkitpro/libctru/include/sys/select.h:9:23: error: unknown type name 'fd_set'
int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);
^
/opt/devkitpro/libctru/include/sys/select.h:9:40: error: unknown type name 'fd_set'
int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);
^
/opt/devkitpro/libctru/include/sys/select.h:9:58: error: unknown type name 'fd_set'
int select(int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds, struct timeval *timeout);
^
/opt/devkitpro/devkitARM/base_rules:84: recipe for target 'main.o' failed
make[1]: *** [main.o] Error 1
Makefile:135: recipe for target 'build' failed
make: *** [build] Error 2
 

TarableCode

Well-Known Member
Member
Joined
Mar 2, 2016
Messages
184
Trophies
0
Age
37
XP
319
Country
Canada
Looks like your toolchain installation might be borked, if you want I can zip up mine and send it to you.
Or you can just do what I did a few posts up and 18 hours later you have a sparkling new toolchain :D

Seriously... 18 Hours.
 

Kaisogen

Member
Newcomer
Joined
Jul 5, 2016
Messages
18
Trophies
0
Age
22
Location
Probably at a PC
XP
51
Country
United States
Yes... Please..

I'm a freshman in High School, grades went down a little bit. Parents took away my devleopment laptop, and I just got a new Pi, so I figured I might as well mess around a little bit with the Pi and some 3DS stuff.

Can you give me some instructions? Or is it literally just copy to /opt/ partition?
 

HamBone41801

Vipera’s Alt
Member
Joined
Jan 16, 2017
Messages
1,083
Trophies
0
Age
23
XP
974
Country
United States
Python tools are platform-independent and C/C++ is exactly the same regardless of the platform you're coding on, so as long as you have a compiler working on your architecture you should be fine. Unfortunately, most of utilities that could help you with development are coded for x86, so that's a bummer, but not a hurdle you can't overcome.

there is a way to run x86 programs. I have no idea how, but it works.
 

HamBone41801

Vipera’s Alt
Member
Joined
Jan 16, 2017
Messages
1,083
Trophies
0
Age
23
XP
974
Country
United States
Good luck setting up a stable emulation environment *and* using WINE on-top. Just run your IDE on a desktop, there's no reason to overcomplicate things.

Thats what I always do, but I've done it on the pi for kicks before so I figured I'd help out.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    bassviolet @ bassviolet: uwu