cancel
Showing results for 
Search instead for 
Did you mean: 

stm32w

lucabe90
Associate II
Posted on August 24, 2012 at 14:51

hi 

i have a problem with the stm32w  mb851a 

i would generate a random number. i have try to use the function rand() and I include header file

but when i execute the program it jump at 

void __attribute__ ((weak)) Default_Handler()

{

/* Hang here */

while(1)

{

}

}

why?

this is my include files

&sharpinclude PLATFORM_HEADER

&sharpinclude BOARD_HEADER

&sharpinclude ''hal/hal.h''

&sharpinclude ''hal/micro/cortexm3/uart.h''

&sharpinclude ''hal/micro/micro-common.h''

&sharpinclude ''hal/micro/cortexm3/micro-common.h''

&sharpinclude ''include/phy-library.h''

&sharpinclude ''hal/error.h''

&sharpinclude <stdio.h>

&sharpinclude <stdlib.h>

&sharpinclude ''hal/micro/temperature_sensor.h''

&sharpinclude <time.h>

&sharpinclude <math.h>

...

int main()

{

int a=0;

.....

 srand(time(NULL));

   a=rand();

....

}

#duplicate-post
2 REPLIES 2
Posted on August 24, 2012 at 17:55

Cross posting, see answer/suggestion in STM32 forum

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on August 24, 2012 at 20:17

/7210dc85