Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Alif/AppKit-E7_USB/Board/Corstone-300/vsi/python/arm_vsi3.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#More details.

import os
import atexit
import logging
import logging.handlers
from os import path
Expand Down Expand Up @@ -214,6 +215,7 @@ def _build_sdsio_request(command: int, sid: int = 0, argument: int = 0, data: by
Stream = sdsio_manager(
work_dir=_work_dir,
auto_playback=_auto_playback,
exit_after_playback=True,
play_list=_play_list,
mon_port=None,
write_flush_records=_write_flush_records,
Expand All @@ -222,6 +224,15 @@ def _build_sdsio_request(command: int, sid: int = 0, argument: int = 0, data: by
control_input_factory=False,
)

# Shutdown SDSIO manager on exit
def shutdown():
try:
Stream.shutdown()
except Exception:
logger.error("Failed to shutdown SDSIO manager.")

# Register the shutdown function to be called on exit
atexit.register(shutdown)

## Process command
# @param command requested SDSIO command
Expand Down
168 changes: 132 additions & 36 deletions Alif/AppKit-E7_USB/Board/Corstone-300/vsi/python/sdsio.py

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions Alif/AppKit-E7_USB/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ To perform a recording, follow these steps:

```txt
>sdsio-server usb
SDSIO-Server v3.0.0
SDSIO-Server v3.1.0
Press 'Ctrl+C' or 'X' to exit.
Working directory: ...\Arm-Examples\SDS-Examples\Alif\AppKit-E7_USB
SDSIO command input: R=Record, P=playback, S/s=stop, T/t=reset, X/x=exit, A-H=set flags 0-7, a-h=clear flags 0-7.
Expand Down Expand Up @@ -174,7 +174,7 @@ The SDS file `Test_Out.<n>.p.sds` created during playback should be identical to

```txt
>sdsio-server usb
SDSIO-Server v3.0.0
SDSIO-Server v3.1.0
Press 'Ctrl+C' or 'X' to exit.
Working directory: ...\Arm-Examples\SDS-Examples\Alif\AppKit-E7_USB
SDSIO command input: R=Record, P=playback, S/s=stop, T/t=reset, X/x=exit, A-H=set flags 0-7, a-h=clear flags 0-7.
Expand Down Expand Up @@ -279,7 +279,7 @@ To perform a recording, follow these steps:

```txt
>sdsio-server usb
SDSIO-Server v3.0.0
SDSIO-Server v3.1.0
Press 'Ctrl+C' or 'X' to exit.
Working directory: ...\Arm-Examples\SDS-Examples\Alif\AppKit-E7_USB
SDSIO command input: R=Record, P=playback, S/s=stop, T/t=reset, X/x=exit, A-H=set flags 0-7, a-h=clear flags 0-7.
Expand Down Expand Up @@ -345,7 +345,7 @@ The SDS file `ML_Out.<n>.p.sds` created during playback should be identical to t

```txt
>sdsio-server usb
SDSIO-Server v3.0.0
SDSIO-Server v3.1.0
Press 'Ctrl+C' or 'X' to exit.
Working directory: ...\Arm-Examples\SDS-Examples\Alif\AppKit-E7_USB
SDSIO command input: R=Record, P=playback, S/s=stop, T/t=reset, X/x=exit, A-H=set flags 0-7, a-h=clear flags 0-7.
Expand Down Expand Up @@ -432,7 +432,7 @@ Detected objects :: [x=109, y=69, w=43, h=58]
```txt
Created by ...\Arm-Examples\SDS-Examples\Alif\AppKit-E7_USB\Board\Corstone-300\vsi\python\arm_vsi3.py

SDSIO VSI version 3.0.0
SDSIO VSI version 3.1.0
SDSIO_FVP environment variable not set.
Working directory: ...\Arm-Examples\SDS-Examples\Alif\AppKit-E7_USB\algorithm\SDS Recordings.
SDSIO configuration YAML: ...\Arm-Examples\SDS-Examples\Alif\AppKit-E7_USB\algorithm.sdsio.yml.
Expand Down
2 changes: 1 addition & 1 deletion Alif/AppKit-E7_USB/SDS.csolution.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ solution:
# Refer to https://open-cmsis-pack.github.io/cmsis-toolbox/ReferenceApplications/ for more information

packs:
- pack: ARM::SDS@^3.0.0-0
- pack: ARM::SDS@^3.1.0-0
- pack: AlifSemiconductor::Ensemble@^2.2.0-0
- pack: ARM::V2M_MPS3_SSE_300_BSP@^1.5.0

Expand Down
2 changes: 1 addition & 1 deletion Alif/AppKit-E7_USB/algorithm.sdsio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sdsio:
# Data stream information used by VS Code extension
streams:
- name: ML_In
view: video
view: image
- name: ML_Out
view: signal

Expand Down
Binary file modified Alif/AppKit-E7_USB/algorithm/SDS Recordings/ML_In.0.mp4
Binary file not shown.
6 changes: 2 additions & 4 deletions Alif/AppKit-E7_USB/algorithm/SDS Recordings/ML_In.sds.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
sds:
name: ML input
description: RGB888 video frames from camera
frequency: 12.5
sample-frequency: 12.5
content:
- value: Frame
type: uint8_t
image:
- image:
pixel_format: RGB888
width: 192
height: 192
Expand Down
6 changes: 3 additions & 3 deletions Alif/AppKit-E7_USB/algorithm/SDS Recordings/ML_Out.sds.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
sds:
name: ML output
description: Results of object detection
frequency: 12.5
sample-frequency: 12.5
content:
- value: confidence
type: double
- value: x
type: uint32_t
- value: y
type: uint32_t
- value: w
- value: width
type: uint32_t
- value: h
- value: height
type: uint32_t
3 changes: 2 additions & 1 deletion Alif/AppKit-E7_USB/algorithm/sds_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ osThreadAttr_t attrAlgorithmThread = {

// sdsControlThread thread attributes
osThreadAttr_t attr_sdsControlThread = {
.name = "sdsControl"
.name = "sdsControl",
.priority = osPriorityNormal1
};

// Idle time counter
Expand Down
6 changes: 3 additions & 3 deletions Alif/AppKit-E7_USB/algorithm/sds_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ __NO_RETURN void AlgorithmThread (void *argument) {
do {
ret = sdsRead(sds_data_in_id, &timeslot, algo_data_in_buf, sizeof(algo_data_in_buf));
if (ret == SDS_NO_DATA) {
osDelay(10U);
osDelay(1U);
DiscardInputData();
}
} while (ret == SDS_NO_DATA);
Expand All @@ -190,7 +190,7 @@ __NO_RETURN void AlgorithmThread (void *argument) {
do {
ret = sdsWrite(sds_data_in_id, timeslot, algo_data_in_buf, sizeof(algo_data_in_buf));
if (ret == SDS_NO_SPACE) {
osDelay(10U);
osDelay(1U);
}
} while (ret == SDS_NO_SPACE);
SDS_ASSERT(ret == sizeof(algo_data_in_buf));
Expand All @@ -208,7 +208,7 @@ __NO_RETURN void AlgorithmThread (void *argument) {
do {
ret = sdsWrite(sds_data_out_id, timeslot, algo_data_out_buf, sizeof(algo_data_out_buf));
if (ret == SDS_NO_SPACE) {
osDelay(10U);
osDelay(1U);
}
} while (ret == SDS_NO_SPACE);
SDS_ASSERT(ret == sizeof(algo_data_out_buf));
Expand Down
26 changes: 13 additions & 13 deletions Alif/AppKit-E7_USB/datatest/SDS Recordings/Test_In.sds.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
sds:
name: Test Input Data
description: Generated accelerometer samples at 16600 Hz
frequency: 16600
sample-frequency: 16600
content:
- value: x
type: uint16_t
scale: 0.001
unit: G
- value: y
type: uint16_t
scale: 0.001
unit: G
- value: z
type: uint16_t
scale: 0.001
unit: G
- value: x
type: uint16_t
scale: 0.001
unit: G
- value: y
type: uint16_t
scale: 0.001
unit: G
- value: z
type: uint16_t
scale: 0.001
unit: G
10 changes: 5 additions & 5 deletions Alif/AppKit-E7_USB/datatest/SDS Recordings/Test_Out.sds.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
sds:
name: Test Output Data
description: Results of algorithm processing
frequency: 1000
sample-frequency: 1000
content:
- value: x
type: uint16_t
- value: y
type: uint16_t
- value: x
type: uint16_t
- value: y
type: uint16_t
3 changes: 2 additions & 1 deletion Alif/AppKit-E7_USB/datatest/sds_control.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ osThreadAttr_t attrAlgorithmThread = {

// sdsControlThread thread attributes
osThreadAttr_t attr_sdsControlThread = {
.name = "sdsControl"
.name = "sdsControl",
.priority = osPriorityNormal1
};

// Idle time counter
Expand Down
6 changes: 3 additions & 3 deletions Alif/AppKit-E7_USB/datatest/sds_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ __NO_RETURN void AlgorithmThread (void *argument) {
do {
ret = sdsRead(sds_data_in_id, &timeslot, algo_data_in_buf, sizeof(algo_data_in_buf));
if (ret == SDS_NO_DATA) {
osDelay(10U);
osDelay(1U);
DiscardInputData();
}
} while (ret == SDS_NO_DATA);
Expand All @@ -190,7 +190,7 @@ __NO_RETURN void AlgorithmThread (void *argument) {
do {
ret = sdsWrite(sds_data_in_id, timeslot, algo_data_in_buf, sizeof(algo_data_in_buf));
if (ret == SDS_NO_SPACE) {
osDelay(10U);
osDelay(1U);
}
} while (ret == SDS_NO_SPACE);
SDS_ASSERT(ret == sizeof(algo_data_in_buf));
Expand All @@ -208,7 +208,7 @@ __NO_RETURN void AlgorithmThread (void *argument) {
do {
ret = sdsWrite(sds_data_out_id, timeslot, algo_data_out_buf, sizeof(algo_data_out_buf));
if (ret == SDS_NO_SPACE) {
osDelay(10U);
osDelay(1U);
}
} while (ret == SDS_NO_SPACE);
SDS_ASSERT(ret == sizeof(algo_data_out_buf));
Expand Down
4 changes: 2 additions & 2 deletions Alif/AppKit-E7_USB/sdsio/fvp/RTE/SDS/sds_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*
* Name: sds_config.h
* Purpose: SDS configuration options
* Rev.: V3.0.0
* Rev.: V3.1.0
*/

//-------- <<< Use Configuration Wizard in Context Menu >>> --------------------
Expand All @@ -40,7 +40,7 @@
#define SDS_THREAD_STACK_SIZE 1024

// SDS system thread priority
#define SDS_THREAD_PRIORITY osPriorityNormal
#define SDS_THREAD_PRIORITY osPriorityNormal1

// SDS stream open timeout in kernel ticks
#define SDS_OPEN_TIMEOUT 3000U
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*
* Name: sds_config.h
* Purpose: SDS configuration options
* Rev.: V3.0.0
* Rev.: V3.1.0
*/

//-------- <<< Use Configuration Wizard in Context Menu >>> --------------------
Expand All @@ -40,7 +40,7 @@
#define SDS_THREAD_STACK_SIZE 1024

// SDS system thread priority
#define SDS_THREAD_PRIORITY osPriorityNormal
#define SDS_THREAD_PRIORITY osPriorityNormal1

// SDS stream open timeout in kernel ticks
#define SDS_OPEN_TIMEOUT 3000U
Expand Down
2 changes: 1 addition & 1 deletion Alif/AppKit-E7_USB/sdsio/fvp/sdsio_fvp.clayer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layer:
description: Layer with SDS and SDSIO using VSI

packs:
- pack: ARM::SDS@^3.0.0-0
- pack: ARM::SDS@^3.1.0-0

connections:
- connect: SDS
Expand Down
4 changes: 2 additions & 2 deletions Alif/AppKit-E7_USB/sdsio/usb/RTE/SDS/sds_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*
* Name: sds_config.h
* Purpose: SDS configuration options
* Rev.: V3.0.0
* Rev.: V3.1.0
*/

//-------- <<< Use Configuration Wizard in Context Menu >>> --------------------
Expand All @@ -40,7 +40,7 @@
#define SDS_THREAD_STACK_SIZE 1024

// SDS system thread priority
#define SDS_THREAD_PRIORITY osPriorityNormal
#define SDS_THREAD_PRIORITY osPriorityNormal1

// SDS stream open timeout in kernel ticks
#define SDS_OPEN_TIMEOUT 3000U
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*
* Name: sds_config.h
* Purpose: SDS configuration options
* Rev.: V3.0.0
* Rev.: V3.1.0
*/

//-------- <<< Use Configuration Wizard in Context Menu >>> --------------------
Expand All @@ -40,7 +40,7 @@
#define SDS_THREAD_STACK_SIZE 1024

// SDS system thread priority
#define SDS_THREAD_PRIORITY osPriorityNormal
#define SDS_THREAD_PRIORITY osPriorityNormal1

// SDS stream open timeout in kernel ticks
#define SDS_OPEN_TIMEOUT 3000U
Expand Down
2 changes: 1 addition & 1 deletion Alif/AppKit-E7_USB/sdsio/usb/sdsio_usb.clayer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ layer:
description: Layer with SDS and SDSIO using USB interface to the SDSIO-Server

packs:
- pack: ARM::SDS@^3.0.0-0
- pack: ARM::SDS@^3.1.0-0
- pack: Keil::MDK-Middleware@^8.0.0

connections:
Expand Down
11 changes: 11 additions & 0 deletions Alif/DevKit-E8_ETH/Board/Corstone-320/vsi/python/arm_vsi3.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#More details.

import os
import atexit
import logging
import logging.handlers
from os import path
Expand Down Expand Up @@ -214,6 +215,7 @@ def _build_sdsio_request(command: int, sid: int = 0, argument: int = 0, data: by
Stream = sdsio_manager(
work_dir=_work_dir,
auto_playback=_auto_playback,
exit_after_playback=True,
play_list=_play_list,
mon_port=None,
write_flush_records=_write_flush_records,
Expand All @@ -222,6 +224,15 @@ def _build_sdsio_request(command: int, sid: int = 0, argument: int = 0, data: by
control_input_factory=False,
)

# Shutdown SDSIO manager on exit
def shutdown():
try:
Stream.shutdown()
except Exception:
logger.error("Failed to shutdown SDSIO manager.")

# Register the shutdown function to be called on exit
atexit.register(shutdown)

## Process command
# @param command requested SDSIO command
Expand Down
Loading
Loading