My preliminary results are folowing:I tested a3400is camera and I used a3400-101a-1.1.0 version.1. I did test of motion.lua script for 4-5 times and camera shut-down every time after about 3 hours of work.2. I relapced md_detect_motion() function by sleep(300000) and it started to work "forever" so the problem is in the md_detect_motion function.3. the ROMLOG.LOG file has the following content:
#define LED_PR 0xC0220120 //check this address// To do: Check this!!// A3400IS has two 'lights' - Power LED, and AF assist lamp// Power Led = first entry in table (led 0) ???// AF Assist Lamp = second entry in table (led 1) ????void camera_set_led(int led, int state, int bright) { return; static char led_table[2]={0,4}; if(state<=1) _LEDDrive(led_table[led%sizeof(led_table)], state);}
I have completed few tests with the new compiled version from reyalp.I have attached the error files.Also, I have tried my own compiled code with print("flag") lines within md_detect_motion function and every time it prints the last flag just before "return" statement so it looks like no crash happens within this function.I would appreciate if reyalp will look for the bug.
71740,LD,03c48b68,lua.flt 96990,LD,03c6a958,mdetect.flt (assuming the second load based on time)0x3c48b68 + 0x24 = 0x3c48b8c0x3c6a958 + 0x24 = 0x3c6a97carm-elf-objdump -d -r -x --adjust-vma=0x3c48b8c lua.elf > lua.0x3c48b8c.objdumparm-elf-objdump -d -r -x --adjust-vma=0x3c6a97c mdetect.elf > mdetect.0x3c6a97c.objdump
R0 0x0000006CR1 0xB2D6FE98R2 0x00000001R3 0x00000000R4 0x00000000R5 0x03C6B4E4R6 0xB2D6FE98R7 0xB2D6FE98R8 0x19980218R9 0x19980218R10 0x19980218R11 0x19980218R13 0x00000162SP 0x00308AACLR 0x03C6AFA3PC 0x03C6AFC2SPR 0x60000033
03c6ae00 <md_detect_motion>:...3c6afc2: 7878 ldrb r0, [r7, #1]
1. Should I uncomment all comments from gui_draw_debug_vals_osd() or just part of it?
sprintf(osd_buf, "FB: %8u", focus_busy); draw_txt_string(28, 10, osd_buf, conf.osd_color);
sprintf(osd_buf, "FB: %8x", vid_get_viewport_live_fb()); draw_txt_string(28, 10, osd_buf, conf.osd_color);
2. What will be advantage of printing? camera will shut down after the error happens and I will not see anything after that.
DEF(viewport_buffers ,0xffb2f90c) // Found @0xff849c00DEF(active_viewport_buffer ,0x000020bc) // Found @0xff849968
3. What to do with that after all? Hot to correct mistake with a wrong return address?
4. Does it correlate with nafraf notice about #define LED_PR 0xC0220120 //check this address parameter?
unsigned char* img = vid_get_viewport_live_fb(); if(img==NULL) { img = vid_get_viewport_fb(); }
unsigned char* img = vid_get_viewport_fb();
It didn't change anything. Camera works as well as before and shut-down in a few hours.It looks like the problem is not in vid_get_viewport_live_fb. Do you have ideas what to to next to debug it?
I'm close to give up with this code
1. the C function luaCB_md_detect_motion( lua_State* L ) represents lua script function md_detect_motion( a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p). Right? When I print flags from luaCB_md_detect_motion it shows me after crush that the function has been successfully passed from the beginning to the end (return lua_yield(L, 0)) so it looks like the crush happens outside of md_detect_motion. Is that right?
2. If I developed C++ code for PC then it would mean for me "Memory leak" with 90% of probability. Can we interpolate PC experience to camera?
3. There is a notice about LED address (#define LED_PR 0xC0220120 //check this address) from nafrat but this parameters is not involved into the motion.lua program. Does that mean that the problem is not in the parameter?
6. Would it help to clean the cache every time the script is finished and started again?
Started by moyix General Help and Assistance on using CHDK stable releases
Started by evershade Script Writing
Started by Gun Jam General Help and Assistance on using CHDK stable releases
Started by TimeScience Hotwire! Hardware Mods, Accessories and Insights
Started by ant_thomas General Discussion and Assistance