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.
Hi,
I am using Phytec LPC3250 board for my design and I have a very important problem that I have been spending time on for days.
I want to modify my bootloader_NOR code so that I can send my application code image from the serial port.
However, when I define a global variable and use this variable in a function it gets wierd values. My code can be simplified as below:
#include "LPC318x.H" int m = 0; void MyFunction(int value) // do nothing function { } int main(void) { for(;;) { m++; // <- Breakpoint MyFunction(m); } }
When I debug the code, I see "m = 0xE0000420" at the breakpoint where I expect to see 0x00.
This ruins all my intention and I cannot proceed to modify the code.
I think the data in the RAM region is corrupted but I dont know why and I have no sensible solution for this.
Thanks for your helps in advance.
You're talking in too simplistic a manner.
Speaking of which, you're contradicting yourself stating:
I'm not saying this would always be the best solution,
since that's quite exactly what you did say before when you replied "Nor do I" to Mr. Karas' statement that he "never uses static initializers".
You'll have to forgive me for simplistically assuming you actually meant what you said.
"You'll have to forgive me for simplistically assuming you actually meant what you said."
I said that I never use static initialisers.
I said that it gives me what I need.
I said that it would not always be the best solution.
Surely you can see the implication that it may not always be the best solution for other situations for other people.
No contradiction there.
What I said is what I meant.
I have also tried to be accurate when responding to the original problem posted by the OP - I'll refrain from passing comment on your first post regarding the matter!
I found something like this in www.phytec.com/.../TN-021e_3(KPCM-040-Keil).pdf. Maybe this is the reason for this problem.
It says do not build the bootloaders using he evaluation version of uVision. But, I am using it.
Problem Description: The KEIL ARM Evaluation Software contains bootloader projects for NAND and NOR Flash memory (Bootloader_NAND.Uv2 and Bootloader_NOR.Uv2). Although there should be no need to re-build the provided Bootloaders, these Bootloader projects cannot be built with the Keil Evaluation version tools. If projects are built with the Keil Evaluation Software this could override functioning Bootloader .axf files. Workaround: Do not attempt to build the Bootloader projects with Keil Evaluation Software. In the event that Bootloaders are corrupted, download the Bootloaders from: www.phytec.com/.../3250_KEIL_Bl.zip
So what did you expect?!
It would have been so much better if you had mentioned the little detail of you using evaluation software at the start.
Sorry but I did not think using the eval version would ever cause such a thing. Therefore I did not mention. I hope the problem gets fixed when the full version is used.
As said before, I have successfully modified, compiled and executed the bootloaders - And there was no drama.
You really should not find any problems.