AN2295 Serial Bootloader error for 9S08GT60A

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AN2295 Serial Bootloader error for 9S08GT60A

5,075 Views
Risan
Contributor I
When I run hc08sprg.exe it fails to program.  Please refer to the following jpg

After asking "Are you sure to program part? [y/N]:"  I respond with "y" enter
Then it responds "Memory programming: E 0x182C 0%"  It will sit here for over 2hrs, so I'm pretty sure the E is meaning some sort of error.  The AN2295.pdf is no help in this regard.  My code works when programmed over the BDM. 

I have three projects, the serial bootloader "hc08sprg-s08gbgt.mcp" and then my project "MSCA(M).mcp", and also an edited MSCA(M).mcp to include the serial bootloader "SerBootloader.mcp" 

The plain serial bootloader project, and combined project program the same and provide the same error when I run hc08sprg.exe

My code MSCA(M) and combined code both operate my user code properly.   

I am unable to program with the serial bootloader.  I'm using a USB to RS232 port, but that shouldn't be the problem since it establishes comunication properly.  I've even tried different *.s19 files thinking maybe mine was a problem, but that didn't change anything.

Also I am using SCI2 of the MCU



Message Edited by Risan on 2007-09-24 09:52 PM

SCIBootloader.JPG

Message Edited by t.dowe on 2009-09-03 05:41 PM
Labels (1)
0 Kudos
23 Replies

1,870 Views
Risan
Contributor I
Has anyone seen this before, or know how to fix it?  I've searched the forums and the internet and haven't found anything like this.

Please help.
0 Kudos

1,870 Views
peg
Senior Contributor IV
Hello and welcome Risan,
 
Just because you can establish comms throught the USB to serial converter does not absolve it.
It could well be causing problems when more data is communicated.
I would try to use a real serial port to check this out.
 
0 Kudos

1,870 Views
Risan
Contributor I
Thank you for the reply. 

I tried programming on a computer with a serial port on the motherboard, but the same result occured.  Initial communications worked, asked if I wanted to program it, I replied 'y', but then it stopped on the line

"Memory programming:  E 0x182C 0%"

I am somewhat glad I didn't have success because many computers now don't have a built in serial port, so that could have been a problem.
0 Kudos

1,870 Views
ok2ucx
Contributor IV
Hi,
 
"Memory programming:  E 0x182C 0%" simply means that the bootloading has been stucked in Erase phase, ie. Erase command has been sent to MCU but no Acknowledge has been received.
 
First I would suggest to use the MCU with bootloader only and eventually try some small code in other memory area (different address than 0x182C). Just to verify if it works. Actually GB/GT bootloader has only been tested with GB/GT successfully, but no A family though. Basically it should work. No major differences between A and non-A.
 
Maybe you can verify if FPROT register contains the correct value (0x80) so the protection is corrextly setup.
 
The communication itself (over USB<>RS232 converter) should be OK since you've reached the point after Identification.
 
Regards,
 
Pavel, an2295 developper
 
Freescale Czech Republic
 
 
 
 
 
0 Kudos

1,870 Views
Risan
Contributor I
I checked the memory
FPROT $1824 is $80

for reference the memory for that area is: 

1820  00  00  00  00  80  C0  00  00

I tried changing the address area, but when I changed it to being 1 block of flash from $2000 to $FDC0 the program still tried to erase 182C

So then I tried programming it as a GT32,  the initial communications succeeded, but it failed to erase 8000.
0 Kudos

1,870 Views
ok2ucx
Contributor IV
Hi,

if the lowest address present in S19 is 0x2000, first Erase operation will be at 0x2000 (its modulo 0x0200 - Erase page size, 512B). Please, double check the S19 file content that you're presenting to hc08sprg.exe.

Anyway, it seems that this is a general problem that you are having with Erase. Do you use the original code from AN2295SW or is it modified somehow?

The part of memory mentioned does not show FCDIV to be set properly - and this could be the reason for Erase to fail.

Pavel


Message Edited by ok2ucx on 2007-10-04 08:50 PM
0 Kudos

1,870 Views
ok2ucx
Contributor IV
P.S. GT60 vs. GT60A should be no difference (as well as GT32 vs. GT32A), although GT16A has slightly different Flash protection scheme than GT16 (thus GT16 bootloader won't work properly on GT16A).

New GT8A is the same as GT16A (it allows the protection boundary to be at any Erase page boundary).

The update for GT16A and GT8A will soon appear in AN2295SW and will try to test also GT60A/GT32A.

Pavel
0 Kudos

1,870 Views
Risan
Contributor I
I'm using the unmodified code, and selecting "GB/GT60 SCI2" as my target for the codewarrior side of things.

I ran into a new problem today.  For some reason when I try to run the serial bootloader I get a new error.  After
"received 0xfc (good).
Calibration break pulse sent. Count: 1"
I receive this error:
"Can't read MCU info.  Could be protocol error.
(Or forgot to set single wire mode?)"

I have no idea where this came from.  I was going to change
NVOPT_ROM:        SECTION
NVOPT      DC.B    %00000000    ; backdoor enable, redirection enable, (un)secured flash [last 10]

to
NVOPT_ROM:        SECTION
NVOPT      DC.B    %00000010    ; backdoor enable, redirection enable, (un)secured flash [last 10]

But I put it back to how it was and it didn't help anything.  I'm going to keep messing with it trying to get it to work.  Any suggestions on a solution would be good.  What does FDIV need to be?

0 Kudos

1,870 Views
Risan
Contributor I
I was able to get it to run again back to the error of errasing 182C  My memory addresses have changed

17F8  FF  FF  FF  FF  FF  FF  FF  FF
1800  00   00  D3  00  12   00  80   02
1808  00  1C  00   00  00   00  00   00
1810  00   00  00   00  pp   pp  00   00
1818  00   00  00   00  00   00  00   00
1820  00   02  00   00  80   C0  00  00
1828  00  00   00   00  FF  FF  FF  FF
0 Kudos

1,870 Views
ok2ucx
Contributor IV
Hallo,
 
I've updated AN2295 bootloader for GT/GB A-families. No difference on GB60A though. Also tested GB60A on both SCI1 and SCI2 channels, tested with M68DEMO908GB60 board, with fresh new GB60A soldered in. Works seamlessly.
 
GT8A and GT16A not yet tested. Any testers here are very welcome.
 
Also attached is the latest hc08sprg.exe, which is ready for QE (Flexis), some minor improvements included too. Beta version of GUI as a bonus :smileywink: Now close to release 9 of AN2295SW.
 
Pavel
 
Freescale CZ
 
 
 
Message Edited by t.dowe on 2009-08-27 03:11 PM
0 Kudos

1,870 Views
Risan
Contributor I
When using this new beta code the program gets stuck in
"Calibration break pulse sent.  Count:  30"
Then if I power it off and back on at this point it returns
"Can't read MCU info.  Could be protocol error.
(Or forgot to set single wire mode?)"

I'm not sure if anyone else has used the code, but that is as far as I get after about 6 tries.  I run it in Command Prompt so the window doesn't close.
0 Kudos

1,870 Views
ok2ucx
Contributor IV
Hmmm, hmmm,
 
then there's yet another possibility - this behaviour could be caused by the hardware itself. It's not wrong just little 'lazy'.
It may be possible that the hardware (namely RS232 receiver is not ready = not powered up correctly) at the time when ACK from PC is expected. So I've added a small delay that might help.
 
Just uncomment the code around line 300 of the beta-3 code attached and recompile:
 
Code:
       CLR     SCC3

; OPTIONAL DELAY - if your RS232 hardware is lazy, uncomment following delay
; lazy means that probably RS232 receiver is not still ready to receive ACK from PC

;        CLRX
;DLY2:   CLRA
;DLY1:   NOP      
;        DBNZA   DLY1
;        DBNZX   DLY2


       LDA     SCS1
       MOV     #ACK,SCDR

 
Regards, Pavel
 
Freescale CZ
 
Message Edited by t.dowe on 2009-08-27 03:12 PM
0 Kudos

1,870 Views
Risan
Contributor I
Sorry I haven't kept up.  I got busy with other things.

But I tried enabling the delay, but it behaved the same as previously.  I'm grateful for the help.  Any other suggestions?
0 Kudos

1,870 Views
ok2ucx
Contributor IV
Yep, I was busy too...
... so far I don't see any other idea here beside hardware issues. Would be nice to see oscilloscope snapshot showing MCU RESET, RxD and TxD signals. Recently I've tested beta-3 code on GB60A mounted on standard S08GB demoboard and, in addition, with MC13213 + MAX3232 level shifter. Both worked fine.
 
BTW, could it be PC related? Have you had success with another bootloader family over the same RS232 port in this specific PC? What Win version do you use? Standard RS232 or USB/RS232 converter?
 
Pavel
Freescale, CZ
0 Kudos

1,870 Views
Risan
Contributor I
I'm running Win XP SP2 on a dell dimension 5150.

I use a USB/RS232 converter.

I have tried running the bootloader on Win 98 using a regular RS232 serial port, but received the same results. 

The board hardware uses a ICL3221 for the RS232 driver.
0 Kudos

1,870 Views
Risan
Contributor I
I looked at it with an O-scope. 

Set for 9600baud

At power up the reset line begins to climb, but is pulled low then released high.  This should simply be the low voltage protection.

Just after power up
The Transmit line (from microprocessor to PC) sends a 336us pulse  - I believe this is the 0xFC
After 1.920ms the Receive line (from PC to uP) sends a 316us pulse then it seems to be stuck
The Reset line stays high

The code gets stuck in "Calibration break pulse sent.  Count:  xx"  the count simply increments.

The Transmit line (from microprocessor to PC) sits at 0 Volts
The Receive line (from PC to uP) is at -8 Volts and will cause a 1ms pulse that causes the uP to reset.


0 Kudos

1,870 Views
ok2ucx
Contributor IV
Hi, back again.
 
It seems to me that you actually measure RS232 signals at RS232 level (on the Cannon connector). For
proper debugging you need to measure actual RxD and TxD signals *between* 232 level shifter and MCU (3V logic). I still think that the main trouble can be seen there - I mean 232 level shifter not working properly right after power up. What you observe there (RS232 levels) won't be reflected correctly at the 3V side.
An "oscillograph" of the 3V signals would be very helpful.
You should see the signals similar to what is shown on the attached picture (all levels are at 3V, at the MCU).
 
If you have RESET pin available (e.g. through button), you may try different way of starting bootloader:
  1. power up the device
  2. press RESET button (and do not release it)
  3. start hc08sprg.exe
  4. release RESET button

This way the level shifters should be functional once the MCU starts executing bootloader code.

Regards, Pavel ok2ucx, Freescale CZ

 

P.S. You've indicated that the transmit line (from MCU to PC) stays at 0V. This is illegal RS232 level, which should be below -3V for log. "1" and above 3V for log. "0", if I remember well. Anything else may not be interpreted correctly.

Please, double check your RS232 level shifter if it's working properly.

P.S.2: I also don't understand this "The Receive line (from PC to uP) is at -8 Volts and will cause a 1ms pulse that causes the uP to reset." - no RS232 signal cannot and will not reset the MCU (directly).   -8V level (from PC) will be translated to log. "1" (3V) level

 

bootack.png

Message Edited by t.dowe on 2009-09-03 05:42 PM
0 Kudos

1,870 Views
ok2ucx
Contributor IV
Hi,
 
your code does not require any changes, any modifications at all. It only has very few limitations which are mentioned in HCS08 System Limitations chapter in AN2295.pdf.
 
Obviously memory consumption won't be your problem (verification OK).
delay after startup?
Flash protection?
 
Regards, Pavel, Freescale CZ
 
 
P.S. Just want to correct the previous picture - the timing should be 312us for 0xFC ACK @ 9600Bd:
 
0 Kudos

1,870 Views
javax
Contributor I
HI
I have been tring to get work the bootloader in a GT16A 32-Pin QFN Package
i used the Mar-14-2008 slfprg-s08gbgt.asm code update and open the hc08sprg.exe, initially
the message that I get is:"received 0xF8 not 0xFC", then i change the rate
to 7200, the ACK is OK but then i got:

"Can't read MCU info.  Could be protocol error.
(Or forgot to set single wire mode?)"


so i would like to know first of all if a  i have to edit some line in the slfprg-s08gbgt.asm
or if there is another issue.

my test aplication is just a blinking LED

thanks
by
0 Kudos

1,870 Views
Risan
Contributor I
In my code there is a short delay after startup and no flash protection. 

After examining the behavior I believe that the code is executing, but the baud rate isn't correct.  I reprogrammed the unit with my software and everything behaves properly, then reloaded an2295 and used it to load my software and it appears the baudrate was changed.  It just seems off to where you get strange characters displaying.  I'm setting the ICG1 and ICG2 in my code, so I don't believe the bootload software would effect me.  Is there another register that is changed by the an2295 software that I need to set?
0 Kudos