Topics

missing header file core_cm3.h


Michael E Goldsby
 

 I prepared a build directory as in the docs:

1) In  <pathto>/zephyr-stuff:
    export ZEPHYR_GCC_VARIANT=zephyr
    export ZEPHYR_SDK_INSTALL=~/zephyr-sdk-0.11.3
    source ~/zephyrproject/zephyr/zephyr-env.sh

    mkdir -p  testapp/build/qemu_cortex_m3

2)  put virtually empty main.c in <pathto>/zephyr-stuff/testapp/src:
      #include <zephyr.h>
      #include <sys/printk.h>
      void main(void) {
                printk("In main\n");
      }


3) Put empty prj.conf and CMakeLists.txt containing

  cmake_minimum_required(VERSION 3.13.1)
  find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
  project(collector)
  FILE(GLOB app_sources src/*.c)
  target_sources(app PRIVATE ${app_sources})

into <pathto>/zephyr_stuff/testapp.

4)  In <pathto>/zephyr_stuff/testapp/build/qemu_cortex_m3:
        cmake -DBOARD=qemu_cortex_m3 ../..
and it appears to have completed correctly.

THen when I go to <pathto>/zephyr-stuff/testapp/build/qemu_cortex_m3
and do
    make
or
    make run
it tries to #include <core_cm3.h> and complains that
there is no such file or directory.

Have I left something out?

Thanks for any help you can give me,
--MIke


Michael E Goldsby
 

Problem solved.
Looks like I neglected to do the export and source commands in  item 1.