Fred's firmware development diary

Official FreeEMS vanilla firmware development, the heart and soul of the system!
User avatar
Fred
Moderator
Posts: 15433
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Fred's firmware development diary

Post by Fred »

I messed around with some special purpose logs today, but nothing serious.

The woman is away this weekend... Paris...

SO, release! bout bloody time really...

Required :
  1. hardware docs - including design for polarity/isolation
  2. data description docs - including schemas
  3. functioning flash burn by serial - Sean, if you can prove I've screwed up, cool, if it's you (i doubt it) cool. needs to work though :-)
Code can stay more or less as is with a tidy up of redundant old stuff etc.

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
Fred
Moderator
Posts: 15433
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Fred's firmware development diary

Post by Fred »

Given up on 1 for now, but...

Solved 3 :-)

My fault <blushes>

When I added the nifty multi sector burn function, I reversed the parameters to the sector burn function...

I've added a check for dest addresses that are in the ram region now. It will throw an error in future for such conditions.

I told you it was my fault... :-)

Serial docs and tidy up tomorrow and it can go out in fine form :-)

Goals for the next release are :
  • Rework the serial spec to make more sense
  • Figure out the hardware stuff, document it and move on in that area.
Nearly 3am, bed time...

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
Fred
Moderator
Posts: 15433
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Fred's firmware development diary

Post by Fred »

There has been a serious spanner stuck in the works... the plan of a release today is looking less likely (though, still possible)... you see, it's 5pm, and I just got out of bed... I wondered why I didn't feel at all tired... haven't felt like that for months... 13 hours sleep is great, but no time now as the house is still trashed and the boss is due home soon. We'll see how I feel about things later after I get the musts out of the way and see how much work is required to get a release out.

Fred. (well rested, but SOL)
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
Fred
Moderator
Posts: 15433
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Fred's firmware development diary

Post by Fred »

I just had an epicly good idea!

For flash burning, currently we only have the ability to burn multiple sectors at a time, but whole sectors only. Blocks that are a multiple of sector size only.

Although it won't really be possible to do 1.5 sectors... it WILL be possible to...

The idea :

When a packet arrives with less than 1k (sector size) of data to burn we can use the left over of the RX buffer to copy the flash block up into, and then over write the piece we need to in RAM and burn the whole lot back down as a full sector. Perfect.

I had thought of this before (it's fairly obvious) but I was planning to waste another 1k of RAM to do it.

If we make the assumption that we will only ever burn 1k 2k or less than 1k chunks this will work sweet, and in fact the assumption is a valid one too.

That will work in nicely with the next release stuff.

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
Fred
Moderator
Posts: 15433
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Fred's firmware development diary

Post by Fred »

I just cut the logging back to 1/s such that I could film a video of the tuner app interracting with the firmware. I plan to make a video for the next release, so it was necessary, besides, it was impossible to use it without that anyway.

Next hack is to remove the reg dump stuff from the orange button and replace it with datalog toggle.

There is a LOT of tidy up to do before I release, but I will be trying for tonight, not sure if I'll make it though...

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
Fred
Moderator
Posts: 15433
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Fred's firmware development diary

Post by Fred »

Code: Select all

			// hack to allow datalog on/off from the orange button (thank christ I asked for that button when I did)
			if(asyncDatalogType){
				asyncDatalogType = asyncDatalogOff;
			}else{
				asyncDatalogType = asyncDatalogBasic;
			}
			break;
:lol: :lol: :lol: :lol:
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
Fred
Moderator
Posts: 15433
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Fred's firmware development diary

Post by Fred »

Tested and works.

I'll be working hard on the train tomorrow to ensure I get a release tomorrow night. Tonight I'm going to bed.

I'm going to do some file splitting and header splitting and other basic stuff and just clean up comments and docs and stuff.

I'll also try to get the JSON stuff more complete first too.

The hardware stuff though has to wait as I don't have any ideas about how to proceed next except spending a long time reading that PDF.

Hopefully we can resolve that soon with a bit of team work. I want to do some more experiments soon too to see if the reset blip on port A is pull up or drive up. basically just add a pull down of 1k or so and see if the leds still flick on or not.

Things are looking pretty good, more progress soon :-)

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
Fred
Moderator
Posts: 15433
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Fred's firmware development diary

Post by Fred »

Managed to move the dictionary/address lookup out of the main comms file, but need to do a lot more - after this release. Will be sanitising the code tonight and cleaning up dirtiness for a release.

I can see 0.0.19 will be a big one again too :-)

Best we get on with the show :-)

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
Fred
Moderator
Posts: 15433
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Fred's firmware development diary

Post by Fred »

0.0.18 JackTheRipper is out now :

https://sourceforge.net/project/showfil ... _id=649069

Change log :

Code: Select all

0.0.18 (JackTheRipper) : 10:40pm 22/12/08 - UK Time
Fred 12/11  7:04am:	Added flash and ram receive functions
					Added wrappers for debug and error
					Modified flash error handling to be compatible with overall scheme
					Renamed all counters more sensibly
					Major tidy up of init.c - more to do in the future
Fred 12/11  7:51pm:	Created generic flash burning wrapper
					Moved flash error handling into wrapper
					Moved page ram init to functions per block of data
					Moved tables to 3 pages from 2 and put functions in place to init them
					Created multi sector flash burn function
					Previously added table size guide
					Previously added testing matrix for comms
					Previously added hardware interface doc
Fred 13/11  8:52am:	Fixed bug where config was coming from flash, not ram.
					Completed paging memory exercise for now
					Removed all linker warnings by shuffling code and data
