
Thread: Memory reserve for bootloader Pic18F46J50 – 61 days old
-
27th November 2020, 11:17 #1
- Join Date
- Nov 2004
- Posts
- 475
- Total Downloaded
- 276.92 MB
Thumbs Up Received: 23
Given: 0
0Memory 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
-
27th November 2020, 12:05 #2
- Join Date
- Feb 2002
- Posts
- 3,899
- Total Downloaded
- 2.09 GB
Thumbs Up Received: 385
Given: 196
0Re: 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
Code:Declare Proton_Start_Address = $2000 On_Hardware_Interrupt GoTo ISR_High On_Low_Interrupt GoTo ISR_Low
Code:proton_code_start org 0X2000 goto proton_main_start org 0X2008 goto ISR_High org 0X2018 goto ISR_Low
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.
-
27th November 2020, 12:32 #3
- Join Date
- Nov 2004
- Posts
- 475
- Total Downloaded
- 276.92 MB
Thumbs Up Received: 23
Given: 0
0Re: Memory reserve for bootloader Pic18F46J50
Thank you Les for your quick response.
Regards,
Gamboa
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.
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.
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
-
Reserve some variable for interrupt at top of ram...
By SELCUK in forum Proton Plus Compiler v3Replies: 4Last Post: 5th November 2013, 01:27 -
Memory LCD...!! Help
By Caronte in forum Proton Plus Compiler v3Replies: 3Last Post: 2nd July 2012, 09:36 -
[SOLVED !] Memory Question
By dmTulsa in forum Proton Plus Compiler v3Replies: 5Last Post: 16th July 2010, 23:05 -
[SOLVED !] USB Memory
By ADLIN SYSTEMS in forum Proton Plus Compiler v3Replies: 3Last Post: 1st June 2007, 16:02 -
[SOLVED !] CF Memory
By RayEllam in forum Proton Plus Compiler v3Replies: 4Last Post: 31st March 2005, 22:14
How much code space our...
This article is based on an idea and code by Darrel Taylor....
1st January 1970, 02:00