camera: try to defer init of video objects#195
Conversation
47651c1 to
6cb0382
Compare
6cb0382 to
1af120d
Compare
|
Just incorporated this change inorder to test with the changes I am making to the ov7670.75 zephyr driver (see the pr) and it seems to working no issues so far. I think I personally prefer doing it this way for a couple of reasons. Primary of which is that if there are any errors in the init function you have a better chance of seeing them when using the core vs having to keep compiling and testing directly in zephyr and then retest with the IDE. the other reason as you said is that you are only starting the camera if you are actually using the camera. Fingers crossed that this change gets incorporated. |
1af120d to
560cd81
Compare
848982b to
bcaca7f
Compare
69633de to
74f9721
Compare
74f9721 to
3efb1a1
Compare
|
@mjs513 Wondering if this will ever be reviewed, or maybe I should go ahead and close it out? Personally I like the idea that the camera object is only initialized if/when a sketch uses the camera library. So for example Let alone it also enables you to use the Portenta H7 with cameras. But just in case I just rebased it to the latest sources |
@KurtE |
d543705 to
add231c
Compare
add231c to
4c4cf0f
Compare
ea6fea0 to
2da8d27
Compare
ede4e5b to
93bc846
Compare
1a2df38 to
2f1f5ae
Compare
2f1f5ae to
fe518e9
Compare
fe518e9 to
4c0cd49
Compare
|
Wondering if I should go ahead and close this out... I don't believe that Camera support is currently a priority. One can always revise it later. Likewise maybe let my Zephyr Camera PRs lapse as well. Including: zephyrproject-rtos/zephyr#98004 for Snapshot mode, I have already received warning that |
f3a7fd9 to
311c584
Compare
311c584 to
4a3d6f0
Compare
4a3d6f0 to
2c894be
Compare
|
Updated to latest stuff, I am guessing it probably won't go anywhere as it is 6 months old without any reviews. |
450d505 to
32be213
Compare
Built
|
| Artifact | Board | Core | Tests | RAM | Sketches | Warnings | Errors |
|---|---|---|---|---|---|---|---|
✅ zephyr_contrib |
ek_ra8d1
| 📗 | ✅ |
11.9% |
2 | - | - |
frdm_mcxn947
| 6 🏷️ | ✅ |
58.0% |
2 | - | - | |
frdm_rw612
| 2 🏷️ | ✅ |
83.0% |
2 | - | - | |
✔️* zephyr_main |
giga
| 4 🏷️ | ✅* |
54.6% |
50 | 12 | - |
nano33ble
| 1 🏷️ | ✅* |
78.8% |
28 | 10 | - | |
nano_matter
| 📗 | ✔️* |
|
20 | 8 | (2*) | |
nicla_vision
| 4 🏷️ | ✔️* |
56.9% |
42 | 8 | (6*) | |
niclasense
| 2 🏷️ | ✅* |
|
26 | 10 | - | |
opta
| 4 🏷️ | ✅* |
56.5% |
60 | 26 | - | |
portentac33
| 3 🏷️ | ✔️* |
|
56 | 26 | (8*) | |
portentah7
| 3 🏷️ | ✅* |
57.1% |
64 | 26 | - | |
✅* zephyr_unoq |
unoq
| 📗 | ✅* |
26.4% |
68 | 8 | - |
Legend
Board Test Status description 🔥 🔥 Test run failed to complete. ❌ 🔴 Test completed with unexpected errors. ✔️* 🚫 Test completed with errors, but all are known/expected. ✅* 🟡 Test completed with some warnings; no errors detected. ✅ 🟢 Test passed successfully, with no warnings or errors. 🌑 🌑 Test was skipped.
4511d20 to
d7847ab
Compare
Built
|
| Artifact | Board | Core | Tests | RAM | Sketches | Warnings | Errors |
|---|---|---|---|---|---|---|---|
✅ zephyr_contrib |
ek_ra8d1
| 📗 | ✅ |
11.9% |
2 | - | - |
frdm_mcxn947
| 6 🏷️ | ✅ |
58.0% |
2 | - | - | |
frdm_rw612
| 2 🏷️ | ✅ |
83.0% |
2 | - | - | |
✔️* zephyr_main |
giga
| 4 🏷️ | ✅* |
54.6% |
56 | 12 | - |
nano33ble
| 1 🏷️ | ✅* |
78.8% |
28 | 10 | - | |
nano_matter
| 📗 | ✔️* |
|
20 | 8 | (2*) | |
nicla_vision
| 4 🏷️ | ✔️* |
56.9% |
50 | 12 | (10*) | |
niclasense
| 2 🏷️ | ✅* |
|
26 | 10 | - | |
opta
| 4 🏷️ | ✅* |
56.5% |
60 | 26 | - | |
portentac33
| 3 🏷️ | ✔️* |
|
62 | 26 | (8*) | |
portentah7
| 3 🏷️ | ✅* |
57.2% |
62 | 22 | - | |
✅* zephyr_unoq |
unoq
| 📗 | ✅* |
26.4% |
74 | 8 | - |
Legend
Board Test Status description 🔥 🔥 Test run failed to complete. ❌ 🔴 Test completed with unexpected errors. ✔️* 🚫 Test completed with errors, but all are known/expected. ✅* 🟡 Test completed with some warnings; no errors detected. ✅ 🟢 Test passed successfully, with no warnings or errors. 🌑 🌑 Test was skipped.
d7847ab to
49bee91
Compare
Built
|
| Artifact | Board | Core | Tests | RAM | Sketches | Warnings | Errors |
|---|---|---|---|---|---|---|---|
✅ zephyr_contrib |
ek_ra8d1
| 📗 | ✅ |
11.9% |
2 | - | - |
frdm_mcxn947
| 6 🏷️ | ✅ |
58.0% |
2 | - | - | |
frdm_rw612
| 1 🏷️ | ✅ |
83.0% |
2 | - | - | |
✔️* zephyr_main |
giga
| 4 🏷️ | ✅* |
54.6% |
56 | 12 | - |
nano33ble
| 1 🏷️ | ✅* |
78.8% |
28 | 10 | - | |
nano_matter
| 📗 | ✔️* |
|
20 | 8 | (2*) | |
nicla_vision
| 4 🏷️ | ✔️* |
56.9% |
50 | 12 | (10*) | |
niclasense
| 2 🏷️ | ✅* |
|
26 | 10 | - | |
opta
| 4 🏷️ | ✅* |
56.5% |
60 | 26 | - | |
portentac33
| 3 🏷️ | ✔️* |
|
62 | 26 | (8*) | |
portentah7
| 3 🏷️ | ✅* |
57.2% |
70 | 26 | - | |
✅* zephyr_unoq |
unoq
| 📗 | ✅* |
26.9% |
74 | 8 | - |
Legend
Board Test Status description 🔥 🔥 Test run failed to complete. ❌ 🔴 Test completed with unexpected errors. ✔️* 🚫 Test completed with errors, but all are known/expected. ✅* 🟡 Test completed with some warnings; no errors detected. ✅ 🟢 Test passed successfully, with no warnings or errors. 🌑 🌑 Test was skipped.
This change, removes the automatic starting of the PWM clock on the GIGA, at startup. Instead it starts the clock if/when the sketch calls the Camera::begin method. But to make this work, we also need to not start up the video objects, until after the MCLK has been started. We can do that with marking them as zephyr,deferred-init
49bee91 to
a1183fd
Compare
Built
|
| Artifact | Board | Core | Tests | RAM | Sketches | Warnings | Errors |
|---|---|---|---|---|---|---|---|
✅ zephyr_contrib |
ek_ra8d1
| 📗 | ✅ |
11.9% |
2 | - | - |
frdm_mcxn947
| 6 🏷️ | ✅ |
58.0% |
2 | - | - | |
frdm_rw612
| 2 🏷️ | ✅ |
83.0% |
2 | - | - | |
✔️* zephyr_main |
giga
| 4 🏷️ | ✅* |
54.6% |
56 | 20 | - |
nano33ble
| 1 🏷️ | ✅* |
78.8% |
28 | 10 | - | |
nano_matter
| 📗 | ✔️* |
|
20 | 8 | (2*) | |
nicla_vision
| 4 🏷️ | ✔️* |
56.9% |
50 | 12 | (10*) | |
niclasense
| 2 🏷️ | ✅* |
|
26 | 10 | - | |
opta
| 4 🏷️ | ✅* |
56.5% |
60 | 34 | - | |
portentac33
| 3 🏷️ | ✔️* |
|
62 | 26 | (8*) | |
portentah7
| 3 🏷️ | ✅* |
57.2% |
70 | 34 | - | |
✅* zephyr_unoq |
unoq
| 📗 | ✅* |
26.9% |
74 | 8 | - |
Legend
Board Test Status description 🔥 🔥 Test run failed to complete. ❌ 🔴 Test completed with unexpected errors. ✔️* 🚫 Test completed with errors, but all are known/expected. ✅* 🟡 Test completed with some warnings; no errors detected. ✅ 🟢 Test passed successfully, with no warnings or errors. 🌑 🌑 Test was skipped.
|
Memory usage change @ a1183fd
Click for full report table
Click for full report CSV |
This change, removes the automatic starting of the PWM clock on the GIGA, at startup. Instead it starts the clock if/when the sketch calls the Camera::begin method.
But to make this work, we also need to not start up the video objects, until after the MCLK has been started. We can do that with marking them as zephyr,deferred-init
This is to me a better solution to adding Portenta H7 than #184 as again this
only starts up (uses) the video resources IF you actually use them in your sketch.
Some of this is discussed in the Arduino discussion: zephyrproject-rtos/zephyr#93058 (reply in thread)