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

nrf9160 MQTT example

Hi!

I just saw the MQTT example that has been merged in the master branch and tried to run it on my DK (NB-IoT). Without changing anything in the code or configuration the execution leads to the following output in the console appears:

***** BUS FAULT *****
Precise data bus error
BFAR Address: 0x4002a514
***** Hardware exception *****
Current thread ID = 0x2000031c
Faulting instruction address = 0x6604
Fatal fault in essential thread! Spinning...

I used the latest tags of the releases of zephyr, etc. and only copied mqtt_simple from master branch. Are there any hints or tips how I can make the example work?

Parents
  • Build and program the samples/nrf9160/secure_boot/ example first, then it should work.

    This is needed since the SPU peripheral needs to be configured with a "NON SECURE" area, in which the MQTT example will reside.

    The secure_boot sample performs this configuration.

  • Hi! Thanks for the answer. There is something very strange going on.

    So I am able to compile and flash secure_boot, at_client, asset_tracker, and the NTP example. Everything seems to work. Serial output looks ok.

    (...)

    Secure Boot: SPU: set SRAM region 30 as Non-Secure
    Secure Boot: SPU: set SRAM region 31 as Non-Secure
    Secure Boot: configure peripherals
    Secure Boot: MSP_NS 200265f0
    Secure Boot: prepare to jump to Non-Secure image
    ***** Booting Zephyr OS v1.13.99-ncs2 *****
    The AT host sample started

    (...)

    Now opening and compiling the mqtt_simple example from the master branch.

    After build and run the output in segger studio is:

    (...)

    Preparing target for download
    Executing script TargetInterface.resetAndStop()
    Reset: Halt core after reset via DEMCR.VC_CORERESET.
    Reset: Reset device via AIRCR.SYSRESETREQ.
    Downloading ‘zephyr.elf’ to J-Link
    Programming 83.3 KB of addresses 00000000 — 00014d37
    Programming 0.4 KB of addresses 00014d38 — 00014edb
    J-Link: Flash download: Bank 0 @ 0x00000000: 1 range affected (16384 bytes)
    J-Link: Flash download: Total time needed: 0.570s (Prepare: 0.042s, Compare: 0.041s, Erase: 0.357s, Program: 0.120s, Verify: 0.000s, Restore: 0.007s)
    Download successful

    Console output:

    Secure Boot: SPU: set SRAM region 30 as Non-Secure
    Secure Boot: SPU: set SRAM region 31 as Non-Secure
    Secure Boot: configure peripherals
    Secure Boot: MSP_NS 200265f0
    Secure Boot: prepare to jump to Non-Secure image
    ***** Booting Zephyr OS v1.13.99-ncs2 *****
    The AT host sample started
    ***** BUS FAULT *****
    Precise data bus error
    BFAR Address: 0x4002a514
    ***** Hardware exception *****
    Current thread ID = 0x2000031c
    Faulting instruction address = 0x6f74
    Fatal fault in essential thread! Spinning...

    Reset and power cycle leads to the same result. Immediate output is always "Bus Fault".

    Now I tried to reprogram the at_client. But it seems like flashing another application is not possible. The output is the following:

    (...)
    Preparing target for download
    Executing script TargetInterface.resetAndStop()
    Reset: Halt core after reset via DEMCR.VC_CORERESET.
    Reset: Reset device via AIRCR.SYSRESETREQ.
    Downloading ‘zephyr.elf’ to J-Link
    Programming 78.3 KB of addresses 00040000 — 0005397b
    Programming 0.4 KB of addresses 0005397c — 00053b23
    J-Link: Flash download: Bank 0 @ 0x00000000: Skipped. Contents already match
    Download successful

    The only thing I can do is re-flashing the secure_boot sample. After that, the device starts to run the at_client

    It seems like there is a problem when flashing the mqtt_client sample.

    Is anybody experiencing similar problems?

Reply
  • Hi! Thanks for the answer. There is something very strange going on.

    So I am able to compile and flash secure_boot, at_client, asset_tracker, and the NTP example. Everything seems to work. Serial output looks ok.

    (...)

    Secure Boot: SPU: set SRAM region 30 as Non-Secure
    Secure Boot: SPU: set SRAM region 31 as Non-Secure
    Secure Boot: configure peripherals
    Secure Boot: MSP_NS 200265f0
    Secure Boot: prepare to jump to Non-Secure image
    ***** Booting Zephyr OS v1.13.99-ncs2 *****
    The AT host sample started

    (...)

    Now opening and compiling the mqtt_simple example from the master branch.

    After build and run the output in segger studio is:

    (...)

    Preparing target for download
    Executing script TargetInterface.resetAndStop()
    Reset: Halt core after reset via DEMCR.VC_CORERESET.
    Reset: Reset device via AIRCR.SYSRESETREQ.
    Downloading ‘zephyr.elf’ to J-Link
    Programming 83.3 KB of addresses 00000000 — 00014d37
    Programming 0.4 KB of addresses 00014d38 — 00014edb
    J-Link: Flash download: Bank 0 @ 0x00000000: 1 range affected (16384 bytes)
    J-Link: Flash download: Total time needed: 0.570s (Prepare: 0.042s, Compare: 0.041s, Erase: 0.357s, Program: 0.120s, Verify: 0.000s, Restore: 0.007s)
    Download successful

    Console output:

    Secure Boot: SPU: set SRAM region 30 as Non-Secure
    Secure Boot: SPU: set SRAM region 31 as Non-Secure
    Secure Boot: configure peripherals
    Secure Boot: MSP_NS 200265f0
    Secure Boot: prepare to jump to Non-Secure image
    ***** Booting Zephyr OS v1.13.99-ncs2 *****
    The AT host sample started
    ***** BUS FAULT *****
    Precise data bus error
    BFAR Address: 0x4002a514
    ***** Hardware exception *****
    Current thread ID = 0x2000031c
    Faulting instruction address = 0x6f74
    Fatal fault in essential thread! Spinning...

    Reset and power cycle leads to the same result. Immediate output is always "Bus Fault".

    Now I tried to reprogram the at_client. But it seems like flashing another application is not possible. The output is the following:

    (...)
    Preparing target for download
    Executing script TargetInterface.resetAndStop()
    Reset: Halt core after reset via DEMCR.VC_CORERESET.
    Reset: Reset device via AIRCR.SYSRESETREQ.
    Downloading ‘zephyr.elf’ to J-Link
    Programming 78.3 KB of addresses 00040000 — 0005397b
    Programming 0.4 KB of addresses 0005397c — 00053b23
    J-Link: Flash download: Bank 0 @ 0x00000000: Skipped. Contents already match
    Download successful

    The only thing I can do is re-flashing the secure_boot sample. After that, the device starts to run the at_client

    It seems like there is a problem when flashing the mqtt_client sample.

    Is anybody experiencing similar problems?

Children
Related