SH16 bootloader

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

SH16 bootloader

6,317 Views
Nico_elect
Contributor I
Hi, I need the sources for 9S08SH16 bootloader.
The AN2295sw not provide it's.

Labels (1)
0 Kudos
Reply
17 Replies

1,947 Views
mcgaiver
Contributor I

Did Have you founded the bootloader?

0 Kudos
Reply

2,999 Views
Ake
Contributor II
Hi,
Here is the software you were looking for!
 
Regards,
Ake
 
Message Edited by t.dowe on 2009-09-03 04:59 PM
0 Kudos
Reply

2,999 Views
RogerSchaefer
Contributor III
Hay Ake,
 
You posted an old ZIP file.  There is a much newer one on the Freescale website (which I downloaded a few days ago).  The newest file within the ZIP is dated 2/12/08 and the whole ZIP is 1.8 MB in size.
 
Alas, it doesn't include a bootloader for the 9S08SH family.  I hope Freescale will post a newer one soon because I also am looking for this.
 
Roger
0 Kudos
Reply

2,999 Views
ok2ucx
Contributor IV

Dears,

SH family bootloader already developed and pre-tested, find attached.
It will appear in the next release (also including S08JM - this time only via SCI).

Regards, Pavel (an2295 developer)

 

hc08sprg-s08sh-beta-1.exe.zip

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

2,999 Views
frangub
Contributor I

Hi all,

 

does anyone knows if bootloader for 9S08SH8 works in single wire mode ?

 

I was able to let it works in full duplex ( TX and RX ) but not in half.

 

Thanks all. 

0 Kudos
Reply

2,999 Views
ok2ucx
Contributor IV

Yes, bootloader works, as all similar single-wire variants. It's been tested, there are several "platforms" available predefined for SH family bootloader.

 

Just to make sure, the hardware must be designed so that RS232 receive buffer does not interfere with the single-wire pin in transmit mode. I.e. as a minimum, a diode and pull-up resistor must be connected as Wired-OR in between these two signal sources.

 

Pavel, Freescale Czech

(an2295 developper)

0 Kudos
Reply

2,999 Views
RogerSchaefer
Contributor III
Hello Pravel,
 
I managed to load the bootloader and TRIM (thanks Peg) into the SH8 via OSBDM but it doesn't seem to work.  It doesn't sent the ACK on power-up.
 
I have used the bootloader for the QG8 a lot so I do know how it "should" work but something is wrong for the SH8.  I know I am not giving much information, but ........
 
Roger
0 Kudos
Reply

2,999 Views
ok2ucx
Contributor IV
Just to be sure: have you set the right target (ie. the right set of RxD and TxD pin)? SH bootloader uses software SCI and both RxD and TxD pins could be configured freely on any pin. You should be seeing 416us pulse being transmitted upon power-on-reset via pin configured as TxD.
 
Pavel
 
0 Kudos
Reply

2,999 Views
RogerSchaefer
Contributor III
Dear Pavel,
 
My target has TxD on pin 15 and RxD on pin16 the regular SCI pins.  Thru a MAX232 to the PC.
 
You seem to have two versions of the bootloader for the 9S08SH8; I tried both. 
 
When programs are loaded with OSBDM the SCI works fine so I know the wiring is good.
 
Roger
0 Kudos
Reply

2,999 Views
ok2ucx
Contributor IV
Roger,

I've used the same configuration (TxD @ pin 15, RxD @ pin 16) too, when testing the SH32 bootloader version (using standard SH32 EVB, which has the standard SCI interface on these pins). This worked for me at the time of the bootloader update (for SH16/32).

Just make sure that the right target is selected in Target tab, ie. that the main assembler file gets assembled with PLATFORM defined as 6:

