gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Beginners > Problem including large bin data

#53927 - falvarez - Tue Sep 13, 2005 2:59 pm

Hello.

I'm trying to play some sound on the GBA.I've exported PCM data to an array and put into a C file.

Player is working well while the array is little. But when I try to play a bigger file, I get this error linking:

/c/devkitPro/devkitARM/bin/arm-elf-gcc sounds.c -I. -I/c/devkitPro/devkitARM/arm-elf/include -I/c/devkitPro/devkitARM/include -I./inc -c -g -O2 -Wall -mcpu=arm7tdmi -mtune=arm7tdmi -fomit-frame-pointer -ffast-math -mthumb -mthumb-interwork
/c/devkitPro/devkitARM/bin/arm-elf-gcc -o player.elf player.o graficos.o irq_handler.o irq.o keyboard.o sprites.o mapper.o rooms.o sounds.o -mthumb -mthumb-interwork -specs=/c/devkitPro/devkitARM/arm-elf/lib/gba_mb.specs -L/c/devkitPro/devkitARM/arm-elf/lib/interwork -L/c/devkitPro/devkitARM/lib
/c/devkitPro/devkitARM/bin/../lib/gcc/arm-elf/3.4.4/../../../../arm-elf/bin/ld: region ewram is full (player.elf section .rodata)
/c/devkitPro/devkitARM/bin/../lib/gcc/arm-elf/3.4.4/../../../../arm-elf/bin/ld: section .ctors [02000000 -> 02000007] overlaps section .init [02000000 -> 02000233]
/c/devkitPro/devkitARM/bin/../lib/gcc/arm-elf/3.4.4/../../../../arm-elf/bin/ld: section .dtors [02000008 -> 0200000f] overlaps section .init [02000000 -> 02000233]
/c/devkitPro/devkitARM/bin/../lib/gcc/arm-elf/3.4.4/../../../../arm-elf/bin/ld: section .jcr [02000010 -> 02000013] overlaps section .init [02000000 -> 02000233]
/c/devkitPro/devkitARM/bin/../lib/gcc/arm-elf/3.4.4/../../../../arm-elf/bin/ld: section .eh_frame [02000014 -> 02000017] overlaps section .init [02000000 -> 02000233]
/c/devkitPro/devkitARM/bin/../lib/gcc/arm-elf/3.4.4/../../../../arm-elf/bin/ld: section .iwram [02000018 -> 02000127] overlaps section .init [02000000 -> 02000233]
/c/devkitPro/devkitARM/bin/../lib/gcc/arm-elf/3.4.4/../../../../arm-elf/bin/ld: section .data [02000128 -> 02000b37] overlaps section .init [02000000 -> 02000233]

I've defined the array like this:

const u8 pcmdata[65536] = { ..... };

How can I manage to store this "raw" data in the ROM or another region with more free space?

Thanks in advance.

#53951 - tepples - Tue Sep 13, 2005 8:09 pm

falvarez wrote:
I'm trying to play some sound on the GBA.I've exported PCM data to an array and put into a C file.

Player is working well while the array is little. But when I try to play a bigger file, I get this error linking:

arm-elf-gcc -specs=/c/devkitPro/devkitARM/arm-elf/lib/gba_mb.specs [...]
/c/devkitPro/devkitARM/bin/../lib/gcc/arm-elf/3.4.4/../../../../arm-elf/bin/ld: region ewram is full (player.elf section .rodata)

If you use -specs=gba_mb.specs then everything must fit into EWRAM, which is only 0.25 MiB. In order to make use of ROM space (for a GBA flash card or a PC-based GBA emulator), use -specs=gba.specs instead.

If you want to have the code in EWRAM but the data in ROM, you'll need to use GBFS. (I use this technique in Luminesweeper to help save energy and to help simplify making both multiboot and ROM based builds of a single program.)
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#53956 - falvarez - Tue Sep 13, 2005 10:01 pm

tepples wrote:

If you use -specs=gba_mb.specs then everything must fit into EWRAM, which is only 0.25 MiB. In order to make use of ROM space (for a GBA flash card or a PC-based GBA emulator), use -specs=gba.specs instead.


Thank you very much, you have made my day! :-)

I didn't notice that option, guess I copied from elsewhere.

Best regards.