Menu

#101 Led wont blink.

Version 1.x
closed
None
5
2015-02-07
2015-01-16
Martin.B
No

Hi All. I’m a newbie as you will discover.

I’ve just spend quite some time getting my ST Arm tool chain up and running. I’m using Eclipse Kepler SR2 with CDT, and the GNU ARM Eclipse Plug-in. I created a new C project using the STM32F10x templates, and the blink a led project files. It compiles and loads without a problem.

I’m using an STM32VL Discovery board fitted with the STM32F100RB CPU. One of the leds on the discovery board is connected to PC8, and I have made a change to the default BLINK_PIN_NUMBER from (12) to (8).

Well it won’t blink?,..noting?, and can someone please help out interpreting this thing here,…

define BLINK_GPIOx(_N) ((GPIO_TypeDef )(GPIOA_BASE + (GPIOB_BASE-GPIOA_BASE)(_N)))

What the hell is it?, the comment in the BlinkLed.h file reads:
“// Olimex STM32-H103 definitions (the GREEN led, C12, active low). “

The schematic for STM32-H103 shows PC12 as stated by the comment above, so I’m a bit confused as to why the define statement above refers to GPIOA_BASE, and GPIOB_BASE?, does it end up addressing PORTC?

Thanks for your help
Cheers
mb

Discussion

  • Liviu Ionescu (ilg)

    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,4 +1,3 @@
    -
     Hi All. I’m a newbie as you will discover.
    
     I’ve just spend quite some time getting my ST Arm tool chain up and running. I’m using Eclipse Kepler SR2 with CDT, and the GNU ARM Eclipse Plug-in.  I created a new C project using the STM32F10x templates, and the blink a led project files. It compiles and loads without a problem. 
    
    • status: open --> accepted
    • assigned_to: Liviu Ionescu (ilg)
     
  • Liviu Ionescu (ilg)

    does it end up addressing PORTC?

    yes

    it is simple arithmetic, and assumes all ports have equal size.

     
  • Martin.B

    Martin.B - 2015-01-16

    ok, thanks Liviu, any ideas why the led on PC8 wont blink?, in fact before I change the port pin, PC12 would not toggle as well, I haven't made any other changes apart from what I've listed above.

    mb

     
  • Liviu Ionescu (ilg)

    any ideas why the led on PC8 wont blink?

    nope, but I guess you are doing a mistake somewhere. just single step the program and check what happens when you execute the instructions intended to toggle the led. also check the registers, possibly single step the assembly code.

     
  • Martin.B

    Martin.B - 2015-01-16

    I will re-do the complete installation once more, its late and I probably missed something. Working out how to single step is a bit of an ask (newbie remember).

    Thanks for your help

    mb

     

    Last edit: Martin.B 2015-01-17
  • Martin.B

    Martin.B - 2015-01-17
     

    Last edit: Martin.B 2015-01-17
  • Martin.B

    Martin.B - 2015-01-17

    ok, great thanks, in fact the documentation is very good, cant wait to get all the arm tools up and running.

    cheers

     
  • Liviu Ionescu (ilg)

    • status: accepted --> closed