ArduCAM/MIPI_Camera

RPi 4b 32bit: gpio -g mode 28 in --> crash

hstarmans opened this issue · 1 comments

The script camera_i2c crashes on the following lines with a Raspberry pi 4B 8 GB

gpio -g mode 28 in
gpio -g mode 29 in

Basically, one is not allowed to touch these pins. I have fixed this by downloading and patching wiringpi.c in WiringPi

void pinMode (int pin, int mode)                                                                                     
 {
      int    fSel, shift, alt ;
      struct wiringPiNodeStruct *node = wiringPiNodes ;
      int origPin = pin ;
      if ((pin == 28) | (pin == 29)){ 
                         return ;      
      }
# code continues

Another fix would be to not make calls to pin 28 and 29 in libarducam_mipicamera.so or pull these out of the driver.
So a user can block these calls.

Note after the fix, I have the following output for arducamstill -?

Open camera...
Found sensor ov2311 at address 60
mode: 0, width: 1600, height: 1300, pixelformat: GREY, desc: (null)
mode: 1, width: 1600, height: 1300, pixelformat: BA81, desc: (null)
# output continues with all other modes etc.. 

It might be fixed with new binary, I still think the IC2 detect script will fail. Closing this for now