bloader and ht-picc

Support for Bloader and Screamer

Moderator: phalanx

Postby cbatters » Mon May 16, 2005 8:21 am

Update:

After arm wrestling with HT PICC to keep low memory blank.... (linker kept trying to use the six blank bytes from 2-7.)

This "bump" should work with the current BScreamer V1.6 which requires words 1-3 (bytes 2-7) be blank. Worth modifying BScreamer at some point to ignore 02-07 if they are either 00's or FF's.)

Just make sure your PSECTMAP looks similar to the one posted with nothing in 0x0001->0x0003 (PSECT display is somewhat erroneous. There is only one word of code in 0x0000h but it displays a range of $0000-$0001)

Note: Earlier version I posted was incorrect listing -L-pintret=04h instead of the correct interrupt entry -L-pintentry=04h .

Code: Select all

#asm
psect reserved,class=CODE
GOTO 0x18; Jump to init code
#endasm

//   and add following switches to your linker command:
//   -L-preserved=0000h -L-pintentry=04h  -L-pend_init=10h -L-ppowerup=18h -PSECTMAP 

Psect Usage Map:

Psect     | Contents                     | Memory Range
----------|------------------------------|--------------------
reserved  | User defined psect           | $0000 - $0001
intentry  | Interrupt service routine    | $0004 - $0007
text4     | Program and library code     | $0008 - $000F
end_init  | Initialization code          | $0010 - $0011
intret    | Interrupt service routine    | $0012 - $0016
powerup   | Power on reset code          | $0018 - $001B



Now let's get the FAQ updated and get rid of ALL references to user code starting at 0x0004. (The only reason this might work with CC5X is that the linker must prioritize intentry over other code for location 0x0004

More general case is to simply have the GOTO jump to a higher location in memory like 0x0018 and let the linker fill in the lower memory. This will work with / without interrupts.


Clint
Last edited by cbatters on Mon May 16, 2005 9:03 am, edited 2 times in total.
cbatters
 
Posts: 65
Joined: Tue Jun 01, 2004 11:45 am

Postby FlipFlops » Mon May 16, 2005 8:26 am

I'm using Screamer 1.6. I have not been able to reach Acrimu. His email bounces for me.
FlipFlops
 
Posts: 44
Joined: Mon May 09, 2005 4:26 pm

Postby cbatters » Mon May 16, 2005 8:48 am

FlipFlops wrote:I'm using Screamer 1.6. I have not been able to reach Acrimu. His email bounces for me.


Try the asm code / linker info I just posted. It dowbnloads fine with V1.6 but I haven't done any testing of correct operation after downloading.


Clint
cbatters
 
Posts: 65
Joined: Tue Jun 01, 2004 11:45 am

Postby FlipFlops » Mon May 16, 2005 10:30 am

Thanks for all the hard work clint, but unfortunately it still doesn't work with or without interrupts, even with those changes.
FlipFlops
 
Posts: 44
Joined: Mon May 09, 2005 4:26 pm

Postby cbatters » Mon May 16, 2005 11:35 am

FlipFlops wrote:Thanks for all the hard work clint, but unfortunately it still doesn't work with or without interrupts, even with those changes.


Please post PSECT MAP and advise whether you are saying that it doesn't download or that it doesn't run correctly.


Clint
cbatters
 
Posts: 65
Joined: Tue Jun 01, 2004 11:45 am

Postby FlipFlops » Mon May 16, 2005 11:47 am

Sorry. It downloads fine over and over, so bloader is working, but I cannot get anything to run once it has downloaded.

Using:
#asm
psect reserved,class=CODE
GOTO 0x18; Jump to init code
#endasm

And:
-icd -L-preserved=0000h -L-pintentry=04h -L-pend_init=10h -L-ppowerup=18h -psectmap

