blob: 08ac978a7f27020f5ad56fda0437140128b65877 [file] [log] [blame]
alexander3c798932021-03-26 21:42:19 +00001/*
Kshitij Sisodia4cef9ac2024-04-08 09:58:46 +01002 * SPDX-FileCopyrightText: Copyright 2021-2024 Arm Limited and/or its
3 * affiliates <open-source-office@arm.com>
alexander3c798932021-03-26 21:42:19 +00004 * 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 */
alexander31ae9f02022-02-10 16:15:54 +000024#include "log_macros.h"
alexander3c798932021-03-26 21:42:19 +000025#include "TensorFlowLiteMicro.hpp" /* our inference logic api */
26
27#include <cstdio>
28
Kshitij Sisodia4cc40212022-04-08 09:54:53 +010029extern void main_loop();
alexander3c798932021-03-26 21:42:19 +000030
31#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
32__ASM(" .global __ARM_use_no_argv\n");
33#endif
34
35/* Print application information. */
36static void print_application_intro()
37{
38 info("%s\n", PRJ_DES_STR);
alexander3c798932021-03-26 21:42:19 +000039 info("Version %s Build date: " __DATE__ " @ " __TIME__ "\n", PRJ_VER_STR);
Kshitij Sisodia4cef9ac2024-04-08 09:58:46 +010040 info("Copyright 2021-2024 Arm Limited and/or its affiliates <open-source-office@arm.com>\n\n");
alexander3c798932021-03-26 21:42:19 +000041}
42
43int main ()
44{
Kshitij Sisodia4cc40212022-04-08 09:54:53 +010045 if (hal_platform_init()) {
alexander3c798932021-03-26 21:42:19 +000046 /* 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 Sisodia4cc40212022-04-08 09:54:53 +010053 main_loop();
alexander3c798932021-03-26 21:42:19 +000054 }
55
56 /* This is unreachable without errors. */
57 info("program terminating...\n");
58
59 /* Release platform. */
Kshitij Sisodia4cc40212022-04-08 09:54:53 +010060 hal_platform_release();
alexander3c798932021-03-26 21:42:19 +000061 return 0;
62}