"break" makes the main() return and go boom.
Giovanni
New from ST: "Nucleo" boards
Moderator: RoccoMarco
- Giovanni
- Site Admin
- Posts: 14891
- Joined: Wed May 27, 2009 8:48 am
- Has thanked: 1202 times
- Been thanked: 996 times
Re: New from ST: "Nucleo" boards
Oh, I didn't even see those...
@Giovanni: But is it correct that one has to manually change the PLL values when changing from HSE to HSI or am I giving wrong advice here?
~ Tectu
@Giovanni: But is it correct that one has to manually change the PLL values when changing from HSE to HSI or am I giving wrong advice here?
~ Tectu
Re: New from ST: "Nucleo" boards
Ah, thanks - this is what I have now, I'll investigate!
Above example simplified, as per your suggestion. I also removed the "break" commands, leftover from an old edit.
Code: Select all
#define STM32_SW STM32_SW_PLL
#define STM32_PLLSRC STM32_PLLSRC_HSI
#define STM32_PLLXTPRE STM32_PLLXTPRE_DIV1
#define STM32_PLLMUL_VALUE 9
Above example simplified, as per your suggestion. I also removed the "break" commands, leftover from an old edit.
Re: New from ST: "Nucleo" boards
Definitely a clock issue, this one blinks just fine:
Ok, that narrows it down considerably.
-jcw
PS. You guys are amazing, helping out within minutes!
Code: Select all
while (true) {
palTogglePad(GPIOA, GPIOA_LED_GREEN);
for (volatile int i = 0; i < 1000000; ++i)
;
// chThdSleepMilliseconds(1);
}
Ok, that narrows it down considerably.
-jcw
PS. You guys are amazing, helping out within minutes!
Re: New from ST: "Nucleo" boards
Problem solved - I had turned off the idle thread, now restored to:
Can't do a chThdSleepMilliseconds() in main() when there's no idle thread to switch to - doh!
Final test code, for reference:
All is well now, both tick-less and with periodic ticks. Onwards!
-jcw
Code: Select all
#define CH_CFG_NO_IDLE_THREAD FALSE
Can't do a chThdSleepMilliseconds() in main() when there's no idle thread to switch to - doh!
Final test code, for reference:
Code: Select all
#include "ch.h"
#include "hal.h"
int main () {
halInit();
chSysInit();
while (true) {
palTogglePad(GPIOA, GPIOA_LED_GREEN);
chThdSleepMilliseconds(500);
}
return 0;
}
All is well now, both tick-less and with periodic ticks. Onwards!
-jcw