This is my psect map:
Code: Select all
Psect     | Contents                     | Memory Range
----------|------------------------------|--------------------
reserved  | User defined psect           | $0000 - $0001
intentry  | Interrupt service routine    | $0004 - $000A
init      | Initialization code          | $000C - $000F
end_init  | Initialization code          | $0010 - $0012
powerup   | Power on reset code          | $0018 - $001B
intret    | Interrupt service routine    | $01A5 - $01AB
clrtext   | Memory clearing code         | $01AC - $01B2
intcode   | Interrupt service routine    | $01B3 - $01E7
text19    | Program and library code     | $01E8 - $04A8
text      | Program and library code     | $04A9 - $07FF
text10    | Program and library code     | $0C6E - $0EFF
rbss_0    | Bank 0 RAM variables         | $0020 - $0063
intsave   | Registers saved on interrupt | $0064 - $0065
temp      | Temporary RAM data           | $0071 - $0072
intsave_0 | Registers saved on interrupt | $0073 - $0073
eeprom_da | User-programmed EEPROM data  | $2100 - $2117
config    | User-programmed CONFIG bits  | $2007 - $2007
FlipFlops
 
Posts: 44
Joined: Mon May 09, 2005 4:26 pm

Postby cbatters » Mon May 16, 2005 12:04 pm

Two thoughts:

1. Please config that serialtest.hex downloads/runs correctly.

2. Please advise value of 0x2007 (config word) in hex file


Clint
cbatters
 
Posts: 65
Joined: Tue Jun 01, 2004 11:45 am

Postby FlipFlops » Mon May 16, 2005 12:15 pm

Serial test works fine, but that is compiled with CC5X.

Config is 0x3F30
FlipFlops
 
Posts: 44
Joined: Mon May 09, 2005 4:26 pm

Postby cbatters » Mon May 16, 2005 1:14 pm

FlipFlops wrote:Serial test works fine, but that is compiled with CC5X.

Config is 0x3F30


Running this in a debugger to get to the bottom of this nightmare....

Try using GOTO 0x10 instead of GOTO 0x18. This downloads and executes on a 16F88 but I am checking now to make sure all of the init codes gets executed.

Using:
#asm
psect reserved,class=CODE
GOTO 0x10; Jump to init code
#endasm


Clint
cbatters
 
Posts: 65
Joined: Tue Jun 01, 2004 11:45 am

Postby cbatters » Mon May 16, 2005 1:27 pm

Confirmed that this works but is not calling init code....


Clint
cbatters
 
Posts: 65
Joined: Tue Jun 01, 2004 11:45 am

Postby cbatters » Tue May 17, 2005 3:28 am

Feels like I am playing whack-a-mole with the linker. Surprised at how simply moving PSECTS around results in corrupt configurations.

Thought this was a reasonable way to get PICC to "bump" code the same way as other compilers but am having second thoughts.

Please PM me your email address and I'll send you the modified BootLoader / Screamer code I got back in March but have never tested.



Clint
cbatters
 
Posts: 65
Joined: Tue Jun 01, 2004 11:45 am

Postby cbatters » Mon May 23, 2005 7:35 am

Correct bump for HT PICC with / without interrupts. The problem was that the -L-pintentry option was replacing some of the load information but NOT generating an error. (nasty bug)

Many thanks to the folks at HT Soft for their assistance.


Code: Select all
#asm
psect reserved,class=CODE, delta=2
GOTO 0x10; Jump to init code
#endasm

//   and add following switches to your linker command:

//  -O"$(TARGETBASE).cof" -O"$(TARGETBASE).hex" -PSECTMAP
//  -L-preserved=0000h -L-pintentry=04h -ICD -L-ppowerup=10h, intcode, intret,
//  init, init23, end_init, clrtext, stringtable, pstrings, strings

//  And to reserve space for the bootloader at the end of EEPROM
//  use the -ICD or -RESROM1F00-1FFF option

//  Note: Not necessary to reserve any EEPROM with PICC Lite
//  because it only creates code from 0000-0FFF



Psect Usage Map:

