Skip to main content
Visitor II
November 19, 2020
Question

MbedTLS mutual authentication failed if adding a task

  • November 19, 2020
  • 2 replies
  • 887 views

Hi

I’m suffering a weird problem:

I’d connected my board to my own Mosquitto broker over MBedTLS 2-way authentication, and pub/sub works.

After adding a FreeRTOS timer to send keepAlive messages to broker by timer’s callback, I found my mutual auth failed. But 1-way auth still works.

I removed that software timer, the 2-way auth works again.

I then try to add an empty user task, the 2-way auth can’t work again. Even it is only priority 0.

Did anyone ever meet this similar problem?

What could cause this?

The memory seems sufficient for malloc

The board is based on STM32F2, and my project is created by CubeMX STM32F2 v1.9.0

Its FreeRTOS: V10.0.1

mbed TLS 2.14.1

    This topic has been closed for replies.

    2 replies

    JWang.10Author
    Visitor II
    November 19, 2020

    Hi

    I’m suffering a weird problem:

    I’d connected my board to my own Mosquitto broker over MBedTLS 2-way authentication, and pub/sub works.

    After adding a FreeRTOS timer to send keepAlive messages to broker by timer’s callback, I found my mutual auth failed. But 1-way auth still works.

    I removed that software timer, the 2-way auth works again.

    I then try to add an empty user task, the 2-way auth can’t work again. Even it is only priority 0.

    Did anyone ever meet this similar problem?

    What could cause this?

    The memory seems sufficient for malloc

    The board is based on STM32F2, and my project is created by CubeMX STM32F2 v1.9.0

    Its FreeRTOS: V10.0.1

    mbed TLS 2.14.1

    JWang.10Author
    Visitor II
    November 20, 2020

    Hi All,

    I found the problem and resolved.

    The root cause is still the insufficient memory.

    The memory size to create a new thread is just making the 2-way auth connection can’t get sufficient memory.

    But MbedTLS debug log didn’t express any malloc failed :confounded_face:

    After releasing more memory from others, it can work fine now