SM Re-Development in GCC + Customisations/fixes

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

Re: SM Re-Development in GCC + Customisations/fixes

Post by Fred »

Work has begun! I got 6 commits in earlier tonight on the roof of the car while enjoying the view of the Barcelona skyline. The next 6 will be harder, but still pretty easy with some luck. Fingers crossed.

Image

Image

Image

Image

Image
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: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: SM Re-Development in GCC + Customisations/fixes

Post by Fred »

I got another commit in on this tonight, next commit should yield a binary of what we already have, but repeatable, and as a source base point.
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: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: SM Re-Development in GCC + Customisations/fixes

Post by Fred »

Getting close now!

GAS seems to be crappy, or I don't know how to use it properly. Maybe I need to patch binutils to work better.

from "bset something, somethingelse" I'm getting the following instruction:

1C 00 0C 01

however it should give:

4C 0C 01

because the high bytes of the "16 bit operand" are zeros and it's static, not dynamic. 25% code space saving there, cycle count is equal, though, so no faster.

I want a resolution for this.

Just changed the operands to literal 8 bit, and no better behaviour. I think GAS simply doesn't support this, or have the sophistication necessary...

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: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: SM Re-Development in GCC + Customisations/fixes

Post by Fred »

GAS definitely has the opcodes in the binutils source, it just won't use them for some reason. More tomorrow.
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: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: SM Re-Development in GCC + Customisations/fixes

Post by Fred »

Code: Select all

if (format & M6811_OP_DIRECT)
                continue;
Motherfucker!

Thanks Sean for your help!

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: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: SM Re-Development in GCC + Customisations/fixes

Post by Fred »

This new serial monitor s19 removes the requirement for a PNP hack for FTDI devices. Other side effects are not tested, however it's strongly likely that it doesn't have any for our application. I suggest using this on new hardware as an interim solution until I can engineer a proper solution. Idea (of hacking the binary directly) by Sean, all reverse and forward engineering by yours truly. This is disgusting, but you'll like it, so enjoy.

Fred.
Attachments
seank.hackers.special.by.fred.s19.zip
Dirty dirty hack :-(
(2.43 KiB) Downloaded 851 times
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: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: SM Re-Development in GCC + Customisations/fixes

Post by Fred »

I have an almost perfect match on the serial monitor of old from code now. Much of the problem was this situation:

Code: Select all

dbset  = 0x4C
dbclr  = 0x4D
dbrset = 0x4E
dbrclr = 0x4F

dldab   = 0xD6
dldy    = 0xDD
dldaa8  = 0x86
dldaa9  = 0x96

dstaa   = 0x5A
dstab   = 0x5B
dstd    = 0x5C
dsty    = 0x5D

dcmpa   = 0x91
Each of those instructions is real if you remove the d which stands for direct. Unfortunately, as illustrated above the direct instructions are _never_ used in GAS.

Another problem is that the source I had wasn't complete. It was nearly complete, though.

I'll make my almost perfect match perfect tomorrow, at which point I have a solid base line for both the SM and binutils testing/dev.

Solid progress tonight! :-)

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: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: SM Re-Development in GCC + Customisations/fixes

Post by Fred »

(03:00:11) Fred: [gnu-binutils bac1ae0] This, ugly as it may be, builds EXACTLY the serial monitor from the firmware lib dir. With time and binutils tweaks I'll make it clean, then I'll make it behave as it should.
(03:00:11) Fred: 3 files changed, 555 insertions(+), 148 deletions(-)

3am, and I beat the bastard fair and square! :-)

Binutils fixes are next on the menu for this thread.

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: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: SM Re-Development in GCC + Customisations/fixes

Post by Fred »

http://issues.freeems.org/view.php?id=668

Gave it an arbitrary target version. I might make sub-issues with each feature/change etc.
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: 15431
Joined: Tue Jan 15, 2008 2:31 pm
Location: Home sweet home!
Contact:

Re: SM Re-Development in GCC + Customisations/fixes

Post by Fred »

Let's see if we've got a spy, or not. Fuck you, James Murray!
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