Skip to content

Question - How to include custom startup code? #352

Closed
@xC0000005

Description

@xC0000005

I'm adding support for a couple of boards by Malyan (the M200 V1 and V2, STM32F103 and 070, respectively). I have these working with STM32GENERIC, but these have some odd startup code requirements. The booloader doesn't set SP, so on the 103, I need to load the SP in the startup assembler, and in both cases, there's some form of interrupt that watches a few key values in RAM that cause the printer to fault. If I disable interrupts and faults until after variable initialization, it works fine (at that point, the core's code is in control 100%).

Right now, I've modified the startup_stm32f103xb.s file to include the required changes, but is there a way we can extend the core to allow a variant to include a startup file instead? I don't mind making such a change, but it's not clear to me yet how the .s files are selected for compliation. I've looked at platform.txt and see the -I settings, but not how we're matching the files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions