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 not set --model-large #52

Open
zaoshang67dian opened this issue Jul 4, 2023 · 2 comments
Open

can not set --model-large #52

zaoshang67dian opened this issue Jul 4, 2023 · 2 comments

Comments

@zaoshang67dian
Copy link

[env:STC8G2K64S4]
platform = intel_mcs51
board = STC8G2K64S4
board_build.f_cpu = 35000000L
build_flags =
--model-large

I get the error:
?ASlink-Warning-Conflicting sdcc options:
"-mmcs51 --model-large" in module "main" and
"-mmcs51 --model-small" in module "_startup".
*** [.pio/build/STC8G2K64S4/firmware.hex] Error 1

what "_startup" is ?

@zerog2k
Copy link
Contributor

zerog2k commented Jul 5, 2023

been a long time since I looked at this, but have a look at the SDCC User Guide
section 3.3.6 MCS51 Options

--model-large Generate code for Large model programs, see section Memory Models for more details. If this
option is used all source files in the project have to be compiled with this option. It must also be used
when invoking the linker

also must pass this option to linker
might be -Wl ?
https://docs.platformio.org/en/stable/projectconf/sections/env/options/build/build_flags.html#scopes-scons-variables

@zaoshang67dian
Copy link
Author

been a long time since I looked at this, but have a look at the SDCC User Guide section 3.3.6 MCS51 Options

--model-large Generate code for Large model programs, see section Memory Models for more details. If this
option is used all source files in the project have to be compiled with this option. It must also be used
when invoking the linker

also must pass this option to linker might be -Wl ? https://docs.platformio.org/en/stable/projectconf/sections/env/options/build/build_flags.html#scopes-scons-variables

the option of SDCC -Wl i have tried。 but unfortunatly it does not work.
config:
build_flags =
--model-large
-Wl,--model-large

output:
Building in release mode
sdcc -o .pio/build/RD8T37P48R/src/main.rel -c --std-sdcc11 --opt-code-size --peep-return -mmcs51 --model-large -DF_CPU=32000000L -DHEAP_SIZE=128 -DPLATFORMIO=60111 -DRD8T3X -DRD8T37P48R -DNAKED_ARCH_MCS51 -DNAKED_MCS51_STC8G2KXXS4 -Iinclude -Isrc src/main.c
src/main.c:11: warning 85: in function main unreferenced local variable : 'i'
sdcc -o .pio/build/RD8T37P48R/firmware.hex -mmcs51 --iram-size 256 --xram-size 8448 --code-size 131072 --out-fmt-ihx -Wl,--model-large .pio/build/RD8T37P48R/src/main.rel -L.pio/build/RD8T37P48R
?ASlink-Error- : ".pio/build/RD8T37P48R/firmware.hex"
*** [.pio/build/RD8T37P48R/firmware.hex] Error 1

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

2 participants