Hi All, After long time I was trying to recompile and load the firmware in MCB2300 board and uversion 4. This project was actually developed for a hardware which was developed based on MCB2300 board schematic and uversion 3.
To a maximum end i have copied the configuration of existing settings to uversion 4.
Now my problem is that program control does not reach main loop. I have a boot loader running. So here i have given the last few lines of boot loader code.
/* Run appliication at specified address */ static void cmd_run (char *par) { int run_addr; U32 i; PFV fp; run_addr = DEFAULT_RUN_ADDR; // #define DEFAULT_RUN_ADDR 0x10000 fp = (PFV)(run_addr); DEBUG_Printf("Run applicaiton at 0x%x...\n", run_addr); for (i=0x1000;i!=0; i--); (*fp)(); }
on-chip IROM1 = 0x10000 0x80000
on-chip Default IRAM1 = 0x40000040 0xFFC0 IRAM2 = 0x7FE00000 0x4000 NoInit
Can anyone point me what would be the problem here?
Forgot to remap interrupt vectors? Look in your startup file/user manual for details.
Why the delay loop before jumping to application? It is wrongfully implemented, anyway...
what is wrong with doing delay loop before jumping???????
what is wrongfully implemented anyway?????????
I assume the delay loop is there to give the printout time to get out before the jump.
But it is wrong to have a for loop as delay, without binding the timing to real hardware. Such as using a timer, a baudrate generator or similar. Your loop is likely to run very quickly. Unless the compiler notices it doesn't have any side effect, in which case the loop gets stripped away, resulting in zero delay.
you think keil know something about their tools?????
/* A short delay after reset. */ for (tout = 100; tout; tout--);
from file ARM\RL\TCPnet\Drivers\EMAC_LPC177x_8x.c in latest mdk
No, actually I don't.
The Keil sample code is filled with lousy pieces of trash that may end up totally destroying an unsuspecting users day some random day.
That "tout" loop could potentially work better than your "i" loop, in case "tout" happens to be volatile. But the actual delay will still depend a lot on compiler settings and compiler version.
Hi thanks for your reply.
I am wondering who is replying in "d kmr" name. But its not me.
Why the delay loop before jumping to application? It is wrongfully implemented, anyway... As Per said its a delay time for serial printing. Serial message is very little useful. So less worry.
Lets come to the real problem. Forgot to remap interrupt vectors? Look in your startup file/user manual for details. I have copied the LPC2300.s file from working project to here. But do i have to still lookin to this file?
Or can i create another small project with my current project configurations and startup files? What else i should copy to my new project environment if i want to narrow down the issue?
"But do i have to still look in to this file?"
Of course you do!
Unless you know that the other project is identical to yours, you will have to check that the files meest the specific requirements of your new project.
(of course, if the other project were identical to yours, you would just use that entire project as-is)
Define these macros in your assembly tab:
REMAP RAM_INTVEC
Hi Tamir, Thanks for your reply. Defining that macro did not help. Even the original project is facing the same problem. Difference is old uvision3 now its uvision4. Hardware vice original controller is LPC2378 now also its same.
I am wondering during this kind of migration what are things should be taken care. However i will spend time in LPC2300.s file to get more info.