Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Requirements (hard/software)

  • Compiling the BSP demo

  • Loading & running the demo

Requirements

N6Cam

Note

This info needs to be updated for N6Cam revB

...

Power

The N6Cam is powered through the USB-C connector on the IO board (3), providing a UVC stream.

...

To debug and flash new firmware you’ll need either one of the following:

...

#

Name (+Link)

Version

Notes

1Python

3.9+

2

STM32CubeIDE

1.17.0

32

STM32CubeN6

1.0.0

CubeIDE extension package

43

STM32CubeProg

2.18.0

Required for firmware signing

...

  • STM32 tools must be included on the system PATH:

    • STM32CubeIDE.
      By default: C:\ST\STM32CubeIDE_1.17.0

    • STM32CubeProgrammer.
      By default: C:\Program Files\STMicroelectronics\STM32Cube\STM32CubeProgrammer\bin 

Compiling the demo

Prepare environment

  1. Open a terminal in the sources root folder

  2. Create a virtual environment for development:

    Code Block
    languagebash
    python -m venv .venv
  3. Activate the environment:

    1. Linux:

      Code Block
      languagebash
      . .venv/bin/activate
    2. Windows:

      Code Block
      languagebash
      .venv\Scripts\activate.bat
  4. Install the module requirements:

    Code Block
    languagebash
    python -m pip install -U pip setuptools wheel -r requirements.txt

Compile using scripts

  1. Open a terminal in the sources root folder

  2. Activate the Python environment as shown in https://siana-systems.atlassian.net/wiki/spaces/N6Cam/pages/edit-v2/3919970305#Prepare-environment

  3. Build the binaries running:

    Code Block
    languagebash
    inv release-binaries
  4. The binaries should be available now in: <ROOT>\RELEASE\SIANA.N6Cam.BSP-Binaries-<VERSION>\Binaries

Compile using IDE

Code source

The following steps assume you have a copy of the N6Cam BSP sources release, which contents should look as follows:

...

This folder will be considered as <ROOT> for the following instructions.

Compiling the demo

Follow these steps to compile:

  1. Open STM32CubeIDE

  2. Go to File > Import...:

    image-20250107-184301.pngImage Removedimage-20250109-151804.pngImage Added
    1. (1) Select General > Existing Projects into Workspace

    2. (2) Click Next.

  3. Find and import the projects:

    image-20250107-184143.pngImage Removedimage-20250109-151644.pngImage Added
    1. (1) Click Select root directory

    2. (2) Browse for <ROOT>\N6Cam.BSP\STM32CubeIDEthe sources <ROOT> folder

    3. (3) Select all projects (FSBL, and Standalone)

    4. (4) Click Finish

  4. Once loaded, your project should look like this:

    image-20250107-184631.pngImage Removedimage-20250109-152006.pngImage Added
  5. Build both FSBL and Standalone using the Release “Release” profile

  6. The generated binaries can be located at:

    1. FSBL: <ROOT>\Sources\STM32CubeIDE\FSBL\Release\Siana.N6Cam.BSP.FSBL.hex

    2. Standalone: <ROOT>\Sources\STM32CubeIDE

    . Specifically:
    1. FSBL: FSBL\Release\Standalone\Release\Siana.N6Cam.BSP.Standalone.hex

Loading & running the demo

Signing binaries

You'll need to sign the binaries first to enable the N6Cam to run the application in operation mode. To achieve this you’ll need to:

  1. Create a “Binaries” folder on <ROOT>

  2. Open a terminal on <ROOT> and run the signing command on the compiled binaries:

    1. FSBL:

      Code Block
      languagebash
      STM32_SigningTool_CLI -bin Sources\STM32CubeIDE\FSBL\Release\Siana.N6Cam.BSP.FSBL.bin -nk -of 0x80000000 -t fsbl -o Binaries\Siana.N6Cam.BSP.FSBL.signed.bin -hv 2.3 Binaries\Siana.N6Cam.BSP.FSBL.signed.
      hex
      bin
    2. Standalone:

      Code Block
      languagebash
      STM32_SigningTool_CLI -bin Sources\STM32CubeIDE\Standalone\Release\Siana.N6Cam.BSP.Standalone.bin -nk -of 0x80000000 -t fsbl -o Binaries\Siana.N6Cam.BSP.Standalone.signed.bin -hv 2.3 Binaries\Siana.N6Cam.BSP.Standalone.signed.
      hex
      bin

