Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge launcher into retro-core #167

Open
ducalex opened this issue Nov 6, 2024 · 2 comments
Open

Merge launcher into retro-core #167

ducalex opened this issue Nov 6, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@ducalex
Copy link
Owner

ducalex commented Nov 6, 2024

I want retro-core to become a standalone esp32 application, containing the launcher and the core emulators. It should be buildable without rg_tool.py, with standard esp-idf tooling.

Benefits:

  • retro-core can now be built and flashed with idf.py (assuming the user doesn't care about DOOM and such)
  • retro-core being standalone means it can be built for platforms with no concept of partitions/multiple exes
  • Reduced firmware size
  • All retro-core apps can now access wifi if they want
  • Faster builds because it means one less app

Drawbacks:

  • It breaks git history for launcher files (but --follow mostly works around that)
  • The presence of the wifi stack, even when not enabled, reserves some amount of internal memory

I've tried on several occasions to merge the launcher and retro-core (latest attempt here), but every time there are issues that stops me. And then I forget what the problem was.

This issue is meant to track problems found during testing.

@ducalex ducalex added the enhancement New feature or request label Nov 6, 2024
@ducalex
Copy link
Owner Author

ducalex commented Nov 6, 2024

Currently the blocking problems are:

  • Must investigate the wifi stack's usage of memory and see if it affects any emulator and if it can be reduced via menuconfig options

@ducalex
Copy link
Owner Author

ducalex commented Nov 29, 2024

Relevant memory info. These are the additional libraries linked in when networking is enabled:

            Archive File DRAM .data & 0.bss .rtc_noinit IRAM0 .text & 0.vectors ram_st_total Flash .text & .rodata & .rodata_noload & .appdesc flash_total
           libnet80211.a        758    6841           0           0           0         7599      105101      8875            10410          0      125144
               liblwip.a         25    3896           0           0           0         3921       77727       721                0          0       78473
         libmbedcrypto.a         36      85           0          30           0          151       67647     10760                0          0       78473
                 libpp.a       2447    1348           0        1354           0         5149       51351      3355             1465          0       59972
                libphy.a       2361     637           0        8902           0        11900       28915         0                0          0       40178
     libwpa_supplicant.a         12    1436           0           0           0         1448       39281       803                0          0       40096
            libmbedtls.a          0     200           0           0           0          200       16263      4581                0          0       20844
           libesp_wifi.a        480      35           0         390           0          905        2873       953                0          0        4696
            libesp_phy.a         16      25           0         194           0          235        1522      1081                0          0        2813

In other words the Wifi/IP/TLS stack currently reserves 31KB of internal memory even when not in use.

It goes down to 18KB when CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY=y is set:


Per-archive contributions to ELF file:
            Archive File DRAM .data & 0.bss .ext_ram.bss .rtc_noinit IRAM0 .text & 0.vectors ram_st_total Flash .text & .rodata & .rodata_noload & .appdesc flash_total
           libnet80211.a        758       0         6841           0           0           0         7599      105057      8875            10410          0      125100
               liblwip.a         17       0         2275           0           0           0         2292       54480       563                0          0       55060
         libmbedcrypto.a         36      85            0           0          30           0          151       67627     10760                0          0       78453
                 libpp.a       2447       0         1348           0        1354           0         5149       51371      3355             1465          0       59992
                libphy.a       2361     637            0           0        8902           0        11900       28907         0                0          0       40170
     libwpa_supplicant.a         12       0         1436           0           0           0         1448       39289       803                0          0       40104
            libmbedtls.a          0     200            0           0           0           0          200       16263      4581                0          0       20844
           libesp_wifi.a        480      35            0           0         390           0          905        2785       953                0          0        4608
            libesp_phy.a         16      25            0           0         194           0          235        1522      1081                0          0        2813

I've disabled this option because it prevents boot when SPIRAM can't be initialized and I wanted to be able to at least show an error on screen when that happens. But retro-go doesn't really work without SPIRAM so maybe it's time to add CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY=y back...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant