2012-08-24 07:23 AM
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 filebut 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;..... a=rand();....}2012-08-24 08:43 AM
With WHAT compiler/toolchain?
Most likely cause of a Hard Fault is that you have linked a library with ARM 32-bit code, which doesn't run on the Cortex-M3 Use your debugger to look at the faulting instruction, and perhaps use a fault handler that can decode the condition, rather than a while(1) loop. Joseph Yiu has published a book, and web examples of such.2012-08-24 10:58 AM
thanks for the answer
i use atollic 3.0. when i use a debugger i can't see the exectly point when the code jump in the default heandler because when i try to step into the function the execution jump in the default heandler. i search on internet and i think the problem could be that i haven't link the stdlib with the compiler but i haven't idea to resolve that. how can do?thanksLuca2012-08-24 11:12 AM
''i would generate a random number''
Remember that rand() does not generate true random numbers - just pseudo-random...
2012-08-24 11:14 AM
Stupid forum insists on hiding text as ''quoted message''
''i would generate a random number''
Remember that rand() does not generate true random numbers - just pseudo-random...
2012-08-24 11:27 AM
2013-02-08 06:52 PM
what this problem ???
http://www.hostingpics.net/viewer.php?id=863791Sanstitre.png
http://www.hostingpics.net/viewer.php?id=863791Sanstitre.png
2013-02-08 07:00 PM
what this problem ???
It appears unrelated to this thread. That BOARD_HEADER isn't resolving to a quoted file name in the preprocessor?