Code:
;**************************************************************************            IF PLATFORM = 6  ; TB1RB0RCS_ENA         EQU     1            ; READ COMMAND SUPPORTED—TXDPORT         EQU     PTBD          ; <<< TxD pin portTXDPIN          EQU     PTBD_PTBD1    ; <<< TxD pin numberSCITXINV        EQU     0             ; 0 with level shifters, 1 withoutSCIRXINV        EQU     SCITXINV      ; 0 with level shifters, 1 withoutRXDPORT         EQU     PTBD          ; <<< RxD pin portRXDPIN          EQU     PTBD_PTBD0    ; <<< RxD pin numberRXDPUEN         EQU     0             ; use pull-up featureRXDPUE          EQU     PTBPE         ; define pull-up enable port, if used            ENDIF

The settings above should be correct for your setup. You need to load "hc08sprg-s08sh32-tb1rb0.abs" file into your board.
I could check this bootloader once I'll get back to work at the beginning of November.
Until then, please, check which pin generates the 416us pulses upon power-on-reset.

Pavel
0 Kudos
Reply

2,999 Views
RogerSchaefer
Contributor III
Thanks Pavel,
 
That worked !
 
Roger
0 Kudos
Reply

2,999 Views
RogerSchaefer
Contributor III
Dear Pavel,
 
I was happy to see that you posted the bootloader for the SH8, however, I have a problem.  Before I load your bootloader program using the OSBDM the MCU is mass erased by CW including the trim value at $FFAF.  Normally, I will load my application program then load and run a small program in ram that finds the correct trim and writes it to $FFAF.  I guess the bootloader program has write protected that part of memory so that I can't write a trim value there.
 
Is there any work around for my problem?
 
Roger
0 Kudos
Reply

2,999 Views
peg
Senior Contributor IV
Hi Rodger,

The automatic mass erasing of the device is optional within Codewarrior.
You could leave the factory trim there or (better) do your own first, then flash the bootloader with the mass erase first turned off.
Also, there is nothing special about the $FFAF location except that it is the Freescale "recommended" location for the trim. You can put it anywhere in flash as long as you know where to retrieve it from on initialisation.

0 Kudos
Reply

2,999 Views
peg
Senior Contributor IV
Hi Rodger,

As you had not commented on my post I thought I would give it a go as I knew I had figured out a way to do this. It does not seem that when you are the OSBDM that you can disable the automatic erasure.
See here for a way around this though.
I also believe you can specify an option on the command line to stop it, but not sure if it works in OSBDM mode. (SKIPERASE???)

0 Kudos
Reply

2,999 Views
RogerSchaefer
Contributor III


peg wrote:
Hi Rodger,

As you had not commented on my post I thought I would give it a go as I knew I had figured out a way to do this. It does not seem that when you are the OSBDM that you can disable the automatic erasure.
See here for a way around this though.
I also believe you can specify an option on the command line to stop it, but not sure if it works in OSBDM mode. (SKIPERASE???)



Hi Peg,
Yes, with OSBDM you cannot load code into Flash without doing a mass erase.
 
Your link above does not give a way around the problem either.
 
I looked for SKIPERASE in the help screens of CW and found nothing.
 
This is not a great problem loading my own programs as I have worked out a trim program that seems to work but it doesn't work loading the Bootloader program because, I think, it write protects upper Flash area.  So I can load the Bootloader program but only if NVICSTRM @ $FFAF is first erased and since I can't rewrite it the trim, it is wrong ( $FF) and Bootloader is not running at 9600 baud and, of course, doesn't work.
 
So the question remains is there any way to load a working Bootloader using OSBDM?
 
Roger
0 Kudos
Reply

2,999 Views
RogerSchaefer
Contributor III
Hi Peg,
 
OK now I understand; using the method described here  you can load the Bootloader without erasing the TRIM.
 
Also, I find with a little reading of the data book, that from the background debug commands only, FPROT can be written to $FF to remove Flash Block Protection.
 
Unfortunately, even though I was able to load the bata Bootloader for the SH8 with out changing the TRIM it didn't work.  It looks like I still have some issues to resolve.
 
Roger
0 Kudos
Reply

2,999 Views
Ake
Contributor II
Hi,
I looked for the AN2295SW but could not find that either.
Hold on while I send a message to the author of this paper.
 
Regards,
Ake
0 Kudos
Reply