AW60, AN2295 bootloader.  Bad files.  Anyone have it working?

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

AW60, AN2295 bootloader.  Bad files.  Anyone have it working?

5,981 Views
TurboBob
Contributor IV
Trying to get my 9S08AW60 project off the ground. The AN2295 bootloader stuff I downloaded off Freescale has the wrong .INC file (and the wrong readme...) and it won't assemble....

I am using the serial bootloader with my AP64 projects with good success, Does anyone have the correct files to build the AW60? Or just the S19.... standard mode, SCI1, No Int pin for boot.....

Thanks!!

Bob
Labels (1)
0 Kudos
12 Replies

941 Views
ok2ucx
Contributor IV
Dears,
 
I tried to Make AW60 bootloader from files that are currently on the web (rev 8.). Both CW3.1 & CW 5.1 generated working code (although .inc file was wrong, correct one has been included from CW installation).
 
My hw setup uses SCI2 @ 9600Bd, optoisolated and works fine:
 
X:\EMBSW\EMBSW238T\unified_driver\examples\HC08\9S08AW\bin>hc08sprg com1 "P&E_FCS.abs.s19"
hc08sprg - Developer's Serial Bootloader for HC(S)08 - $Version: 1.0.27.0$
FC protocol versions supported: 1 (HC08), 2 (S08), 3 (large HC08)
See Freescale Application Note AN2295.
Waiting for HC08 reset ACK...received 0xfc (good).
Calibration break pulse sent. Count: 1
Bootloader protocol version: 0x02 (read command supported)
Bootloader version string: AW60
System device ID: 0x008 [MC9S08AW60] rev. 5
Number of memory blocks: 2
Memory block #1: 0x0870-0x17FF
Memory block #2: 0x1860-0xFDCB
Erase block size: 512 bytes
Write block size:  64 bytes
Original vector table: 0xFFCC-0xFFFF
New vector table:      0xFDCC-0xFDFF
Are you sure to program part? [y/N]: Y
Memory programmed:           100%
Memory verified:             OK
X:\EMBSW\EMBSW238T\unified_driver\examples\HC08\9S08AW\bin>
 
To verify I've generated a new example for Freemaster, it uses interrupts, ICG, all is OK.
 
 
Attached you find the corrected AW60 bootloader and also mentioned Freemaster example. Trim S8P file too.
 
Let me know, regards, Pavel ok2ucx
 
an2295 developper

Message Edited by ok2ucx on 2006-10-1801:31 PM

(Alban removed soft beta version. released now available and license agreement required for legal reasons)

Message Edited by Alban on 2006-11-18 11:33 PM

 

Freemaster-example-9S08AW-alpha-1.zip

9s08aw60-trim.zip

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

941 Views
TurboBob
Contributor IV
Thanks for the reply. It is working now. I get a speed/baud error of some sort when trying to download to it, but I will fix that I'm sure. For now I am still using BDM to develop.

A follow-up question or 2 if I may...

Is there an example of in-application flash programming that is easily ported over to my application? I need to store some data in flash within my app. In my AP64 designs there were monitor routines that were called, which seemed to work fine. I am trying to understand the routines in the serial bootloader code, as well as the serial monitor example. Are there any other examples so I can understand what I need to do?

If I wanted to overlay the bootloader image on my application, so I could flash the parts once during manufacture (I want to ship my units with bootloader capability), what needs to be done other than copying the interrupt vectors?

Thanks

Bob
N8DRK
0 Kudos

941 Views
ok2ucx
Contributor IV
Hi,
 
the in-circuit Flash programming is in detail described in HCS08RM - S08 Family Manual. From this document, 'do on stack routines' have been taken for bootloader. As an alternative, I've attached a simple C example with these routines are used. The only thing (often forgotten) is the configuration of Flash module block before Flash programming occurs.
 
Regarding the 'overlaying' the bootloader with the application, probably the best way would be:
 
1) use BDM to program bootloader code
2) bootload your application into MCU
3) use BDM to upload the complete Flash memory back to PC
4) you can optionally erase all lines in the S19 file that contain only FF (unprogrammed) bytes.
 
Such S19 file can be then used for mass production. This is applicable for both HC08 and S08 families.
 
S08 family can use the method you propose, just relocating interrupt vectors and concatenating both code (user code + bootloader) would work too.
 
Regards,
 
Pavel, ok2ucx
 
 
 
Message Edited by t.dowe on 2009-09-03 05:27 PM
0 Kudos

941 Views
TurboBob
Contributor IV
Ok, I have the projects building, and have edited the s8p files, so the trim works properly. My application works correctly when BDM'd into the processor.

When I build the bootloader it gives warning 13003 for 2 truncated values.

I disabled those messages and it builds. It BDM flashes in no problem, and appears to be trimmed during the flashing.

But when I try to bootload my application code, I get errors related to the trim and baud rate.

here is what it is saying:

c:\HS08SPRG COM1 9600 PL001.s19
hc08sprg - Developer's Serial Bootloader for HC(S)08 - $Version: 1.0.22.0$
FC protocol versions supported: 1 (HC08), 2 (S08), 3 (large HC08)
See Freescale Application Note AN2295.

Waiting for HC08 reset ACK...received 0x00 (off-key).

Calibration break pulse sent. Count: 1
Wrong calibrate response (0x00, must be 0xFC). Target is not calibrated.

I am testing this on the AW60 demo board, my device has a FTDI USB chip on it and therefore the calibration may be even more of an issue......

