zephyr/tests/arch/arm/arm_interrupt
Torsten Rasmussen 407b49b35c cmake: use find_package to locate Zephyr
Using find_package to locate Zephyr.

Old behavior was to use $ENV{ZEPHYR_BASE} for inclusion of boiler plate
code.

Whenever an automatic run of CMake happend by the build system / IDE
then it was required that ZEPHYR_BASE was defined.
Using ZEPHYR_BASE only to locate the Zephyr package allows CMake to
cache the base variable and thus allowing subsequent invocation even
if ZEPHYR_BASE is not set in the environment.

It also removes the risk of strange build results if a user switchs
between different Zephyr based project folders and forgetting to reset
ZEPHYR_BASE before running ninja / make.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
2020-03-27 16:23:46 +01:00
..
src tests: arch: arm: arm_interrupt: remove side effect in assertion 2020-03-25 16:15:24 -04:00
CMakeLists.txt cmake: use find_package to locate Zephyr 2020-03-27 16:23:46 +01:00
README.txt tests: arch: arm: interrupt: test the spurious ISR handler 2020-03-11 10:26:36 +02:00
prj.conf tests: arch: arm: interrupt: add test-case for user mode IRQ locking 2020-01-22 12:08:14 -06:00
testcase.yaml tests: remove duplicate name for the kernel arch.interrupt test 2019-11-19 12:18:18 +01:00

README.txt

Title: Test to verify code fault handling in ISR execution context
       and the behavior of irq_lock() and irq_unlock() when invoked
       from User Mode. (ARM Only)

Description:

The first test verifies that we can handle system fault conditions
while running in handler mode (i.e. in an ISR). Only for ARM
Cortex-M targets. The test also verifies the behavior of the
spurious interrupt handler.

The second test verifies that threads in user mode, despite being able to call
the irq_lock() and irq_unlock() functions without triggering a CPU fault,
they won't be able to read or modify the current IRQ locking status.

---------------------------------------------------------------------------

Building and Running Project:

This project outputs to the console.  It can be built and executed on QEMU as
follows:

    ninja/make run

---------------------------------------------------------------------------

Troubleshooting:

Problems caused by out-dated project information can be addressed by
issuing one of the following commands then rebuilding the project:

    ninja/make clean    # discard results of previous builds
                        # but keep existing configuration info
or
    ninja/make pristine # discard results of previous builds
                        # and restore pre-defined configuration info

---------------------------------------------------------------------------

Sample Output:
***** Booting Zephyr OS build zephyr-v2.0.0-1066-ga087055d4e3d *****
 Running test suite arm_interrupt
 ===================================================================
 starting test - test_arm_interrupt
 Available IRQ line: 25
 E: ***** HARD FAULT *****
 E: ARCH_EXCEPT with reason 3

 E: r0/a1:  0x00000003  r1/a2:  0x20001240  r2/a3:  0x00000003
 E: r3/a4:  0x20001098 r12/ip:  0x00000000 r14/lr:  0x000012c9
 E:  xpsr:  0x01000029
 E: Faulting instruction address (r15/pc): 0x000003de
 E: >>> ZEPHYR FATAL ERROR 3: Kernel oops
 E: Current thread: 0x20000058 (unknown)
 Caught system error -- reason 3
 E: Fault during interrupt handling

 E: ***** HARD FAULT *****
 E: ARCH_EXCEPT with reason 4

 E: r0/a1:  0x00000004  r1/a2:  0x20001240  r2/a3:  0x00000004
 E: r3/a4:  0x20001098 r12/ip:  0x00000000 r14/lr:  0x000012c9
 E:  xpsr:  0x01000029
 E: Faulting instruction address (r15/pc): 0x000003e8
 E: >>> ZEPHYR FATAL ERROR 4: Kernel panic
 E: Current thread: 0x20000058 (unknown)
 Caught system error -- reason 4
 E: Fault during interrupt handling

 PASS - test_arm_interrupt
 ===================================================================
 starting test - test_arm_user_interrupt
 PASS - test_arm_user_interrupt
 ===================================================================
 Test suite arm_interrupt succeeded
 ===================================================================
 PROJECT EXECUTION SUCCESSFUL

 Test suite arm_interrupt succeeded
 ===================================================================
 PROJECT EXECUTION SUCCESSFUL