Commit Graph

178 Commits

Author SHA1 Message Date
Paul Molloy 2f8823053e making some changes to dictionary call for print options. 2016-12-01 23:15:58 -06:00
paul eeepc a24d728cea flashing page working, verified by reading back again.
currently instruct buffer to dump/flash by setting its function accordingly
2016-12-01 00:45:10 -06:00
Paul Molloy 937435220a Some early dumping functionality working.
buffer opcode updates to transfer payloads
including stuffing two bytes of write transfers in setup packet.
Calling specific buffers with miscdata or opcode.

new dump and flash modules for firmware.

new buffer function update_buffers called during main to monitor and
manage buffer objects when not being loaded/unloaded from USB.
2016-11-30 22:52:43 -06:00
paul eeepc 8cdeecdd77 adding some error checks to usbFunctionWrite.
Trying to prevent transfer from exceeding buffer size.
Also verifying buffer's status is properly set to enforce upholding of the status.
Giving usbFunctionWrite a means to communicate it's error/success back to host with USB 'dictionary'.
2016-11-30 12:53:06 -06:00
paul eeepc b6164aa3a6 adding buffer element getter and setters to dict and firmware.
Need to add to host support and test operation.
2016-11-30 02:04:07 -06:00
Paul Molloy c256ca6b66 testing some bigger transfer sizes removing some printing. 2016-11-30 00:03:40 -06:00
Paul Molloy 3326c2fb34 payload buffers working with some early testing.
Had a good lesson on what static means... :/
everything working now as previously designed
speed testing on windows10 PC yeilded ~21KBps when transferring 128-512KB
payloads and 128Byte transfer size.  Going to bump to 256 and see how that
does after 128KB speed tests on linux machine.

created host test.c/.h file for general testing of new features.
that way I can start working on erase/write.h files and just use test.c as
scratch code space for tinkering and still call with -t flag on command
line.

modified dictionary calls to include pointers to data and lengths.
2016-11-29 18:27:54 -06:00
paul eeepc cb0941e86c usbFunctionWrite support loading incoming write/OUT data to buffer objects.
Still untested, need to write some host code to test things out.
2016-11-29 15:27:31 -06:00
Paul Molloy fe1b0e0ba5 AVR Memory Usage
----------------
Device: atmega164a

Program:    4092 bytes (25.0% Full)
(.text + .data + .bootloader)

Data:        445 bytes (43.5% Full)
(.data + .bss + .noinit)

upgraded windows machine to avr-gcc (GCC) 6.1.1 20160627
dropped .hex down to within 2 bytes of linux machine running 4.8.2

changed main to remove avr-gcc 6.1.1 warnings
2016-11-28 22:53:12 -06:00
Paul Molloy 80943f7f62 firmware buffer.c reorganization and some intitial testing complete.
moved all buffer operations out of usb.c with new bridge function between
the two files.  Lots of pointing going on and lessons learned..
Thankfully everything seems to be working if you actually call the
functions as I designed them..  Gotta love trouble shooting bugs that
don't exist..  Helped updating allocate output to get returned as error
back to the host.

Moved typedef structs to firmware type.h file as seemed to cause
compilation issues being contained in the files .h file when other .c
files needed those types.

Fixed casting warnings with usbMsgPtr ended up looking at usbdrv.c figured
out how close I got, just shouldn't have been putting the * in there..
2016-11-28 22:16:35 -06:00
Paul Molloy 52ef11c7e3 AVR Memory Usage
----------------
Device: atmega164a

Program:    4186 bytes (25.5% Full)
(.text + .data + .bootloader)

Data:        445 bytes (43.5% Full)
(.data + .bss + .noinit)

buffer allocation basic operations tested and working great.
Still need to update windows machine avr-gcc..
implemented with 8 buffers and 256 raw buffer
2016-11-28 20:45:46 -06:00
Paul Molloy c36313135e Initial firmware implementation of buffer objects and raw sram allocation
complete.  should be able to allocate buffers from host, but haven't got
to testing it yet.  Compiling on firmware though..
Currently have 256 bytes of raw_buffer, and 8 buffer objects/structs
each with ~16 bytes per object.  So could trim things down, but still have
decent amount of SRAM left.  Could have another 256 byte buffer at this
rate..  but might not leave enough SRAM for temporary routines.

Possible that raw buffer space could be dynamically allocated
as either buffer space or temporary routine space...

AVR Memory Usage
----------------
Device: atmega164a

Program:    4094 bytes (25.0% Full)
(.text + .data + .bootloader)

