cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F411E-DISCO board basics

garthy_ts2
Associate II
Posted on August 21, 2016 at 10:36

I was wondering if anyone is able to provide the following:

- A link to the prebuilt existing image as originally supplied with the STM32F411E discovery boards. Preferably as a single file, but failing that clear directions on how to obtain it (eg. download link and specific file to look for).

- A link to a set of simple step-by-step known working instructions that can be followed by a small child to flash this image to the STM32F411E board.

- A link to a simple minimal example in source code form that blinks a single LED on this board on and off.

- A link to a set of simple step-by-step known working instructions that can be followed by a small child to build an image from this source and flash this image to the STM32F411E board.

Preferred environment is Linux (arm-none-eabi-gcc,  gdb-arm-none-eabi, openocd, and texane stlink installed) given the choice, but at this point I'll do it on an abacus if it is viable.
6 REPLIES 6
Posted on August 21, 2016 at 16:38

I've attached a .HEX file with the original F411-DISCO board to this post. You'd download a copy of the ST-LINK Utilities, load the file into that, and then program it. ie File->Open, Target->Program

________________

Attachments :

F411E-DISCO.hex : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hzmu&d=%2Fa%2F0X0000000bPd%2FgSC.DmdToix6yWPdD5_RXcOg6_R.M_Yhk0qLLt3ExP0&asPdf=false
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
garthy_ts2
Associate II
Posted on August 22, 2016 at 14:51

Thankyou Clive1 for taking the time to track the image down and put together a quick list of instructions, much appreciated.

I've taken the attached file, downloaded the ST-Link V2 software on Windows, installed the device driver, fired up the ST-Link utility, and followed the steps you provided with some minor changes. Everything worked beautifully.

The installation files I used were from here:

http://www.st.com/content/st_com/en/products/development-tools/hardware-development-tools/development-tool-hardware-for-mcus/debug-hardware-for-mcus/debug-hardware-for-stm32-mcus/st-link-v2.html

Some additional context that was missing from my original post:

I've been trying to get things going on a Linux box with the arm-none-eabi toolset, and not having a lot of luck. I have been struggling with both my unfamiliarity with the platform and some intermittent hardware issues. I'd reached the point where I really needed to go back, confirm a working environment with the best-supported tools, and be able to program something that I could use to confirm that the program has worked. Any sort of LED blinker would suit, but having the same image that I had seen working on the board previously would have been be ideal.

Thankyou for your post and for getting me back onto the right track. This gives me a lot to experiment with. Being armed with a known working case will hopegully mean that I can figure out what has been going wrong thus far.

...

So, it looks like I'm well-covered for the first two questions now. 🙂

In asking the latter two questions in my original post, I was hoping to get a better idea as to the best place to start in order to get a trivial image running. Being new to the platform, I do not yet know the best-supported toolchain, nor the best-supported level to come in at (eg. low-level, CMSIS, HAL, something else?) yet. Having one solid working example means that I can use this to diagnose problems with less trivial examples, as well as giving me a foundation on which I can build further.

Any thoughts welcome. 🙂

Amel NASRI
ST Employee
Posted on August 22, 2016 at 14:53

Hi _._.156,

You may find all what you need to get started with the Discovery kit for STM32F411 line in

http://www.st.com/content/st_com/en/products/evaluation-tools/product-evaluation-tools/mcu-eval-tools/stm32-mcu-eval-tools/stm32-mcu-discovery-kits/32f411ediscovery.html

. Simple examples as well as more complicated ones may be found in the

http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32cube-embedded-software/stm32cubef4.html

(STM32Cube_FW_F4_V1.13.0\Projects\STM32F411E-Discovery).

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Amel NASRI
ST Employee
Posted on August 22, 2016 at 15:07

As IDE, I recommend you to select the

http://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-ides/sw4stm32.html?sc=sw4stm32

free toolchain which can be used on Linux platform.

