AN2295 (HC08/S08 Developer's Serial Bootloader) updated for rev. 9.2 - CF V1 (alpha) support added

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

AN2295 (HC08/S08 Developer's Serial Bootloader) updated for rev. 9.2 - CF V1 (alpha) support added

Jump to solution
84,229 Views
ok2ucx
Contributor IV
Dears,

software for Application note AN2295 (HC08/S08 Developer's Serial Bootloader) has been updated recently. Since the last rev. 8 (Aug-2006) several additions and enhancements has been done:
  • S08LC family added
  • S08QE (Flexis) added
  • S08GB/GT family updated for A-family
  • S08EL/SL family added (including EEPROM programming)
  • S08QD family added (with software SCI)
  • S08DZ family added (including EEPROM programming)
  • HC08GR8A corrected
  • S08QG8 corrected
  • hc08sprg.exe master updated
  • simple Windows GUI application added
  • all projects updated for CodeWarrior 6.1
HC08 families supported: AB/AS/AZ, AP, GP32, GR(A), GZ, JKJL, JKJL8, JW32, KX/EY/GT, LB, LJ, MR, QB, QC, QT/QY, SR

S08 families supported: AW, DZ, EL/SL, GB/GT(A), LC, QD, QE, QG, RC/RD/RE/RG, SR

Any comments, reports, suggestions or wishes are more than welcome. Some of the latest bootloaders are still in alpha stage, tested briefly.

Direct download link is here:
http://www.freescale.com/webapp/sps/download/license.jsp?colCode=AN2295SW

Unfortunately accompanying application note AN2295.pdf has not been updated yet (to reflect new protocol variations).

Best regards, Pavel, ok2ucx
Freescale Czech Republic
an2295 developer


Message Edited by ok2ucx on 2008-02-19 04:16 PM
Message Edited by ok2ucx on 2009-08-04 10:37 AM
Labels (1)
1 Solution
32,370 Views
Limestone
Contributor III

Hi Pavel and thanks for your response!

 

It worked like a charm!

 

I changed that line and stopt feeding my watchdog when I wanted to reboot and enter the bootloader.

 

Since I spent alot of time searching for a solution like this on the forum and did not find it, mabey this should be documented in someway :smileyhappy:

 

Best regards

Martin

 

 

View solution in original post

0 Kudos
241 Replies
1,309 Views
admin
Specialist II

Thank you ok2ucx. I had wrong setinngs of prm file and addtionaly I had set registers NVPROT_INIT,NVOPT_INIT (@0x0000FFBD,@0x0000FFBF) during initialization of the MCU.

 

Regards,

Piotr

 

0 Kudos
1,311 Views
ninesky
Contributor I

When compile the hc08sprg-s08qd.mcp ,Show error!!!

Please check,thanks

 

Link Error : L1100: Segments ROM2 (0xFFC0) and SCI_ROM (0xFFF8) overlap

Project: hc08sprg-s08qd.mcp,

Target: S08QD4 - TRA0

Link Error : Link failed Project: hc08sprg-s08qd.mcp, Target: S08QD4 - TRA0

Message Edited by ninesky on 2009-10-07 04:05 PM
0 Kudos
1,311 Views
ok2ucx
Contributor IV

Hi, this is just typo in PRM file. Change following line to get compile-free process:

 

  ROM2   = READ_ONLY  0xFFC0 TO 0xFFF7;   // UNUSED SPACE IN INT. VECTOR TABLE

 

Pavel

 

0 Kudos
1,311 Views
ninesky
Contributor I
Thanks,Now is OK!
0 Kudos
1,309 Views
TurboBob
Contributor IV
In thinking about this, I have the following issues/questions.
 
I have not studied the AN2295 code in great detail,  I have used it several times with success.
 
I believe it operates with the interrupts disabled, polling the SCI for received bytes.
 
This would be necessary due to the interupt redirection mechanism, I believe.  Can USB function with interrupts disabled?  I haven't dug in far enough to understand the USB mechanisms in the S08JM.
 
One modification I implemented in AN2295 for a specific application was a checksum of the operating code. 
 
The bootloader verifies the checksum before jumping to the user code.
 
The PC side application computed and embedded a checksum in the code that was uploaded.
 
I also located a jump-in address that the application could jump to if certain conditions were met.  This way the bootloader could be initiated from the user code.  This was required due to the FTDI USB/serial IC  in use,  Windows would never locate the  COM port in time to initialize the bootloader, and the port-pin test was not possible in this application.  So I modified the PC application to send a command thru the serial port which triggered the main application to jump to the bootloader.
 
Another application used a generic port pin instead of IRQ to check if the bootloader should run, this just required initializing the port direction and pullups.
 
Just some ideas for features...
 
Thanks
 
Bob
0 Kudos
1,309 Views
JimDon
Senior Contributor III

Since you brought this thread to my attention, let me say that I am sorry I have not yet posted the code, but I am re-writing it to fix some issues, and re-factoring the PC app to take many of the USB details out of the GUI.
The new sample app will have a class that sends messages to a window concerning USB activity.


I don't think you can use the USB code as written with interrupts disabled, as the usb polls would be missed and at some point windows would declare the device as 'gone missing'. Perhaps there is enough of a time window to allow for burning, or perhaps there is some hack where you can burn a sector and then service the interrupt.
It is one thing to re-burn the app and another to re-burn the USB code and I would think that you would want to make these two separate operations.
One will "brick" the device, the other would just require a reload of it failed.




0 Kudos
1,309 Views
TurboBob
Contributor IV
In my opinion, the bootloader must have its own USB code,  so it can recover in case of a failed or interrupted re-flash.  (no bricks allowed)
 
If the USB transaction rate can be limited to something 'reasonable', then transferring and burning small packets of data is the best way to do it.  I believe the bootloader erases one sector at a time as it receives data from the host.
 
Bob
 
 
0 Kudos
1,309 Views
allawtterb
Contributor IV
I thought it might be of some interesting that a new app note was posted today about a USB bootloader for the MCF51JM128/64/32.  Here is a link to the app note itself.
 
0 Kudos
1,309 Views
JimDon
Senior Contributor III
I hope fsl publishes all the source for it...

0 Kudos
1,309 Views
bitwok
Contributor I

Hi all,
I just read your messages (very interesting things by the way) and I was thinking that you may find useful what I did.

I developed a series of "how-to-videos" on how to make a GUI for your USB application. At this moment they are published in my personal webpage but they will be published (hopefully soon) in the Freescale website. It's a simple approach for those who need basic USB communication.

I also developed a DLL for making a USB bootloader in your GUI. It’s based on the JM60 GUI that a colleague in Freescale did.

You may want to take a look if you are interested. I will be glad to hear your comments.

Regards!

Samuel (bitwok)

0 Kudos
1,309 Views
JimDon
Senior Contributor III
Is there any advantage to using this method over generic hid?
Is the source code for the dll available?

0 Kudos
1,309 Views
bitwok
Contributor I
The SimpleUSB.dll is only an API that simplifies the winusb functions. Honestly I don't see any advantages of using it instead of the HID. The source code is not planned to be published but I can send it to you.
 
I just saw the HID example in C# (the one at nikola) and it's really cool. Are you the author of the HIDDriver.dll? Can it be used for commercial applications? Where can I find more info?
 
Thanks!
 
0 Kudos
1,309 Views
JimDon
Senior Contributor III
Yes, I wrote that. I am currently revising it and will shortly publish a new version, as well as an application layer for both c++ and c#. Probably by next week. I only get a few hours per week to work on this stuff, but I am actively working on it now.

My first cut was done in a weekend, and the application was kind of messy. I also found some issues with the DLL, which have been fixed. Yes, it can be used for anything you wish, but this will be the first public release, as I felt it needed more testing (other have used it, and it seems pretty solid). In fact, if I ever the time to write an app note, FSL may publish it.


I would like see see to the source code for simpleusb.




Message Edited by JimDon on 2008-08-18 05:19 PM
0 Kudos
1,309 Views
TurboBob
Contributor IV
anything new on this stuff?

Bob
0 Kudos
1,309 Views
stefano664
Contributor I
Hi,
  I'm trying to bootload my s19 file into an MC9S08GT32 device with an USB -> RS232 converter, but the loader say:

"Can't read MCU info. Could be protocol error"

What is happened? Can you help me?

Stefano
0 Kudos
1,309 Views
ok2ucx
Contributor IV
Hi, some more information would be needed. How the bootloader was invoked - what does the command line look like? Try adding :d immediatelly after the COM port number, like: hc08sprg.exe COM8:d yourS19file.s19

:d could be in upper case, this editor gives this smiley instead :smileyvery-happy:

What version of hc08sprg.exe? What type of USB to serial converter?

Pavel (an2295 developer)




Message Edited by ok2ucx on 2008-10-09 11:34 PM
0 Kudos
1,309 Views
gdc_i2dev
Contributor I
Hi everyone. Do you know a way to load encrypted S19 files? The idea is that the application could be upgraded by the end user using the serial interface with the Windows GUI, but without disclosing the S19 that would be encrypted in some way. The bootloader inside the MCU would have the key to decrypt the data that would receive through the SCI and write it to the flash. That way let the firmware (encrypted S19) be published or sent by email, etc. but still maintaining the code secure. TIA. gdc
0 Kudos
1,309 Views
ok2ucx
Contributor IV

Dears,

 

before AN2295 goes to release 10 (that will officially include ColdFire V1 support), find attached alpha versions of CF V1 bootloader, namely MCF51QE, MCF51JM and MCF51CN families.

 

Second file attached is the MCF51JM AN2295-compatible USB bootloader.

 

Third file contains S08QE family beta-3 update, there were some minor changes done to the structure, smaller QE family (8-32kB) support added as well.

 

Fourth file holds the update for hc08sprg.exe master, required for CF V1 addressing mode.

 

Any feedback is more than welcome.

 

Regards, Pavel ok2ucx

an2295 bootloader developer & coordinator

 

P.S. All four files are included in one ZIP file attached. [file removed and superseded with release 9.2.1]

Message Edited by ok2ucx on 2009-08-07 02:00 PM
0 Kudos
1,309 Views
ok2ucx
Contributor IV

As per request from other thread I'm adding S08SE bootloader in alpha version (i.e. not tested). It is very much similar to smaller QE family.

 

Second request, for CDC-based (Virtual Serial Port) AN2295 Bootloader for S08JM family is attached too.

 

If there's someone willing to test it, I'll be glad to hear your results.

 

Regards, Pavel ok2ucx

an2295 bootloader developer & coordinator

[files removed and superseded with release 9.2.1]
Message Edited by ok2ucx on 2009-08-07 02:00 PM
0 Kudos
1,311 Views
Yoheeb
Contributor I

Hi, this bootloader looks exactly like what I need.  However, I can't figure out how to use it over usb for the S08JM60.  I have programmed the device with the S08JM-USB project, but I can't manage to get the VCP to show up.

 

Now, I am on windows 7(sigh), so maybe I need to tweak the driver inf file.

 

Any help is appreciated, I seem to be missing something simple.

0 Kudos
1,311 Views
ok2ucx
Contributor IV

 


Yoheeb wrote:

Hi, this bootloader looks exactly like what I need.  However, I can't figure out how to use it over usb for the S08JM60.  I have programmed the device with the S08JM-USB project, but I can't manage to get the VCP to show up.

 

Now, I am on windows 7(sigh), so maybe I need to tweak the driver inf file.

 

Any help is appreciated, I seem to be missing something simple.


Dears,

 

 

find attached INF file (that has been derived from some other Freescale Virtual Serial Port project) and it seems to work on Win XP. Unfortunately I do not have any quick chance to test AN2295 USB implementations with Win 7 or Vista (but got reports that it worked with ZSTAR modules that are also Virtual Serial Port based - although using different implementation).

 

If someone is able to test this INF file (you may be asked to point to usbser.sys - Win XP has it in c:\WINDOWS\system32\drivers\) - both pass/fail reports are welcome.

 

Release 10 of AN2295 package is late also due to extensive testing required for CFV1 + USB implementations.

 

Pavel

 

0 Kudos