Data:        573 bytes (56.0% Full)
(.data + .bss + .noinit)
2016-11-28 02:01:14 -06:00
paul eeepc 931222cf17 new buffer.h/.c firmware files. Mostly just comments and struct defn for now 2016-11-27 21:18:54 -06:00
Paul Molloy c6a68c679f Adding EXP0_PULLUP_TEST should probably verify pullup on EXP0 provides
logic 1 if relying on it.  Seems to work fine on NES discrete and
INLXO-ROM boards where planning to utilize it.  SNES can't pull up due to
pulldown and original famicom cart can't either perhaps because of
EXP6 EXP FF output being too much of a load..?
2016-11-27 17:47:40 -06:00
Paul Molloy 8c1eb00e85 last commit apparently didn't include the recent version, just the rename.? 2016-11-27 15:40:13 -06:00
Paul Molloy 7b1db30054 moving windows binary from inlretro.exe to inlretro_commited.exe
Makes commits easier, make clean removes all non-commit files.
cp recent build to _commited separates recent build from last commited
build.
2016-11-27 15:38:12 -06:00
paul eeepc cd6378b8c5 SNES dictionary creation, addition of NES cpu/ppu read/writes
cleaned up firmware pinport.h used PURPLE/GREEN KAZZO for all #ifdef's

AVR Memory Usage
----------------
Device: atmega164a

Program:    3404 bytes (20.8% Full)
(.text + .data + .bootloader)

Data:         53 bytes (5.2% Full)
(.data + .bss + .noinit)

final kazzo design hex commited as comparable build to the past two commits of green/purple.
So this .hex commit is apples to apples with recently commited purple/green .hex commits.
2016-11-27 15:32:36 -06:00
paul eeepc 3aca4c863e AVR Memory Usage
----------------
Device: atmega164a

Program:    3416 bytes (20.8% Full)
(.text + .data + .bootloader)

Data:         53 bytes (5.2% Full)
(.data + .bss + .noinit)

First commit of purple kazzo specific firmware.
Currently just 12bytes larger than final design v1.2b-v1.4
This will probably expand as more updates twiddle with EXP FF
2016-11-27 15:10:16 -06:00
paul eeepc 6c8ece5fa8 AVR Memory Usage
----------------
Device: atmega164a

Program:    3692 bytes (22.5% Full)
(.text + .data + .bootloader)

Data:         55 bytes (5.4% Full)
(.data + .bss + .noinit)

committing green v1.2 firmware for first time.  code uses decent amount more rom
3692 green - 3404 final = 288 bytes
2016-11-27 13:37:18 -06:00
paul eeepc bfff2b0fdd AVR Memory Usage
----------------
Device: atmega164a

Program:    3404 bytes (20.8% Full)
(.text + .data + .bootloader)

Data:         53 bytes (5.2% Full)
(.data + .bss + .noinit)

moving main.hex to include pcb version number.

hex includes snes read/write dictionary additions, but still untested.
code updates for this .hex are in commit to follow shortly.

Noticed avr-gcc version 4.8.2 on linux pc is compiling significantly smaller than
avr-gcc version 4.3.3 on windows PC.  Need to update so hopefully getting
identical builds on both of my machines.
2016-11-27 13:28:24 -06:00
Paul Molloy 7d00145431 Big step in confirmation of pin manipulations working on kazzo.
Able to read PRG-ROM flash chip's manf and device ID from commandline.

New dictionaries io and nes along with firmware files to support.
now have io_reset, nes_init, and snes_init io.c functions
nes.c functions including discrete_exp0_prgrom_wr and emulate_nes_cpu_rd.

New dictionary.c/.h for host to make dictionary calls easier including
setting proper return data lengths based on opcode.

adding nop command to pinport.h

AVR Memory Usage
----------------
Device: atmega164a

Program:    2960 bytes (18.1% Full)
(.text + .data + .bootloader)

Data:         53 bytes (5.2% Full)
(.data + .bss + .noinit)
2016-11-27 00:18:46 -06:00
paul eeepc 94ea3fd474 modified: host/source/inlprog.c
new file:   host/source/erase.c
new file:   host/source/erase.h
	creating erase files called from main with e_flag

modified:   firmware/source/usb.c
	introducing switch statement with range of values of opcode type detection.

modified:   host/source/usb_operations.h
	turning off debug

modified:   shared/shared_errors.h
	renumbering some error codes
	thinking I'll have codes which can come from avr set to 128+
2016-11-26 14:17:34 -06:00
paul eeepc 14eddd74ab committing source code changes for main.hex commit that was just made axing usbFunctionRead 2016-11-25 19:59:07 -06:00
paul eeepc 7aab299b66 removing usbFunctionRead because I'm not planning to utilize it.
Expecting it to be simpler and potentially faster to send dump commands and simply provide pointer to ram buffer within usbFunctionSetup.  Saves about 70Bytes of code, so not huge, but whatevs..