Pre-configured projects for SW4STM32 and other IDEs are available in the Cube package. The demonstration you are looking for is under STM32Cube_FW_F4_V1.13.0\Projects\STM32F411E-Discovery\Demonstrations.

-Mayla-

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Posted on August 22, 2016 at 16:28

I use the Standard Peripheral Library (SPL), with Keil, in Windows. It is uncomplicated.

I can build things with makefiles and GNU/GCC, and have published a couple of examples of doing that with STM32F4-DISCO boards, although admittedly not the 411E.

I wouldn't be that hard to fashion an example build that would blink the LEDs, or output to a serial connector on an

http://www.newark.com/stmicroelectronics/stm32f4dis-bb/expansion-stm32f4-cortex-m4-for/dp/47W1731

or via the SWV

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
garthy_ts2
Associate II
Posted on August 24, 2016 at 13:32

I was recently able to get a simple blinker going with arm-none-eabi under Linux. Everything should be downhill from here.

For anyone else looking to solve the same problem, here are some Makefile settings that may help:

INCLUDES=-I../Inc -I ../Drivers/STM32F4xx_HAL_Driver/Inc -I../Drivers/CMSIS/Device/ST/STM32F4xx/Include -I../Drivers/CMSIS/Include

CFLAGS=-DSTM32F411xE -Wall -mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard $(INCLUDES) -O2

LDFLAGS=-mcpu=cortex-m4 -mthumb -mfpu=fpv4-sp-d16 -mfloat-abi=hard -TSTM32F411VETx_FLASH.ld --specs=nosys.specs

ADDR=0x8000000

OBJS=main.o stm32f4xx_hal_gpio.o stm32f4xx_hal_rcc.o stm32f4xx_hal_msp.o stm32f4xx_it.o stm32f4xx_hal.o stm32f4xx_hal_cortex.o system_stm32f4xx.o startup_stm32f411xe.o

Here are some of the rules I used:

main.o: main.c

        $(CC) $(CFLAGS) -c -o $@ $<

stm32f4xx_hal.o: ../Drivers/STM32F4xx_HAL_Driver/Src/stm32f4xx_hal.c

        $(CC) $(CFLAGS) -c -o $@ $<

startup_stm32f411xe.o: ../Drivers/CMSIS/Device/ST/STM32F4xx/Source/Templates/gcc/startup_stm32f411xe.s

        $(CC) $(CFLAGS) -c -o $@ $<

foo.bin: foo.elf

        $(OBJCOPY) -Obinary foo.elf foo.bin

        

foo.elf: $(OBJS) main.o

        $(LD) $(LDFLAGS) -o $@ $(OBJS)

flash: foo.bin

        st-flash --reset write foo.bin $(ADDR)

Note that this was a hack job- it's not neat. The aim was to get something going, making it pretty can come later. 😉

The base code is a mish-mash of CubeMX generated code using ''Other Toolchains (GPDSC)'', and some from ''SW4STM32''. It is probably easier to just start with SW4STM32 (thanks Mayla), but I can't confirm the steps there.

STM32F411VETx_FLASH.ld was generated by CubeMX using SW4STM32 and used without change. I don't believe the other toolchain generated an ld file that I could use.

I believe ''startup_stm32f411xe.s'' is needed to resolve a missing init or exit or similar.

I experimented with ''-nostdlib'' and ''-nostartfiles'', but didn't succeed with these options.

The hex code and ST-Link advice from clive1 was invaluable for confirming the ability to flash, how correct data should look, and what many of the correct settings were (thanks clive1).

I can't promise that the above is the best way to do it- it's just the first solution I was able to find. Someone with more experience with the environment could probably offer a far better solution.

Thankyou clive1 and Mayla for your suggestions and advice- there were too many variables for me to be able to solve this problem without your input. There are still a number of pointers that you have given that I intend to explore fully. Thanks again. 🙂