Thanks!

Bob
N8DRK
0 Kudos

941 Views
ok2ucx
Contributor IV
Hallo Bob, this is probably not a bootloader bug but rather a behaviour caused by 'lazy' RS232 interface. What I mean by lazy - the software starts quickly but RS232 converters are not providing enough charge/voltage to the RS232 lines and the FC acknowledge character is not being transmitted properly, ie. not received by PC.
 
In the latest QG bootloader, I've introduced an additional delay, just before the FC acknowledge is sent out. This enlarges the startup time but improves the reliabilty of bootloader hook up. You may try to include following lines into AW bootloader...
 
...
       CLR     SCIC3
;----------------------------------------------------------------------------
; OPTIONAL DELAY - if your RS232 hardware is lazy, uncomment following delay
       CLRX
DLY2:   CLRA
DLY1:   NOP
        
       DBNZA   DLY1
       DBNZX   DLY2
;----------------------------------------------------------------------------
      LDA     SCIS1
      MOV     #ACK,SCDR
      LDX     #T100MS
...
 
Let me know whether this helps with your hardware configuration.
 
Regards, Pavel ok2ucx
 
0 Kudos

941 Views
TurboBob
Contributor IV
Thanks for the reply. I will try that.

I was trying the AW60 demo board without success. I tried my prototype unit and it sync'd up fine (USB).

It is giving me errors related to the Flash block protection register, which I am trying to turn off. It is seeming that Codewarrior (Processor Expert) is initializing it to FF even if I have it disabled.

Should the Bootloader PC program ignore the settings of the NVPROT and NVOPT registers?

Bob
N8DRK
0 Kudos

941 Views
Alban
Senior Contributor II
Hello guys,
 
For Your Information:
A new version of the AN2295 software is now publicly released on Freescale website.
Please look for AN2295SW to get it.
 
AN2295SW 
Software for AN2295  
FREESCALE  zip  1176  8.2  11/06/2006  
 
I need to remove the draft version from this thread because of the license agreement.
 
Cheers,
Alban.
0 Kudos

941 Views
Geezer
Contributor I
Alban, Good Evening!

What is the nature of missing file "flash.ini"?

Al
0 Kudos

941 Views
Alban
Senior Contributor II
Hi Al !
 
There's a file missing in the archive released ? :smileysad:
 
Is it the AN2295SW or other software included in the thread ?
If the first, Pavel will probably be reading your message and update AN2295SW.
 
Cheers,
Alban.
0 Kudos

941 Views
Geezer
Contributor I
Morning, Alban (I am East Coast, USA)--

File "flash.ini" is listed as a required file in the project file. It it not required there, but perhaps somewhere else such as by the driver program code? I removed the reference with no ill effects. [I'm guessing, as I've only played with the HCS08 side, the GBGT folder to be specific.. I needed a good number for the ROM bytes required for this function...]

I'm using CW 5.x so a conversion was called for. When I see such a message the first thing I do is start a blank new project for my derivative under my CW version, and drag in ONLY the source files, assemble all. Then the adventure begins, some book keeping stuff, fixing offsets, equates, and conflicts in the respective PRM files. I now have a clean (it assembles, no erros/warnings, but I don't know it it'll actually work!) version for the GT16A, and I have my answer:

*********************************************************************************************
SECTION-ALLOCATION SECTION
Section Name Size Type From To Segment
---------------------------------------------------------------------------------------------
.data 1 R/W 0x100 0x100 RAM
MY_ZEROPAGE 8 R/W 0x80 0x87 Z_RAM
.init 383 R 0xFE00 0xFF7E ROM
.stack 80 R/W 0x101 0x150 RAM
.vectSeg0_vect 2 R 0xFFFE 0xFFFF .vectSeg0

Summary of section sizes per section type:
READ_ONLY (R): 181 (dec: 385)
READ_WRITE (R/W): 59 (dec: 89)

I'll stay tuned, of course, and see when/if some user gets BOTH sides working. Officially I can't pursue this much further until our marketing geniuses deem this to be useful or not. :smileyhappy:
0 Kudos

941 Views
Geezer
Contributor I
The "official" way to run this sample code is to invoke 'HC08 bootloader.mcp', and to then choose the target derivative. This is less painful, it ports cleanly to CW 5.x, and only two minor warnings pop up.

I don't do this, I get nervous when asked to map older INCLUDE files to a brand new derivative such as the GT16A. It could work, it even should work.. but my confidence level is below 100% until I get the EXACT derivative .INC file to drive it all. This is a matter of personal choice.
0 Kudos

941 Views
ok2ucx
Contributor IV
Hi,
 
flash.ini file is no longer a part of the distribution - it contains just settings of the debugger. It's not distributed because I've (internally) changed the way of generating AN2295SW.ZIP file :robotsurprised:
 
I need to remove the references to flash.ini (or alike) files from all .mcp files in the future releases. You can completely remove these with no effect.
 
AN2295SW is (historically) created still in CW3.1. Conversion to CW5.x is as simple as
a) removing read-only flag of the .mcp file (sorry for this, all files are under ClearCase version control which plays with this flag)
b) clicking to Cancel button once the call for conversion is issued
 
Then .mcp is saved automatically and no further conversion is required. Since I can see a lot of people migrating to CW5.x, I promise I will convert all bootloaders into CW5.1 in the future release. Opening these in CW3.1 does not require any action.
 
Regards, Pavel ok2ucx, Developer of AN2295 developer's bootloader
 
 
0 Kudos