|
3 | 3 | Bootloader
|
4 | 4 | ==========
|
5 | 5 |
|
6 |
| -DepthAI bootloader is a small program which **handles the booting process**, either by **booting the flashed application**, |
7 |
| -or by **initializing the OAK PoE camera** so DepthAI API can connect to it. |
| 6 | +DepthAI bootloader is a small program which handles the booting process, either by **booting the flashed application** (see :ref:`Standalone mode`), |
| 7 | +or by **initializing the OAK PoE camera** so DepthAI API can connect to it. OAK PoE cameras already come with bootloader flashed at the factory. |
8 | 8 |
|
9 |
| -To be able to run in :ref:`Standalone mode`, the Depthai bootloader must be first flashed to the devices flash. |
10 |
| -This step is required only once. |
11 |
| - |
12 |
| -Once the device has the bootloader flashed, it will perform the same as before. Running pipelines with a host |
13 |
| -connected doesn't require any changes. |
14 |
| - |
15 |
| -Suggested workflow is to perform as much of development as possible with the host connected as the |
16 |
| -iteration cycle is greatly improved. |
| 9 | +Bootloader is part of the ``depthai`` library, so to eg. flash the newest bootloader, you should use the newest ``depthai`` library. |
17 | 10 |
|
18 | 11 | Device Manager
|
19 | 12 | ##############
|
20 | 13 |
|
21 |
| -``device_manager.py`` is a Python helper that interfaces with device :ref:`Bootloader` and bootloader configuration. |
| 14 | +``device_manager.py`` is a Python script that interfaces with device :ref:`Bootloader` and bootloader configuration. |
22 | 15 | It can be found at `depthai-python/utilities <https://github.com/luxonis/depthai-python/tree/main/utilities>`__.
|
23 | 16 |
|
24 |
| -.. image:: https://user-images.githubusercontent.com/18037362/171629704-0f78f31a-1778-4338-8ac0-bdfb0d2d593f.png |
| 17 | +.. image:: https://github.com/luxonis/depthai-python/assets/18037362/b2f067d8-8b4b-4158-9342-ea0dfbe0caf6 |
25 | 18 |
|
26 |
| -Device Manager Usage |
27 |
| --------------------- |
| 19 | +About Device |
| 20 | +------------ |
28 | 21 |
|
29 |
| -**About device tab** - Select a camera to see its metadata - like MxID, flashed bootloader version, device state etc. |
| 22 | +Allows you to select the device you want to connect to, and you see metadata of connected device. |
30 | 23 |
|
31 | 24 | * First we have to select the device we want to connect (boot) to, you can select that using:
|
32 | 25 |
|
33 | 26 | * **Dropdown** which contains found device MX Ids. Dropdown will only get updated when starting the app.
|
34 | 27 | * **Specify IP** button if your OAK PoE camera isn't in the same LAN.
|
35 | 28 | * **Search** feature - a new window will show that has a table with all available cameras (either via USB port or on LAN - OAK PoEs), their MxId, name, and status. Clicking on a table row will select that device and boot to it.
|
36 |
| -* ``Flash newest Bootloader`` button will flash the ``newest bootloader`` to the device. You can select AUTO, USB or NETWORK bootloader. |
37 | 29 |
|
38 |
| - * **AUTO** will select the connection type of bootloader with which the camera is currently connected to. If you are connected via USB (doing factory reset) to an OAK PoE camera, you shouldn't select AUTO, as it will flash USB bootloader. |
39 |
| - * **USB** bootloader will try to boot the application that is stored on flash memory. If it can't find flashed application, it will just behave as normal USB OAK - so it will wait until a host computer initializes the application. |
40 |
| - * **NETWORK** bootloader is used by the OAK PoE cameras, and is flashed at the factory. It handles network initialization so the OAK PoE cameras can be booted through the LAN. |
41 |
| -* ``Factory reset`` will erase the whole flash content and re-flash it with only the USB or NETWORK bootloader. Flashed application (pipeline, assets) and bootloader configurations will be lost. |
42 |
| -* ``Boot into USB recovery mode`` will force eg. OAK PoE camera to be available through the USB connector, even if its boot pins are set to PoE booting. It is mostly used by our firmware developers. |
| 30 | +Configuration settings |
| 31 | +---------------------- |
43 | 32 |
|
44 |
| -**Configuration settings tab** - After you select a device that has bootloader flashed, you can also configure bootloader |
45 |
| -configuration. |
| 33 | +After you select a device that has bootloader flashed, you can also configure bootloader configuration. |
46 | 34 |
|
47 | 35 | - If the device has **NETWORK bootloader flashed**, you will be able to set its static/dynamic IP/mask/gateway, DNS, MAC, etc.
|
48 | 36 | - If the device has **USB bootloader flashed**, you will be able to set its USB max speed and USB timeout.
|
49 | 37 |
|
50 |
| -After setting some values, you have to click on the ``Flash configuration`` button. You can also flash a :ref:`DAP`, |
51 |
| -or clear the bootloader config. |
| 38 | +After setting some values, you have to click on the ``Flash configuration`` button. You can also ``Clear configuration``, or ``View configuration`` (its JSON). |
| 39 | + |
| 40 | +.. figure:: https://github.com/luxonis/depthai-python/assets/18037362/4bced0ab-92fa-4a73-986f-4a3ba8848940 |
| 41 | + |
| 42 | + When flashing static IP, make sure to also set the gateway/mask |
| 43 | + |
| 44 | +Applications settings |
| 45 | +--------------------- |
| 46 | + |
| 47 | +Useful when dealing with :ref:`Standalone mode` applications. |
| 48 | + |
| 49 | +- **Flash application**: Select DepthAI Application Package (``.dap``) you want to flash the device. Below is a code snippet that showcases how to create the dap file. |
| 50 | +- **Remove application**: Removes/clears the flashed application from the device |
| 51 | +- **Open device streaming application**: Starts streaming frames from all connected cameras on the device. |
| 52 | + |
| 53 | +.. code-block:: python |
| 54 | +
|
| 55 | + import depthai as dai |
| 56 | + pipeline = dai.Pipeline() |
| 57 | + # ... add nodes to pipeline |
| 58 | + dai.DeviceBootloader.saveDepthaiApplicationPackage( |
| 59 | + './file.dap', # Where to save the .dap file |
| 60 | + pipeline, # My pipeline |
| 61 | + compress=True, # Compress the FW and assets. In my case, it went from 24MB -> 9.5MB |
| 62 | + applicationName='myAppName' # Optional, so you know which app is flashed afterwards |
| 63 | + ) |
| 64 | +
|
| 65 | +Danger Zone |
| 66 | +----------- |
| 67 | + |
| 68 | +.. warning:: |
| 69 | + |
| 70 | + This section can potentially soft-brick your device, so be careful when using it. |
| 71 | + |
| 72 | +To prevent soft-bricking, OAK devices (since 2023) have factory bootloader and user bootloader. If user flashes a corrupted user bootloader, it will fallback to using factory bootloader. When updating bootloader, |
| 73 | +Device Manager will try to flash the user bootloader first, if flashed (factory) bootloader supports it. If it's not possible, it will flash the factory bootloader. |
| 74 | + |
| 75 | +* **Update Bootloader** button will flash the newest bootloader to the device. You can select AUTO, USB or NETWORK bootloader. |
| 76 | + |
| 77 | + * AUTO will select the connection type of bootloader with which the camera is currently connected to. If you are connected via USB (doing factory reset) to an OAK PoE camera, you shouldn't select AUTO, as it will flash USB bootloader. |
| 78 | + * USB bootloader will try to boot the application that is stored on flash memory. If it can't find flashed application, it will just behave as normal USB OAK - so it will wait until a host computer initializes the application. |
| 79 | + * NETWORK bootloader is used by the OAK PoE cameras, and is flashed at the factory. It handles network initialization so the OAK PoE cameras can be booted through the LAN. |
| 80 | +* **Flash Factory Bootloader**: If you want to flash the factory bootloader, you can use this button. It will flash the factory bootloader, even if the user bootloader is already flashed. |
| 81 | +* **Factory reset** will erase the whole flash content and re-flash it with only the USB or NETWORK bootloader. Flashed application (pipeline, assets) and bootloader configurations will be lost. |
| 82 | +* **Boot into USB recovery mode** will force eg. OAK PoE camera to be available through the USB connector, even if its boot pins are set to PoE booting. It is mostly used by our firmware developers. |
52 | 83 |
|
53 | 84 | Boot switches
|
54 | 85 | #############
|
|
0 commit comments