1

(4 replies, posted in wolfSSL)

I have managed to compile the MQX example code on the TWRK60F120M with MQX4.0
Because of the new directory structure in MQX4.0, the include paths for the projects needed to be changed.

There was no problem when I ran the project with the debugger attached. However, when the debugger was stopped and the tower board reset. The wolfssl_client example will get stuck after the Ethernet device is bound to an IP.

The problem seems to be caused by the XTIME function in asn.c -> ValidateDate() LINE 1706.

To resolve this problem, an MQX specific time implementation was added.

#ifdef FREESCALE_MQX

time_t time(time_t* timer)
{
    TIME_STRUCT   mqx_time;
    time_t        localTime;

    if (timer == NULL)
        timer = &localTime;

    _time_get(&mqx_time);   
    *timer = (time_t)mqx_time.SECONDS;

    return *timer;
}

#endif /* FREESCALE_MQX */

I am unsure if this is the right way to do it, or the right solution.
But the example code can now run till the end without the debugger attached.
It is able to connect to the HTTPS server and load the index.html

I hope somebody can comment on this.

Thanks.