|
|
View previous topic :: View next topic |
Author |
Message |
jmaurin
Joined: 29 Mar 2008 Posts: 26 Location: Ribeirão Preto, SP, Brasil
|
Problem compiling with CCS > 4.038 |
Posted: Sun Mar 06, 2011 7:45 pm |
|
|
Hi.
I have a program with i usually compile using CCS 4.038 and everything works fine. I tried to use ANY version after 4.038, but not work, any version.
The program compiles fine, but the memory mapping where code are stored are totally crazy.
My code is to use with Microchip bootloader for 18F4550 and i have these lines to make sure my code start from the right point in memory, but it`s not working anymore.
Code: | //Bootloader
#build(reset=0x800, interrupt=0x808)
#org 0x000, 0x7ff { }
|
This is the RIGHT code, compiled in PCWHD 4.038
http://img845.imageshack.us/i/working.jpg/
Look at the address, start exactly where i need.
Now, this is the code generated by any CCS after 4.038
http://img402.imageshack.us/i/wrongs.jpg/
And more: this address is random. What i'm missing? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19515
|
|
Posted: Mon Mar 07, 2011 9:29 am |
|
|
Settings.
Check the code format being generated. Normally an odd format like this, is because CCS is set to generate a different output format to the one that the MPLAB program is trying to read. The default changed during the development of V4....
Best Wishes |
|
|
jmaurin
Joined: 29 Mar 2008 Posts: 26 Location: Ribeirão Preto, SP, Brasil
|
|
Posted: Mon Mar 07, 2011 1:18 pm |
|
|
But where? I tried to change everything in "Output Files" and still the same problem :/ |
|
|
jmaurin
Joined: 29 Mar 2008 Posts: 26 Location: Ribeirão Preto, SP, Brasil
|
|
Posted: Fri Apr 15, 2011 10:45 am |
|
|
Up |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Fri Apr 15, 2011 12:54 pm |
|
|
You didn't post a test program, so there's no real way to test your
exact problem. So I just threw together some code, that may not be in
your same configuration, and compiled it with vs. 4.120 and it works.
Here's the program:
Code: |
#include <18F4550.h>
#fuses HS,NOWDT,NOLVP,PUT,NOBROWNOUT
#use delay(clock=20000000)
//Bootloader
#build(reset=0x800, interrupt=0x808)
#org 0x000, 0x7ff { }
//======================================
void main(void)
{
while(1);
} |
Then if I go to View/Disassembly Listing in MPLAB, I get this.
(I don't have your USB bootloader). It's working.
Code: |
1: #include <18F4550.h>
0800 EF04 GOTO 0x808
2: #fuses HS,NOWDT,NOLVP,PUT,NOBROWNOUT
3: #use delay(clock=20000000)
4:
5: //Bootloader
6: #build(reset=0x800, interrupt=0x808)
7: #org 0x000, 0x7ff { }
8:
9:
10: //======================================
11: void main(void)
12: {
0808 6AF8 CLRF 0xff8, ACCESS
080A 9ED0 BCF 0xfd0, 0x7, ACCESS
080C 6AEA CLRF 0xfea, ACCESS
080E 6AE9 CLRF 0xfe9, ACCESS
0810 50C1 MOVF 0xfc1, W, ACCESS
0812 0BC0 ANDLW 0xc0
0814 090F IORLW 0xf
0816 6EC1 MOVWF 0xfc1, ACCESS
0818 0E07 MOVLW 0x7
081A 6EB4 MOVWF 0xfb4, ACCESS
13:
14: while(1);
081C D7FF BRA 0x81c |
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|