This page details how to compilecompiling, loadloading, and run running the N6Cam BSP.
Table of Contents
Table of Contents |
---|
...
References
...
Requirements (hard/software)
Compiling the BSP demo
Loading & running the demo
Requirements
N6Cam
...
Power
The N6Cam is powered through the USB-C connector on the IO board (3), providing a UVC stream.
Debug
The debug connector (2) provides a standard STDC14 interface to plug a debugger.
Boot Mode
The boot selector switch (1) selects the board's operating mode. Facing the N6Cam from the front (camera):
...
Switch to the left: Development mode.
...
...
Hardware Tools
To debug and flash new firmware you’ll need either one of the following:
1 x STLink-V3 programmer, or…
2 x STLink-V3MINIE programmer
Note:
Both options include the STDC14-STDC14 flat cable used to program the N6Cam.
...
Toolchain
# | Name (+Link) | Version | Notes | |||
---|---|---|---|---|---|---|
1 | 3.9+ | 2 | 1.17.0 | |||
32 | 1.0.0 | CubeIDE extension package | ||||
43 | 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
Open a terminal in the sources root folder
Create a virtual environment for development:
Code Block language bash python -m venv .venv
Activate the environment:
Linux:
Code Block language bash . .venv/bin/activate
Windows:
Code Block language bash .venv\Scripts\activate.bat
Install the module requirements:
Code Block language bash python -m pip install -U pip setuptools wheel -r requirements.txt
Compile using scripts
Open a terminal in the sources root folder
Activate the Python environment as shown in https://siana-systems.atlassian.net/wiki/spaces/N6Cam/pages/edit-v2/3919970305#Prepare-environment
Build the binaries running:
Code Block language bash inv release-binaries
The binaries should be available now in:
<ROOT>\RELEASE\SIANA.N6Cam.BSP-Binaries-<VERSION>\Binaries
Compile using IDE
...
Add the above paths to your system environment variables.
BSP Source
Info |
---|
The BSP source is available from the Board Support Packages (BSP) |
The following steps assume that you have unzipped the N6Cam BSP source package, which looks like:
...
This working folder will be considered as <ROOT>
in the following instructions.
Compiling the BSP
Follow these steps to compile:
Open the STM32CubeIDE
Go to
File > Import...
:(1) Select
General > Existing Projects into Workspace
(2) Click Next.
Find and import the projects:
(1) Click
Select root directory
(2) Browse for
<ROOT>\N6Cam.BSP\STM32CubeIDE
the sources<ROOT>
folder(3) Select all projects (FSBL, and Standalone)
(4) Click Finish
Once loaded, your project should look like this:
Build both FSBL and Standalone using the Release “Release” profile
The generated binaries can be located at:
FSBL:
<ROOT>\Sources\STM32CubeIDE\FSBL\Release\Siana.N6Cam.BSP.FSBL.hex
Standalone:
<ROOT>\Sources\STM32CubeIDE
FSBL:
FSBL\Release\Standalone\Release\Siana.N6Cam.BSP.Standalone.hex
Loading & running the demo
The BSP comes with the demo that is preloaded when you purchased the N6Cam. This demo consists of a people-detector model and a vider streamer over USB, see the Intro (unboxing).
Signing binaries
Before loading the application to the N6Cam, you must sign the binaries. To achieve this you’ll need to:
Create a “Binaries” folder on
<ROOT>
Open a terminal on
<ROOT>
and run the signing command on the compiled binaries:FSBL:
hexStandalone: Standalone\ReleaseCode Block language bash 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.bin
Standalone:
hexCode Block language bash 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.bin
Loading binaries
With the N6Cam unpowered and STLink unplugged from your host machine.
Set the N6Cam switch to development mode
Plug the STDC14-STDC14 flat cable to connect the STLink and the N6Cam
Plug the N6Cam and the STLink to your host machine
Open the STM32CubeProgrammer (if closed):
Configure the external loader:
(1) Go to the “external “External loaders” tab
(2) Search for
STM32N6
(3) Select the
MX66UW1G45G
loader
Connect to the device:
(1) Select ST“ST-Link LINK” from the dropdown menu
(2) Configure the device as shown:
Hot plug
mode, withSoftware reset
, for access port1
(3) ConnectClick “Connect”
Flash Flashing the firmware:
(1) Go to the “erase “Erasing & programming” Programming” tab
(2) Browse for the images to be flashed, to be either:
From script build: All are located in
<ROOT>\RELEASE\SIANA.N6Cam.BSP-Binaries-<VERSION>\Binaries
Model:
SIANA.N6Cam.BSP-Standalone-<VERSION>_AI.Model_PeopleDetect.hex
FSBL:
SIANA.N6Cam.BSP-FSBL-<VERSION>.hex
Standalone:
SIANA.N6Cam.BSP-Standalone-<VERSION>.hex
FSBL:
Image:
<ROOT>\Binaries\Siana.N6Cam.BSP.FSBL.signed.bin
Address:
0x70000000
Standalone:
Image:
<ROOT>\Binaries\Siana.N6Cam.BSP.Standalone.signed.bin
Address:
0x70080000
From IDE build:
Model: <ROOT>\N6Cam.BSPbinaries and (3) configure the start address as follows:
(4) Click “Start Programming”
Flashing the AI model:
(1) Go to the “Erasing & Programming” tab
(2) Browse for model binaries:
<ROOT>\Sources\Model\network_data.hex
FSBL:
<ROOT>\N6Cam.BSP\STM32CubeIDE\FSBL\Release\Siana.N6Cam.BSP.FSBL.signed.hex
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
(3) Click “Start Programming”
Disconnect both the N6Cam and the STLink from the host machine
Set the N6Cam to operation mode
Connect the N6Cam to the host machine
...
Running the demo
Follow the steps in https://siana-systems.atlassian.net/wiki/spaces/N6Cam/pages/3919937537/Intro+unboxing#Running-the-demo