1 Reply Latest reply on Nov 10, 2020 5:54 AM by LePo_1062026

    Linker Problem

    EdHa_4455331

      I am trying to reuse some tasks/files from my main app (App1-Main) in a second stand alone app that will be used during manufacturing to store bits maps in the system flash (AppX-BitmapUtility). But... the linker insists that SpiMasterTaskHandle is undefined even though: 1) it is defined in main_cm4.c and 2) it shows up in the linker map file.

       

      It MAY have something to do with the fact that the main_cm4.h is defined up in App1-Main, but for the life of me I can't see why that should make any difference. I have been trying to find a work-around for this issue for a couple of days to no avail.

       

      In the attached workspace, most of App1-Main has been stripped out for propriety reasons and it will not build successfully, but that shouldn't matter. I still get he same error in my complete system.

       

      Any recommendations would be greatly appreciated.

       

      Ed H.

        • 1. Re: Linker Problem
          LePo_1062026

          Ed,

           

          I've downloaded your workspace.   I've tried to build the workspace.  

           

          App1-Main goes through the Application build phase but doesn't start the compile phase.

          It's missing:

          • main_cm0p.c
          • Misc.h
          • Main_cm4.c
          • Sensors.h

          I see one "Additional Include Directories".

           

          AppX-BitmapUtility goes through the Application build phase but fails at the compile phase with:

          ..\App1-Main.cydsn\SpiMasterTask.c:5:24: fatal error: cy_scb_spi.h: No such file or directory compilation terminated.

          I see no "Additional Include Directories"

           

          As you indicated, the workspace will not build but I can't get directly to your stated problem.   hit other problem first.

           

          Is the aPOC project used for anything?

           

          Sharing content between projects.   I've done it before.  It can be done but is tricky.  I have a PSoC6 project I placed in the Code Sharing forum.   It uses shared .c and .h files across two projects.   PSoC6 BLE Beacon and Scanner Creator projects. PSoC6 BLE Beacon and Scanner Creator projects.

           

          I can easily share .c files.  I just have to "Add/Existing Item..." from the other project.

           

          The trick is #include .h files referenced in the .c file wants to be local to the project.  To fix this I had to add the source project directory to the "Build Settings.../CM4.../Compiler/Additional Include Directories" for the project that requires the shared .c and .h files.

           

          I hope this helps.

           

          Len

          PSoC6 BLE Beacon and Scanner Creator projects.