monitor_load in "px100mhz"-branch

28 views
Skip to first unread message

Ben-401

unread,
Feb 7, 2018, 6:27:39 PM2/7/18
to MEGA65 Development
the "monitor_load" program is a great tool that overcomes many/some/all of the current problems associated with the "px100mhz" branch.
these problems include:
- not knowing what files need to go onto the SDCARD,
- what format the sdcard needs to be
- how to use the sdcard-fdisk-format-utility (and getting this to work)
- etc.

the "monitor_load" program is not built by default.

$> cd src
$> make tools/monitor_load
$> cd ..

the command I use is (NOTE the SUDO, else you will get "open: Permission denied")

$> sudo src/tools/monitor_load -l /dev/ttyUSB1 -b bin/nexys4ddr.bit -k bin/KICKUP.M65 -R MEGA65.ROM -C CHARROM.M65 -4

currently the "MEGA65.ROM" is not built by default. It was previously built (wget zimmers) but is no longer...

$> cp ../../ver23/mega65-core/sdcard-files/MEGA65.ROM .

so now we have enough dependencies to run the "monitor_load" program.

Paul Gardner-Stephen

unread,
Feb 7, 2018, 7:27:24 PM2/7/18
to Ben-401, MEGA65 Development
Hello,

You can avoid the need for sudo if you add yourself to the dialout group.

Paul.

--
You received this message because you are subscribed to the Google Groups "MEGA65 Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to c65gs-development+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ben-401

unread,
Feb 7, 2018, 8:31:14 PM2/7/18
to MEGA65 Development
after the following command:
"sudo src/tools/monitor_load -l /dev/ttyUSB1 -b bin/nexys4ddr.bit -k bin/KICKUP.M65 -R MEGA65.ROM -C CHARROM.M65 -4 src/utilities/test01prg.prg"
i cannot get the m65dbg to respond with anything, not even the "boot-message" that used to appear.

I have tried minicom and that also fails.

I have seen in ubuntu/dmesg that following the execution of the above "monitor_load" command that the USB device becomes disconnected.
This is shown below:

$ nexys is off ^C
$ insert USB-stick to get text in dmesg-logs ^C
$ dmesg | tail
[1453997.922923] usb-storage 2-5:1.0: USB Mass Storage device detected
[1453997.923601] scsi host15: usb-storage 2-5:1.0
[1453999.279898] scsi 15:0:0:0: Direct-Access     TOSHIBA  TransMemory      1.00 PQ: 0 ANSI: 4
[1453999.280612] sd 15:0:0:0: Attached scsi generic sg4 type 0
[1453999.285387] sd 15:0:0:0: [sdd] 15137280 512-byte logical blocks: (7.75 GB/7.22 GiB)
[1453999.286008] sd 15:0:0:0: [sdd] Write Protect is off
[1453999.286011] sd 15:0:0:0: [sdd] Mode Sense: 45 00 00 00
[1453999.286719] sd 15:0:0:0: [sdd] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[1453999.290891]  sdd: sdd1
[1453999.293379] sd 15:0:0:0: [sdd] Attached SCSI removable disk

$ now turn on the NEXYS board ^C
$ dmesg | tail
[1454031.949347] usb 1-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[1454031.949351] usb 1-4: Product: Digilent USB Device
[1454031.949353] usb 1-4: Manufacturer: Digilent
[1454031.949356] usb 1-4: SerialNumber: 210292744832
[1454031.951626] ftdi_sio 1-4:1.0: FTDI USB Serial Device converter detected
[1454031.951666] usb 1-4: Detected FT2232H
[1454031.951889] usb 1-4: FTDI USB Serial Device converter now attached to ttyUSB0
[1454031.953993] ftdi_sio 1-4:1.1: FTDI USB Serial Device converter detected
[1454031.954028] usb 1-4: Detected FT2232H
[1454031.954260] usb 1-4: FTDI USB Serial Device converter now attached to ttyUSB1

