Issues with a bootloader


Closed Thread
Results 1 to 13 of 13

Hybrid View

  1. #1
    Join Date
    Oct 2009
    Posts
    583


    Did you find this post helpful? Yes | No

    Default Re: Issues with a bootloader

    I wiped the PIC and loaded the bootloader, read back a screen dump and showed FF for all blocks apart from the 1st four. The PC app fond the pic and uploaded the main code - You can see that the first 4 blocks remained the same so I'm guessing it didn't overwrite the bootloader (see the diagram attached)

    My PicFlash application has tick boxes for code protect sections of PIC memory - is it worth enabling this for 0x00 ??



    Sorry guys the forum resizes the image - here's a link to the full sized one http://www.micro-heli.co.uk/screendump.png

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,623


    Did you find this post helpful? Yes | No

    Default Re: Issues with a bootloader

    Scampy,
    Try adding
    Code:
    DEFINE LOADER_USED 1
    And see if that makes it any better.

    /Henrik.

  3. #3
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: Issues with a bootloader

    Surely a boot loader can’t be written in a few instructions...
    Have you scrolled right down the bottom of your hex file when only the boot loader is loaded?
    I think it would be written to the last locations it could fit.

  4. #4
    Join Date
    Oct 2009
    Posts
    583


    Did you find this post helpful? Yes | No

    Default Re: Issues with a bootloader

    Art, I think the bootloader contains the "goto" section at the start, and then the actual loader is at the end of the code space as shown below and confirmed in the attachment.



    @Henrik, Line added to the main code - thanks
    Attached Images Attached Images  

  5. #5
    Join Date
    Oct 2009
    Posts
    583


    Did you find this post helpful? Yes | No

    Default Re: Issues with a bootloader

    It's still flakey, but seems to work 8 out of 10 times !

    Cheers guys

  6. #6
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: Issues with a bootloader

    If the boot loader can write your program over serial the pic must support program memory read/write.
    So you should be able to check if the loader exists with your own pic program.
    If you think you're overwriting it with your program you'd only need to check the first word is correct.
    Code:
    pword var word
    index var word
    
    index = $7F40
    LCDOUT ... clear screen and home command
    READCODE index,pword
    IF pword = $700E THEN
    LCDOUT “  Loader exists   "
    ELSE
    LCDOUT “Loader Overwrite"
    ENDIF
    Last edited by Art; - 15th May 2015 at 01:48.

Similar Threads

  1. pic18F6722 issues
    By ptig185 in forum General
    Replies: 8
    Last Post: - 2nd September 2011, 18:37
  2. EEPROM issues
    By timmers in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 25th March 2010, 17:19
  3. Comparator Issues
    By Freman in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 23rd May 2008, 13:58
  4. Pulsein issues...
    By cpayne in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 4th April 2006, 19:45

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts