Page 1 of 1

Random number generation

Posted: Thu Aug 13, 2015 1:37 pm
by giovanni
When trying to generate a random integer I get following error:

c:/td/td_rf_module_sdk-v4.0.0/gnu/bin/../lib/gcc/arm-none-eabi/4.7.2/../../../../arm-none-eabi/lib/thumb2\libcs3unhosted.a(unhosted-sbrk.o): In function `_sbrk':
sbrk.c:(.text+0x3c): undefined reference to `__cs3_heap_limit'

I have included stdlib.h and am calling the rand() function like I would do in any C program.
Any suggestions?

Kind regards.

Re: Random number generation

Posted: Thu Aug 13, 2015 2:11 pm
by lcheminade
This basically means your binary requires more RAM than available on board. Keep in mind we only have 16Kb of RAM and that using standard librairies usually links a lot of things... A good random number is RTC->CNT for example but you can also use ADC inputs to read some noise.