[Bug report] Unaligned memory acces with Zigbee R23 on nRF54

How to reproduce:

Generate a production config (content doesn´t care because the error still exists after changing the content) and build / flash it:

nrfutil nrf5sdk-tools zigbee production_config zigbee_config.yml zigbee_config.hex --offset 0x17a000
nrfjprog --program zigbee_config.hex --verify

00> [00:00:44.726,567] <err> os: ***** USAGE FAULT *****
00> [00:00:44.726,573] <err> os:   Unaligned memory access
00> [00:00:44.726,590] <err> os: r0/a1:  0x00000000  r1/a2:  0x00051a8c  r2/a3:  0x0005317c
00> [00:00:44.726,598] <err> os: r3/a4:  0x00000000 r12/ip:  0x00000000 r14/lr:  0x0004088d
00> [00:00:44.726,602] <err> os:  xpsr:  0x69100000
00> [00:00:44.726,612] <err> os: s[ 0]:  0x0005019f  s[ 1]:  0x00000000  s[ 2]:  0x20009300  s[ 3]:  0x000501a5
00> [00:00:44.726,620] <err> os: s[ 4]:  0x0005019f  s[ 5]:  0x0003beed  s[ 6]:  0x500ca000  s[ 7]:  0x00041d77
00> [00:00:44.726,628] <err> os: s[ 8]:  0x000082ed  s[ 9]:  0x00008303  s[10]:  0x00050724  s[11]:  0x000497f7
00> [00:00:44.726,636] <err> os: s[12]:  0x00050614  s[13]:  0x00018a0b  s[14]:  0x00000000  s[15]:  0x00000001
00> [00:00:44.726,641] <err> os: fpscr:  0x00000000
00> [00:00:44.726,645] <err> os: Faulting instruction address (r15/pc): 0x00000000

Behaviour:

During the FIRST reset after flashing the config, this error occurs. After the second rese,t the firmware starts as expected.

Environment:

- Zigbee R23 (latest)
- NCS 2.9.0

Parents Reply Children
  • Hi,

    The project does not build out of the box. Please provide a minimal sample that builds out of the box and the steps to build and reproduce the issue.

    Is it based on the sample from ncs-zigbee, i.e. this one: https://github.com/nrfconnect/ncs-zigbee/tree/main/samples/template, or from the nrf repository, i.e. this one: https://github.com/nrfconnect/sdk-nrf/tree/v2.9.0/samples/zigbee/template?

    I am asking because the sample in the ncs-zigbee repository supports the nRF54L15 DK out of the box, while the sample in the nrf repository does not. If you have used the sample from the nrf repository, there might be missing or incorrect Kconfig and devicetree configurations.

    I recommend keeping Kconfig and devicetree configurations specific to the project in the project files (prj.conf and devicetree overlay) instead of moving them into the board files. It can be a good idea to compare your project with the template sample in ncs-zigbee and verify that the configurations are correct.

    Best regards,
    Marte

  • Hi Marte,

    please let me try to reproduce it with one of the samples. If it´s successful I will provide you the neccessary steps. If I can´t reproduce it, I will check my code to make sure you can use it out of the box.

    Sorry for the issues.

  • Hi  ,

    I´ve updated the documentation and the project on GitHub. You should be able to build it now. I´ve tested it in WSL and with an Ubuntu VM and there was no issue. This should help you to reproduce the issue.

  • Hi,

    I see that the project is a workspace application and that I need to install the nRF Connect SDK and some additional sensor libraries and patches. Can you share a minimal example where you can reproduce this using the ncs-zigbee SDK without adding additional libraries?

    Best regards,
    Marte

  • Hi  ,

    I´ve compiled the light bulb sample with the following config to make it usable for my board:

    # Must be set to "y" because no external 32 kHz crystal is used here
    CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
    
    CONFIG_GPIO=y
    CONFIG_PWM=y
    
    # Make sure printk is not printing to the UART console
    CONFIG_LOG=y
    CONFIG_LOG_PRINTK=y
    
    CONFIG_DEBUG_OPTIMIZATIONS=y
    
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_LOG_BACKEND_RTT=y
    CONFIG_LOG_BACKEND_RTT_MODE_BLOCK=y
    CONFIG_LOG_BUFFER_SIZE=4096
    CONFIG_LOG_BACKEND_RTT_OUTPUT_BUFFER_SIZE=128
    CONFIG_LOG_BLOCK_IN_THREAD=y
    
    CONFIG_HEAP_MEM_POOL_SIZE=2048
    CONFIG_MAIN_THREAD_PRIORITY=7
    
    CONFIG_ZIGBEE_ADD_ON=y
    CONFIG_ZIGBEE_APP_UTILS=y
    CONFIG_ZIGBEE_ROLE_ROUTER=y
    
    # Enable DK LED and Buttons library
    CONFIG_DK_LIBRARY=y
    
    # This example requires more workqueue stack
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
    
    # Networking
    CONFIG_NET_IPV6=n
    CONFIG_NET_IP_ADDR_CHECK=n
    CONFIG_NET_UDP=n
    
    # Scene extension
    CONFIG_ZIGBEE_SCENES=y
    

    I´ve opened an RTT terminal after flashing the Zigbee config file, and I get this output

    00> [00:16:18.850,864] <inf> ieee802154_nrf5: nRF5 802154 radio initialized

    But I wasn´t able to reproduce the error.

    Btw. the error is caused by flash read and sync during the "stream_flash_init" function.

Related