STM32-E407 can't blink led

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

Moderator: RoccoMarco

DashieV3
Posts: 5
Joined: Thu Jun 26, 2014 1:37 pm

STM32-E407 can't blink led

Post by DashieV3 »

Hello,

I've tryied the demo "ARMCM4-STM32F407-LWIP" but it doesn't works on the E407 (no ping nor web page, led doesn't blink).

I've found that the F407 is different than the E407 finally, so i've tryied to do a simple blink to start.

I've edited Makefile to use "$(CHIBIOS)/boards/OLIMEX_STM32_E407/board.mk" instead of F407, updated "mcuconf.h" for the PLL:
"#define STM32_PLLM_VALUE 12" because the one for F407 isn't the same and used :

Code: Select all

main... () {
palSetPadMode(GPIOC, GPIOC_LED, PAL_MODE_OUTPUT_PUSHPULL);

  while (TRUE) {
          palClearPad(GPIOC, GPIOC_LED);
          chThdSleepMilliseconds(500);
          palSetPad(GPIOC, GPIOC_LED);
          chThdSleepMilliseconds(500);
  }


For what i understand GPIOC_LED is the only led on the board and got GPIOx_foo from board definition, but it doesn't blink.
The programmation using SWD is working (confirmed with the demo blink from Olimex) but the led doesn't change.

To verify that she isn't dead i've tryied the demo from Olimex eclipse package "OlimexODS/examples/STM32-E407_blink_FLASH" and it act as wanted...

Any ideas how to get a working blink programm to start with ChibiOS ? I've found some bits talking about PLL values and things in the mcuconf.h file for the E407 but can't found a "working" one to test for it.

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

Re: STM32-E407 can't blink led

Post by Giovanni »

Hi,

You need to create "board files" for your board, basically you have to define the programmed function for *each* pin used on the board looking at schematics and Reference Manual.

In ChibiStudio there is a board files generator that uses an XML description as input named board.chcfg, see the various topics regarding this process.

Search for ".chcfg".

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

Re: STM32-E407 can't blink led

Post by Giovanni »

Wait, there are two revisions of that board, look under ./boards. Probably you have the other one, edit the Makefile to point to the other board files.

Giovanni
DashieV3
Posts: 5
Joined: Thu Jun 26, 2014 1:37 pm

Re: STM32-E407 can't blink led

Post by DashieV3 »

Hi, thanks.

I've missed the step of assigning pins.. i will look with ChibiStudio.

My board is REV.E so i think the board files are "OLIMEX_STM32_E407" instead of "OLIMEX_STM32_E407_REV_D".
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32-E407 can't blink led

Post by Giovanni »

I think "D" is newer, you should verify if it is different from "E".

Giovanni
DashieV3
Posts: 5
Joined: Thu Jun 26, 2014 1:37 pm

Re: STM32-E407 can't blink led

Post by DashieV3 »

right, according to the manual there seems to be no hw change impact on the board specs since REV_D, so my board does use the REV_E (because of the ethernet change in REV.D).

i've searched about ".chcfg" and be able to re-generate files using ChibiStudio but dont understand yet what to edit in that file.

For the LED pin the schematics says:

Code: Select all

PC12/UART5_TX/SDIO_CK/DCMI_D9/SPI3_MOSI/I2S3_SD/USART3_CK |113___________PC12/SD_CLK
                                             PC13/RTC_AF1 |7_____________LED


Does that tell me that i can use the PC13 pin to "activate" the RTC _or_ use the LED ?
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32-E407 can't blink led

Post by Giovanni »

On one side there are all the possible configurations for the pin, the other side is how it is actually used. You have to program it accordingly.

See the GPIO section in the Reference Manual.

Giovanni
DashieV3
Posts: 5
Joined: Thu Jun 26, 2014 1:37 pm

Re: STM32-E407 can't blink led

Post by DashieV3 »

i'm stuck with the chcfg thing.

As i understand there is only one choice for the PIN13, then the default chcfg doesn't needs to be changed ?

Code: Select all

<pin13 ID="LED" Type="PushPull" Speed="Maximum" Resistor="Floating" Level="High" Mode="Output" Alternate="0" />


If yes, my first post, with the right clock settings should works, right ?
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: STM32-E407 can't blink led

Post by Giovanni »

If your revision E is similar to revision D then the demo should work after changing the makefile to use the rev D.

Giovanni
dalbert
Posts: 16
Joined: Mon Mar 02, 2015 8:02 pm

Re: STM32-E407 can't blink led

Post by dalbert »

I know this is an old post, but I had a similar problem: for a rev E board, you need to change the top level Makefile to use boards/OLIMEX_STM32_E407_REV_D *and also* change the board.mk file in OLIMEX_STM32_E407_REV_D (which still points to the pre-rev-D files).
Post Reply