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

nrf: clock_control: Fatal error during initialization #25568

Closed
tsvehagen opened this issue May 24, 2020 · 1 comment · Fixed by #25579
Closed

nrf: clock_control: Fatal error during initialization #25568

tsvehagen opened this issue May 24, 2020 · 1 comment · Fixed by #25579
Assignees
Labels
bug The issue is a bug, or the PR is fixing a bug platform: nRF Nordic nRFx priority: medium Medium impact/importance bug

Comments

@tsvehagen
Copy link
Collaborator

Describe the bug
Having a combination of CONFIG_POLL=y, a large mbedtls heap and using the RC oscillator as K32SRC causes a fatal error during initialization.

Changing anyone of these and the problem seem to go away. Another way to make the problem go away is to change the init prio of mbedtls where the heap initialization happens. (modules/crypto/mbedtls/zephyr_init.c)

To Reproduce
I used a nrf52840dk_nrf52840 board and the following prj.conf in samples/hello_world

CONFIG_POLL=y

CONFIG_MBEDTLS=y
CONFIG_MBEDTLS_BUILTIN=y
CONFIG_MBEDTLS_ENABLE_HEAP=y
CONFIG_MBEDTLS_HEAP_SIZE=100000

CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y

Screenshots or console output
Here is a backtrace from @carlescufi

(gdb) bt
#0  arch_system_halt (reason=reason@entry=0) at /home/carles/src/zephyr/zephyr/kernel/fatal.c:31
#1  0x00003f7c in k_sys_fatal_error_handler (reason=reason@entry=0,
    esf=esf@entry=0x20019b88 <z_interrupt_stacks+1888>) at /home/carles/src/zephyr/zephyr/kernel/fatal.c:43
#2  0x00003fa0 in z_fatal_error (reason=reason@entry=0, esf=esf@entry=0x20019b88 <z_interrupt_stacks+1888>)
    at /home/carles/src/zephyr/zephyr/kernel/fatal.c:123
#3  0x00003bdc in z_arm_fatal_error (reason=reason@entry=0, esf=esf@entry=0x20019b88 <z_interrupt_stacks+1888>)
    at /home/carles/src/zephyr/zephyr/arch/arm/core/aarch32/fatal.c:47
#4  0x00001130 in z_arm_fault (msp=<optimized out>, psp=<optimized out>, exc_return=<optimized out>)
    at /home/carles/src/zephyr/zephyr/arch/arm/core/aarch32/cortex_m/fault.c:969
#5  0x00000ffc in z_arm_usage_fault () at /home/carles/src/zephyr/zephyr/arch/arm/core/aarch32/cortex_m/fault_s.S:85
#6  <signal handler called>
#7  0x00004718 in sys_dlist_remove (node=0x0 <z_finalize_fd>) at ../include/sys/dlist.h:518
#8  sys_dlist_get (list=list@entry=0x200003b0 <k_sys_work_q+8>) at ../include/sys/dlist.h:518
#9  z_handle_obj_poll_events (events=events@entry=0x200003b0 <k_sys_work_q+8>, state=state@entry=4)
    at /home/carles/src/zephyr/zephyr/kernel/poll.c:406
#10 0x00004030 in handle_poll_events (state=4, queue=0x200003a8 <k_sys_work_q>)
    at /home/carles/src/zephyr/zephyr/kernel/queue.c:179
#11 queue_insert (queue=0x200003a8 <k_sys_work_q>, prev=0x0 <z_finalize_fd>, data=<optimized out>,
    alloc=<optimized out>) at /home/carles/src/zephyr/zephyr/kernel/queue.c:179
#12 0x000008cc in clkstarted_handle (type=<optimized out>, dev=0x2000005c <__device_clock_nrf>)
    at /home/carles/src/zephyr/zephyr/drivers/clock_control/nrf_power_clock.c:366
#13 0x000008fe in nrf_power_clock_isr (arg=<optimized out>)
    at /home/carles/src/zephyr/zephyr/drivers/clock_control/nrf_power_clock.c:421
#14 0x00000fa6 in _isr_wrapper () at /home/carles/src/zephyr/zephyr/arch/arm/core/aarch32/isr_wrapper.S:195

Environment:
Commit 1a89ca1

@tsvehagen tsvehagen added bug The issue is a bug, or the PR is fixing a bug platform: nRF Nordic nRFx labels May 24, 2020
@ioannisg
Copy link
Member

will investigate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug platform: nRF Nordic nRFx priority: medium Medium impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants