Author Topic: DIGIC 7 development (200D/SL2, 800D/T7i, 77D, 6D2)  (Read 101362 times)

names_are_hard

  • Contributor
  • Freshman
  • *****
  • Posts: 60
  • 200D idiot
Re: DIGIC 7 development (200D/SL2, 800D/T7i, 77D, 6D2)
« Reply #250 on: July 21, 2019, 06:48:14 PM »
debug printfs - shameful, but we all use them (entirely excusable here, where you don't have a debugger!).  I've added a convenience printf that works like this:
bmp_printf_auto("some string with data: %d", 6")
It has static x and y which it increments for you.  Nice for lazily printing things in order.

The fixed assert handler has made it much more stable.  Lockups are rare.

This is probably too hopeful, but I wonder if the main thing stopping me getting into ML menus is I haven't defined the button to trigger it?  I think this is supposed to be the delete / bin / trash button, but I don't know where to find it in consts / stubs / code.  What's the name used?  Or, more generallly, what's the path that leads to ML menus, so I can debug it?

MrDerrick

  • Just arrived
  • *
  • Posts: 1
Re: DIGIC 7 development (200D/SL2, 800D/T7i, 77D, 6D2)
« Reply #251 on: July 25, 2019, 04:07:33 AM »
Hi, i have an 800d, I can help you in any way?

names_are_hard

  • Contributor
  • Freshman
  • *****
  • Posts: 60
  • 200D idiot
Re: DIGIC 7 development (200D/SL2, 800D/T7i, 77D, 6D2)
« Reply #252 on: July 25, 2019, 01:13:46 PM »
Digic7 are in very early stages.  Do you have experience with C or disassembly, or have the time to learn?

nikfreak

  • Developer
  • Hero Member
  • *****
  • Posts: 1132
Re: DIGIC 7 development (200D/SL2, 800D/T7i, 77D, 6D2)
« Reply #253 on: July 26, 2019, 01:36:31 PM »

This is probably too hopeful, but I wonder if the main thing stopping me getting into ML menus is I haven't defined the button to trigger it?  I think this is supposed to be the delete / bin / trash button, but I don't know where to find it in consts / stubs / code.  What's the name used?  Or, more generallly, what's the path that leads to ML menus, so I can debug it?

Check platform dir and gui.h in it.
Might be a good idea to copy and use that from my 100d port. You can also grep source code for 100D
70D.112 & 100D.101

names_are_hard

  • Contributor
  • Freshman
  • *****
  • Posts: 60
  • 200D idiot
Re: DIGIC 7 development (200D/SL2, 800D/T7i, 77D, 6D2)
« Reply #254 on: July 30, 2019, 03:59:51 AM »
Ah, I'd forgotten about gui.h, thank you.  I took a look at it, and I can see it's associated with button codes in gui_massive_event_loop, but comparing between 50D and 200D is difficult.  I think Ghidra has decompiled them in different ways, one part that I'd expect to be a switch is a messy if/else nest.  I think I will have to come back to this part.

Other problems I have: this crash log:
Quote
ASSERT: 0
at TouchUtility.c:132, task DispDCtrl
lv:0 mode:0

DispDCtrl stack: 28d100 [28d218-28c218]
0xUNKNOWN  @ 1b67db:28d100

Which I think is related to these debug messages:
Quote
19.697151   DispVCtrl:e054852d:42:02: GiveSemaphore : StateChangeWaitCBR 56
19.697188   DispDCtrl:e04e2e51:45:03: TCH_ProhibitTouch
19.697216   DispDCtrl:e055a3bb:45:03: JDI_LAM_ProhibitTouch
19.697245   DispDCtrl:e059bec3:45:06: TryPost Cannot be Done!!! 3   <--- I think this is strongly related to the assert

I can locate the function that triggers those messages but it's not obvious how I fix the crash.  I also don't know if I need to - the camera remains responsive.  Perhaps this is not a high priority?  Anyone know a general pattern for dealing with these kinds of logs?  To debug this further I think I would write a dynamic patching util to dump register contents and stacktrace when a given address was hit, which would be fun but likely slow to get working reliably (if it was x86 asm it would be easy :P).

I also find that any attempt to vsnprintf() with %s in the format string has a high chance of causing a very fast crash, fast enough that it stops the string being displayed.  But, it's not a guarantee, just very likely.  Sometimes you get part of the string displayed before locking up.  I don't understand this fully and can't explain it.  It evens occurs with local static strings as the arg.  There is nothing in crash logs when this happens.  I'm mostly mentioning this in case it confuses other Digic7 porters, but if this makes sense to anybody, please let me know.

nikfreak

  • Developer
  • Hero Member
  • *****
  • Posts: 1132
Re: DIGIC 7 development (200D/SL2, 800D/T7i, 77D, 6D2)
« Reply #255 on: July 30, 2019, 06:37:14 AM »
I would just try to disable touch in canon menu until you find the root cause (stub / const). It's at least possible on 100d. Do you have a pull request available? It might help others to chime in
70D.112 & 100D.101

kitor

  • Contributor
  • Member
  • *****
  • Posts: 127
Re: DIGIC 7 development (200D/SL2, 800D/T7i, 77D, 6D2)
« Reply #256 on: July 30, 2019, 08:16:35 AM »
Do you have a pull request available? It might help others to chime in

https://bitbucket.org/stephen-e/ml_200d/
I don't think that this will be ready for PR anytime soon  :)
EOS R

names_are_hard

  • Contributor
  • Freshman
  • *****
  • Posts: 60
  • 200D idiot
Re: DIGIC 7 development (200D/SL2, 800D/T7i, 77D, 6D2)
« Reply #257 on: July 30, 2019, 03:01:57 PM »
Disabling touch in the menus was a good idea I hadn't thought of, thanks.  It didn't help, still get the same crash.  I note that the debug messages look related to disabling touch, and the camera will crash if I halfshutter - perhaps it always tries to disable the touchscreen when the display is off?  It does give me the crash log if I insert card, turn on cam, do nothing, turn off cam - but that leads to a display off too.  It's a pattern worth investigating.

I'm happy to look at PRs, but they'd be Git ones, not HG.  Unless Kitor was simply saying my code is too painful to work with :)  I'll also throw stuff over the fence into HG land if people want me to (but I don't want to use it all the time).

kitor

  • Contributor
  • Member
  • *****
  • Posts: 127
Re: DIGIC 7 development (200D/SL2, 800D/T7i, 77D, 6D2)
« Reply #258 on: July 31, 2019, 09:55:26 PM »
I thought about PR into unified which this is based on ;)
Obviously taking this as a new branch in ML repo is different story - and may encourage others to give it a try.

I really need to find some time and dig for stubs on R to try this. I hope for next month - depends mostly on how long will take me to migrate all stuff from server running in my closet to full-blown rack setup in my parents house ("just IT things")  :)
You know that you work on too many items at once when you have multiple kanban boards just for your own projects...
/ot
EOS R