3 Replies Latest reply on Nov 2, 2016 12:05 AM by jackson_lv

    how to creat random number?

    jackson_lv

      I am using WICED SDK 3.7.0 and I want to creat some random number.I try

       

      srand(time(NULL));

      uint8_t value = rand()%255;

       

      but I get error lib/thumb/v7em\libc.a(lib_a-gettimeofdayr.o): In function `_gettimeofday_r':

      c:\pf8_3\Wiced-Tool-Source\ARM_GNU\newlib-build\arm-none-eabi\thumb\v7em\newlib\libc\reent/../../../../../../../newlib-2.0.0/newlib/libc/reent/gettimeofdayr.c:71: undefined reference to `_gettimeofday'

      tools/makefiles/wiced_elf.mk:240: recipe for target 'build/' failed

       

      If I block the srand(time(NULL));  the target can be made without error but the value is the same .Can somebody tell me how to creat random value?THS!