Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Bootloader and user code relocating?

Status
Not open for further replies.

UroBoros

Advanced Member level 2
Joined
May 5, 2004
Messages
642
Helped
19
Reputation
38
Reaction score
8
Trophy points
1,298
Location
Cochin - India
Activity points
6,459
Hai

This is the Bootloader I am using or trying to use form PIC 18F452.


The bootloader is downloading the user code successfully.

But my code is not running.

Seems my code vectoring may be wrong.But cant find the method.


can anybody go through the bootloader asm attached and suggest me how to vector user code for this.

Thanks
picstudent
 

jshroff

Advanced Member level 4
Joined
Apr 30, 2004
Messages
116
Helped
14
Reputation
28
Reaction score
0
Trophy points
1,296
Activity points
935
Hi Post your actual program looking at the bootloader source looks like your actal program needs to start with a GOTO PROGSTART instruction.

The bootloader will look for this and patch your program accordingly.
 

    UroBoros

    Points: 2
    Helpful Answer Positive Rating

UroBoros

Advanced Member level 2
Joined
May 5, 2004
Messages
642
Helped
19
Reputation
38
Reaction score
8
Trophy points
1,298
Location
Cochin - India
Activity points
6,459
Hai

PROGSTART? I think it is a label in bootloader code. Is it relevent in my application?

My code starts with like this


org 00h
goto start




start

call port_ini
call timer_ini

goto mainline



mainline

nop


goto mainline


Where I should place my start vector?

the bootloader seems to reside at the extereme end of programe memory

also in 18 series can we start on HS mode and later switch on to PLL mode?

or will start with PLL only if PLL is to be used?

thanks
picstudent
 

jshroff

Advanced Member level 4
Joined
Apr 30, 2004
Messages
116
Helped
14
Reputation
28
Reaction score
0
Trophy points
1,296
Activity points
935
Picstudent said:
Hai

PROGSTART? I think it is a label in bootloader code. Is it relevent in my application?

My code starts with like this


org 00h
goto start




start

call port_ini
call timer_ini

goto mainline



mainline

nop


goto mainline


Where I should place my start vector?

the bootloader seems to reside at the extereme end of programe memory

also in 18 series can we start on HS mode and later switch on to PLL mode?

or will start with PLL only if PLL is to be used?

thanks
picstudent

This looks OK, the bootloader will look for the first 4 bytes GOTO START and place them in the right location, this code looks like it will work correctly do yo have a way to test it without the bootloader? The start vector is correct, and will be relocated appropriately.
 

    UroBoros

    Points: 2
    Helpful Answer Positive Rating

UroBoros

Advanced Member level 2
Joined
May 5, 2004
Messages
642
Helped
19
Reputation
38
Reaction score
8
Trophy points
1,298
Location
Cochin - India
Activity points
6,459
Hai

Thanks for the reply.

I have checked the code with ICD without bootloader.It is ok in that mode.


But in bootloader mode,it detects the bootloader ,downloads the code successfully and able to download agin also,Seems bootloader not corrupted and still in control.

But my code, it cant be seen anywhere!

Actually I have changed the asm for bootloader to suit my crystal frequency of 10mhz. It seems ok because both are communicating each other and if we pressed reset during a transfer it aborts also. All ok it seems for me.


Is there any pin pulling up for this bootloader to run.No information on its site.

thanks and regards
picstudent
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top