blob: 6e1c620f51531527e724462eefada7d16062a32c [file] [log] [blame]
alexander3c798932021-03-26 21:42:19 +00001/*
2 * Copyright (c) 2021 Arm Limited. All rights reserved.
3 * SPDX-License-Identifier: Apache-2.0
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18/****************************************************************************\
19 * Main application file for ARM NPU on MPS3 board *
20\****************************************************************************/
21
22#include "hal.h" /* our hardware abstraction api */
23#include "TensorFlowLiteMicro.hpp" /* our inference logic api */
24
25#include <cstdio>
26
27extern void main_loop(hal_platform& platform);
28
29#if defined(__ARMCC_VERSION) && (__ARMCC_VERSION >= 6010050)
30__ASM(" .global __ARM_use_no_argv\n");
31#endif
32
33/* Print application information. */
34static void print_application_intro()
35{
36 info("%s\n", PRJ_DES_STR);
37 info("Target system design: %s\n", DESIGN_NAME);
38 info("Version %s Build date: " __DATE__ " @ " __TIME__ "\n", PRJ_VER_STR);
39 info("Copyright (C) ARM Ltd 2020. All rights reserved.\n\n");
40}
41
42int main ()
43{
44 hal_platform platform;
45 data_acq_module dataAcq;
46 data_psn_module dataPsn;
47 platform_timer timer;
48
49 /* Initialise the HAL and platform. */
50 hal_init(&platform, &dataAcq, &dataPsn, &timer);
51
52 if (0 == hal_platform_init(&platform)) {
53 /* Application information, UART should have been initialised. */
54 print_application_intro();
55
56 /* Check the version of TensorFlow Lite Micro. */
57 PrintTensorFlowVersion();
58
59 /* Run the application. */
60 main_loop(platform);
61 }
62
63 /* This is unreachable without errors. */
64 info("program terminating...\n");
65
66 /* Release platform. */
67 hal_platform_release(&platform);
68 return 0;
69}
70