1

I am trying to replace the standard startup code to save flash space.

I've put the new startup.s in my core directory and added the -nostartfiles parameter to the linker reciepe in my platform.txt.

When I compile with the IDE, it does not include my start code at all.

When I use Atmel Studio or a makefile, the code assembles and is included just fine.

How can I get the Arduino IDE to use my new start up code?

4
  • to which board package does this apply? I don't have an startup.S file in any of the many installed packages
    – Juraj
    Nov 23, 2018 at 12:08
  • @Juraj I am using a custom AVR board, but this applies to any board with an architecture that requires a startup file - which is all that I know of. The standard startup file is usually included as an already compiled .o file. For example, the AVR start code lives in the hardware/tools/avr/lib tree as crtXXXX.o where the subsirectory and the XXXX depends on the selected platform/board/chip/variant. This file is automagically included by the linker is -nostartfiles is not specified.
    – bigjosh
    Nov 23, 2018 at 17:48
  • is it a bug in Arduino builder?
    – Juraj
    Nov 23, 2018 at 18:05
  • @Juraj I'd call it more of an "unexpected, undocumented, and undesirable behavior" than a bug. :)
    – bigjosh
    Nov 23, 2018 at 22:19

1 Answer 1

1

The Arduino builder is case sensitive and will only see files that end in .S and not files that end in .s.

Renaming the new start up file to startup.S and then deleting the precomplied core archive fixed the problem.

Note that committing this change to git slightly complicated!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.