AnsweredAssumed Answered

stm32w

Question asked by berardi.luca on Aug 24, 2012
Latest reply on Aug 24, 2012 by Andrew Neil
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

#include PLATFORM_HEADER
#include BOARD_HEADER
#include "hal/hal.h"
#include "hal/micro/cortexm3/uart.h"
#include "hal/micro/micro-common.h"
#include "hal/micro/cortexm3/micro-common.h"
#include "include/phy-library.h"
#include "hal/error.h"
#include <stdio.h>
#include <stdlib.h>
#include "hal/micro/temperature_sensor.h"
#include <time.h>
#include <math.h>
...
int main()
{
int a=0;


.....

 srand(time(NULL));
   a=rand();

....
}

Outcomes