AdaCore / Ada_Drivers_Library

Ada source code and complete sample GNAT projects for selected bare-board platforms supported by GNAT.
BSD 3-Clause "New" or "Revised" License
236 stars 141 forks source link

Project Wizard doesn't generate startup files #383

Closed JCGobbi closed 3 years ago

JCGobbi commented 3 years ago

When running project_wizard.py and choosing to use startup-gen to generate the link.ld and crt0.S files, the script uses the file ada_drivers_library.gpr instead of the "real" project file, that must be outside the Ada_Drivers_Library directory.

Considering that the Ada_Drivers_Library directory is inside the actual project directory, the text for startup-gen inside project_wizard.py could be:

# Run startup-gen
    if config.get_config ("Use_Startup_Gen") == "True":

# Start changes
        prj_dir = os.path.abspath(os.path.join(project_directory, ".."))
        print("\nPut the full name of the ZFP project file.")
        config.query_string_key('ZFP_Project_File', default="zfp.gpr")
        prj_path = os.path.join(prj_dir, config.get_config("ZFP_Project_File"))
        print(" -> Generating startup files.")
        run_program ('startup-gen',
                     '-P', prj_path,
# End changes

                     '-l', os.path.join(source_dir, "link.ld"),
                     '-s', os.path.join(source_dir, "crt0.S"))

This time, considering that startup-gen is in the PATH, it will use the ../zfp.gpr project file or the name the user choose. I have tested and it runs fine.

Fabien-Chouteau commented 3 years ago

Hello @JCGobbi,

I am not sure to understand the problem here. I think it is normal that startup-gen is called on the ada_drivers_library.gpr project.

JCGobbi commented 3 years ago

Hello @Fabien-Chouteau

Sorry, because it was my fault. I am creating a wizard for a new MCU (STM32F334R8) and forgot to include memory descriptions in the devices.py file. Now I included that information and startup-gen runs fine on ada_drivers_library.gpr.

Thank you for your attention.

Fabien-Chouteau commented 3 years ago

No problem :+1: