alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 1 | /* |
Kshitij Sisodia | 4cef9ac | 2024-04-08 09:58:46 +0100 | [diff] [blame] | 2 | * SPDX-FileCopyrightText: Copyright 2021-2024 Arm Limited and/or its |
| 3 | * affiliates <open-source-office@arm.com> |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 4 | * SPDX-License-Identifier: Apache-2.0 |
| 5 | * |
| 6 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | * you may not use this file except in compliance with the License. |
| 8 | * You may obtain a copy of the License at |
| 9 | * |
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | * |
| 12 | * Unless required by applicable law or agreed to in writing, software |
| 13 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | * See the License for the specific language governing permissions and |
| 16 | * limitations under the License. |
| 17 | */ |
| 18 | |
| 19 | /****************************************************************************\ |
| 20 | * Main application file for ARM NPU on MPS3 board * |
| 21 | \****************************************************************************/ |
| 22 | |
| 23 | #include "hal.h" /* our hardware abstraction api */ |
alexander | 31ae9f0 | 2022-02-10 16:15:54 +0000 | [diff] [blame] | 24 | #include "log_macros.h" |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 25 | #include "TensorFlowLiteMicro.hpp" /* our inference logic api */ |
| 26 | |
| 27 | #include <cstdio> |
| 28 | |
Kshitij Sisodia | 4cc4021 | 2022-04-08 09:54:53 +0100 | [diff] [blame] | 29 | extern void main_loop(); |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 30 | |
| 31 | #if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050) |
| 32 | __ASM(" .global __ARM_use_no_argv\n"); |
| 33 | #endif |
| 34 | |
| 35 | /* Print application information. */ |
| 36 | static void print_application_intro() |
| 37 | { |
| 38 | info("%s\n", PRJ_DES_STR); |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 39 | info("Version %s Build date: " __DATE__ " @ " __TIME__ "\n", PRJ_VER_STR); |
Kshitij Sisodia | 4cef9ac | 2024-04-08 09:58:46 +0100 | [diff] [blame] | 40 | info("Copyright 2021-2024 Arm Limited and/or its affiliates <open-source-office@arm.com>\n\n"); |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 41 | } |
| 42 | |
| 43 | int main () |
| 44 | { |
Kshitij Sisodia | 4cc4021 | 2022-04-08 09:54:53 +0100 | [diff] [blame] | 45 | if (hal_platform_init()) { |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 46 | /* Application information, UART should have been initialised. */ |
| 47 | print_application_intro(); |
| 48 | |
| 49 | /* Check the version of TensorFlow Lite Micro. */ |
| 50 | PrintTensorFlowVersion(); |
| 51 | |
| 52 | /* Run the application. */ |
Kshitij Sisodia | 4cc4021 | 2022-04-08 09:54:53 +0100 | [diff] [blame] | 53 | main_loop(); |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 54 | } |
| 55 | |
| 56 | /* This is unreachable without errors. */ |
| 57 | info("program terminating...\n"); |
| 58 | |
| 59 | /* Release platform. */ |
Kshitij Sisodia | 4cc4021 | 2022-04-08 09:54:53 +0100 | [diff] [blame] | 60 | hal_platform_release(); |
alexander | 3c79893 | 2021-03-26 21:42:19 +0000 | [diff] [blame] | 61 | return 0; |
| 62 | } |