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

MQTT+TLS does not work when including math.h

I'm developing a device using mqtt+tls referring the link here.

https://devzone.nordicsemi.com/f/nordic-q-a/48407/how-to-use-mqtt-tls-in-nrf9160

When I add CONFIG_NEWLIB_LIBC=y to prj.conf and #include <math.h> to main.c,
certificates.h file which is put under src folder does not seem to be included in main.c.

If I comment out the two lines, certificates.h file seems to be included in main.c.

CA_CERTIFICATE, CLIENT_PRIVATE_KEY, and CLIENT_PUBLIC_CERTIFICATE are defined in certificates.h.

Is this bug?

Parents
  • Hi,

    Are you sure that e.g CA_CERTIFICATE is defined ? If yes, it could be a visual GUI bug in SES.

    If you run the code, do you get e.g. "Write ca certs sec_tag:" printed in the terminal ?

  • I'm sure CA_CERTIFICATE is defined in certificates.h

    Although there are some warning when I add CONFIG_NEWLIB_LIBC=y to prj.conf and #include <math.h> to main.c, the program works out! This bug might not affect the program behavior itself.

  • Yusuke said:
    This bug might not affect the program behavior itself.

     Good, if you also see e.g "Write ca certs sec_tag" printed on the terminal, which is only printed when CA_CERTIFICATE is defined, then this is just a visual bug in SES.

  • Yea, it's printed

    SPM: NS image at 0xc000
    SPM: NS MSP at 0x20024bd8
    SPM: NS reset vector at 0x14aad
    SPM: prepare to jump to Non-Secure image.
    ***** Booting Zephyr OS v1.14.99-ncs2-rc3 *****
    The MQTT simple sample started
    Deleting certs sec_tag: 16842753
    nrf_inbuilt_key_delete(16842753, 0) => result=2
    Deleting certs sec_tag: 16842753
    nrf_inbuilt_key_delete(16842753, 1) => result=2
    Deleting certs sec_tag: 16842753
    nrf_inbuilt_key_delete(16842753, 2) => result=2
    Deleting certs sec_tag: 16842753
    nrf_inbuilt_key_delete(16842753, 3) => result=2
    Deleting certs sec_tag: 16842753
    nrf_inbuilt_key_delete(16842753, 4) => result=2
    Write ca certs sec_tag: 16842753
    Write private cert sec_tag: 16842753
    Write public cert sec_tag: 16842753
    LTE Link Connecting ...

Reply
  • Yea, it's printed

    SPM: NS image at 0xc000
    SPM: NS MSP at 0x20024bd8
    SPM: NS reset vector at 0x14aad
    SPM: prepare to jump to Non-Secure image.
    ***** Booting Zephyr OS v1.14.99-ncs2-rc3 *****
    The MQTT simple sample started
    Deleting certs sec_tag: 16842753
    nrf_inbuilt_key_delete(16842753, 0) => result=2
    Deleting certs sec_tag: 16842753
    nrf_inbuilt_key_delete(16842753, 1) => result=2
    Deleting certs sec_tag: 16842753
    nrf_inbuilt_key_delete(16842753, 2) => result=2
    Deleting certs sec_tag: 16842753
    nrf_inbuilt_key_delete(16842753, 3) => result=2
    Deleting certs sec_tag: 16842753
    nrf_inbuilt_key_delete(16842753, 4) => result=2
    Write ca certs sec_tag: 16842753
    Write private cert sec_tag: 16842753
    Write public cert sec_tag: 16842753
    LTE Link Connecting ...

Children
No Data
Related