View previous topic :: View next topic |
Author |
Message |
JBM
Joined: 12 May 2004 Posts: 54 Location: edinburgh, Scotland
|
Some bloader help! |
Posted: Sat Oct 30, 2004 8:04 am |
|
|
Until recently i've been surviving wihtout bootloaders, but there's only so long i can avoid the issue.
I've compiled the EX_LOAD.C example and loaded it onto my PIC. i can then see the "Software Version A!" messages, etc. When i go to load a program, i send the .hex file as text, adn get a shed load of characters looking like spades coming up. After about 7 lines of these, it stops dead. Even after a hardware reset, the program is just as before.
And yes, i am using XON/XOFF flow control.
What am I not doing / doing wrong? Any feedback / suggestions / slaps across the face with a wet trout would be appreciated.
-JBM |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Sat Oct 30, 2004 8:48 am |
|
|
From the top of loader.c: Quote: | After each good line, the loader sends an ACKLOD character. |
combined with Code: |
#define ACKLOD 0x06 |
Then look up the character code 0x06 in the IBM PC Extended Character Set (ECS) and you will notice this is a spade symbol (see this link for a description of ECS characters).
Basically this means your bootloader is downloading a large part of your program correctly before failure. Without more information I can't tell you whether the error is in the bootloader or in your downloaded program. To figure this out out I suggest you add a special message to the end of the bootloader, just before it resets the CPU. For example, modify the end of loader.c to look like: Code: | putchar (ACKLOD);
puts('Finished'); // Add this line
putchar(XON);
reset_cpu();
}
|
After this modification download your program again. If the new added text shows up in your terminal emulator, then you know the error is most likely not in the bootloader but in your own program. |
|
|
dan king
Joined: 22 Sep 2003 Posts: 119
|
|
Posted: Sat Oct 30, 2004 9:21 am |
|
|
one suggestion would be to try and add character or line delays from the terminal emulation program. That helped me on several occasions. If hardware flow control is not used, as in the bootloader you are using, the flow isn't effectively stopped all the time. If you are using hyperterm, in the advanced ascii setup there are several delay settings you can try, they slow the transfer down so you can see if the file transfer gets further along in the process.
Just a suggestion but worked for me.
Dan |
|
|
JBM
Joined: 12 May 2004 Posts: 54 Location: edinburgh, Scotland
|
|
Posted: Tue Nov 02, 2004 3:01 pm |
|
|
Many stressful hours later, I've come back for more help. It acknowleges the \r character coming in, but it never reaches the end of the real_load_program() function.
For the moment, the fact that it seems to be doing bugger all to alter my program is a secondary concern!
If anyone has a working implementation of LOADER.C and is willing to share code ( and a bit about #ORGing out memory ) I would be über-grateful.
-JBM |
|
|
|