Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: kernel: timer_api fails with hard fault in CONFIG_TICKLESS_KERNEL #33665

Closed
FRASTM opened this issue Mar 24, 2021 · 4 comments
Closed
Labels
area: Tests Issues related to a particular existing or missing test bug The issue is a bug, or the PR is fixing a bug platform: STM32 ST Micro STM32

Comments

@FRASTM
Copy link
Collaborator

FRASTM commented Mar 24, 2021

Describe the bug
run the tests/kernel/timer/timer_api with the prj_tickless.conf on the nucleo_wb55rg
This board and soc device have PM with their own ./soc/arm/st_stm32/stm32wb/power.c

To Reproduce
Steps to reproduce the behavior:
set prj.conf with

CONFIG_ZTEST=y
CONFIG_PM=y
CONFIG_TICKLESS_KERNEL=y
CONFIG_MP_NUM_CPUS=1
CONFIG_TEST_RANDOM_GENERATOR=y

CONFIG_TEST_USERSPACE=y
  1. west build -p auto -b nucleo_wb55rg tests/kernel/timer/timer_api/
    or
    ./scripts/twister -p nucleo_wb55rg -T tests/kernel/timer/timer_api

Impact

Running test suite timer_api                                                    
===================================================================             
START - test_time_conversions                                                   
 PASS - test_time_conversions in 0.113 seconds                                  
===================================================================             
START - test_timer_duration_period                                              
ASSERTION FAIL [!arch_is_in_isr()] @ WEST_TOPDIR/zephyr/kernel/sched.c:841      
                                                                                
E: ***** HARD FAULT *****                                                       
E:   Fault escalation (see below)                                               
E: r0/a1:  0x00000004  r1/a2:  0x00000349  r2/a3:  0x00000040                   
E: r3/a4:  0x0000003f r12/ip:  0xa0000000 r14/lr:  0x08007637                   
E:  xpsr:  0x4100003f                                                           
E: Faulting instruction address (r15/pc): 0x0800d676                            
E: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0                             
E: Fault during interrupt handling                                              
                                                                                
E: Current thread: 0x200004b0 (idle 00)                                         
E: Halting system 

Environment (please complete the following information):*
master : SHA1 = 7397e3e

Additional context
Also failing test : tests/kernel/tickless/tickless_concept/

Running test suite tickless_concept
===================================================================
START - test_tickless_sysclock
ASSERTION FAIL [!arch_is_in_isr()] @ WEST_TOPDIR/zephyr/kernel/sched.c:841
...
@FRASTM FRASTM added the bug The issue is a bug, or the PR is fixing a bug label Mar 24, 2021
@FRASTM
Copy link
Collaborator Author

FRASTM commented Mar 24, 2021

There is a PR #33222, where the commit bfc11b5 "power: Send exit notification after post_ops callback" is causing the kernel crash.

@FRASTM
Copy link
Collaborator Author

FRASTM commented Mar 24, 2021

I propose to unlock the scheduler NOT in the pm_system_resume() itself but in the pm_system_suspend() just after the pm_system_resume() function call, as follows:

	pm_log_debug_info(z_power_state.state);
	pm_system_resume();
	k_sched_unlock();

	return z_power_state.state;
}

@FRASTM FRASTM added area: Tests Issues related to a particular existing or missing test platform: STM32 ST Micro STM32 labels Mar 24, 2021
@FRASTM
Copy link
Collaborator Author

FRASTM commented Mar 30, 2021

The tests/subsys/power/power_mgmt_soc also fails on nucleo_wb55 and nucleo_l552 boards

@galak galak added the has-pr label Mar 30, 2021
@FRASTM
Copy link
Collaborator Author

FRASTM commented Apr 2, 2021

closing as the PR #33666 is now merged

@FRASTM FRASTM closed this as completed Apr 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Tests Issues related to a particular existing or missing test bug The issue is a bug, or the PR is fixing a bug platform: STM32 ST Micro STM32
Projects
None yet
Development

No branches or pull requests

2 participants