A blog about electronics and programming
Home ElectronicsSTM32 Getting started with the STM32 Nucleo-F746ZG

Getting started with the STM32 Nucleo-F746ZG

by Carmine Noviello
80 comments 4.4K views 17 minutes read

Finally the totally new Nucleo-F746 is in my hands! This is the first development kit of the Nucleo-144 line from ST, and I've to say that probably, at that street price (~23$), is the best development kit a maker can find on the market, if you consider that a genuine Arduino DUE costs more than 40$ and its MCU is just a Cortex-M3.

nucleo-144-vs-nucleo-64

Compared to the classic Nucleo-64, it looks impressive: it's more wider and offers a lot of more "standard" peripherals. The USER LEDs are now three (red, blue and green), and the power LED is now green. The most relevant thing is that the board comes with a LAN jack, magnetics and a SMSC phyther. This means that we can start developing IoT applications using the powerful Cortex-M7 core running at 216MHz. Respect to the STM32F746-Discovery, which was the first "cheap" F7 development board from ST, it doesn't provide an LCD display. However, the Nucleo-144 provides the most of MCU signal I/Os through the "Zio" connectors, while the Discovery-F7 only few signals routed to the Arduino-style connectors. If you are going to use the Nucleo-144 to develop a custom product, then it's the best option.

In this post I will show you the steps needed to start working with this fantastic piece of hardware. We'll use the LwIP stack to create a simple web server running on the Nucleo. The web-app will allow us to interact with Nucleo LEDs and USER BUTTON, using bootstrap and jQuery. The following video shows how the HTTP server works.

I'll assume that you have a working Eclipse/GCC ARM tool-chain based on the excellent GNU ARM Eclipse plug-ins by Liviu Ionescu. If you don't have the whole tool-chain installed, please refer to the free sample of my book about STM32 platform: you'll find all the required instructions to getting started with those tools. It's completely useless repeat here more that 40 pages of instructions.

[box type="warning" align="" class="" width=""]Read carefully

My book currently relies on OpenOCD 0.9. However, this release doesn't support the STM32F7, so you'll need a preview of the release 0.10. Liviu provides a precompiled release for Windows, Linux and MacOS. You can download it from here.[/box]

STEP1: Create a new Eclipse project

The first step is creating a new Eclipse project. Liviu Ionescu has recently updated the project templates, adding the support to STM32F7 MCUs. However, we use another procedure here: we'll first create a basic ARM C/C++ project, and then we'll import inside it a project generated by CubeMX, which simplify a lot the MCU configuration procedure. Moreover, it will allow us to quickly import the LwIP stack, which is used to develop TCP/IP applications with STM32 MCUs.

So, go to File->New->C Project and select the entry Hello World ARM Cortex-M C/C++ Project. Give the name you like to the project. Click on Next.

Schermata 2016-01-21 alle 12.47.23

In the next step select Cortex-M7 from the Processor core entry, insert 1024 inside the Flash size field and 320 in the RAM size field, as shown below.

Schermata 2016-01-21 alle 12.50.05

[box type="info" align="" class="" width=""]Where are those numbers coming from?

Those numbers are nothing more than the size of FLASH and SRAM memories in a STM32F746 MCU. They are used to generate the right linker script, as we'll see next. [/box]

Click on Next. In the next step leave all unchanged except for the Vendor CMSIS field: write stm32f7xx inside it, as shown below.

Schermata 2016-01-21 alle 12.53.43

Complete the project wizard leaving all standard options.

Now, before we import a CubeMX project inside this Eclipse project, it's better to modify the ldscripts/mem.ld file. By default, the GNU ARM plug-in assigns 0x00000000 as starting address for the FLASH memory, while in all STM32 MCUs the internal FLASH is mapped at 0x08000000. So, from the Eclipse IDE open the file ldscripts/mem.ld and write the first line of the MEMORY section as shown below:

