Can this be fixed in the bootstrap?

This is a forum for discussing the development and testing of alpha MS2/Extra code. Documentation
(Runs on MS2 and Microsquirt)

Moderators: jsmcortina, muythaibxr

Post Reply
msoultan
Super MS/Extra'er
Posts: 1021
Joined: Sun Jun 27, 2004 12:04 pm
Location: Long Beach, CA - USA

Can this be fixed in the bootstrap?

Post by msoultan »

If I power up the the MS while megatune is not running but laptop connected to MS, the MS goes straight into bootloader mode.

This is a really annoying quirk with the original MS2 bootloader, and I was wondering if this is something that could be fixed now that you guys are modifying the bootstrap. Here's the original thread where we had some initial discussion regarding the problem along with the code that Bruce thinks is the problem:

http://www.msefi.com/viewtopic.php?t=27124&highlight=

Bruce Bowling wrote:Sounds like the serial line is sending a "break" command instead of an idle command. The serial bootloader, right out of reset, checks the serial port line to see if there is a break character being sent - if so then it jumps to the bootloader, otherwise it proceeds with the main EFI code. The brief flash of the LEDs is the tip-off.

Here is the line of the code in the Serial Monitor bootloader that I suspect is getting triggered:

Code: Select all

;**********************************************************************
;  (c) force monitor if RxD low (from host)  PORTS bit 0
;      This is true if the host holds RxD on break level
;  Note: this port is configured after reset as input with pull-up
;**********************************************************************
             brclr  PTS,PTS0,Monitor ;to monitor if RxD low
             bclr   PPSS,PPSS0    ;restore reset state on RxD0 pin
             bclr   PERS,PERS0    ;restore reset state on RxD1 pin
Moving to another computer and having the problem disappearing leads me to think one computer is sending a break command and the other is not.
jsmcortina
Site Admin
Posts: 39619
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Post by jsmcortina »

Our "bootstrap" code doesn't actually replace the monitor - it sits there in place of the normal MS2 code and waits for the downloader to talk to it. The only difference is that it allows the full 128k to be flashed.

The serial monitor code has a number of options for bootload pins or serial etc. I'll have to debug a standard MS2 chip to confirm what is actually there. I've reprogrammed the monitor in mine so I cannot be sure it is the same as comes standard.

(Note, I haven't added anything useful to the monitor on mine, I erased it by accident and had to re-programme!)

Removing that serial code is dead easy, but unless I can figure out a way to reprogramme the monitor without BDM this isn't really going to help anyone unless they send their chips to someone who does have BDM to change them.

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
msoultan
Super MS/Extra'er
Posts: 1021
Joined: Sun Jun 27, 2004 12:04 pm
Location: Long Beach, CA - USA

Post by msoultan »

Ahhh.. ok.. that makes sense. Thanks for the explanation!

Mike
jsmcortina
Site Admin
Posts: 39619
Joined: Mon May 03, 2004 1:34 am
Location: Birmingham, UK
Contact:

Post by jsmcortina »

I checked the monitor that is in my MS2 (99% sure it is the standard monitor actually) and it DOES have that code segment in there.

I also checked the C64 datasheet and it looks impossible to reprogramme the monitor without use of BDM because flash protection is enabled. I had hoped it might be possible to do a mass erase and load in a new monitor. We could have changed the use of the monitor pin at the same time and made it into an output instead... but that is not to be.

James
I can repair or upgrade Megasquirts in UK. http://www.jamesmurrayengineering.co.uk

My Success story: http://www.msextra.com/forums/viewtopic ... 04&t=34277
MSEXTRA documentation at: http://www.msextra.com/doc/index.html
New users, please read the "Forum Help Page".
Post Reply