Memory reserve for bootloader Pic18F46J50


+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Senior Member GAMBOA's Avatar
    Join Date
    Nov 2004
    Posts
    475
    Thumbs Up
    Received: 23
    Given: 0
    Total Downloaded
    276.92 MB

    0 Not allowed!

    Default Memory reserve for bootloader Pic18F46J50

    Hi list,

    I have to reserve space for a bootloader right at the beginning of the flash, from the address 0x0000 to 0x2000 it is reserved for the bootloader (although it may end up being more). My application should use program memory from address 2010 onwards. Well how can I tell the compiler to do this. I have no idea. Thank you.

    Regards,
    Gamboa

  2. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  3. #2
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,899
    Thumbs Up
    Received: 385
    Given: 196
    Total Downloaded
    2.09 GB

    0 Not allowed!

    Default Re: Memory reserve for bootloader Pic18F46J50

    Over the years I have created declares to help me develop the compiler that have come in useful, and here is another one:

    Declare Proton_Start_Address = $2000

    The above Declare will move the original Org for the compiler's library code and the interrupt vector orgs to the address in the Declare. It is only valid on 18F devices, but I'll see about adding it to enhanced 14-bit core device as well. It will not work with (legacy) standard 14-bit core devices because of their older architecture, and PIC24 and dsPIC33 devices have a complex lower flash architecture with the interrupt vector tables that the linker adds seperately, so it will not be suitable for those either. For PIC24 and dsPIC33 devices, a new linker script would have to be written each time the address changed! Although it looks like the new vectored interrupt PIC18F devices will need the same because they use a new assembler program, so this Declare is only for the standard 18F devices and will not be valid for later microcontrollers that "must" use the linker.

    With the above Declare, the start of the assembler code listing looks like:

    Code:
    proton_code_start
        org 0X2000
        goto proton_main_start
    If interrupts are used:
    Code:
        Declare Proton_Start_Address = $2000
        
        On_Hardware_Interrupt GoTo ISR_High
        On_Low_Interrupt GoTo ISR_Low
    The Asm code listing looks like:
    Code:
    proton_code_start
        org 0X2000
        goto proton_main_start
        org 0X2008
        goto ISR_High
        org 0X2018
        goto ISR_Low
    Notice it has also re-vectored the High and Low interrupt address'.

    Your program sitting at the bottom of flash must add jumps to the new vector address', otherwise the program will not start and interrupts will be chaos because the hardware's vectors are still at adress' $0000, $0008 and $0018. This is standard for bootloaders that sit at the bottom of flash memory, but make sure it is re-vectoring (jumping) to the new address'.
    Last edited by top204; 27th November 2020 at 12:16.

  4. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  5. #3
    Senior Member GAMBOA's Avatar
    Join Date
    Nov 2004
    Posts
    475
    Thumbs Up
    Received: 23
    Given: 0
    Total Downloaded
    276.92 MB

    0 Not allowed!

    Default Re: Memory reserve for bootloader Pic18F46J50

    Thank you Les for your quick response.

    Regards,
    Gamboa

  6. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Reserve some variable for interrupt at top of ram...
    By SELCUK in forum Proton Plus Compiler v3
    Replies: 4
    Last Post: 5th November 2013, 01:27
  2. Memory LCD...!! Help
    By Caronte in forum Proton Plus Compiler v3
    Replies: 3
    Last Post: 2nd July 2012, 09:36
  3. [SOLVED !] Memory Question
    By dmTulsa in forum Proton Plus Compiler v3
    Replies: 5
    Last Post: 16th July 2010, 23:05
  4. [SOLVED !] USB Memory
    By ADLIN SYSTEMS in forum Proton Plus Compiler v3
    Replies: 3
    Last Post: 1st June 2007, 16:02
  5. [SOLVED !] CF Memory
    By RayEllam in forum Proton Plus Compiler v3
    Replies: 4
    Last Post: 31st March 2005, 22:14

Posting Permissions

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