1 (edited by dan9er 2021-04-27 20:01:28)

Topic: Building for Nintendo 3DS userland through devkitARM?

I'm making a Gemini client for the Nintendo 3DS. The Gemini protocol requires TLS 1.2 and recommends 1.3, which is why I am seeking to use wolfSSL instead of mbedtls.

What configure flags should I use to build it for static linking in a userland Nintendo 3DS app?

I've noticed wolfSSL supports Wii/Gamecube via devkitPPC:
https://github.com/wolfSSL/wolfssl/blob … 00-1212009
This likely can be modified to work with devkitARM

dkP devs have made a cURL port:
https://github.com/devkitPro/pacman-pac … r/3ds/curl
But cURL has rejected Gemini support.

Example library makefile provided by dkP:
https://github.com/devkitPro/3ds-exampl … y/Makefile

The (New) Nintendo 3DS has:

  • 2 (4) ARM11/ARMv6K threads, one is shared with the system

  • 1 ARM9 thread, system reserved

  • 128 (256) MB of RAM, 32 (64) MB system reserved

Edit: word choice

Share

Re: Building for Nintendo 3DS userland through devkitARM?

Hi dan9er,

We have someon working on updating the support for PPC and testing it for wii. After touching base with them I was able to compile.

For 3DS I was able to compile with

PATH=/opt/devkitpro/devkitARM/bin/:$PATH ./configure  --host=arm-none-eabi --disable-shared --disable-examples --disable-crypttests CFLAGS="-I/opt/devkitpro/libctru/include/ -march=armv6k -mtune=mpcore -mfloat-abi=hard -mtp=soft -mword-relocations -DNO_WRITEV" LDFLAGS="-L/opt/devkitpro/libctru/lib -lctru"
PATH=/opt/devkitpro/devkitARM/bin/:$PATH make -j1 V=1

For PKGBUILD this would reduce to something like

./configure CFLAGS="-DNO_WRITEV" LIBS="-lctru" --host=arm-none-eabi --disable-shared --disable-examples --disable-crypttests --enable-sp-math-all
make

I have not attempted to test actually using the library. I'll put up a draft PR for https://github.com/devkitPro/pacman-packages and update you.

Compiling the examples and tests I am seeing warnings.

c:/msys64/opt/devkitpro/devkitarm/bin/../lib/gcc/arm-none-eabi/10.2.0/../../../../arm-none-eabi/bin/ld.exe: warning: cannot find entry symbol _start; defaulting to 0000000000008020

Any ideas if it's possible to compile the examples and run on 3ds?

If you are able to test on hardware, can you share the results?

Share

Re: Building for Nintendo 3DS userland through devkitARM?

Hey @dan9er,

This still needs to be tested, but here is a branch to build https://github.com/elms/pacman-packages … dd_wolfssl

Turns out I was able to resolve those warnings by adding

-specs=3dsx.specs

to LDFLAGS, but I still disabled examples and tests for the package.

Share

Re: Building for Nintendo 3DS userland through devkitARM?

jeff wrote:

Hi dan9er,

We have someon working on updating the support for PPC and testing it for wii. After touching base with them I was able to compile.

[snip]

Any ideas if it's possible to compile the examples and run on 3ds?

If you are able to test on hardware, can you share the results?

Depends:

  • How is testing for devkitPPC handled, if at all?

  • How do the tests express success or failure? If they just print to console, libctru has a console renderer that can be used with some setup.

  • libctru provides BSD style sockets. Will it play nice with wolfSSL?

Also I looked through ./configure's options, and I have some suggestions:

  • --enable-32bit - ARMv6K is 32-bit.

  • --enable-singlethreaded - Like I've stated in OP, in Old3DS userland we only get one 1 thread to ourselves.

  • --disable-filesystem (maybe) - There are 2 filesystem access systems on libctru: romfs (linked with executable) and sdmc (SD card access). If wolfSSL handles file reading/writing itself, then this may be a problem.

Share