STM32F100 hangs with a simple Thread depending on the cfg
Posted: Mon Apr 22, 2013 9:08 am
Hi, sorry for the title, but I can not find a suitable one for describing what is happening here.
I am dealing with a STM32F100C8 (8KB RAM and 64KB Flash).
I have modified the linker script SM32F100xB with the new lenght of the Flash (before it was set to 128KB).
The next main works as expected blinking the red LED if #define HAL_USE_I2C is set to TRUE, if not, it hangs.
The next code hangs and it is independent on defining I2C TRUE or FALSE.
Any clues about what is going on?
I am dealing with a STM32F100C8 (8KB RAM and 64KB Flash).
I have modified the linker script SM32F100xB with the new lenght of the Flash (before it was set to 128KB).
The next main works as expected blinking the red LED if #define HAL_USE_I2C is set to TRUE, if not, it hangs.
Code: Select all
#include "ch.h"
#include "hal.h"
static WORKING_AREA(waThread1, 128);
static msg_t Thread1(void *arg) {
(void)arg;
chRegSetThreadName("blinker");
while (TRUE) {
palSetPad(GPIOB, GPIOB_LED_RED);
chThdSleepMilliseconds(500);
palClearPad(GPIOB, GPIOB_LED_RED);
chThdSleepMilliseconds(500);
}
return 0;
}
int main(void) {
halInit();
chSysInit();
chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
while (TRUE) {
chThdSleepMilliseconds(500);
}
}
The next code hangs and it is independent on defining I2C TRUE or FALSE.
Code: Select all
#include "ch.h"
#include "hal.h"
static WORKING_AREA(waThread1, 128);
static msg_t Thread1(void *arg) {
(void)arg;
chRegSetThreadName("blinker");
while (TRUE) {
chThdSleepMilliseconds(500);
}
return 0;
}
int main(void) {
halInit();
chSysInit();
chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL);
while (TRUE) {
palSetPad(GPIOB, GPIOB_LED_RED);
chThdSleepMilliseconds(500);
palClearPad(GPIOB, GPIOB_LED_RED);
chThdSleepMilliseconds(500);
}
}
Any clues about what is going on?