AVR Memory Usage
----------------
Device: atmega164a

Program:    2594 bytes (15.8% Full)
(.text + .data + .bootloader)

Data:         53 bytes (5.2% Full)
(.data + .bss + .noinit)
2016-11-25 19:55:42 -06:00
paul eeepc dae63f73b0 Tons of edits...
rearranged some of the .h files, created dictionary file to list all dictionaries of opcodes.
        moved error codes to shared file so host can interpret firmware error codes.
        created firmware usb.c/h to handle usb operations (didn't move as git seems to think..)
	cleaned up fw main function and file.
	host usb_operations, created USBrequest struct type to more easily handle all transfer info.

Currently able to send pinport commands and read back return values from retro prog.
Just need to start writting functions to send opcodes and start actually preforming some cartridge operations.
2016-11-25 19:50:43 -06:00
paul eeepc 53578116f1 committing main.hex with upcoming commit's code changes complete.
this commit has usbFunctionRead enabled, next commit will have it cut for comparison.
AVR Memory Usage
----------------
Device: atmega164a

Program:    2632 bytes (16.1% Full)
(.text + .data + .bootloader)

Data:         53 bytes (5.2% Full)
(.data + .bss + .noinit)
2016-11-25 19:40:13 -06:00
paul eeepc fdf88f7256 removing shared files from source dir when making clean. 2016-11-24 11:39:05 -06:00
Paul Molloy 47545169ee modified: source/pinport.c
modified:   source/pinport.h
	-fixing bunch of compile errors and stupid mistakes.
	go to sleep and stop writing bad code...
2016-11-24 07:24:12 -06:00
Paul Molloy ce2a5aecca modified: logic.h
modified:   pinport.c
modified:   pinport.h
	-completing implementation of remaining shared_pinport opcodes
modified:   ../../shared/shared_pinport.h
	-few opcodes deleted because I decided they were stupid when got
	around to implementing them.  Set user up for errors and not
	useful generally.
2016-11-24 07:14:15 -06:00
paul eeepc 0af7bb3b16 modified: logic.h
modified:   pinport.c
	-started working on 16bit operand function
2016-11-24 05:33:02 -06:00
paul eeepc c984f15f01 modified: source/pinport.h
modified:   source/logic.h
	-adding IP and OP definitions to use on DDR registers
	-ERROR codes denote what function errored out

modified:   ../shared/shared_pinport.h
	-changing some opcode names for clarity and lowercasing non-recommended ones

modified:   source/pinport.c
	-fix bug that recreated cur_AHL_addr and cur_AXL_addr
	-create opcode with 8bit operand function
2016-11-24 03:06:34 -06:00
paul eeepc a6a6369226 untested main.hex commit for logging rom/ram use
pinport has opcode only and opcode with 8bit operand complete:
14% used of 87.5% available

avr-size -C --mcu=atmega164a main.elf
AVR Memory Usage
----------------
Device: atmega164a

Program:    2300 bytes (14.0% Full)
(.text + .data + .bootloader)

Data:         45 bytes (4.4% Full)
(.data + .bss + .noinit)
2016-11-24 03:04:00 -06:00
Paul Molloy afb5f6f158 modified: shared_pinport.h
-creating new opcodes with operatnds and return values
	still yet to be implemented elsewhere
2016-11-23 22:53:23 -06:00
Paul Molloy 31678bacfe renamed: host/source/pinport.h -> shared/shared_pinport.h
modified:   firmware/source/pinport.c
modified:   firmware/source/pinport.h
	-creating shared_pinport.h which is effectively a dictionary for
	pinport opcodes
	-file gets copied to host and firmware source dirs when compilied.
	-hardware macros had to be renamed to include underscore to
	differentiate opcode name from hardware macro.
	-pinport.c now is a nice clean switch between opcode name and
	macro with all literal numbers removed.
	-now don't have to manually track/update opcode numbers between
	multiple locations.

modified:   firmware/source/io.c
modified:   firmware/source/main.c
	-updates to add underscore pre-fix to hardware macros.
2016-11-23 18:12:50 -06:00
Paul Molloy 27cca679d5 new file: pinport.h
-created from firmware/source/pinport.c
	-macros to create opcodes which will get sent as commands over USB
	-they will then get interpreted by pinport.c in firmware.
2016-11-23 03:05:29 -06:00
Paul Molloy aca6bb8960 modified: source/pinport.c
modified:   source/pinport.h
	-adding some compatibility between boards.
	-purple and green should work under final version commands.
	-making some commands lower case which aren't recommended.
2016-11-23 02:23:17 -06:00
Paul Molloy b1ba1c4432 modified: logic.h
-defining SUCCESS & ERROR_CODES
new file:   pinport.c
	-Creation of file with giant switch to decode byte value into
	macro call.
	-software AXL and AHL clocking of for green boards.
modified:   pinport.h
	-removed #ifdef for signals, should only be based on board when
	possible.
	-created macro for AXL/AHL_CLK to call software function
deleted:    macro.h
	-don't want this old guy around any more...
2016-11-23 01:19:14 -06:00
paul eeepc b43b3c0756 modified: Makefile
-modified to caluclate ROM/RAM usage of atmega164a

new file:   source/io.h
new file:   source/logic.h
	-created files

modified:   source/io.c
modified:   source/main.c
	-created io_pullup going to make separate io inits based on cartridge inserted
	-modifing for io.h

modified:   source/pinport.h
	-File mostly complete with all possible pin manipulations
2016-11-22 20:27:52 -06:00
paul eeepc f973d990cd Initial add of firmware hex.
Base line rom/ram usage.
usb read/write functions are enabled, but long transfers are not.
host support only for LED on/off.
2KB of 16KB (12.5%) of program memory are not available due to bootloader.

AVR Memory Usage
----------------
Device: atmega164a

Program:    1620 bytes (9.9% Full)	87.5% is MAX due to bootloader
(.text + .data + .bootloader)

Data:         45 bytes (4.4% Full)
(.data + .bss + .noinit)
2016-11-22 20:20:30 -06:00
paul eeepc 70e700c7e8 Prepending 'shared' to files in shared folder to make more clear that these files should only be edited from the shared folder as they're copied into source folder at compile time. Any edits from source folder will get stopped, and committing shared files outside of shared folder is not desired. 2016-11-22 00:52:06 -06:00
Paul Molloy ab52b30d8d lowercasing soldermask color denotations for signals. 2016-11-22 00:30:03 -06:00
Paul Molloy 42e8339600 Updating pinport.h with PCB version history and more i/o definitions and
macros
2016-11-22 00:23:22 -06:00
paul eeepc 5620b34a9e new file: io.c
-creation of io file
modified:   main.c
	-moving io setup to io.c
new file:   pinport.h
	-creation of pinport file, intended to be avr specific code from macro.h
2016-11-21 17:54:29 -06:00
Paul Molloy b8be4b768a new file: shared/usb_commands.h
-shared .h files used in both firmware and host app
modified:   firmware/Makefile
modified:   host/Makefile
	-added shared dependency to copy shared files to source prior to
	building
modified:   host/source/usb_operations.h
modified:   firmware/source/main.c
	-removing usb commands (now in shared)
modified:   host/include/dbg.h
	-adding SUCCESS defintion
modified:   host/source/inlprog.c
	-calling write file if write arg sent
new file:   host/source/write_operations.c
new file:   host/source/write_operations.h
	-creation of write operations files
	-opens file and reads header
	-some skeleton comments
	-lots of work left to do here
new file:   roms/nrom_v_test.nes
	-adding NROM test rom file
2016-11-20 23:57:09 -06:00
Paul Molloy 6a370d3893 Moving source code to source folder
Modifing Makefile to support
2016-11-20 20:11:05 -06:00
paul eeepc cfffe554be modified: source/inlprog.c
-introducing getopt to obtain commandline args
modified:   source/usb_operations.c
	-moving USB defn comments in from main
2016-11-20 15:43:11 -06:00
paul eeepc 4cbeff1ecf modified: source/inlprog.c
- removing compile errors
	- fixing request/command for off (was always sending on copy paste error)
modified:   source/usb_operations.c
	- Adding checks beyond VID/PID pair
	- Now check Manufacturer, Product, and build version
	- Give Warnings/Error if device is not supported
	- Don't blindly accept and try to write to non-supported devices.
	- Cleared up confusion on ENDPOINT direction.
2016-11-19 23:58:47 -06:00
Paul Molloy 49c9876770 modified: source/inlprog.c
modified:   source/usb_operations.c
modified:   source/usb_operations.h
	-moving usb transfer operation to usb_operations
2016-11-19 21:32:54 -06:00
Paul Molloy 782ed343f7 modified: source/inlprog.c
-moved usb device operations into usb_operations module
new file:   source/usb_operations.c
new file:   source/usb_operations.h
	-creation of usb_operations module
	-currently handles libusb open/close and retrieving INL retro-prog
	usb handle.
2016-11-19 19:10:13 -06:00
Paul Molloy 3c09f388ab new file: host/inlretro.exe
initial commit of windows executable.
	turning LED on and off is the only functionality present.
2016-11-19 17:59:16 -06:00