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

Hostname in nrfConnect settings is not set when running code

I have set the host name to my aws thing endpoint name per the instructions on the following link

developer.nordicsemi.com/.../README.html

but the hostname ends up blank as you can see in the watch window at the breakpoint

and the settings are show below

and a search on the name in files finds it set in the zephyr.elf and other generated files

Why is the hostname blank?

Parents
  • Hello,

    When you have stopped on line 385 in Segger Embeddes Studio, this line has not yet been executed. Try to set the breakpoint on the next line, and then check the hostname pointer in watch. 

    Best regards,

    Edvin

  • I hit same breakpoint then did a debug "step-over" with still the same result

    The hostname is set in the calling function

    With the define CONFIG_MQTT_BROKER_HOSTNAME

    which is set to mqtt.eclipse.org

  • It also shows up in a search through the obj file for main and the elf files

    So it looks like it is generated by the nrfConnect settings process followed by a build

  • It may be caused by optimization by your compiler. Can you please try to disable the optimization and see if the variable's content is displayed?

Reply
  • It may be caused by optimization by your compiler. Can you please try to disable the optimization and see if the variable's content is displayed?

Children
  • I set the optimization level to optimize for debug

    then reran the program and I get the same result

    I will be working at 09:00 Norway time (02:00 Nashville time) if you are

    able to provide something additional to try

  • Also when I run the simple_mqtt sample the hostname (node in this case) is displayable in the debug window.

  • I should also point out that the reason that I am looking at the hostname in the AWS FOTA sample is because the connection is not being made in the terminal window.

  • I also can use the simple MQTT Sample and change the desired broker (using nrfConnect Settings) to mqtt.dashboard.mqtt.com and publish messages 

  • Hello. I just tested the aws_fota example, and initially (without any modifications) I saw the same behavior as you did. What project settings is the screenshot in your original post from? Menuconfig, mcuboot_menuconfig or spm_menuconfig?

    I tried to set Menuconfig -> ticked of Optimize debugging experience -> pressed Configure:

    And then I can see the hostname pointer:

    Are you sure you selected menuconfig? And that you have not saved the project settings? Please check whether that option is still set.