Psect     | Contents                     | Memory Range
----------|------------------------------|--------------------
reserved  | User defined psect           | $0000 - $0000
intentry  | Interrupt service routine    | $0004 - $0007
text4     | Program and library code     | $0008 - $000F
powerup   | Power on reset code          | $0010 - $0013
intcode   | Interrupt service routine    | $0014 - $011C
intret    | Interrupt service routine    | $011D - $0121
init      | Initialization code          | $0122 - $0129
end_init  | Initialization code          | $012A - $012B
clrtext   | Memory clearing code         | $012C - $0132
Last edited by cbatters on Thu May 26, 2005 10:53 am, edited 1 time in total.
cbatters
 
Posts: 65
Joined: Tue Jun 01, 2004 11:45 am

Postby acrimu » Thu May 26, 2005 10:21 am

FlipFlops wrote:I'm using Screamer 1.6. I have not been able to reach Acrimu. His email bounces for me.


The email address that I posted before was wrong. Sorry about that. I didn't check the forum for some time.
This is a good email: acrimuATyahooDOTcom
acrimu
 
Posts: 8
Joined: Mon Mar 07, 2005 10:54 am

Postby cbatters » Thu May 26, 2005 10:57 am

acrimu wrote:
FlipFlops wrote:I'm using Screamer 1.6. I have not been able to reach Acrimu. His email bounces for me.


The email address that I posted before was wrong. Sorry about that. I didn't check the forum for some time.
This is a good email: acrimuATyahooDOTcom


Appreciate your help... long tortured path to get the HT PICC linker to do the bump correctly.

As per earlir posts, I believe it would be a more robust product if the Bloader/ Screamer did not require any code bumping. (along with some other enhancements to make the BLoader more robust.)

NOTE: I updated the description to include the -RESROM for people that are using the full version of PICC



Clint
cbatters
 
Posts: 65
Joined: Tue Jun 01, 2004 11:45 am

Postby rglenn » Mon Oct 24, 2005 6:58 pm

cbatters wrote:Correct bump for HT PICC with / without interrupts. The problem was that the -L-pintentry option was replacing some of the load information but NOT generating an error. (nasty bug)

Many thanks to the folks at HT Soft for their assistance.


Code: Select all
#asm
psect reserved,class=CODE, delta=2
GOTO 0x10; Jump to init code
#endasm

//   and add following switches to your linker command:

//  -O"$(TARGETBASE).cof" -O"$(TARGETBASE).hex" -PSECTMAP
//  -L-preserved=0000h -L-pintentry=04h -ICD -L-ppowerup=10h, intcode, intret,
//  init, init23, end_init, clrtext, stringtable, pstrings, strings

//  And to reserve space for the bootloader at the end of EEPROM
//  use the -ICD or -RESROM1F00-1FFF option

//  Note: Not necessary to reserve any EEPROM with PICC Lite
//  because it only creates code from 0000-0FFF



Psect Usage Map:

Psect     | Contents                     | Memory Range
----------|------------------------------|--------------------
reserved  | User defined psect           | $0000 - $0000
intentry  | Interrupt service routine    | $0004 - $0007
text4     | Program and library code     | $0008 - $000F
powerup   | Power on reset code          | $0010 - $0013
intcode   | Interrupt service routine    | $0014 - $011C
intret    | Interrupt service routine    | $011D - $0121
init      | Initialization code          | $0122 - $0129
end_init  | Initialization code          | $012A - $012B
clrtext   | Memory clearing code         | $012C - $0132


I'm having some difficulty with this - it seems that with this setup, there's no jump from the int_entry to the actual ISR - just a bunch of blank memory until 0x10.

I can post the .LST file if that would help. I'm using PICC-Lite 8.05PL2 from within MPLAB 7.21. My linker is configured as such:
Code: Select all
 -M"$(TARGETBASE).map" -O"$(TARGETBASE).cof" -O"$(TARGETBASE).hex" -PSECTMAP  -L-preserved=0000h -L-pintentry=04h -ICD -L-ppowerup=10h,intcode,intret,init,init23,end_init,clrtext,stringtable,pstrings,strings


Anyone know what might be wrong?
rglenn
 
Posts: 10
Joined: Wed Aug 03, 2005 6:26 am

PreviousNext

Return to Boot Loading

Who is online

Users browsing this forum: No registered users and 1 guest