Topic: wolfSSL on Freescale MQX 4.0

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.

Share

Re: wolfSSL on Freescale MQX 4.0

Hi,

Thanks for the report and for letting us know what worked for you.  When we put the example MQX project files together, we were using MQX 3.8 with a TWRK70F120M.  It looks like we'll have to update them for 4.0.  Thanks again for the note - I'll keep you updated on the status of this and what we find.

Thanks,
Chris

Re: wolfSSL on Freescale MQX 4.0

Dear Chris,

Do you know when will release the new wolfSSL embedded SSL for Freescale MQX 4.0 and codewarrior 10.3?


Thanks.
Best Regards,
Sean Wu
Weikeng Inc.

Share

Re: wolfSSL on Freescale MQX 4.0

Hello all,

I have managed to compile and run the MQX example in a twrk60n512 with MQX 3.8. However, I had some problems with the example, is there a readme or guide explaining how to test it?

I ran the server example on a Linux machine, but noticed after adding some printfs that the "-v 0" (SSLv3) argument was being ignored when "-b eth1" was also present, only if the order was "./server -b eth1 -v 0" (with "./server -v 0 -b eth1") it worked.
Is this the way I was supposed to test it or is there a public server for this test?

Also, I've had the same problem than HardDrive, and adding the time function did solved it. However, do you init the mqx time at compile time or sync from the internet? I call _time_set() when it first runs with localtime and it's enough for me, but I don't think it's a good approach.

Finally, I have the RNG macro commented for now (it seems to be different from K70s), did you enabled it? Could you give some hints on how you ported it?

Best regards,

Sebastián.-

Share

Re: wolfSSL on Freescale MQX 4.0

...do you init the mqx time at compile time or sync from the internet? I call _time_set() when it first runs with localtime and it's enough for me, but I don't think it's a good approach.

Ok, that was easy, I just call SNTP_oneshot( IPADDR(64,90,182,55), 20000); to update the timer. And I've just noticed that you are using a TWRK60F120 which has an RNGA as K70, mine has an RNGB, so I should modify the function in random.c.

Share