reboot() problem - page 2 - General Discussion and Assistance - CHDK Forum supplierdeeply

reboot() problem

  • 43 Replies
  • 7188 Views
*

Offline timgor

  • ***
  • 150
Re: reboot() problem
« Reply #10 on: 25 / November / 2014, 10:25:37 »
Advertisements
Quote
Are you completely rebuilding all modules and everything else?
I use smart svn and i just change make options.
probably I need to svn it to a separate folder and compile it from scratch. Thanks for reminding me about it.

*

Offline timgor

  • ***
  • 150
Re: reboot() problem
« Reply #11 on: 25 / November / 2014, 22:34:09 »
It looks like reboot() works. There is another problem with motion detection function.
This function may crash only first time after start. The crash is irregular and happens rarely. If it didn't crash - it works unlimited number of times in a loop.
...
repeat 
md_detect_motion( ....)
...

Re: reboot() problem
« Reply #12 on: 25 / November / 2014, 22:49:14 »
There is another problem with motion detection function. This function may crash only first time after start. The crash is irregular and happens rarely. If it didn't crash - it works unlimited number of times in a loop.
No idea why this would happen.  But tell us more about the conditions under which the first start occurs?  Only after a reboot()?  Post some script code please?
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline philmoz

  • *****
  • 3140
    • Photos
Re: reboot() problem
« Reply #13 on: 25 / November / 2014, 23:19:17 »
It looks like reboot() works. There is another problem with motion detection function.
This function may crash only first time after start. The crash is irregular and happens rarely. If it didn't crash - it works unlimited number of times in a loop.
...
repeat 
md_detect_motion( ....)
...

In order to debug this sort of crash it would help to have the following:
- core/main.bin.dump from the build you are running
- modules/mdetect.flt.dump from the build (I'm assuming it's probably crashing in the motion detect module)
- MODULES.LOG from the SD card after the crash.

To get the module dump files (modules/xxx.flt.dump) you need to modify modules/Makefile and rebuild. Uncomment lines 39 & 40 and comment out line 41.

To get the MODULES.LOG file you need to enable logging in the CHDK modules menu. This file will give the load address of the module in memory so it can be matched to the stack trace.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)


*

Offline timgor

  • ***
  • 150
Re: reboot() problem
« Reply #14 on: 26 / November / 2014, 10:26:25 »
Quote
To get the module dump files (modules/xxx.flt.dump) you need to modify modules/Makefile and rebuild. Uncomment lines 39 & 40 and comment out line 41.
Do I need to run my camera and make the crash again after that or I just need to rebuild and get modules/xxx.flt.dump?

Quote
- MODULES.LOG from the SD card after the crash.
I'll dump MODULES.LOG today later
Would it help if I insert flags in the C code of motion detector module and say where it happens exactly in the C code?
« Last Edit: 26 / November / 2014, 12:16:34 by timgor »

*

Offline philmoz

  • *****
  • 3140
    • Photos
Re: reboot() problem
« Reply #15 on: 26 / November / 2014, 13:46:37 »
Quote
To get the module dump files (modules/xxx.flt.dump) you need to modify modules/Makefile and rebuild. Uncomment lines 39 & 40 and comment out line 41.
Do I need to run my camera and make the crash again after that or I just need to rebuild and get modules/xxx.flt.dump?

You need to run until it crashes so that the MODULES.LOG contains the correct address where the module is loaded. You should also dump the ROMLOG.LOG again after the crash - if it is crashing in the module then it may have loaded at a different address from the previous log so the addresses in the stack trace may be different.

When logging is enabled it appends to this file, so the last entries in the file will correspond to the crash.

Quote
Quote
- MODULES.LOG from the SD card after the crash.
I'll dump MODULES.LOG today later
Would it help if I insert flags in the C code of motion detector module and say where it happens exactly in the C code?

Probably not. The stack trace in the ROMLOG.LOG file should contain the address where it crashed.
If this is in the core CHDK then we can find it in main.bin.dump and see what function crashed.
If it is in the loaded module then we can find it in module dump using the load address from MODULES.LOG.

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)

*

Offline timgor

  • ***
  • 150
Re: reboot() problem
« Reply #16 on: 26 / November / 2014, 22:51:57 »
I have reproduced a new crash and got the corresponding files.

*

Offline timgor

  • ***
  • 150
Re: reboot() problem
« Reply #17 on: 26 / November / 2014, 22:52:39 »
All other compiled files are in this archive.


*

Offline philmoz

  • *****
  • 3140
    • Photos
Re: reboot() problem
« Reply #18 on: 26 / November / 2014, 23:02:26 »
All other compiled files are in this archive.

The CHDK.rar file looks like the contents of the SD card.

The main.bin.dump and module dump files are not installed on the SD card, they need to be copied from your build machine (from the core and modules directories).

Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)

*

Offline timgor

  • ***
  • 150
Re: reboot() problem
« Reply #19 on: 27 / November / 2014, 12:14:59 »
Ups... I attached all needed modules now.

 

Related Topics