We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I am seeing this warning when I try to compile my code
Warning L15: multiple call to segment segment: ?pr?_nvmwrit?nvmem_cc caller1: ?pr?spicommisr?spi_com_cc caller2: ?c_c51startup
I looked through my code, I don't call nvmwrite in spicommisr routine. And what is this c51startup file?
thanks, DG
I did have that nvmwrite in isr before, but I already moved it out. Right now, I only set flag and take care of that nvmwrite in supper loop which belongs to main. I don't understand why linker still thinks I have that nvmwrite in isr.
And what is that C51startup anyway?
C51startup is the code that runs before main is called then calls main(). If your project does not have one the compiler will use the default.
if the linker is confused try to rebuild all or delete the object files then try to build again.
Mayby it will help if you change the Code Optimation Level, try it.
When I reduce optimization level to level 1 (dead code elimination), the warning goes away. If I increase to level 2 (data overlaying), the warning comes back.
and solution or I stuck with level 1 optimization?
Is it safe to ignore the warning? Is changing nwmwrite to reentrant a safe option?
thanks,
I stuck with level 1 optimization? no
Is it safe to ignore the warning? no
Is changing nwmwrite to reentrant a safe option? yes, but that is NOT fixing the problem, just hiding it
do a global search on nwmwrite and get rid of the offending call.
if you need it both in main and an ISR, make 2 (differently named) copies.
if the function is called from anything with using 1, 2 or 3 it must have 'using' the same in its header
Erik
Maybe the following manual information will help.
http://www.keil.com/support/man/docs/c51/c51_xf_recursivecode.htm
Jon