This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

The sample bootloader project resets with a bus fault

Steps:

cd nrf/samples/bootloader
west build --board=nrf52840dk_nrf52840
west flash --erase

UART output:

*** Booting Zephyr OS build v2.4.0-ncs2 ***
E: ***** BUS FAULT *****
E: Precise data bus error
E: BFAR Address: 0xffffffff
E: r0/a1: 0xffffffff r1/a2: 0x2000142b r2/a3: 0x0000000c
E: r3/a4: 0x00007000 r12/ip: 0xffffffff r14/lr: 0x00000671
E: xpsr: 0x21000000
E: Faulting instruction address (r15/pc): 0x000050b4
E: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0
E: Current thread: 0x00000000 (unknown)
E: Resetting system

I'm guessing this is not supposed to happen?

Parents
  • The secure bootloader is never used alone, so the default way to build it is to add it as a child image to your main application. That can be done by setting CONFIG_SECURE_BOOT=y in e.g. zephyr/samples/hello_world/prj.conf. If you build the hello world sample then, you can see the build output for the secure bootloader in \zephyr\samples\hello_world\<build folder>\b0. If you run west flash, it will flash the hex file zephyr\samples\hello_world\<build folder>\zephyr\merged.hex which contains both the hello_world sample as well as the secure bootloader.

    I just tested this and it worked:

    *** Booting Zephyr OS build v2.4.0-ncs2  ***
    Attempting to boot slot 0.
    
    Attempting to boot from address 0x8000.
    
    Verifying signature against key 0.
    
    Hash: 0xae...d1
    
    Firmware signature verified.
    
    Firmware version 1
    
    Setting monotonic counter (version: 1, slot: 0)
    
    Booting (0x8000).
    
    *** Booting Zephyr OS build v2.4.0-ncs2  ***
    Hello World! nrf52840dk_nrf52840

    However, there might be circumstances where one would like to build the secure bootloader as a standalone. I can look into this if you would like to.

    Best regards,

    Simon

Reply
  • The secure bootloader is never used alone, so the default way to build it is to add it as a child image to your main application. That can be done by setting CONFIG_SECURE_BOOT=y in e.g. zephyr/samples/hello_world/prj.conf. If you build the hello world sample then, you can see the build output for the secure bootloader in \zephyr\samples\hello_world\<build folder>\b0. If you run west flash, it will flash the hex file zephyr\samples\hello_world\<build folder>\zephyr\merged.hex which contains both the hello_world sample as well as the secure bootloader.

    I just tested this and it worked:

    *** Booting Zephyr OS build v2.4.0-ncs2  ***
    Attempting to boot slot 0.
    
    Attempting to boot from address 0x8000.
    
    Verifying signature against key 0.
    
    Hash: 0xae...d1
    
    Firmware signature verified.
    
    Firmware version 1
    
    Setting monotonic counter (version: 1, slot: 0)
    
    Booting (0x8000).
    
    *** Booting Zephyr OS build v2.4.0-ncs2  ***
    Hello World! nrf52840dk_nrf52840

    However, there might be circumstances where one would like to build the secure bootloader as a standalone. I can look into this if you would like to.

    Best regards,

    Simon

Children
No Data
Related