SDCC --model-small to --model-medium

Hey, I’m working on the Nuvoton N76E003 using platformio-mode for emacs.

I’m running out of RAM with the default --model-small flag. I tried using --model-medium, but it requires compiling all the files with it. My platformio.ini and project structure are as follows:


platform = intel_mcs51
board = N76E003
build_flags = -DFOSC_160000 --model-medium
upload_protocol = custom
upload_command = nuvoprog -t n76e003 program -c FBFFFFFFFF -a .pio/build/N76E003/firmware.hex

project structure

├── +include
├── +lib/N76E003
├── +src
└── platformio.ini

How can I compile every file with --model-medium ? Also the nuvoprog upload_protocol does not seem to work.

This should apply globally to the compilation of C code. However

  1. the old --model-small flag might still also be given so you have to use build_unflags
  2. it may not appear in the final linker flags

Execute the project task Clean then Advanced->Verbose Build. What’s the output?