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?

  • OK, I exported the location so that nrfjprog is accessible but I get this error now...

    rob@rob-VirtualBox:~/dev/ncs/nrf/samples/nrf9160/mqtt_simple/build$ west -v flash --skip-rebuild
    ZEPHYR_BASE=/home/rob/dev/ncs/zephyr (origin: manifest file /home/rob/dev/ncs/nrf/west.yml)
    Using runner: nrfjprog
    nrfjprog --ids
    Flashing file: /home/rob/dev/ncs/nrf/samples/nrf9160/mqtt_simple/build/zephyr/zephyr.hex
    nrfjprog --program /home/rob/dev/ncs/nrf/samples/nrf9160/mqtt_simple/build/zephyr/zephyr.hex -f NRF91 --snr 960011468 --sectorerase
    ERROR: JLinkARM DLL reported an error. Try again. If error condition
    ERROR: persists, run the same command again with argument --log, contact Nordic
    ERROR: Semiconductor and provide the generated log.log file to them.
    ERROR: command exited with status 33: nrfjprog --program /home/rob/dev/ncs/nrf/samples/nrf9160/mqtt_simple/build/zephyr/zephyr.hex -f NRF91 --snr 960011468 --sectorerase
    Traceback (most recent call last):
    File "/home/rob/dev/ncs/.west/west/src/west/main.py", line 505, in main
    args.handler(args, unknown)
    File "/home/rob/dev/ncs/.west/west/src/west/main.py", line 326, in ext_command_handler
    command.run(*west_parser.parse_known_args(argv))
    File "/home/rob/dev/ncs/.west/west/src/west/commands/command.py", line 85, in run
    self.do_run(args, unknown)
    File "/home/rob/dev/ncs/zephyr/scripts/west_commands/flash.py", line 32, in do_run
    'ZEPHYR_BOARD_FLASH_RUNNER')
    File "/home/rob/dev/ncs/zephyr/scripts/west_commands/run_common.py", line 246, in do_run_common
    runner.run(command_name)
    File "/home/rob/dev/ncs/zephyr/scripts/west_commands/runners/core.py", line 407, in run
    self.do_run(command, **kwargs)
    File "/home/rob/dev/ncs/zephyr/scripts/west_commands/runners/nrfjprog.py", line 128, in do_run
    self.check_call(cmd)
    File "/home/rob/dev/ncs/zephyr/scripts/west_commands/runners/core.py", line 466, in check_call
    subprocess.check_call(cmd)
    File "/usr/lib/python3.6/subprocess.py", line 291, in check_call
    raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['nrfjprog', '--program', '/home/rob/dev/ncs/nrf/samples/nrf9160/mqtt_simple/build/zephyr/zephyr.hex', '-f', 'NRF91', '--snr', '960011468', '--sectorerase']' returned non-zero exit status 33.

    ..sorry for being a pain.

  • Hi!

    I had a couple of days off, but now I tried to do the build via command line. Works fine until I want to run "ninja flash". It says that I have to install west:

    [0/1] cmd.exe /C "cd /D C:\Users\***\Documents\workspace\nrf91_src_root\ncs...est bootstrapper with: 'pip install west --user', and thereafter 'west init'.""
    West was not found in path. To support 'C:/ProgramData/chocolatey/bin/ninja.exe flash', please install west bootstrapper with: 'pip install west --user', and thereafter 'west init'.

    So I installed west like in the documentation for already existing repositories with the enclosing zephyrproject folder. So the structure is "ncs/zephyrproject/zephyr". But this seems to confuse cmake as it quits with an error.

    Any hints on how to make "ninja flash" work? Whats the correct way to install west for this purpose?

    Are there any updates regarding building and flashing via SES?

    Thanks!

  • Hi Dominik,

    Which guide did you follow?

    Did you follow the guide listed in the ncs documentation?

    The reason I am asking this is because your folder setup should look like this:

    (not with the 'zephyrproject' folder included)

    If you clean up in that regards, and following the guide I proposed I think the issue should be resolved.

    Also, the error log you got could be helpful to share as well.

    I need to come back to you with regards to SES IDE support on the master branch. 

     

  • Hi! Thanks for the hint to the ncs documentation. It seems like I missed that. Compiling and flashing works now. Thanks for the help!

    There is another issue now, but I'll post this separatly.

  • This is odd as I'm trying to program my nrf52 DK (10040 & 10056) but give me the same error.

    ***** BUS FAULT *****
    Precise data bus error
    BFAR Address: 0x2730303f
    ***** Hardware exception *****
    Current thread ID = 0x20001880
    Faulting instruction address = 0x9778
    Fatal fault in thread 0x20001880! Aborting.

    What should I do with these boards?

Related