I'm a user of a TP2808 MCU(128K Flash Rom),so I need to bank my code to 2. For cost considering,I want to change my MCU with a cheaper one,STK6012(128K Flash Rom),which has the same pin difination with TP2808.I modified L51_bank.a51 for STK6012,and included it. Why my code does not work !! Steven Young
Why my code does not work... Without more information, it's impossible to answer your question. It's like me saying, "My car stopped running yesterday. What's wrong with it?" Jon
"Why my code does not work!!" Has it ever worked?
"128K Flash Rom, so I need to bank my code" Just because your micro has 128K Flash doesn't mean that you have to fill it with code! Is your application code actually >64K?
Sorry for "My car stopped running yesterday. What's wrong with it?" Of Course my code is larger than 64K,and my code runs properly with MCU TP2808. Compiled successful with bank6012.a51 included.I used this bank6012.a51 in other project and caused no problems. If anybody will help me out!Please tell me Your email or send a mail to netsheep@126.com,I'll send the whole project(Source code: 7MB)! Thanks Steven Young
Here's a suggestion. Before you send someone a 7M file, take the code banking example we have which is VERY simple and try to make it work. The problem is probably with the L51_BANK.A51 file. Jon
Do you get any linker warnings or did you disable some linker warnings?
Just one linking warning: *** WARNING L13: RECURSIVE CALL TO SEGMENT SEGMENT: ?CO?LCD_OSD CALLER: ?PR?_OSD_TV_PROC?LCD_OSD But I think it's not the key.Because when I use TP2808,the warning remains,and the code runs well. Steven Young
My warning setting is "Warning Level 2" Thanks Steven Young
The warning 13 that you are getting indicates that you have function pointers in your program. Did you tell the linker about your real call tree as explained in the Assembler/Utilities User's Guide under Chapter 9, Data Overlaying. It is also esstial to tell the linker the call tree of code banking, since otherwise the interbank calls cannot be correctly inserted.
"the code runs well" You mean you haven't seen it fail yet! That's the thing about Warnings - they tell you that there's something dodgy about your code. It may well appear to be all fine - until one day it hits the particular circumstances where that dodginess bites you. eg, if the bug affects your leap-year handling, it could appear to "run well" for a whole four years before the bug shows up...!
Thanks All. And now I've modified my code. until "128MCUTV" - 0 Error(s), 0 Warning(s). The problem remains. I have asked the STK6012 FAE.He said it maybe the problem of hardware not software. Thanks again Steven Young