- 
                Notifications
    You must be signed in to change notification settings 
- Fork 8.2k
drivers: video: ov7670: update the camera init sequence #91760
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
drivers: video: ov7670: update the camera init sequence #91760
Conversation
| This PR is meant to fix nxp-mcuxpresso/mcuxsdk-core#3 | 
The previous initialization sequence fails to configure the module properly. Update the sequence using the code provided by vendor. The update is verified using the FRDM-MCXN947 SmartDMA camera case under samples/drivers/video/capture. Signed-off-by: Kate Wang <[email protected]>
6b3a275    to
    07b1bb2      
    Compare
  
    | 
 | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| @KATE-WANG-NXP Thank you very much for helping fixing this (and @josuah for the test). | 
| if fails at my board  | 
| Hi @KATE-WANG-NXP , could you please check the error @hakehuang mentioned? thanks. | 
| It fails right at pritnting controls ... maybe address2line would help to debug ?. I don't have a valid mcxn947 board now to test unfortunately | 
| Hi all. My toolchain info: └─▶ west build -b frdm_mcxn947/mcxn947/cpu0 --shield dvp_20pin_ov7670 -p
-- west build: generating a build system
Loading Zephyr default modules (Zephyr base).
-- Application: /home/marin/code/zephyrproject/zephyr/samples/subsys/usb/uvc
-- CMake version: 4.0.3-dirty
-- Found Python3: /home/marin/code/zephyrproject/.venv/bin/python3 (found suitable version "3.13.3", minimum required is "3.12") found components: Interpreter
-- Cache files will be written to: /home/marin/.cache/zephyr
-- Zephyr version: 4.1.99 (/home/marin/code/zephyrproject/zephyr)
-- Found west (found suitable version "1.3.0", minimum required is "0.14.0")
-- Board: frdm_mcxn947, qualifiers: mcxn947/cpu0
-- Shield(s): dvp_20pin_ov7670
-- ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK
-- Found host-tools: zephyr 0.17.0 (/home/marin/.local/share/zephyr-sdk/zephyr-sdk-0.17.0)
-- Found toolchain: zephyr 0.17.0 (/home/marin/.local/share/zephyr-sdk/zephyr-sdk-0.17.0)
-- Found Dtc: /home/marin/.local/share/zephyr-sdk/zephyr-sdk-0.17.0/sysroots/x86_64-pokysdk-linux/usr/bin/dtc (found suitable version "1.6.0", minimum required is "1.4.6")I've built sample with different log variants and they all exhibit different behavior. I've recorded logs from serial for all variants. Access to video device is done using  Deferred loggingBuilt with  Due to deferred logging lot of messages is being dropped. I've recorded couple of runs trying to catch fault and it USAGE FAULT is escalated in main thread. Two warning messages are always present Usage fault snippet from deferred logsImmediate loggingBuilt with  This variant triggers stack overflow, again in main thread. Usage fault snippet from immediate logsMinimal loggingBuilt with  This variant keeps running even though same warning messages are present as with deferred logging. Usage fault snippet from minimal logs | 
| Thank you for the tests @marinjurjevic! I opened that issue for following-up on this: It seems related to timing more than the OV7670 but did not dive in-depth. | 




The previous initialization sequence fails to configure the module properly. Update the sequence using the code provided by vendor. The update is verified using the FRDM-MCXN947 SmartDMA camera case under samples/drivers/video/capture using command:
west build -b frdm_mcxn947/mcxn947/cpu0 samples/drivers/video/capture -DCONFIG_DEBUG_OPTIMIZATIONS=y -d n947_camera -DSHIELD="lcd_par_s035_8080;dvp_20pin_ov7670"