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

Can't build ...will not fit in region 'FLASH'... #2

Open
AlfonsoBR opened this issue Jan 31, 2021 · 3 comments
Open

Can't build ...will not fit in region 'FLASH'... #2

AlfonsoBR opened this issue Jan 31, 2021 · 3 comments

Comments

@AlfonsoBR
Copy link

with Drivers folder and startup_stm32h7b0xx.s, ...will not fit in region 'FLASH'...

...
fpu=fpv5-d16 -mfloat-abi=hard -specs=nano.specs -TSTM32H7B0VBTx_FLASH.ld -lc -lm -lnosys -Wl,-Map=build/gw_doom.map,--cref -Wl,--gc-sections -o build/gw_doom.elf
/usr/lib/gcc/arm-none-eabi/7.3.1/../../../arm-none-eabi/bin/ld: build/gw_doom.elf section .data' will not fit in region FLASH'
/usr/lib/gcc/arm-none-eabi/7.3.1/../../../arm-none-eabi/bin/ld: region `FLASH' overflowed by 4268 bytes

@Willyarma
Copy link

I already asked this, nobody answered so gave up and closed it, look in closed issues.

@AlfonsoBR
Copy link
Author

It is a problem with the GCC ARM version, you have to use version 10.2.0 or higher, I have replaced the original in the Debian distro and now it compiles, but I suppose some more work will have to be done since the binary occupies 2MB and does not fit the flash.

@benob
Copy link

benob commented Apr 6, 2022

but I suppose some more work will have to be done since the binary occupies 2MB and does not fit the flash.

For that that last part, you need to extract the sections that go to internal and external flash.
Use size -A build/gw_doom.elf to check the sections, then objdump -O binary -S -j section1 -j section2... to extract the relevant sections. Check the rules to build $(TARGET)_{extflash,intflash}.bin in Makefile of https://github.com/kbeckmann/game-and-watch-retro-go for an example.

(I haven't tried it myself, yet)

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

No branches or pull requests

3 participants