CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

bootloader hex2bin converstion of line type 4

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message Visit poster's website

bootloader hex2bin converstion of line type 4
PostPosted: Wed Dec 14, 2005 12:31 pm     Reply with quote

I am makeing a boot loader of types.
I am hiting a line type 4. extened LBA the address comes out to a
big 0x00300026 which is way biger than the 32K I can program.
AND
hex2bin is producing a big(padded with zeros) file.


Is someone one messing with the intel spec?
How should I interpret this line type 4?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Dec 14, 2005 1:25 pm     Reply with quote

Post the part of the HEX file that contains that line, and a few lines
before it. Also post your PIC type.
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message Visit poster's website

PostPosted: Wed Dec 14, 2005 2:02 pm     Reply with quote

18F452 @40MhZ pcwh 3.239
This is from the very end of the hex file.
ps: I used the #fill_rom 0xFFFF, note the FF's
Code:
107F7000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF11
:107F8000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF01
:107F9000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF1
:107FA000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE1
:107FB000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFD1
:107FC000FFFFFFFFFFFFF2CF0EF0F29EF76AE00F18
:107FD000F66E7F0EF7220900F5500EBEF28E1200EB
:107FE000020103010100000CFFFFFFFFFFFFFFFF85
:107FF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF91
:020000040030CA
:0E0000000026020E000181000FC000E00F403C
:00000001FF
;PIC18F452

I can see where the compiler 0xFF filed the file to addr=0x7FFF which is my standard 32K progm space. Then comes the type 4 line and the next.
------hex2bin output-----------
C:\ccs\Projects\3200I\update_firmware>hex2bin t_172
HEX2BIN Version 1.06
Copyright (c) 1995 Programix Corp.
Portions copyright (c) 1993-1995 BITWARE.
All rights reserved.
Status: Creating binary file.
Status: Read linear address record of 0x00000000.
Status: Writing 16 bytes at address 0x00007FF0.
Status: Read linear address record of 0x00300000.
Status: Writing 14 bytes at address 0x00300000.
Status: HEX to BIN conversion was successful.
Ttelmah
Guest







PostPosted: Wed Dec 14, 2005 2:14 pm     Reply with quote

The configuration fuses are stored at address 0x300000.

Best Wishes
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message Visit poster's website

PostPosted: Wed Dec 14, 2005 2:21 pm     Reply with quote

Thanks. Figured that was it. ((from deductive reasoning))

I can't write_program_memory() for that line? can I.

Don't I need the high volt of ICSP to program them?


Last edited by treitmey on Wed Dec 14, 2005 2:27 pm; edited 1 time in total
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Dec 14, 2005 2:23 pm     Reply with quote

But I wanted to show how to find the answer.
Oh well, I'll post it anyway:
----------------------------------
Keil has a nice explanation of the Hex file format.
Here's the page about extended records:
http://www.keil.com/support/man/docs/oh166/oh166_ih_extrec.htm
So that means the high word is 0x0030, as shown in bold:
020000040030CA

The next line in the Hex file is a data record, with address = 0x0000.
:0E0000000026020E000181000FC000E00F403C
http://www.keil.com/support/man/docs/oh166/oh166_ih_record.htm

So that means the full address for that line is 0x00300000.


Then go to the 18F452 page on the Microchip site:
http://www.microchip.com/stellent/idcplgidcplg?IdcService=SS_GET_PAGE&nodeId=1335&dDocName=en010296
Then download the Programming spec:
http://ww1.microchip.com/downloads/en/DeviceDoc/39576b.pdf
Then go to page 4 and it shows that the Config words start at 300000h.
So that line holds the CCS #fuses settings.
Ttelmah
Guest







PostPosted: Wed Dec 14, 2005 3:15 pm     Reply with quote

Ongoing, it is up to you what you do with them.
There is a 'write_configuration_memory' function. It is internally identical to the write_program_memory function, except the addresses it actually writes start at the required address. You can write these bits without high voltage programming, _but_ the bits in the 'code protection' area, can only be _cleared_ by a high voltage erase.
Generally, for many bootloaders, you would not want these bits to be changeable, so you just ignore data in this area.

Best Wishes
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message Visit poster's website

PostPosted: Wed Dec 14, 2005 3:33 pm     Reply with quote

Thanks so very, very much.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group