Stri
Reged: Mar 20 2007
Posts: 4
|
|
I'm not sure if it's right place to ask this...if it's not, please remove this post. I got a strange problem with bootloader from /hitech-18/samples. It works fine while programming FLASH, but then it starts program EEPROM area it writes only a few bytes instead of 255, and then just hangs. After some research, I found what writing in EEPROM is very slow, so while bootloader writes first few bytes, stream in USART ends, and bootloader hangs at [while(!RCIF); in gx(void). What I'm dooing wrong? (device PIC18F452, 10mhz, 9600).
|
Matthew Bowles
 
Reged: Jul 30 2006
Posts: 175
Loc: Tatura, VIC, Aust.
|
|
I'm trying to get the bootloader to run on my 18F8723. I don't think I'm setting things up right..
I have a 10MHz crystal running, and I presume the bootloader is setting this to XT or HS. however, I am getting a strange baud-rate so I can't pass any key-strokes through.
I changed the Fosc to 10000000L, perhaps it should be 2500000L (the SysClock is divide by 4)
most other things are left as per the sample bootldr.h
I am passing a BOOT_BLOCK_SIZE=0x1FFF just because that's hte default for this chip.
I am a little suspicious that the code isn't compiling correctly because when i choose DVERBOSE I get a Code:
PICC-18\9.51\lib\pic82l-c.lib(btemp0.obj): 0: (491) can't find 0x25 words for psect "rdata" in segment "COMRAM" error.. even though it compiles fine when I don't use -DVERBOSE
matt
edit: I just found using my logic analyser, that hte baudrate is 960. weird!!! (and yes I did check that there's no typo in the .h file)
Edited by Matthew Bowles (Tue May 06 2008 02:09 AM)
|
PC Pete
Reged: Oct 15 2005
Posts: 23
Loc: Melbourne, Victoria
|
|
I'm so glad _someone_ mentioned samples and bootloader routines for the HiTech products, as the documentation doesn't seem to (not that I could find, anyway).
I've built the bootloader using the examples in the std (not pro) samples folder, and it appears to work on my 18F4620 - I get the countdown, and when I send a character the bootloader prints a ":" prompt, and appears to upload my code - but after resetting, the code never runs (the bootloader restarts and just times out).
I read the documentation that comes in the bootloader sample folder, and it requires me to compile the bootloader with full optimisations on. In other words, with a PRO version of the compiler. All the rest of the instructions depend on the code being 200H or 400H bytes long (in quiet and verbose mode respectively). But without using the PRO compiler, the code is actually 960 bytes long.
I thought that was the problem, so I added the code offset of 960 in the test project settings, but after compiling and (possibly) uploading the new code, nothing continues to happen.
FWIW, the test code is extremely complicated and difficult to follow, but I've included it here for completeness (I hope it's not too difficult to figure out): Code:
#include void main(void) { TRISB = 0x00; PORTB = 0xC0; }
... that's it. But after (apparently) uploading this code, nothing happens on the target device's port pins after the bootloader finishes, which is kinda NOT what I expected.
So are there additional settings that I need to understand to get my code running in "uploadable" mode if the bootloader is LARGER than the textbook example? If so, if some info was available to help me understand this, it might help someone else too.
Alternatively, is there a HTC bootloader available that will work "out of the box" using the lite version of HTCC?
Thanks in advance for any suggestions. PCPete [EDIT] Hmm. Interesting posting preview behaviour. I'm not sure how I get the less-than and greater-than signs to display in my final post as well as the preview mode... In preview mode the code-wrapped characters appear correctly in the code, but after accepting and previewing, on the forum page, they've disappeared. Oh well. SEP. Meanwhile assume that I'm including the default header htc.h. [/EDIT]
Edited by PC Pete (Sun Apr 12 2009 04:01 AM)
|
Neil_K
 
Reged: Mar 09 2005
Posts: 956
Loc: NY,USA
|
|
Unless you need to change it way not use the pre-built Bootloader.
As far as you code you still need to set up the config registers.
|
Bibby
stranger
Reged: Jun 15 2009
Posts: 1
Loc: Stone, UK
|
|
Hi, I am running the 18F bootloader on a 18f8722. Works fine with the config settings embedded in the header file. But... it is only working at 9600 Baud. Can we have bootloader at 38k or 115k?. Could we have an eeprom based boot / button based .How about with auto baud detect. I would like to do a live update of firmware in field
It does work fine upto detection of port at 115k and time out count down, but fails on flash/eeprom writes
Edited by Bibby (Fri Jan 15 2010 05:29 AM)
|
Neil_K
 
Reged: Mar 09 2005
Posts: 956
Loc: NY,USA
|
|
You may have a time issue without handshaking the PC may send the data faster then the Chip can write it to flash.
|
asmprog
stranger
Reged: Jan 29 2010
Posts: 1
|
|
I am new to Hi-Tech C and I am attempting to build the sample bootloader for use with the PIC16F1827 processor. I have modified the include files so that the sample will compile for the 1827 without any errors. When I check the program memory after the compile, only the redirect is located in the segment 0f00 - 0fff and main is located at 0700. I have include the directive picc --chip=16F1827 bootldr.c --ROM=F00-FFF in the custom build window. I tried it as both pre-build and post build. Does aynbody have an idea as to what I am doing wrong?
|