...
MEMORY
{
  FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
  RAM (xrw)  : ORIGIN = 0x20000000, LENGTH = 320K
...

Ok. The next important step is to CLOSE the Eclipse project, before we import the CubeMX.

[box type="warning" align="" class="" width=""]Do not skip this step! Close the Eclipse project before continuing the tutorial!!!!![/box]

STEP2: Create a new CubeMX project

Now we need to create a new project in CubeMX. First of all, ensure that you have the latest version of CubeMX, which at time of writing this tutorial is the 4.12. This is the first version that supports the Nucelo-144 line-up, so it's important to have at least this release.

Launch CubeMX and start a new project. In the New Project wizard select the Board Selector tab, and choose the Nucleo-F746ZG from the list. Be sure that the flag "Initialize all IP with their default mode" is checked. Click on OK and wait for project generation.

[box type="warning" align="" class="" width=""]Read carefully

At the time of writing this post, January 22th, 2016, a bug affects CubeMX 4.12. This bug is related to the project configuration for this Nucleo, and I've already submitted it to ST. CubeMX simply assigns a wrong address to the Ethernet Phyther. To fix this, go inside the Configuration section in CubeMX and click on the Eth button. In the PHY Address config, change the value from 1 to 0, as shown below.

Schermata 2016-01-22 alle 08.16.30

Probably, when you read this post it will be fixed, but it's best to take a look.[/box]

Ok. Now we need to enable two middleware stacks: FreeRTOS and LwIP. From the IP Tree pane (the tree view on the left in CubeMX), enable FREERTOS and LWIP modules, as shown below.

Schermata 2016-01-22 alle 08.28.53

Now go inside the Configuration section in CubeMX and click on the LWIP button. In the DHCP section disable the DHCP module, and assign a static IP address as shown below:

Schermata 2016-01-22 alle 08.30.51

The IP address must match your network configuration. Click on the OK button. Ok. Now we are ready to generate the project code. Go in the Project->Generate Code menu. Choose the Project Name you like (I chose nucleo-f7), but ensure that the Toolchain/IDE selected is the SW4STM32, as shown below.

Schermata 2016-01-22 alle 08.34.15

Click on the OK button.

STEP3: Import the CubeMX project in Eclipse

Now we have to import the project generated with CubeMX inside the Eclipse project made so far. To do this, we'll use a tool I've made. It's named CubeMXImporter, and it's available on my github account. The tool relies on Python 2.7 (NOT 3.x) and the lxml library. Here you can find all the installation instructions. Once CubeMXImporter is installed, open a terminal command line, and write the following command:

For example, if you named the Eclipse project as stm32-nucleo144-f7 and the CubeMX as nucleo-f7, than the command must be invoked in the following way:

CubeMXImporter will automatically import the project skeleton, the CubeF7 HAL and middleware libraries (LwIP and FreeRTOS) inside the Eclipse project.

Ok, now we can reopen the project in Eclipse. Once opened, click with the right mouse button on the project name in the Project Explorer view and select the Refresh entry.
As suggested by the CubeMXImporter tool, we now need to do a couple of things manually. First of all, we need to specify the right FPU configuration for the Cortex-M7. So go inside the Project Settings->C/C++ Build->Settings->Target Processor. In the Float ABI field select "FP instructions (hard)" and in the FPU Type field select "fpv5-sp-d16", as shown below.

Schermata 2016-01-22 alle 08.47.47

Click on the OK. Now we have to select the right FreeRTOS algorithm. In the Project Explorer view, go inside the Middlewares/Third_Party/FreeRTOS/Source/portable/MemMang folder. Select the files heap_1.cheap_2.cheap_3.c and heap_5.c. Click with the right mouse button on them and select the entry Resource Configurations->Exclude from build.... Select all the project configurations and click on OK. Now we can compile the application and flash our Nucleo using OpenOCD (if you don't know how to use OpenOCD with the F7 platform, refer to this other post).

If all went the right way, you should be able to ping your Nucleo board.

STEP4: Building a simple HTTP Server

Now we are ready to build a simple HTTP Server using the LwIP stack. The first important thing we have to do is to fix the body of the SysTick_Handler() inside the stm32f7_xx_it.c. A known CubeMX bug causes that the call to HAL_IncTick() function is omitted. So, we need to modify it in the following way:

The main() code is quite simple: we first initialize the hardware, and then we create a new thread using the function StartDefaultTask().

The function StartDefaultTask() dose nothing more than initializing the LwIP stack and starting the HTTP server.

Explaining how the HTTP server works is outside the scope of this post: it would require a dedicated post. All the dirty job is done by the function http_server_serve(), which simply scans the HTTP request for some well known string. The rest of the work is performed by jQuery.

The webpages/index.html contains the HTML code. It is transformed in a C string using the UNIX command xxd:

and embedded inside the final firmware (the STM32F7 has sufficient FLASH space to store a whole HTML file in it). The web-app is reachable going to http://<nucleo-ip>/index.html.

The complete project can be downloaded from my github account. For any doubt, don't hesitate to contact me.


You may also like

80 comments

Robert February 2, 2016 - 11:33 pm

Hello
Thanks for great tutorial !! I just bought Nucleo-F746ZG and STM32F746G-DISCO 🙂 After few hours testing and compiling (i am a newbie with STM32 and eclipse - i just switch from PIC mcu) Your example working with my Nucleo-F746ZG + SW4STM32 (it is a more friendly for me) - only i have problem with MCU Temperature - i see only this - "°C" on webpage.

Reply
CaCO3 February 22, 2016 - 6:38 pm

Hi Carmine
Thank you very much for your very detailed explanations!
I just got an Nucleo-F746ZG but failed to get your project running.
Simply nothing happens 🙁
Is there any notification like a blinking LED or so?

Could you provide a bin file so I can check the HW is working?
I am successfully able to program the bin with openOCD, but I am unable to debug it. My guess is that it crashes immediately. I know openOCD runs correctly because I can use it to program the original demo project which was on the MCU originally.

Reply
Carmine Noviello February 22, 2016 - 6:47 pm

I've packed the binary files here: http://www.carminenoviello.com/stm32-nucleo144-f7.zip

The IP address is 192.168.1.204

Reply
CaCO3 February 23, 2016 - 8:43 am

Thank you very much!
I am able to flash your hex file with the ST-Link Utility and run it.
Are you able to flash the hex file through openOCD? I get the following error:
openocd -f "..\scripts\board\stm32f7discovery.cfg" -c "program Binary_von_Blog/stm32-nucleo144-f7.hex 0x08000000 reset exit"
Warn : no flash bank found for address 10000000
wrote 0 bytes from file Binary_von_Blog/stm32-nucleo144-f7.hex in 0.037004s (0.000 KiB/s)

However, when I compile your example (or the example provided by the GNU ARM Toolchain Plugin), I can't get it to run or debug.
Which toolchain version are you using? I tested 4.9 2015q3 and 5.2 2015q4 but neither binary works.

Reply
Carmine Noviello February 23, 2016 - 8:50 am

The GCC release should not affect the way the binary is generated. However, try the "flash_write" command, because the "program" one needs that you specify the flash boundary address.

If I'm not wrong, the ST-Link firmware need to be updated. Check if there is an update available. Pay attention that, if you are using a Mac, several people are reporting a severe issue with the latest ST-LINK firmware on MacOS El Capitan.

Reply
CaCO3 February 23, 2016 - 9:43 am

I have the latest ST-Link firmware!
I am not sure what you mean with "flash_write" as openOCD seems not to know such a command.

Note that the main issue seems not to be openOCD as I am able to use it to flash the demo bin files.

My issue seems to be related to the way it get build.

Carmine Noviello February 23, 2016 - 10:05 am

Download this guide and refer to the chapter 5 (page 67) on how to use the flash write_image command.

The error message you have posted before says that OpenOCD wants to write the binary image starting from 0x10000000 address, which is an invalid address for an STM32F7 (usually, the CCM RAM is mapped there).

CaCO3 February 23, 2016 - 10:34 am

Thanks for the link. I have read your coll book before.
I tried it again as you describet through telnet and it works correctly. But when you want to call openOCD directly, it seems not to know this command:
openocd -f "..\scripts\board\stm32f7discovery.cfg" -c "flash write_image erase stm32-nucleo144-f7.elf"
It doesnt know the command:
invalid subcommand "write_image erase stm32-nucleo144-f7.elf"
in procedure 'flash'

But as said before, this is not the issue I have (as I can sucessfully flash the bin files or use the ST-Link Utility).

My issue instead is that the builds are not running at all.
Could you tell me, which toolchain version you are using?

Carmine Noviello February 23, 2016 - 10:43 am

I've recompiled the project with the latest GCC tool-chain (5.2) right now, and it works well (apart from that configuration issue with the LWIP timeval struct).

Carmine Noviello February 23, 2016 - 10:45 am

However, if OpenOCD works use it to debug step-by-step and see what's going wrong. Otherwise it is hard to give help.

CaCO3 February 23, 2016 - 10:51 am

Ok, I set now up the toolchain and IDE on a virgin windows. And there the build is working correctly 🙂
So it looks like my setup on my primary PC is somehow messed up. I will now try to re-install it.

Thank you very much for your quick support and the detailed information you share on your blog! I am aware that it costs a lot of time.

CaCO3 February 22, 2016 - 6:42 pm

Some side notes:
If you are using a more recent toolchain (i.e. GNU Tools ARM Embedded 5.2 2015q4), you will get a compile error:
redefinition of 'struct timeval'
To resolve it, simply disable the define
#define LWIP_TIMEVAL_PRIVATE 1
in sockets.h

The patched version of openOCD supporting the F7 (0.10.0) is now available at http://gnuarmeclipse.github.io/openocd/releases/

Reply
Alain Mosnier February 23, 2016 - 9:49 pm

Thanks guys for your interesting insights.
As far as struct timeval is concerned, just a detail: I think it is cleaner to use
#define LWIP_TIMEVAL_PRIVATE 0
in lwiopts.h

Reply
Alain Mosnier February 24, 2016 - 7:45 pm

Sorry, I meant lwipopts.h.

Reply
Alain Mosnier February 24, 2016 - 9:05 pm

Hi Carmine,
Your demo has the sophistication of simplicity. I am impressed.
I'm currently using the STM32F7-Discovery instead of the Nucleo board because it has a micro SD-card slot that I would like to use. I had no problem getting the board up and running and answering my pings adapting your instructions.
I am wondering if you could quickly summarize your procedure for the HTTP/HTML/Javascript parts. I am mostly wondering where the different parts come from. More specifically:
- HTTP server: am I correct that the LwIP HTTP server code does not come from CubeMX? Did you fetch it manually from Cube? Did you start from a specific example/template?
- HTML/Javascript: did you write the index.html file manually, or is it partly generated by bootstrap? I am not experienced with bootstrap. Any advice on how to go from scratch to your HTML-file by myself?
Thanks in advance for any advice.
Regards,
Alain

Reply
Carmine Noviello February 25, 2016 - 7:55 am

Hi Alain,

- HTTP server: am I correct that the LwIP HTTP server code does not come from CubeMX? Did you fetch it manually from Cube? Did you start from a specific example/template?

No, the LwIP HTTP server is generated by CubeMX. You have to enable first the RTOS middleware, and then LwIP. If you are using the GNU ARM Eclipse plugin, my script can also handle the import of LwIP stack in your project.

- HTML/Javascript: did you write the index.html file manually, or is it partly generated by bootstrap? I am not experienced with bootstrap. Any advice on how to go from scratch to your HTML-file by myself

The file is generated manually by me. Bootstrap is a JS/CSS framework you can import in your HTML pages and use it. It's not too much complex to use (I've to admit that I've a past as web developer 🙂 ), and it allows you to develop responsive, multi-browser and mobile-ready web application with a little bit of effort. The web page (index.html - attached in the project) is then converted in a C const variable using the xxd tool in UNIX. Since the F7-Discovery have a MicroSD card reader, you could simply place it on a microsd and use FATFS library to access to it. It would be the most clean solution.

Reply
Alain Mosnier February 25, 2016 - 9:50 am

> No, the LwIP HTTP server is generated by CubeMX. You have to enable first the RTOS middleware, and then LwIP. If you are using the GNU ARM Eclipse plugin, my script can also handle the import of LwIP stack in your project.

Interesting. I did use your script, but did not see any http related file in my project. I will check again this evening. Thanks a lot.

Alain

Reply
Alain Mosnier February 25, 2016 - 7:45 pm

No, the LwIP HTTP server is generated by CubeMX. You have to enable first the RTOS middleware, and then LwIP. If you are using the GNU ARM Eclipse plugin, my script can also handle the import of LwIP stack in your project.

Do you mean that the CubeMX project includes httpserver-netconn.c and httpserver-netconn.h? It does not for me. I have just generated the Nucleo-F746ZG project and am looking at the generated files right now (directly from CubeMX, your script has not yet been involved). All the files under Inc and Src are there (FreeRTOS, lwip, etc.), except http-server.netconn.c and .h. I am using CubeMX 4.13.0. Have they removed it in the updgrade?
Regards,
Alain

Reply
Carmine Noviello February 26, 2016 - 6:31 am

Sorry Alain, it's my fault. I've misunderstood the question.

I've arranged the content of httpserver-netconn.c from several examples provided by ST. If do a "find" inside the CubeHAL you should see several examples.

Reply
Alain Mosnier February 26, 2016 - 4:13 pm

Sorry Alain, it's my fault. I've misunderstood the question.

I've arranged the content of httpserver-netconn.c from several examples provided by ST. If do a "find" inside the CubeHAL you should see several examples.

No problem. That's what I thought then. I have seen the examples in Cube. The HTTP server is extremely simple, and your solution based on static HTML + JQuery is more elegant than ST's dynamic HTML. I love the simplicity of:

sprintf(buf, "%2.1f °C", getMCUTemperature());
write(buf);

No XML or other cumbersome format, which I though was necessary with AJAX. I didn't know solutions existed that made transfer of data to a static page that simple.

Regards,
Alain

Valeria April 28, 2016 - 9:28 am

Hi Carmine,
I am a student and I am trying to work with NUCLEO F746ZG and X-NUCLEO IKS01A1 (this is an expansion board with sensors). Have you ever developed code to configure nucleo board for communication with this kind of expansion board?

Reply
Carmine Noviello April 28, 2016 - 9:34 am

Hi Valeria,
I've one of these expansion shields, but I've never played with it. I'm too busy right now, but I'll give a look to it in the next days to see if I can arrange a test project.

Reply
Valeria April 28, 2016 - 9:49 am

Ok, thank you so much for your kindness! I'm in a big mess...

Reply
Carmine Noviello April 28, 2016 - 2:34 pm

Hi Valeria,
I've successfully imported the shield library in this project. You can find the full project here:

https://github.com/cnoviello/stm32-nucleo144-f7-iks01a1

I've not too much time to explain what I did, but I essentially imported the official ST library in the project described in this post. It simply shows the Humidity. It's up to you to check that other sensors works too.

Good luck.

Reply
Nicola May 5, 2016 - 12:02 pm

Hi Carmine,
I'm a collegue of Valeria and I tried to import and compile your project with iks01a1 libraries, but I have this error in compilation: conflicting types for 'lwip_select' in sockets.c (path = /stm32-nucleo144-f7-iks01a1/Middlewares/Third_Party/LwIP/src/api). How is that possible?

Carmine Noviello May 5, 2016 - 12:36 pm

Hi,
Which toolchain are you using? Can you post the complete compiler message (a screen capture is also good)?

Nicola May 5, 2016 - 1:16 pm

I'm using the toolchain you suggest, GNU ARM Eclipse plug-ins by Liviu Ionescu.

This is he compiler results
http://imgur.com/EvlcRqh

Carmine Noviello May 5, 2016 - 1:31 pm

Have you imported the project using the Eclipse Import feature?

Conflicting type errors happen when a function ("lwip_select" in our case) is redefined elsewhere. You are redefining the same function in your code, or there is something nasty happening with the project import. I can guarantee that it compiles well.

Valeria April 29, 2016 - 9:00 am

Thank you very much Carmine!

Reply
simon May 13, 2016 - 2:09 pm

Hello,
I flash your hex file with the ST-Link Utility V1.9.0, but it display an error:illegal parameter? Is the file wrong?

Reply
Carmine Noviello May 15, 2016 - 10:38 am

Hi,
the binary is for the Nucleo-F746ZG. Usually, that message appear when there is something wrong with the chip option bytes (a full erase is suggested) or the USB doesn't provide the right power to the ST-LINK interface.

Reply
Valeria May 16, 2016 - 10:39 am

Hi Carmine, I've run you HTTP-Server project and it works fine, but I've thought that it can be useful to implement a socket communication in C with an application that runs on a PC. I'm working in this direction but after socket creation my application sleeps on read method. Have you ever tried to do something similar?

Reply
Carmine Noviello May 17, 2016 - 10:18 am

Hi Valeria,
It's hard to say what could be wrong. Too few information. You need to perform low-level TCP packet sniffing to try understanding what's going wrong. Is the TCP connection started at least? Can you see ACK packet from the board to the PC? Have you a traceback?

Moreover, are you trying to perform the read from a FreeRTOS thread? If so, does the thread have sufficient stack room?

Reply
Kevin Gordon May 29, 2016 - 4:32 am

re NUCLEO_F746ZG
I downloaded gnuarmeclipse-openocd-win64-0.10.0-201601101000-dev-setup.exe which has stm32f7discovery.cfg but no st_nucleo_f7.cfg.
Has anyone used stm32f7discovery.cfg on eclipse with a NUCLEO_F746ZG board?

Reply
Carmine Noviello June 2, 2016 - 8:00 am

Yes, it's ok to use the stm32f7discovery.cfg file with the Nucleo-F746.

Reply
Bill July 26, 2016 - 11:35 pm

Is the spacing of the outside solder pads (like the CN11 connector) .1"?

Reply
Carmine Noviello July 27, 2016 - 6:48 am

Yes, they are 100mils spaced connectors (2.54mm).

Reply
Boondoggler August 10, 2016 - 11:08 pm

Hi great tutorial!

I have used system workbench with cubemx to essentially recreate the same project. Also purchased your great PDF book, exactly what I have been looking for!

One thing I note is as one of the above questions is the the MCU temp is just showing °c, any ideas?
Cheers
Boondoggler

Reply
Carmine Noviello August 11, 2016 - 9:10 pm

You need to enable float support in printf()/scanf() routines. Give a look to the book: it's explained somewhere (close to pg. 255).

Reply
Boondoggler August 12, 2016 - 9:57 pm

Great thanks all good now

🙂

Reply
Paul Claessen September 15, 2016 - 9:32 pm

Looks like your python script doesn't work anymore with STM23CubeMX version 45.16.1 generated code.
I get an error about it not for the SW4STM32 tool chain. (Even thopugh that's what I selected in STM32BubeMX)

The way it fails depends on the new checkbox ''Generate under root' ..

Checkbox checked:

C:\CubeMXImporter>python cubemximporter.py C:\stm32\workspaces\web\nucleof746_web C:\stm32\cubexm\nucleo-f7
Traceback (most recent call last):
File "cubemximporter.py", line 520, in
cubeImporter.cubeMXProjectPath = args.cubemx_path
File "cubemximporter.py", line 72, in setCubeMXProjectPath
"The generated CubeMX project is not for SW4STM32 tool-chain. Please, regenerate the project again.")
__main__.InvalidSW4STM32Project: The generated CubeMX project is not for SW4STM32 tool-chain. Please, regenerate the project again.

Checkbox NOT checked:

C:\CubeMXImporter>python cubemximporter.py C:\stm32\workspaces\web\nucleof746_web C:\stm32\cubexm\nucleo-f7
Traceback (most recent call last):
File "cubemximporter.py", line 520, in
cubeImporter.cubeMXProjectPath = args.cubemx_path
File "cubemximporter.py", line 54, in setCubeMXProjectPath
self.detectHALInfo()
File "cubemximporter.py", line 221, in detectHALInfo
"The generated CubeMX project is not for SW4STM32 tool-chain. Please, regenerate the project again.")
__main__.InvalidSW4STM32Project: The generated CubeMX project is not for SW4STM32 tool-chain. Please, regenerate the project again.

~ Paul

Reply
Paul Claessen September 15, 2016 - 9:34 pm

That should have read: STM32CubeMX version 4.16.1 !!

Reply
Carmine Noviello September 16, 2016 - 5:59 pm

Hi Paul,
I've tested the script with the latest CubeMX and it works correctly. Are you using the latest version of my script? The latest release doesn't care about the location of the SW4STM32 project file.

Reply
Raj January 25, 2017 - 3:07 pm

Hi Carmine,
Nice blogs very descriptive posts for a beginner, but I am still getting the same issue as mentioned by PAUL.

I have used different versions of "cubemximporter.py" (0.1 to 0.2.2)but I am still getting that project is not built with the SW4STM32 toolchain in spite of building one. Can you please let me know where am I going wrong.

CubeMX version is 14.19.0
SW4STM32 is selected and "Generate Under Root" checkbox is chosen/selected/checked.

Reply
Skalibur January 25, 2017 - 5:56 pm

Better copy the files manually, it's easy when you do it a second time.
I have windows, and I could not execute the script

Reply
Mateusz October 3, 2016 - 8:42 am

Hi Carmine,

Will you cover any basics of DSP in your Mastering STM32 book at some time later on ? I am not really familiar with DSP but as far as I understand it, some operations might be executed faster by using it ?

Regards

Reply
Carmine Noviello October 3, 2016 - 1:54 pm

Hi Mateusz,
Actually I don't think I'll cover DSP in the book. There are other relevant topics I need to cover before, and the book is becoming too huge. This would require a lot of space and time that I no longer have.

Reply
Lollol November 7, 2016 - 8:45 pm

Hi Carmine,

I want to add a Nucleo expansion board to the F746ZG. So I've downloaded the associated expansion board STM32Cube zip on ST website.

In this zip I have a Middleware folder with all the files that seems to really simplify coding and communication with the expansion board.

However I don't know how to add this properly to AC6 environment... At the moment I just drag and drop the folder inside the Project Explorer. But when I wan't to include a header from this expansion Middleware library, the project cannot compile any more "***.h: No such file or directory".

I think I'm not adding the STM32Cube folder in the right way.

Thanks for help

regards

Reply
Carmine Noviello November 9, 2016 - 10:44 am

When importing Cube expansion libraries, you need to check two things:

- That imported folder and files are not excluded from build
- You need to add folders containing ".h" files to the list of include folders in project settings.

These steps are usually sufficient to import Middleware libraries.

Reply
DutchEngineer December 17, 2016 - 5:58 pm

Thank you very much for this tutorial!
I used this tutorial in combination with the STM32F429-Nucleo.
I now have a working example with Atollic Truestudio 7.0.0 and STM32CubeMX 4.18.0. I followed the STMcube "user code begin" and "user code end" comments so regeneration is possible.
Is it okay if i post my code to github, with of course a link to this page? So that other people can use the example.

Reply
Carmine Noviello December 18, 2016 - 8:52 am

Yes. You are totally free to do it 😉

Reply
DutchEngineer December 18, 2016 - 12:57 pm

Hi!
Nice to hear, you can find my repository here:
http://www.github.com/DutchEngineer/STM32F429_NUCLEO_LWIP_FREERTOS

At the moment I am working on a Python script to convert .html .css .js and .ico files to c string. I am not using Linux so i don't have xxd.
I will also post a link here as soon as I have finished it.

Reply
Billl Lewis January 16, 2017 - 12:06 am

Carmine,

You are a brilliant engineer! Thank you for sharing your work.

Bill

Reply
Piotr February 17, 2017 - 4:42 pm

Thanks for the awesome tutorial!
When building I get the following error:

Description Resource Path Location Type
make: *** [Middlewares/Third_Party/LwIP/src/core/init.o] Error 1 stm32-nucleo-f746zg-http-server C/C++ Problem
recipe for target 'Middlewares/Third_Party/LwIP/src/core/init.o' failed subdir.mk /stm32-nucleo-f746zg-http-server/Debug/Middlewares/Third_Party/LwIP/src/core line 66 C/C++ Problem
redefinition of 'struct timeval' sockets.h /stm32-nucleo-f746zg-http-server/Middlewares/Third_Party/LwIP/src/include/lwip line 442 C/C++ Problem

Any ideas?

Reply
Carmine Noviello February 17, 2017 - 5:36 pm

To resolve it, simply disable the define
#define LWIP_TIMEVAL_PRIVATE 1
in sockets.h

Reply
Piotr February 18, 2017 - 9:32 am

Thanks, it worked. Had some other strange errors, which were resolved by restarting eclipse, cleaning and then building again.

Reply
Bill Lewis February 20, 2017 - 10:11 pm

Carmine,

It seems the ARM plug-in has changed over time, and the now File->New->C Project dialog do not match up with the examples above. There is no "Hello World ARM Cortex-M C/C++ Project".

Neither Hello World ARM C Project nor STM32F7xx C/C++ Project give satisfactory results.

Eclipse Neon.2
GNU ARM plug-in 201701141320

Bill

Reply
Carmine Noviello February 27, 2017 - 6:36 am

This happens because the installation is changed a little bit. Take a look to the installation instructions in my book:

http://samples.leanpub.com/mastering-stm32-sample.pdf

Reply
bdang May 5, 2017 - 7:30 pm

Hi Carmine,

In this tutorial and in your book Mastering-STM32, to help the reader getting the correct information on the Flash and RAM size easily without referring to datasheet or other ways, I suggest to build the CubeMX project first and then the Eclipse instead of the other way around as you had done. The reason is that after building the CubeMX project, we can correctly read the memory Length and Origin information from the generated linker description file STM32XXXX_FLASH.ld and then use this information to fill in the Target Processor Setting step during Eclipse project building as below:
MEMORY
{
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 1024K
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 320K
...

Another suggestion. On page 132 and 133 of Mastering-stm32, the instruction of how to Add the corresponding STM32xx processor name (used as conditional macro) to the Cross ARM GNU C Compiler's Preprocessor (since the STM HAL is designed to work with all MCU), it was not too clear for me what to do.
It says "...and then click on Add icon. Use the macro corresponding to your Nucleo.....". I wasn't sure what to do with the new opened window with Defined Symbols (- D). So instead of saying "Use the macro corresponding...." (this sounds more like selecting the right macro name from the drop-down list), I think it's more clear to say "Type in the macro name corresponding to your Nucleo (refer to Table 3....)....".

Question: I am using NucleoF722ZE but cannot find the st_nucleo_f7.cfg file under \openocd\scripts\board\ . What should I do (to use openocd for debugging)?

Best,
Brian

Reply
Theo June 27, 2017 - 6:56 am

Do you know how to get access to the application from outside the local network?

Reply
ray July 22, 2017 - 10:36 pm

Hi Carmine,

you are really brilliant!!
I was wondering if you have a working example of telnet and ftp servers for STM32F746ZG Nucleo. I have the ping working but need a quick telnet and ftp servers. Any help would be highly appreciated.

Reply
Markus October 4, 2017 - 8:14 pm

Hi Carmine,

I what to test your example on an Nuclueo 144 STM32F429ZI Board.

The build does not work.

Building file: ../system/src/cmsis/system_stm32f429.c
Invoking: GNU ARM Cross C Compiler
arm-none-eabi-gcc -mcpu=cortex-m4 -mthumb -mfloat-abi=hard -mfpu=fpv5-sp-d16 -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -fno-move-loop-invariants -Wall -Wextra -g3 -DDEBUG -DOS_USE_SEMIHOSTING -DTRACE -DOS_USE_TRACE_SEMIHOSTING_DEBUG -DSTM32F429xx -I"../include" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f429" -I"../system/include/stm32f4xx" -I"../system/include/cmsis/device" -I"../Middlewares/Third_Party/LwIP/src/include" -I"../Middlewares/Third_Party/LwIP/system" -I"../Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F" -I"../Middlewares/Third_Party/FreeRTOS/Source/include" -I"../Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS" -I"../Middlewares/Third_Party/LwIP/src/include/lwip" -I"../Middlewares/Third_Party/LwIP/src/include/lwip/apps" -I"../Middlewares/Third_Party/LwIP/src/include/lwip/priv" -I"../Middlewares/Third_Party/LwIP/src/include/lwip/prot" -I"../Middlewares/Third_Party/LwIP/src/include/netif" -I"../Middlewares/Third_Party/LwIP/src/include/netif/ppp" -I"../Middlewares/Third_Party/LwIP/src/include/netif/ppp/polarssl" -I"../Middlewares/Third_Party/LwIP/src/include/posix" -I"../Middlewares/Third_Party/LwIP/src/include/posix/sys" -I"../Middlewares/Third_Party/LwIP/system/arch" -std=gnu11 -MMD -MP -MF"system/src/cmsis/system_stm32f429.d" -MT"system/src/cmsis/system_stm32f429.o" -c -o "system/src/cmsis/system_stm32f429.o" "../system/src/cmsis/system_stm32f429.c"
In file included from ../system/include/cmsis/stm32f429.h:147:0,
from ../system/src/cmsis/system_stm32f429.c:40:
../system/include/cmsis/core_cm4.h:153:8: error: #error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
#error "Compiler generates FPU instructions for a device without an FPU (check __FPU_PRESENT)"
^
make: *** [system/src/cmsis/system_stm32f429.o] Error 1
system/src/cmsis/subdir.mk:38: recipe for target 'system/src/cmsis/system_stm32f429.o' failed

I set the parameter in the project to "FP instructions(hard)" and "fpv5-sp-d16". Proably there is the fault. Do you now the right parameter?`

Thanks

Markus

Reply
Klok October 19, 2017 - 6:14 pm

Hi friend. I have a small problem.
Can anybody give me a file from stmcube mx for this project? Thank you

Reply
greg November 7, 2017 - 4:49 pm

Hi Carmine,

I wonder if it is possible to ping a web site with the board in order to get time and date

Reply
John Keenan November 15, 2017 - 10:30 pm

I tried this code with another of the STM32 Nucleo-144 boards, the NUCLEO-STM32F429ZI ,and it worked great. ( using STM32CubeMX and Keil MDK5 ).

The only problem I had is it did not seem to work at first. My bad - I was forgetting to add /index.html after the IP address.

Great job - thanks Carmine!

Reply
Amol V November 18, 2017 - 8:34 am

hello Carmine,
I am facing trouble with python importer tool can you upload video for this post on youtube.

Reply
Olivier February 17, 2018 - 2:14 pm

Hi Carmine,

When I found your post, I immediately decided to put my arduino in the drawer to get a Nucleo board!

Your example allowed me to make my little project a lot more fun.

But, ther is one thing that I cannot accomplish and help would be very appreciated ...

Can you show us an example of how to read with the Nucleo a number input entered in the web browser?

Thank you for everything I learned on your blog!
Nice job!

Reply
Giovanni July 9, 2018 - 11:46 pm

Salve, in queste schede st nucleo f7 come posso implementare una memoria eeprom esterna compatibile arduino?
Mi serve per salvare delle variabili staccando l'alimentazione.
Grazie per l'aiuto a tutti.

Reply
Chris Lock August 20, 2018 - 6:49 am

Hi Carmine,
I've bought your book on Leanpub and found it very helpful.
I only have a couple of simple questions:
1. Are you going to update the book with more details on F746 etc.?
2. I am trying to add QSPI memory to the F746ZG board using a more recent flash memory IC (N25Q128A is obsolete), I have tried various memories (e.g. S25FL256 etc.) and used a modified N25Q128A.h and code from the F746G disco examples on MBED, without success. Can you point me in the direction of any useful tips or software?
Thanks,
Chris

Reply
Huzaifah September 19, 2018 - 10:53 am

Hello Carmine Noviello,
I want to implement an application won STM32F429Zi Nucleo which should have CDC enable, ETH TCP/IP and one LED blink task with FreeRTOS.
I tried few codes by assembling after implementing them separately but unfortunately enable to get success on that idea, it through 2 error while going to init the ETH which is nothing but some kind of Assertion error listed here :
Assertion "failed to create tcpip_thread mbox"
Assertion "failed to create lock_tcpip_core"
Do i miss something or anything that i have to configure or i have to understand.
Can you please help me,
Thank you in advance!
Note : I'm using HAL library.

Reply
Hwee Choo Liaw July 17, 2019 - 3:38 am

Hello Carmine Noviello,

Thank you very much for your detailed explanation on this example for the Nucleo-F746ZG board. This example implements the HTTP Server via the netconn API of LwIP stack with FreeRTOS. It is working well, and i wish to check with you that is it possible to implement the HTTP Server via Socket API of LwIP?

Reply
Stefan November 12, 2019 - 5:15 am

Hello Carmine Noviello,

very nice example - works fine.

Is there any posibility to send values (e.g. integer) from the webpage to the uC during process?

For example: If I would have an slider on my webpage, how would I get its actual value to my uC?

Thank you!

Reply
Rocky November 21, 2019 - 8:48 am

Hello Stefan what compiler have used in that eclipse

Reply
Goma November 12, 2019 - 4:23 pm

Dear Sirs,

I'm using CubeIDE and activated the floating printf but always showing "TEMP" in MCU temp section.
When I un-check the floating printf activation, always shows only Degree unit. Any idea ? LED button and User button reading is working perfectly.

BR

Reply
Sid Shinde November 16, 2019 - 6:01 pm

Hello Sir,
Thanks for this great tutorial.

I tried to implement this in my STM32F429ZI but I am getting a redefinition ERROR while compiling.

The SysTick_Handler() function that you instructed to edit in the stm32f7xx_it.c was not available in my case(stm32f4xx_it.c). I added the function as in your file.
When I tried to build the code, I am getting an error stating that the void SysTick_Handler(void) function is already defined in port.c as xPortSysTickHandler.

#define xPortSysTickHandler SysTick_Handler is declared in FreeRTOSConf.h

I cross checked in your github repository and i am found that FreeRTOSConf.h does not esist in your case and the above definition does not esist in your case.

Hoe do I rectify this error?

Reply
Richard S September 14, 2021 - 2:49 am

Great project thank you.

Sadly, try as I might I cannot get the script to run on an iPad or iPhone regardless of which browser I use, have tried Safari, Edge, Chrome and Firefox. The page loads fine but the led switches, blue button status and temperature reading don’t work.

It won’t run on Safari on an iMac either though Microsoft Edge does work and it also works on a Windows 10 PC with Edge.

Reply
Richard S September 14, 2021 - 2:50 am

Great project thank you.

Sadly, try as I might I cannot get the script to run on an iPad or iPhone regardless of which browser I use, have tried Safari, Edge, Chrome and Firefox. The page loads fine but the led switches, blue button status and temperature reading don’t work.

It won’t run on Safari on an iMac either though Microsoft Edge does work and it also works on a Windows 10 PC with Edge.

Reply
Nage December 15, 2021 - 11:29 pm

can we apply this project to stm-32 nucleo-767zi board

Reply
Nage December 15, 2021 - 11:30 pm

Can we apply this project to stm-32 nucleo-767zi board?

Reply
Sisto Zànier April 26, 2023 - 5:57 pm

Ottima novità, peccato che in Europa i tempi di consegna sono un po' lunghi. Per esempio Mouser da 53 settimane, mentre in Farnell non prima di fine luglio.

Reply

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.