STM32F030F4

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32F030F4

Post 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
etrombly
Posts: 10
Joined: Tue Jul 14, 2015 9:26 pm

Re: STM32F030F4

Post 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?)
Eddie
Posts: 44
Joined: Sat Mar 16, 2013 5:57 pm
Has thanked: 2 times
Been thanked: 6 times

Re: STM32F030F4

Post 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
etrombly
Posts: 10
Joined: Tue Jul 14, 2015 9:26 pm

Re: STM32F030F4

Post 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?
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32F030F4

Post 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
Eddie
Posts: 44
Joined: Sat Mar 16, 2013 5:57 pm
Has thanked: 2 times
Been thanked: 6 times

Re: STM32F030F4

Post 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.
Attachments
test.zip
(16.02 KiB) Downloaded 409 times
etrombly
Posts: 10
Joined: Tue Jul 14, 2015 9:26 pm

Re: STM32F030F4

Post 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.
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32F030F4

Post 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
etrombly
Posts: 10
Joined: Tue Jul 14, 2015 9:26 pm

Re: STM32F030F4

Post 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.
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32F030F4

Post 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
Post Reply