S32K1 weak cannot be overridden by strong definitions.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K1 weak cannot be overridden by strong definitions.

1,136 Views
wuxianlong
Senior Contributor I

Hi,NXP

We encountered an issue where a weakly defined interrupt handling function could not be replaced by a strong definition in the library. When we compiled the SDK into a static library and added it to the APP, we found that the CAN0 interrupt handling function could not be strongly defined.
The IDE I am using is S32DS ARM 2.2, the SDK version is 3.0.0, and the compiler version is gcc 6.3.
Below is the situation of my Demo test:
① If I keep the weakly defined interrupt handling functions in the startup, the content of the interrupt vector table will be the weakly defined functions.
image.pngimage.png
② If I comment out the weakly defined interrupt handling functions in the startup, the CAN interrupt handling function can be correctly defined.
image.pngimage.png
What is the reason for this phenomenon? The source files of my test Demo and the files after compiling the static library are attached.
Tags (1)
0 Kudos
Reply
4 Replies

1,105 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@wuxianlong

I didn't fully understand your question.

I tested the project you provided, "S32K146_UJA1169_SDK300.zip," and followed your method to disable "def_irq_handler CAN0_ORed_0_15_MB_IRQHandler."

The compilation results for both were exactly the same, with no difference whatsoever.

 

0 Kudos
Reply

1,100 Views
wuxianlong
Senior Contributor I

Hi,@Senlent 

Thanks for your support. The problem that a weak definition cannot be replaced by a strong definition only occurs when using the static library file .a and using a strong definition in the static library.

Based on S32K146_UJA1169_SDK300, I compiled the SDK into a static library (.a file) and loaded it into the application, such as my S32K146_UJA1169_Lib_SDK300. Then I can reproduce the problem. The CAN0_ORed_0_15_MB_IRQHandler will not be loaded into the interrupt vector table unless I comment out the weak definition.

Best Regards,
xianlong

0 Kudos
Reply

1,095 Views
Senlent
NXP TechSupport
NXP TechSupport

Hi@wuxianlong

This is probably related to some compiler settings. I will deal with your problem when I have time; it's not an urgent issue.

0 Kudos
Reply

1,133 Views
wuxianlong
Senior Contributor I
What is the reason for this phenomenon? The source files of my test Demo and the files after compiling the static library are attached.
 
 
 
 
 
 
 
 
 
0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2348835%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32K1%20weak%20cannot%20be%20overridden%20by%20strong%20definitions.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2348835%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%EF%BC%8CNXP%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CDIV%20class%3D%22%22%3EWe%20encountered%20an%20issue%20where%20a%20weakly%20defined%20interrupt%20handling%20function%20could%20not%20be%20replaced%20by%20a%20strong%20definition%20in%20the%20library.%20When%20we%20compiled%20the%20SDK%20into%20a%20static%20library%20and%20added%20it%20to%20the%20APP%2C%20we%20found%20that%20the%20CAN0%20interrupt%20handling%20function%20could%20not%20be%20strongly%20defined.%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3EThe%20IDE%20I%20am%20using%20is%20S32DS%20ARM%202.2%2C%20the%20SDK%20version%20is%203.0.0%2C%20and%20the%20compiler%20version%20is%20gcc%206.3.%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3EBelow%20is%20the%20situation%20of%20my%20Demo%20test%3A%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%E2%91%A0%20If%20I%20keep%20the%20weakly%20defined%20interrupt%20handling%20functions%20in%20the%20startup%2C%20the%20content%20of%20the%20interrupt%20vector%20table%20will%20be%20the%20weakly%20defined%20functions.%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F381871iBDCAA5F5CA1E4B86%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3Cspan%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3Eimage.png%3C%2Fspan%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%E2%91%A1%20If%20I%20comment%20out%20the%20weakly%20defined%20interrupt%20handling%20functions%20in%20the%20startup%2C%20the%20CAN%20interrupt%20handling%20function%20can%20be%20correctly%20defined.%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F381872i29B60054FF568AA8%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3Cspan%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3Eimage.png%3C%2Fspan%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3EWhat%20is%20the%20reason%20for%20this%20phenomenon%3F%20The%20source%20files%20of%20my%20test%20Demo%20and%20the%20files%20after%20compiling%20the%20static%20library%20are%20attached.%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2349055%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K1%20weak%20cannot%20be%20overridden%20by%20strong%20definitions.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2349055%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%40%3CSPAN%3Ewuxianlong%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EThis%20is%20probably%20related%20to%20some%20compiler%20settings.%20I%20will%20deal%20with%20your%20problem%20when%20I%20have%20time%3B%20it's%20not%20an%20urgent%20issue.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2349013%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K1%20weak%20cannot%20be%20overridden%20by%20strong%20definitions.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2349013%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F188029%22%20target%3D%22_blank%22%3E%40Senlent%3C%2FA%3E%26nbsp%3B%3CBR%20%2F%3E%3CBR%20%2F%3EThanks%20for%20your%20support.%20The%20problem%20that%20a%20weak%20definition%20cannot%20be%20replaced%20by%20a%20strong%20definition%20only%20occurs%20when%20using%20the%20static%20library%20file%20.a%20and%20using%20a%20strong%20definition%20in%20the%20static%20library.%3CBR%20%2F%3E%3CBR%20%2F%3EBased%20on%20S32K146_UJA1169_SDK300%2C%20I%20compiled%20the%20SDK%20into%20a%20static%20library%20(.a%20file)%20and%20loaded%20it%20into%20the%20application%2C%20such%20as%20my%20S32K146_UJA1169_Lib_SDK300.%20Then%20I%20can%20reproduce%20the%20problem.%20The%20CAN0_ORed_0_15_MB_IRQHandler%20will%20not%20be%20loaded%20into%20the%20interrupt%20vector%20table%20unless%20I%20comment%20out%20the%20weak%20definition.%3CBR%20%2F%3E%3CBR%20%2F%3EBest%20Regards%2C%3CBR%20%2F%3Exianlong%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2348983%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K1%20weak%20cannot%20be%20overridden%20by%20strong%20definitions.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2348983%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%40%3CSPAN%3Ewuxianlong%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EI%20didn't%20fully%20understand%20your%20question.%20%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EI%20tested%20the%20project%20you%20provided%2C%20%22S32K146_UJA1169_SDK300.zip%2C%22%20and%20followed%20your%20method%20to%20disable%20%22def_irq_handler%20CAN0_ORed_0_15_MB_IRQHandler.%22%20%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EThe%20compilation%20results%20for%20both%20were%20exactly%20the%20same%2C%20with%20no%20difference%20whatsoever.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2348837%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K1%20weak%20cannot%20be%20overridden%20by%20strong%20definitions.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2348837%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3EWhat%20is%20the%20reason%20for%20this%20phenomenon%3F%20The%20source%20files%20of%20my%20test%20Demo%20and%20the%20files%20after%20compiling%20the%20static%20library%20are%20attached.%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3C%2FDIV%3E%3CDIV%20class%3D%22%22%3E%26nbsp%3B%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FLINGO-BODY%3E