Page 2 of 3

Re: STM32F030F4

Posted: Wed Jul 15, 2015 9:31 am
by Giovanni
I looked at the latest ST headers, apparently the STM32F030F4 is not yet supported. Cloning the x6 is the way to go.

Giovanni

Re: STM32F030F4

Posted: Wed Jul 15, 2015 9:51 am
by etrombly
your example compiles and flashes fine (changed GPIOA_LED_GREEN to GPIOA_PIN5, that's where my led is hooked up). It's not blinking though, the led is at about 1/4 brightness (the same on all port a pins).

Code: Select all

Reading symbols from build/ch.elf...done.
Remote debugging using :4242
_idle_thread (p=0x0) at ../../../ChibiOS/os/rt/src/chsys.c:72
72          port_wait_for_interrupt();
(gdb) c
Continuing.
^C
Program received signal SIGTRAP, Trace/breakpoint trap.
0x08000402 in port_wait_for_interrupt () at ../../../ChibiOS/os/rt/ports/ARMCMx/chcore_v6m.h:401
401     }
(gdb) bt
#0  0x08000402 in port_wait_for_interrupt () at ../../../ChibiOS/os/rt/ports/ARMCMx/chcore_v6m.h:401
#1  0x080005ca in _idle_thread (p=0x0) at ../../../ChibiOS/os/rt/src/chsys.c:72
#2  0x080001a6 in _port_thread_start ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

Re: STM32F030F4

Posted: Wed Jul 15, 2015 9:54 am
by Eddie
it seems that the ST uses stm32f030x6.h for F030x4

Code: Select all

  * @file    stm32f030x6.h
  * @author  MCD Application Team
  * @version V2.0.1
  * @date    18-June-2014
  * @brief   CMSIS STM32F030x4/STM32F030x6 devices Peripheral Access Layer Header


Giovanni wrote:I looked at the latest ST headers, apparently the STM32F030F4 is not yet supported. Cloning the x6 is the way to go.

Giovanni

Re: STM32F030F4

Posted: Fri Jul 17, 2015 5:37 am
by etrombly
So I've made some progress with your example Eddie. It seems like there are some issues with chThdSleepMilliseconds not returning though. With the example blink code you provided it was not blinking. If I change the sleep to a delay it blinks.

Code: Select all

void delay (int a);

/*
 * Red LED blinker thread, times are in milliseconds.
 */
static THD_WORKING_AREA(waThread1, 128);
static THD_FUNCTION(Thread1, arg) {

  (void)arg;
  chRegSetThreadName("blinker");
  while (TRUE) {
    palClearPad(GPIOA, GPIOA_PIN5);
    //chThdSleepMilliseconds(500);
    delay(100000);
    palSetPad(GPIOA, GPIOA_PIN5);
    delay(100000);
    //chThdSleepMilliseconds(500);
  }
}

void delay (int a)
{
   volatile int i,j;
   
   for (i=0 ; i < a ; i++)
   {
      j++;
   }
   
   return;
}


if I switch back to sleeping here is the trace:

Code: Select all

#0  port_wait_for_interrupt () at ../../../ChibiOS/os/rt/ports/ARMCMx/chcore_v6m.h:401
#1  0x0800051a in _idle_thread (p=0x0) at ../../../ChibiOS/os/rt/src/chsys.c:72
#2  0x080001a6 in _port_thread_start ()
Backtrace stopped: previous frame identical to this frame (corrupt stack?)

looks like maybe the thread is never starting correctly?

Re: STM32F030F4

Posted: Fri Jul 17, 2015 8:22 am
by Giovanni
There is a problem with system tick apparently.

BTW, is some board with this device available? It is an interesting little device but I found nothing on the ST web site.

Giovanni

Re: STM32F030F4

Posted: Fri Jul 17, 2015 9:49 am
by Eddie
etrombly wrote:So I've made some progress with your example Eddie. It seems like there are some issues with chThdSleepMilliseconds not returning though. With the example blink code you provided it was not blinking. If I change the sleep to a delay it blinks.

looks like maybe the thread is never starting correctly?


Try bin or hex from attachment, led changed to PA5.

Re: STM32F030F4

Posted: Fri Jul 17, 2015 12:31 pm
by etrombly
The bin you sent works. Maybe it's my compiler? Here is the board I'm using http://www.aliexpress.com/item/ST-M0-mi ... 84748.html It's pretty cheap to play around with.

Re: STM32F030F4

Posted: Fri Jul 17, 2015 12:37 pm
by Giovanni
OMG, it is dirty cheap :) I will buy some of those.

About the compiler, this one works for sure: https://launchpad.net/gcc-arm-embedded

Giovanni

Re: STM32F030F4

Posted: Fri Jul 17, 2015 1:20 pm
by etrombly
ok, that is on gcc 4.9. I'm using 5.1.0 and LTO wasn't working either. I'll try the older version.

Re: STM32F030F4

Posted: Fri Jul 17, 2015 1:31 pm
by Giovanni
I am very prudent with compilers, 4.9.x is OK but I am staying with the latest 4.7.x.

Not all benchmarks are better on 4.9 compared to 4.7.

Giovanni