You are here

build release configuration causes a lot of warning | Cypress Semiconductor

build release configuration causes a lot of warning

Summary: 6 Replies, Latest post by Bob Marlowe on 14 Feb 2012 03:48 PM PST
Verified Answers: 3
Last post
Log in to post new comments.
boulder's picture
User
44 posts

 

Everything works in debug configuration, no error, no warning. However, if I change to Release configuration, I got a lot of warning L15: Multiple call to function 

or warning L13: Recursive Call to function

Before when I use a Keil uVersion to compile the similar code for a difference type processor, I saw the same warning. In that case, I can change the Overlay setting in BL51 Misc. For example, I can add a line in overlay:

myfunc ! *

that will take out the warning of multiple or recursive call to myfunc. However, I don't know what to edit overlay in Creator 2.0.

Any suggestions?

Thanks,

dasg's picture
Cypress Employee
730 posts

Hi boulder,

 

This could be due to reentrancy issue.

Try declaring the files listed in the warning into reentrancy file. To learn how to do it, please refer to the Reentrancy section of the application note AN54460 http://www.cypress.com/?docID=32588

 

 

U2
uday's picture
Cypress Employee
569 posts

If your function is going to be called more than once from multiple places it adviced to make the function reentrant. You can make any function reentrant by using the keyword REENTRANT. Please go through the link above understand how to better use the keyword.

boulder's picture
User
44 posts

define these functions as re-entrant does remove the warning. However, it still doesn't feel right, because define the function as re-entrant would waste more resource. A lot of functions are only used in one place, but I got warnings like this: I only call sSpiMFCPid1 once, so what is this c51startup routine?

*** WARNING L15: MULTIPLE CALL TO FUNCTION

NAME: SSPIMFCPID1/SPIHANDLERS_MFC

CALLER1: ?C_C51STARTUP

CALLER2: SPIS_RX_ISR/SPIS_INT

 

dasg's picture
Cypress Employee
730 posts

Hi boulder,

 

The following is the reason which is cited by Keil for L15 warning:

 

" Warning 15 indicates that the linker has found a function that may be called from both main code and an ISR (or functions called by an ISR) or from multiple ISRs at the same time.

One problem is that the function is not reentrant and it may get invoked (by an ISR) while the function is already executing. The result will be variable and probably involve some form of argument corruption.

Another problem is that memory used for local variables and arguments may be overlaid with the memory of other functions. If the function is invoked by an interrupt, that memory will be used. This may cause memory corruption of other functions."

 

Hence, even if a function is called from only one place, the memory used by two functions may get overlaid leading to corruption. Declaring the function as Reentrant will result is reentrancy stack being used to store arguments and local variables.

boulder's picture
User
44 posts

Cool! Thanks.

I followed your link and changed function routines to re-entrant. Among these functions, some of them are my functions, and some of them are generated API functions. All these warnings are gone except one. I did add this function in the cyre file, but for some reason, the compiler still gives me the warning. Is this a compiler bug because warning from other API functions are gone. I can manually add CYREENTRANT to remove the warning, but of course if I do a clean&built, the compiler will remove my CYREENTRANT and report the warning.*** WARNING L15: MULTIPLE CALL TO FUNCTION

 

 

NAME: _DAC_I2C_MASTERSENDSTART/DAC_I2C

CALLER1: ?C_C51STARTUP

CALLER2: SPIS_RX_ISR/SPIS_INT

user_1377889's picture
User
10803 posts

When configuring your components, under the "biult-in"-tab you find the option "supress API gen" which will prevent overwriting your code-changes made.

Bob

Log in to post new comments.