$ now run the monitor_load program ^C
$ sudo src/tools/monitor_load -l /dev/ttyUSB1 -b bin/nexys4ddr.bit -k bin/KICKUP.M65 -R MEGA65.ROM -C CHARROM.M65 -4 src/utilities/test01prg.prg
fpgajtag -a bin/nexys4ddr.bit
fpgajtag: Digilent:Digilent USB Device:210292744832; bcd:700
count 0/1 cortex -1 dcount 0 trail 0
STATUS 00401079 done 0 release_done 0 eos 10 startup_state 0
fpgajtag: Starting to send file
fpgajtag: Done sending file
fpgajtag: bypass already programmed bc
STATUS 00401079 done 0 release_done 0 eos 10 startup_state 0
fpgajtag: ERROR failed to run pciescanportal: No such file or directory
[T+2sec] Bitstream loaded
sending R command to sync @ 2000000pbs.
[T+2sec] Replacing and patching kickstart...
patching...
Patching Kickstart @ $a076 to skip SD card and ROM checks.
Read to $fff8000 (16384 bytes)
[T+2sec] 'bin/KICKUP.M65' loaded.
Read to $20000 (16384 bytes)
Read to $24000 (16384 bytes)
Read to $28000 (16384 bytes)
Read to $2c000 (16384 bytes)
Read to $30000 (16384 bytes)
Read to $34000 (16384 bytes)
Read to $38000 (16384 bytes)
Read to $3c000 (16384 bytes)
[T+4sec] 'MEGA65.ROM' loaded.
Read to $ff7e000 (8192 bytes)
[T+4sec] 'CHARROM.M65' loaded.
sending R command to sync @ 2000000pbs.
Synchronised with monitor.
[T+4sec] GO64
Y
[T+5sec] LOAD"!
Filename is 1 bytes long, and is stored at $9fff
Asking for filename from memory: m9fff
Request to load '!'
Replacing filename: s9fff 41
Filename is src/utilities/test01prg.prg
Forcing load address to $0801
Read to $0801 (44 bytes)

LOADED.
Exiting...
Closing serial port (fd)
Closed serial port.

$ dmesg | tail
[1454031.949353] usb 1-4: Manufacturer: Digilent
[1454031.949356] usb 1-4: SerialNumber: 210292744832
[1454031.951626] ftdi_sio 1-4:1.0: FTDI USB Serial Device converter detected
[1454031.951666] usb 1-4: Detected FT2232H
[1454031.951889] usb 1-4: FTDI USB Serial Device converter now attached to ttyUSB0
[1454031.953993] ftdi_sio 1-4:1.1: FTDI USB Serial Device converter detected
[1454031.954028] usb 1-4: Detected FT2232H
[1454031.954260] usb 1-4: FTDI USB Serial Device converter now attached to ttyUSB1
[1454086.317191] ftdi_sio ttyUSB0: FTDI USB Serial Device converter now disconnected from ttyUSB0
[1454086.317206] ftdi_sio 1-4:1.0: device disconnected

I have tried adjusting the "monitor_load" program to close nicely the serial port, but have not achieved a good result.

Can someone please confirm that they can:
- use the monitor_load program to get the "px100mhz" bitstream over to the nexys4ddr,
- and without using an SDCARD (because that seems to be broken),
- and then hook up the m65dbg (or any other serial-port program).

Currently im blocked.

Paul Gardner-Stephen

unread,
Feb 7, 2018, 9:27:59 PM2/7/18
to MEGA65 Development
Hello,

This works for me, but I find that there are reliability issues with the USB serial driver, or something in that chain, that causes intermittent problems like this.
Try using a different USB port, or a USB hub to ensure that it is not an excess power draw problem.

Paul.


On Thursday, February 8, 2018 at 10:57:24 AM UTC+10:30, Paul Gardner-Stephen wrote:
Hello,

You can avoid the need for sudo if you add yourself to the dialout group.

Paul.

Ben-401

unread,
Feb 8, 2018, 10:05:13 PM2/8/18
to MEGA65 Development
not blocked anymore, seems to be working ok now.
Reply all
Reply to author
Forward
0 new messages