Skip to content

Commit

Permalink
Update FreeRTOS demo to run in demo script
Browse files Browse the repository at this point in the history
Also, minor text fixes.
  • Loading branch information
Mousius committed Feb 9, 2022
1 parent c6484ea commit 9d71d3f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 20 deletions.
8 changes: 4 additions & 4 deletions apps/microtvm/ethosu/src/demo_freertos.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static void prvDataCollectionTask(void* pvParameters);
/* The queue used to pass data to run through our model */
static QueueHandle_t xQueue = NULL;

void main(void) {
int main(void) {
// Platform UART
uart_init();
// NPU
Expand All @@ -61,7 +61,7 @@ void main(void) {
mainQUEUE_INFERENCE_TASK_PRIORITY, NULL);

// Data collector task
xTaskCreate(prvDataCollectionTask, "Data", mainQUEUE_INFERENCE_TASK_STACK_SIZE, NULL,
xTaskCreate(prvDataCollectionTask, "Data", mainQUEUE_DATA_TASK_STACK_SIZE, NULL,
mainQUEUE_DATA_TASK_PRIORITY, NULL);

// Start the task scheduling
Expand Down Expand Up @@ -103,7 +103,7 @@ static void prvInferenceTask(void* pvParameters) {
// Print output of inference and exit task
printf("Running inference\n");
struct tvmgen_default_inputs xInputs = {
.input = pucReceivedData,
.tfl_quantize = pucReceivedData,
};
struct tvmgen_default_outputs xOutputs = {
.output = output,
Expand All @@ -116,7 +116,7 @@ static void prvInferenceTask(void* pvParameters) {
ethosu_release_driver(xDriver);

// Calculate index of max value
uint8_t ucMaxValue = 0;
int8_t ucMaxValue = -128;
int32_t lMaxIndex = -1;
for (unsigned int i = 0; i < output_len; ++i) {
if (output[i] > ucMaxValue) {
Expand Down
1 change: 0 additions & 1 deletion apps/microtvm/zephyr_cmsisnn/run_demo.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ export ARMFVP_BIN_PATH=/opt/arm/FVP_Corstone_SSE-300/models/Linux64_GCC-6.4/
west zephyr-export
west build
west build -t run &> ${LOGDIR}/west.log &
WEST_PID=$!

# Wait for "exit" keyword
until grep -m 1 "exit" ${LOGDIR}/west.log; do sleep 1 ; done
Expand Down
15 changes: 0 additions & 15 deletions tests/scripts/task_cpp_unittest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,3 @@ cd apps/bundle_deploy
rm -rf build
make test_dynamic test_static
cd ../..

# Test Arm(R) Cortex(R)-M55 CPU and Ethos(TM)-U55 NPU demo app
FVP_PATH="/opt/arm/FVP_Corstone_SSE-300"

# TODO(@grant-arm): Remove once ci_cpu docker image has been updated to FVP_Corstone_SSE
if test ! -d $FVP_PATH; then
FVP_PATH="/opt/arm/FVP_Corstone_SSE-300_Ethos-U55"
fi

if test -d $FVP_PATH && pip3 list | grep vela; then
cd apps/microtvm/ethosu
./run_demo.sh --fvp_path $FVP_PATH --cmake_path /opt/arm/cmake/bin/cmake
./run_demo.sh --fvp_path $FVP_PATH --cmake_path /opt/arm/cmake/bin/cmake --freertos_path /opt/freertos/FreeRTOSv202112.00
cd ../../..
fi
9 changes: 9 additions & 0 deletions tests/scripts/task_demo_microtvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,12 @@ set -euxo pipefail
pushd apps/microtvm/zephyr_cmsisnn
./run_demo.sh
popd

pushd apps/microtvm/ethosu
FVP_PATH="/opt/arm/FVP_Corstone_SSE-300_Ethos-U55"
CMAKE_PATH="/opt/arm/cmake/bin/cmake"
FREERTOS_PATH="/opt/freertos/FreeRTOSv202112.00"

./run_demo.sh --fvp_path $FVP_PATH --cmake_path $CMAKE_PATH
./run_demo.sh --fvp_path $FVP_PATH --cmake_path $CMAKE_PATH --freertos_path $FREERTOS_PATH
popd

0 comments on commit 9d71d3f

Please sign in to comment.