Fred 14/11  7:45am:	Split regions into regions.x out of the main linker script
					Split page for small tables into chunks to cause link issues if oversize and still work if undersize
Fred 16/11  5:05pm:	Fixed hard reset functionality
					Refactored the table lookup to be faster and use less space
					Updated serial core docs
					Added doc describing the datalog format
					More comms test packets
					Pin out doc update!
Fred 18/11  6:04pm:	Fixed missing text1 copy options
					Changed makefile to be faster and more versatile
					Migrated rodata back to its own section(s)
					Moved ADC tables and core var gen to a paged flash region together
Fred 19/11  8:30am:	Migrated data init to static from dynamic
					Fixed comms dictionary lookup addresses with lookup addr init function
Fred 19/11  5:55pm:	Moved all ISR code to text1 so we know how big it is and how big the rest is
Fred 20/11  7:55am:	Added check for packet from own address
					Changed error codes to be more meaningful
Fred 20/11  6:37pm:	Added interface data map
Fred 21/11  8:27pm:	Added windows Makefile
					Added size utility call
					Added example datalog json
					Merged lambda and ve into fuel files
Fred 22/11  2:27pm:	Split fixed config in two different pieces
					Rearranged makefile
					Split fixed configs into two different files
					Added extra user text field and filled out to section boundary
					Moved some functions back into the text areas
					Added interface packet descriptions
					Fixed init values
					Split headers out a bit
					Fixed and added some comments etc
					Added win make file generator
					Tweaked makefile to work with windows
Fred 25/11 11:37pm:	Added test packets to dump registers with SM
					Added memory management documentation
					Added example settings file
					Added tuner interface overview doc
					Further updated pin out doc
Fred 26/11 11:12pm:	Added Sean's flash fixes in and looped flash erase/burn to test it
					More changes to the json stuff
					Fixed bug with makefile that caused it to regen files without need
Fred 27/11  6:31pm:	Added custom packet definition file for tuner
					Added windows makefile generation to the makefile
					Optimised flash writing by moving page swapping up one level
					Removed cruft from comms core
					Relocated dictionary to paged flash
Fred 29/11  7:20pm:	Added axis and cell value adjustment routines for the main tables
					Added axis adjustment error checking function
					Rearranged error codes a bit
					Added test data block for testing serial comms
Fred 30/11 10:19am:	Removed redundant code from serial comms
					Added basic datalog function and serial option
					Updated readme file
					Rearranged and renamed some doc files and interface descriptors
Fred 30/11  8:04pm:	Added async datalog sender
					Added configurator for async logging
					Added all minor parts of the dynamic config to the dictionary
					Divided page f9 into data and functions
					Added two d us table adjuster functions and serial routines
Fred  1/12 10:22pm:	Fixed serial bug with small hack (needs better fix)
					Moved many functions to paged flash
					Fixed copy paste error in address init code
					Fixed - instead of + in cell setting function
Fred  7/12 10:41pm:	Added data map overview doc					
Fred 11/12 12:31am:	Added JSONSchema for one JSON file
Fred 18/12  6:29pm: Refactored array based banking to pointer based - Awesome change
					Fixed pointer to a pointer bug in datalog introduced above
					Removed extra copies of core and derived vars from header
					Documented new pointer scheme in header
Fred 21/12  2:37am:	Fixed bug, flash and ram pages/addresses were swapped in a flash burn function call
					Added check for dest address in ram region
Fred 21/12 10:46pm:	Hacked in datalog delay of 1 second
					Hacked orange button to turn basic datalog off and on
					Added comments for future changes to serial stuff
					Added ifdef wrappers around unrequired init stuff
Fred 22/12  8:46pm:	Split address lookup function out of comms file
					Added more comments etc
					Moved old bugs to mantis and removed bugs.txt
					Cleaned out HEAPS of old cruft, tidied up and commented stuff
Video :

http://www.youtube.com/watch?v=4MS_zc8sZxM

Main features are awesome serial comms and semi matching tuning app.

Big changes left right and centre, but switching to pointers for banking made a huge difference to the code.

Looking forward to moving to GIT and popping out 0.0.19 soon!

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
User avatar
Fred
Moderator
Posts: 15433
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: Fred's firmware development diary

Post by Fred »

Excuse the focus/clarity...

Steps taken :

1) Connect serial device
2) Retrieve interface version and string
3) Retrieve firmware version string
4) Retrieve max packet size
5) Send packet echo request
6) Open memory block request screen
7) select block ID 2
8) Retrieve block 2 from RAM
9) Connect/disconnect for no reason
10) Retrieve block 2 from RAM again
11) Disconnect tuner, connect cutecom
12) Use cutecom to adjust a table cell in RAM
13) Disconnect cutecom, connect tuner
14) Retrieve block 2 from RAM with cell changed, circle change
15) Retrieve block 2 from Flash to show not changed
16) Send burn ram to flash command for block 2
17) Retrieve block 2 from Flash and circle changed cell
18) Enable datalog using hack and soft reset button
19) Illustrate changing values in datalog due to starting JimStim
20) Send hard reset and observe datalogs keep flowing but with different data
21) Disable datalog again
22) Send version string request
23) Retrieve Lambda table and illustrate difference to VE tables
24) Review history of comms
25) Re-enable datalogs
26) Disable datalog
27) Pan around to the device and the sound of the piezo showing RPM

Fred.
DIYEFI.org - where Open Source means Open Source, and Free means Freedom
FreeEMS.org - the open source engine management system
FreeEMS dev diary and its comments thread and my turbo truck!
n00bs, do NOT PM or email tech questions! Use the forum!
The ever growing list of FreeEMS success stories!
Locked