gnupic: Re: [gnupic] gplink Question


Previous by date: 4 Jul 2006 23:44:45 +0100 Re: [gnupic] Re: [X_SPAM] [gnupic] gplink Question, Byron A Jeff
Next by date: 4 Jul 2006 23:44:45 +0100 Re: [gnupic] gplink Question, M.S.Waters
Previous in thread:
Next in thread: 4 Jul 2006 23:44:45 +0100 Re: [gnupic] gplink Question, M.S.Waters

Subject: Re: [gnupic] gplink Question
From: Robert Pearce ####@####.####
Date: 4 Jul 2006 23:44:45 +0100
Message-Id: <l41c0gBq7uqEFw87@jonah.huneausware.local>

On Tue, 4 Jul 2006, M.S.Waters ####@####.#### wrote :
>
>I'm in the process of developing a PIC bootloader specifically for
>Linux based PIC development.

Been there, done that. Twice. The first one was for a "MIDI drum pad" 
project for www.livewires.org.uk so the download sequence obeyed the 
rules for a MIDI system exclusive message. The second was on RS232 so I 
made some minor adjustments to the protocol.

>
>The bootloader is made up of 4 ASM modules which are separately
>assembled and then linked with gplink. The bootloader is designed to
>be installed at the top of the PIC's memory.
>
>I would like to hard code a memory address in one module using an ORG
>or CODE directive and have the linker place the remaining modules
>after the first. At present I must address all 4 modules separately
>which kind of defeats the purpose of using the linker.
>
No, you don't use ORG with the linker. What you do is declare all the 
code to be in a suitably named code section, so each file contains

boot code        ; Put this code in the bootloader block

Then you need to create an appropriate linker file, based on the default 
one but with changes. In particular you need to define a logical code 
section called "boot" at the top of the flash.

CODEPAGE   NAME=BBLOCK    START=0x0700   END=0x07FF   PROTECTED

SECTION    NAME=boot      ROM=BBLOCK

Then set up your makefile to use that linker file and it should work. 
I've done this extensively in my current project. Code from different 
files allocated to the same section will be linked end-to-end in the 
order the files are listed on the gplink command line.
-- 
Rob Pearce                       http://www.bdt-home.demon.co.uk

The contents of this | Play Rogue, visit exotic locations, meet strange
message are purely   | creatures and kill them.
my opinion. Don't    |
believe a word.      |

Previous by date: 4 Jul 2006 23:44:45 +0100 Re: [gnupic] Re: [X_SPAM] [gnupic] gplink Question, Byron A Jeff
Next by date: 4 Jul 2006 23:44:45 +0100 Re: [gnupic] gplink Question, M.S.Waters
Previous in thread:
Next in thread: 4 Jul 2006 23:44:45 +0100 Re: [gnupic] gplink Question, M.S.Waters


Powered by ezmlm-browse 0.20.