Loading

...

binaries

With the N6Cam unpowered and STLink unplugged from your host machine.

  1. Set the N6Cam switch to development mode

  2. Plug the STDC14-STDC14 flat cable to connect the STLink and the N6Cam

  3. Plug the N6Cam and the STLink to your host machine

  4. Open the STM32CubeProgrammer (if closed):

    1. Configure the external loader:

      image-20250107-192753.png
      1. (1) Go to the “external “External loaders” tab

      2. (2) Search for STM32N6

      3. (3) Select the MX66UW1G45G loader

    2. Connect to the device:

      image-20250107-192848.png
      1. (1) Select ST“ST-Link LINK” from the dropdown menu

      2. (2) Configure the device as shown: Hot plug mode, with Software reset, for access port 1

      3. (3) ConnectClick “Connect”

    3. Flash Flashing the firmware:

      image-20250107-192941.pngImage Removedimage-20250109-172112.pngImage Added
      1. (1) Go to the “erase “Erasing & programming” Programming” tab

      2. (2) Browse for the images to be flashed, to be either:

      3. From script build: All are located in <ROOT>\RELEASE\SIANA.N6Cam.BSP-Binaries-<VERSION>\Binaries

        1. Model: SIANA.N6Cam.BSP-Standalone-<VERSION>_AI.Model_PeopleDetect.hex

        2. FSBL: SIANA.N6Cam.BSP-FSBL-<VERSION>.hex

        3. Standalone: SIANA.N6Cam.BSP-Standalone-<VERSION>.hex

      4. From IDE build:

        Model: <ROOT>\N6Cam.BSP

        the binaries and (3) configure the start address as follows:

        1. FSBL:

          1. Image: <ROOT>\Binaries\Siana.N6Cam.BSP.FSBL.signed.bin

          2. Address: 0x70000000

        2. Standalone:

          1. Image: <ROOT>\Binaries\Siana.N6Cam.BSP.Standalone.signed.bin

          2. Address: 0x70080000

      5. (4) Click “Start Programming”

    4. Flashing the AI model:

      image-20250109-172339.pngImage Added
      1. (1) Go to the “Erasing & Programming” tab

      2. (2) Browse for model binaries: <ROOT>\Sources\Model\network_data.hex

      3. FSBL: <ROOT>\N6Cam.BSP\STM32CubeIDE\FSBL\Release\Siana.N6Cam.BSP.FSBL.signed.hex

      4. Standalone: <ROOT>\N6Cam.BSP\STM32CubeIDE\Standalone\Release\Siana.N6Cam.BSP.Standalone.signed.hex

        Note: Since this is a hex file you don’t need to set the target address

      5. (3) Click “Start Programming”

  5. Disconnect both the N6Cam and the STLink

  6. Set the N6Cam to operation mode

Running the demo

These instructions assume you’ve loaded the binaries to the device and the N6Cam is in operation mode.

  1. Connect the N6Cam to the host machine

  2. Open the viewer tool included in <ROOT>\Tools. Binaries for both Windows and Linux are included

If the flashing process is OK, the N6Cam will be recognized as a UVC device by the host . Use the N6Cam Viewer application to visualize and the viewer will be able to read the stream:

...

In the image:

  1. N6Cam being detected as a camera device on Windows

  2. N6CamViewer is streaming video from the device. The image shows a single detection from the people-detect model