Dude! You are awesome! It is clear that you understand the material well, as you conveyed the meaning of you points very clearly. My only feedback is that I was left a little un-sure about the flag definitions inside the make file. Thanks, and best of luck!
3 ปีที่แล้ว
Thank you for the comment. I try to explain everything regarding a topic in as much detail as possible, so that by understanding each part, you can modify, grow and adapt pieces of code or configurations. Hopefully my newer videos will do this approach justice. Cheers!
Let me say this is the only tutorial and information that work for stm32Nucle0-031c6 not even opeocd after weeks of tenacity I can finally flash and detect my board. This is awesome and thank you for this video. Seem like openocd uses stlink as wrapper for some stlkink debugger.
To anyone getting the make error or st-info --probe access error, do the following for fixes. As a side note, go into the stlink-1-x-x/doc folder and open the compiling.md file as it has all the packages you need. For the make error, make sure first have the correct packages, taken from the compling.md file mentioned above: * `git` * `gcc` or `clang` or `mingw32-gcc` or `mingw64-gcc` (C-compiler; very likely gcc is already present) * `build-essential` (on Debian based distros (Debian, Ubuntu)) * `cmake` (3.4.2 or later, use the latest version available from the repository) * `rpm` (on Debian based distros (Debian, Ubuntu), needed for package build with `make package`) * `pkg-config` * `libusb-1.0` * `libusb-1.0-0-dev` (development headers for building) * `libgtk-3-dev` (_optional_, needed for `stlink-gui`) * `pandoc` (_optional_, needed for generating manpages from markdown) Then try run make again. If this comes up with this error: [RELEASE] make[1]: *** No targets specified and no makefile found. Stop. Makefile:33: recipe for target 'release' failed make: *** [release] Error 2 Then run: $ make clean $ make For the access error go down to the set permissions with udev section, as it says what to do. But essentially I wrote: $ sudo cp ~/Embedded/stlink-1.6.1/config/udev/rules.d/49-stlinkv* /etc/udev/rules.d/ This worked for me.
/bin/sh: 1: cmake: not found make: *** [Makefile:58: build/Release] Error 127 .... I get this error. when ı open terminal in stlink directory . and do make command . after this command ı get this error. how can I solve this ?
Good and well explained. How do I get firmware/standard-peripheral-library for for stm32f411RE nucleo-64 board? I don't think yours will work; Will it?
Hi, I have a question. Where did you get the project files? From STM32Cube_FW_F4_V1.27.0 by any chance? If so, which ones? Cause I don't understand where those files are comming from. Thank you. I almost made it to the second videos :))
2 ปีที่แล้ว
The files I posted on github are the same as in the video and are "project specific". Others are located in that software pack in a known location ln the disk. Makefile has a variable where you can put that path in. Nowdays it is easier to go with cubemx and hal, but I think going back to this approach before or after cubemx is great for learning. In my current videos you can learn even more using cmake and taking build system into your own hands, understanding each file and setting that goes into the process. Cheers.
What if i do not have an ST-LINK? I have managed to burn the bootloader (on windows) and burn a program my stm32F1 using FTDI and Arduino IDE on windows and linux. But i do not have a ST-Link yet. Is there any way to burn the code via FTDI using your technique? (i guess not, since i can see from the gitlab that it is only made for stlink programmers). Thanks.
4 ปีที่แล้ว +1
As far as I am aware, blue pill, using F1 ic is popular with arduino users as there is usb/serial bootloader. After that, it is compatible with arduino ide, that uploads code via serial port with bootloader. I am certain there is no way to upload code to your "blank" processor without a proper hardware, like stlink or jlink. In order for arduino bootloader to work, someone had to put it on there with a debugger, such as stlink. You can get one by purchasing any stm32 development board and can be even broken away on nucleo boards.
If possible, i would love this kind of video but for GD32 device, as it is now the case with the chip shortage situation that GD32 can provide a replacement for STM32, but there is no IDE for it
2 ปีที่แล้ว
I just took a look and it sounds both legit and interesting. I'll try finding a dev board and see if I can get it working.
2 ปีที่แล้ว
Update: I just found and purchased a board. Not that easy to find on regular sites like ebay, aliexpress, banggood, seeedstudio, etc.
Thank you very much ! Just a question. How I can use the same method with GNU Tools but with HAL and not SPL ? I'm generaly using STM32CubeIDE, and I prefer your method without application. It seem better for learning and understanding the backend of microcontroller design.
3 ปีที่แล้ว
Thank you for the comment. I also prefer this way of learning everything behind the system. I would use HAL and CubeMX to generate project files and manage mcu configuration and then I would suggest you to follow my new series on Building(playlist) to learn how to manage and build your project with common tools instead of using a specific ide, only one that you want.
hi, stupid question, what is the difference between arm-none-eabi-gcc and gcc?, thanks for answer :D
3 ปีที่แล้ว +2
No worries. As far as I understand it, a compiler usually compiles for the host operating system and platform. Standard gcc on your computer compiles for x86 platform. arm-none-eabi-gcc is a cross compiler meaning that it can compile binary for a different platform from the host, in this case it runs on x86 compiling for arm. For example clang is a native cross compiler, meaning any version for a given host platform can compile for any other platform. It will be interesting to try it out. Power is in that you only need ony compiler for all platforms (let say you're building arm and desktop applications and you can use shared code and same compiler instead of two). I will have more videos on building projects in the future.
Awesome video, really well done tutorial. I'm running into a small issue when I try to probe the board. I do the "st-info --probe" command after making sure they're both the proper version and I get the following error: "st-info: symbol lookup error: /usr/lib/libstlink.so.1: undefined symbol: libusb_set_option" Do you have any idea what could cause this or how I could fix it?
4 ปีที่แล้ว
Thank you. I am unfamiliar with this error, so you might have to check this one on the gihub page(i think it got moved to another account) to maybe find an answer in problems section. I also had sometimes problem with certain releases, so maybe try other releases and updates of the project. Hope this helps.
At 2:11 of the video you run the 'make' command. To me it gives an error: /bin/sh: 1: cmake: not found make: *** [Makefile:58: build/Release] Error 127 At for today the file version is 'stlink-1.6.1' I am working with Linux Ubuntu. I did an extra step where I also installed the 'cmake' file in the '/opt' folder and still gives the same error. I used this guide here: geeksww.com/tutorials/operating_systems/linux/installation/downloading_compiling_and_installing_cmake_on_linux.php How can I solve it?
4 ปีที่แล้ว
Make sure you have a few build tools installed, such as make, cmake, gcc, g++ and libusb. Then you should be able to compile. Now you only have to run make in root folder and resulting binaries will be located in ./build/Release/bin. Now this project is under stlink-org and not just texane, so things might change over time.
HI thank you For stlink-1.7.0 when i run make the result is no makefile found and not cible specified please help me
2 ปีที่แล้ว
Do you have gcc/clang installed along with gnumake? I believe they updated and corrected the instructions for compiling the tool. On some distributions you can even find it in the package repos
teno un problema al jecutar make burn ~/Embedded/stlink/st-flash write test.bin 0x80000000 /bin/sh: 1: /home/juan/Embedded/stlink/st-flash: not found make: *** [Makefile:57: burn] Error 127
3 ปีที่แล้ว
Have you exported st-flash path to your shell? Looks like it does not find your st-flash binary. Please follow the video to see the procedure.
Thanks for the amazing tutorial. I am trying to setup this environment for STM32F103C8T6, but I cannot find the firmware package on the website. Can you help me?
3 ปีที่แล้ว
If it is not available on ST's site I would suggest using CubeMX or CubeIDE with HAL or LL. I have some newer videos on the topic :)
Thank you for your wonderful video! I would like to ask if you could also upload the elf and hex file in your github repo. Thanks!
2 ปีที่แล้ว
Github might have some filter that prevent uploading binary files as you cannot know what it does. I recommend you to take a look at my build series for creating the binaries.
Hi, I found your tutorial to be everything I was looking for as I am learning to program microcontrollers and such a detailed tutorial is very welcome. I was following your video and after doing st-info --probe i get ERROR usb.c: Could not open USB device 0x0483:0x3748, access error. Found 0 stlink programmers. I have my microcontroller plugged in. There are some leds on from some tutorials I've done before. How can I solve this?
2 ปีที่แล้ว +1
If access error is something to go by, then maybe try running the command as sudo, just for a test. Since all devices have different permissions and groups, not all are available to the user priviledge. Just like serial devices, which are usually a part of dialout group, which you also have to be a part of in order to use it without superuser. Try that and if it works, then you just need to add the device either to your user or group. Look up udev rules and how to make one for a specific usb device uid and vid (the two hex values separated by :). Cheers, hope this helps.
@ thans for your answer. I tried but it didn't work. I think I rushed too early into this as there are too many things around programming microcontrollers that I don't know. Do you by any chance know some good resources that I can use to learn this stuff? Anyway thanks again and all the best.
Hello Matej, I am using linux 19.04 .when installing stlink-1.5.1(latest on given link )then it show "/bin/sh: 1: cmake: not found make: *** [Makefile:43: build/Release] Error 127" type of error .what i will do to install stlink and video is very helpful.
5 ปีที่แล้ว
Check if you have a good version of cmake, make and gcc in order to compile stlink. Also you can check if configuration file is set. Also, you might try the latest version of stlink on github or one of zip/tar files available to download(versions do differ and sometimes one works and other doesnt). Experiment, but eventually it should work
Hi, iam using stm32f401re nucleo, the microcontroller communication with the pc but i can't link the external libraries in the make file. I have changed the path accordingly but make gives error
5 ปีที่แล้ว
Can you describe or copy the error? Do you have the correct absolute path to the libraries inside the library pack?
5 ปีที่แล้ว
In the file that you provided, please check if paths to subfolders for includes are correct. Also I would advise you to use the newest arm gcc toolchain from arm as shown in the vide. What error does compiler return?
@ compiling with arm-none-eabi-gcc --specs=nosys.specs main.c -o main does produce binaries. Problem similar to th-cam.com/video/TgDQejrI_vU/w-d-xo.html Am not using eclipse.
5 ปีที่แล้ว
You have to use compiler flags for libraries, if you just use that command line. Or just use a makefile like me. Just compare everything in the video to your case and you should have everything cleared.
@ I did make a few mistakes I have not included the additional three files in the dir. After i put them from the standard libary folder and running make give following error #error "Please select first the target STM32F4xx device used in your application (in stm32f4xx.h file)" ^~~~~ system_stm32f4xx.c: In function 'SystemCoreClockUpdate': system_stm32f4xx.c:575:25: error: 'HSE_VALUE' undeclared (first use in this function); did you mean 'HSI_VALUE'? SystemCoreClock = HSE_VALUE;
You would need a set of libraries for that family of mcu, it's a bit different from 407 or 411 series. But the names of libraries should stay the same, only header files and some source files would change (different functionality of mcus).
I have seen some people reflash the onboard debugger with SEGGER. Is there any benefit of doing that? I was just following some tutorials. Thanks
5 ปีที่แล้ว +1
I have not worked with j-link from Segger. They mostly focus on their debuggers and thats the point. If you need testing and debugging of large code, you could benefit from conversion, but you are limited in some features. Go to Seggers website as they have their tutorial on how to convert your stlink, which is cool.
Sure, I love how this gcc method is not size-limited unlike keil, iar, segger. My only concern is how do you debug like setting breakpoints and going through the code. Do you need something like eclipse to do that? Is it possible to do all that in terminal?
5 ปีที่แล้ว +1
There is a gdb server that comes in the st-link utility and you might get something out of that (called st-util). Please read st-link git repository for info. I do small stuf so debugging isn't that important, but would be welcome. Onboard st debugger is still good for that meaning you dont't need new firmware as Eclipse and another linux version do include break points and variable watch etc. I did work for a company that makes debuggers and trace analyzers called iSystem. They have a free version of their IDE calle winIdea Open. You can give that a look, but mostly is targeted to companies and professionals.
stlink-1.7.0 make command doesn't work in fedora I search it but i didn't see a good result
2 ปีที่แล้ว
What is the problem - does the compiler give you an error, make, cmake? I tested compiling stlink checked out on release v1.7.0 using docker container base on fedora:36 with only the following libraries installed on a bare container: git, make, cmake, gcc, g++, libusb-devel Just run "make release -j" inside the repository to compile the project into ./build/Release/bin, where you'll find the executables. For further install information read the compiling manual from stlink: github.com/stlink-org/stlink/blob/develop/doc/compiling.md#macOS
@ okey Fix it but this time *** No rule to make target '/home/alihan/ARM/STM32F4-Discovery_FW_V1.1.0/Libraries/CMSIS/ST/STM32F4xx/Source/Templates/TrueSTUDIO/startup_stm32f4xx.s', needed by 'Project_0001_test.elf'. this happened
2 ปีที่แล้ว
I'm confused. Are you trying to build the project or are you trying to build the tool stlink-1.7.0? The second is what I suspected from your question. Now it looks like you're trying to build the project. It complained that it cannot find the mentioned file in order to compile the project. Looks like you either have the wrong path or name of the file.
-- Configuring incomplete, errors occurred! See also "/home/eltj/Embedded/stlink-1.5.1/build/Release/CMakeFiles/CMakeOutput.log". See also "/home/eltj/Embedded/stlink-1.5.1/build/Release/CMakeFiles/CMakeError.log". Makefile:42: recipe for target 'build/Release' failed make: *** [build/Release] Error 1 during the make i got this error, can anybody help. i have installed cmake
5 ปีที่แล้ว
Do you have installed make, build-essentials and gcc and g++ and check for libusb-1.0.. Check in the logs to see where it went wrong
@ I was having problems with the auto complete from other files, manange to solve that by installing a package! You'r doing a great job with these videos!
@ Thank you. I have a nucleo and was looking in the nucleo-f429zi datasheet and could not find it. What I wanted was the stm32f429zi datasheet.
3 ปีที่แล้ว +1
Memory map is located on page 86/240 for your mcu. First 512MB block (0) is expanded and you can find flash memory as third box from the bottom up. This is where the binary is stored and is the actual address of the physical flash memory.
Hello, i get the error: st-info: error while loading shared libraries: libstlink.so.1: cannot open shared object file: No such file or directory I am looking for help in the forum: github.com/texane/stlink/issues/478 How can i solve it?
4 ปีที่แล้ว +1
I got this error too, when I moved st-flash(shuld be same with st-info) to another l folder to be used with python, in my case. I then also copied libstlink.so.1 along with it. So make sure that library is in the same directory as st-flash or st-info. Hope this helps.
@ Hello. I solved the issue, i re-installed the file using `sudo make` instead of `make`
4 ปีที่แล้ว
Be carefull when using sudo. If you had to use sudo for just compiling, then you dont have permission to write in that directory. Make sure you have permissions to write that file.
How to download STM32F446RE (nucleo board) firmware?
4 ปีที่แล้ว +1
If you want to use the old SPL, then you can download one that is for the whole F4 family: www.st.com/content/st_com/en/products/embedded-software/mcu-mpu-embedded-software/stm32-embedded-software/stm32-standard-peripheral-libraries/stsw-stm32065.html For newer project I would suggest Cube and HAL or LL.
@ Hello Sir I want build everything (GPIO, I2C, ...) from scratch without Lib or IDE. But I need Flash and startup file for STM32F446. Now, I can handler and build successfully. Thanks sir
4 ปีที่แล้ว +1
Thats a great way to learn and one that I have done as well. For actual development its a bit impractical.
$ arm-none-eabi-gcc --version arm-none-eabi-gcc (15:6.3.1+svn253039-1build1) 6.3.1 20170620 I installed it via apt. Do you think I can work with this version?
4 ปีที่แล้ว
It looks to be an older version, so I would suggest you download a newer one or update repositories in your package manager. I think it should work fine if you're not using any newer architectures and cores, but some bugs might be present that are absent from the newer ones.
This should work on most linux machines as the files downloaded are global for all Linux distros. If you will be able to check this, you could add a comment.
I explain that first in the beginning of the video. You can download (0:23) the whole toolchain into a folder and create a global path to it (3:15) or you can use repositories, Ubuntu: apt-get, but direct download is compatible on different distributions. It is also the best way to have the newest version if your package manager's version is not that up to date.
@ I had download arm-gcc package, but i don't know how install, 0:23 or 3:15 don't explain how to install arm-gcc
4 ปีที่แล้ว
Just unzip the file and put contents into a folder. You dont "install" it, whatever that means. Installing is just putting some files into specific directories and creating paths to access those files. By using .bashrc you add path to that folder, therefore arm-gcc is accessible globaly.
Dude! You are awesome!
It is clear that you understand the material well, as you conveyed the meaning of you points very clearly. My only feedback is that I was left a little un-sure about the flag definitions inside the make file.
Thanks, and best of luck!
Thank you for the comment. I try to explain everything regarding a topic in as much detail as possible, so that by understanding each part, you can modify, grow and adapt pieces of code or configurations.
Hopefully my newer videos will do this approach justice.
Cheers!
Let me say this is the only tutorial and information that work for stm32Nucle0-031c6 not even opeocd after weeks of tenacity I can finally flash and detect my board. This is awesome and thank you for this video. Seem like openocd uses stlink as wrapper for some stlkink debugger.
Excellent! Simply excellent. Thank you very much.
Thank you very much for this, I can't wait to get started!
Thank you so much for your contribution!!! It helps me a lot.
Thank you for watching :)
This is exactly what I am looking for! thx
thank you , it was very helpful .
To anyone getting the make error or st-info --probe access error, do the following for fixes. As a side note, go into the stlink-1-x-x/doc folder and open the compiling.md file as it has all the packages you need.
For the make error, make sure first have the correct packages, taken from the compling.md file mentioned above:
* `git`
* `gcc` or `clang` or `mingw32-gcc` or `mingw64-gcc` (C-compiler; very likely gcc is already present)
* `build-essential` (on Debian based distros (Debian, Ubuntu))
* `cmake` (3.4.2 or later, use the latest version available from the repository)
* `rpm` (on Debian based distros (Debian, Ubuntu), needed for package build with `make package`)
* `pkg-config`
* `libusb-1.0`
* `libusb-1.0-0-dev` (development headers for building)
* `libgtk-3-dev` (_optional_, needed for `stlink-gui`)
* `pandoc` (_optional_, needed for generating manpages from markdown)
Then try run make again. If this comes up with this error:
[RELEASE]
make[1]: *** No targets specified and no makefile found. Stop.
Makefile:33: recipe for target 'release' failed
make: *** [release] Error 2
Then run:
$ make clean
$ make
For the access error go down to the set permissions with udev section, as it says what to do. But essentially I wrote:
$ sudo cp ~/Embedded/stlink-1.6.1/config/udev/rules.d/49-stlinkv* /etc/udev/rules.d/
This worked for me.
Very useful videos....Thanku sir
Very useful! Very simple!
/bin/sh: 1: cmake: not found
make: *** [Makefile:58: build/Release] Error 127 .... I get this error. when ı open terminal in stlink directory . and do make command . after this command ı get this error. how can I solve this ?
Good and well explained. How do I get firmware/standard-peripheral-library for for stm32f411RE nucleo-64 board? I don't think yours will work; Will it?
Is the same will work on window ?
What a great knowledge and awesome tutorial thank you so much for all your help
Hi, I have a question. Where did you get the project files? From STM32Cube_FW_F4_V1.27.0 by any chance? If so, which ones? Cause I don't understand where those files are comming from. Thank you. I almost made it to the second videos :))
The files I posted on github are the same as in the video and are "project specific". Others are located in that software pack in a known location ln the disk. Makefile has a variable where you can put that path in.
Nowdays it is easier to go with cubemx and hal, but I think going back to this approach before or after cubemx is great for learning.
In my current videos you can learn even more using cmake and taking build system into your own hands, understanding each file and setting that goes into the process.
Cheers.
That's Great but can we Do Code debugging with it or can we use ITM unit on Linux to see real time printf like debugging
great work thank you for your lectures ' the black screen is hard to see
Do you have a reason for not using stm32-cube framework?
What if i do not have an ST-LINK?
I have managed to burn the bootloader (on windows) and burn a program my stm32F1 using FTDI and Arduino IDE on windows and linux.
But i do not have a ST-Link yet. Is there any way to burn the code via FTDI using your technique? (i guess not, since i can see from the gitlab that it is only made for stlink programmers).
Thanks.
As far as I am aware, blue pill, using F1 ic is popular with arduino users as there is usb/serial bootloader. After that, it is compatible with arduino ide, that uploads code via serial port with bootloader. I am certain there is no way to upload code to your "blank" processor without a proper hardware, like stlink or jlink. In order for arduino bootloader to work, someone had to put it on there with a debugger, such as stlink. You can get one by purchasing any stm32 development board and can be even broken away on nucleo boards.
If possible, i would love this kind of video but for GD32 device, as it is now the case with the chip shortage situation that GD32 can provide a replacement for STM32, but there is no IDE for it
I just took a look and it sounds both legit and interesting. I'll try finding a dev board and see if I can get it working.
Update: I just found and purchased a board. Not that easy to find on regular sites like ebay, aliexpress, banggood, seeedstudio, etc.
B-L072Z-LRWAN1. How you got blank_project.zip for this board? I got i-cube-lrwan downloaded. But, there is no Makefile !
Thank you very much !
Just a question. How I can use the same method with GNU Tools but with HAL and not SPL ? I'm generaly using STM32CubeIDE, and I prefer your method without application. It seem better for learning and understanding the backend of microcontroller design.
Thank you for the comment.
I also prefer this way of learning everything behind the system. I would use HAL and CubeMX to generate project files and manage mcu configuration and then I would suggest you to follow my new series on Building(playlist) to learn how to manage and build your project with common tools instead of using a specific ide, only one that you want.
@ Perfect that’s look good! Thank you
hi, stupid question, what is the difference between arm-none-eabi-gcc and gcc?, thanks for answer :D
No worries. As far as I understand it, a compiler usually compiles for the host operating system and platform. Standard gcc on your computer compiles for x86 platform. arm-none-eabi-gcc is a cross compiler meaning that it can compile binary for a different platform from the host, in this case it runs on x86 compiling for arm.
For example clang is a native cross compiler, meaning any version for a given host platform can compile for any other platform. It will be interesting to try it out. Power is in that you only need ony compiler for all platforms (let say you're building arm and desktop applications and you can use shared code and same compiler instead of two). I will have more videos on building projects in the future.
Awesome video, really well done tutorial. I'm running into a small issue when I try to probe the board. I do the "st-info --probe" command after making sure they're both the proper version and I get the following error:
"st-info: symbol lookup error: /usr/lib/libstlink.so.1: undefined symbol: libusb_set_option"
Do you have any idea what could cause this or how I could fix it?
Thank you.
I am unfamiliar with this error, so you might have to check this one on the gihub page(i think it got moved to another account) to maybe find an answer in problems section.
I also had sometimes problem with certain releases, so maybe try other releases and updates of the project. Hope this helps.
for the love of god I can never get stlink to work. I downloaded stlink in mylinux mint and it wouldn't even run make
At 2:11 of the video you run the 'make' command. To me it gives an error:
/bin/sh: 1: cmake: not found
make: *** [Makefile:58: build/Release] Error 127
At for today the file version is 'stlink-1.6.1'
I am working with Linux Ubuntu.
I did an extra step where I also installed the 'cmake' file in the '/opt' folder
and still gives the same error.
I used this guide here:
geeksww.com/tutorials/operating_systems/linux/installation/downloading_compiling_and_installing_cmake_on_linux.php
How can I solve it?
Make sure you have a few build tools installed, such as make, cmake, gcc, g++ and libusb. Then you should be able to compile. Now you only have to run make in root folder and resulting binaries will be located in ./build/Release/bin. Now this project is under stlink-org and not just texane, so things might change over time.
HI thank you
For stlink-1.7.0 when i run make the result is no makefile found and not cible specified
please help me
Do you have gcc/clang installed along with gnumake? I believe they updated and corrected the instructions for compiling the tool. On some distributions you can even find it in the package repos
@ I did'nt install those. So I will try now
teno un problema al jecutar make burn ~/Embedded/stlink/st-flash write test.bin 0x80000000
/bin/sh: 1: /home/juan/Embedded/stlink/st-flash: not found
make: *** [Makefile:57: burn] Error 127
Have you exported st-flash path to your shell? Looks like it does not find your st-flash binary. Please follow the video to see the procedure.
is gnu arm is needed if we use stm workbench . thanks for the knowledge sharing
If you use systemworkbench or cubeide, all tools for development come with the installation, that includes compiler and debuging.
Thanks for the amazing tutorial. I am trying to setup this environment for STM32F103C8T6, but I cannot find the firmware package on the website. Can you help me?
If it is not available on ST's site I would suggest using CubeMX or CubeIDE with HAL or LL. I have some newer videos on the topic :)
Thank you for your wonderful video! I would like to ask if you could also upload the elf and hex file in your github repo. Thanks!
Github might have some filter that prevent uploading binary files as you cannot know what it does. I recommend you to take a look at my build series for creating the binaries.
Hi, I found your tutorial to be everything I was looking for as I am learning to program microcontrollers and such a detailed tutorial is very welcome. I was following your video and after doing st-info --probe i get ERROR usb.c: Could not open USB device 0x0483:0x3748, access error. Found 0 stlink programmers. I have my microcontroller plugged in. There are some leds on from some tutorials I've done before. How can I solve this?
If access error is something to go by, then maybe try running the command as sudo, just for a test. Since all devices have different permissions and groups, not all are available to the user priviledge.
Just like serial devices, which are usually a part of dialout group, which you also have to be a part of in order to use it without superuser.
Try that and if it works, then you just need to add the device either to your user or group. Look up udev rules and how to make one for a specific usb device uid and vid (the two hex values separated by :).
Cheers, hope this helps.
@ thans for your answer. I tried but it didn't work. I think I rushed too early into this as there are too many things around programming microcontrollers that I don't know. Do you by any chance know some good resources that I can use to learn this stuff? Anyway thanks again and all the best.
Hello Matej,
I am using linux 19.04 .when installing stlink-1.5.1(latest on given link )then it show
"/bin/sh: 1: cmake: not found
make: *** [Makefile:43: build/Release] Error 127"
type of error .what i will do to install stlink and video is very helpful.
Check if you have a good version of cmake, make and gcc in order to compile stlink. Also you can check if configuration file is set. Also, you might try the latest version of stlink on github or one of zip/tar files available to download(versions do differ and sometimes one works and other doesnt). Experiment, but eventually it should work
Hi, iam using stm32f401re nucleo, the microcontroller communication with the pc but i can't link the external libraries in the make file. I have changed the path accordingly but make gives error
Can you describe or copy the error? Do you have the correct absolute path to the libraries inside the library pack?
In the file that you provided, please check if paths to subfolders for includes are correct. Also I would advise you to use the newest arm gcc toolchain from arm as shown in the vide. What error does compiler return?
@
compiling with
arm-none-eabi-gcc --specs=nosys.specs main.c -o main
does produce binaries.
Problem similar to
th-cam.com/video/TgDQejrI_vU/w-d-xo.html
Am not using eclipse.
You have to use compiler flags for libraries, if you just use that command line. Or just use a makefile like me. Just compare everything in the video to your case and you should have everything cleared.
@ I did make a few mistakes I have not included the additional three files in the dir.
After i put them from the standard libary folder and running make give following error
#error "Please select first the target STM32F4xx device used in your application (in stm32f4xx.h file)"
^~~~~
system_stm32f4xx.c: In function 'SystemCoreClockUpdate':
system_stm32f4xx.c:575:25: error: 'HSE_VALUE' undeclared (first use in this function); did you mean 'HSI_VALUE'?
SystemCoreClock = HSE_VALUE;
does it work on Nucleo f401re board ?
You would need a set of libraries for that family of mcu, it's a bit different from 407 or 411 series. But the names of libraries should stay the same, only header files and some source files would change (different functionality of mcus).
@ Thank you so much
I have seen some people reflash the onboard debugger with SEGGER. Is there any benefit of doing that? I was just following some tutorials. Thanks
I have not worked with j-link from Segger. They mostly focus on their debuggers and thats the point. If you need testing and debugging of large code, you could benefit from conversion, but you are limited in some features. Go to Seggers website as they have their tutorial on how to convert your stlink, which is cool.
Sure, I love how this gcc method is not size-limited unlike keil, iar, segger. My only concern is how do you debug like setting breakpoints and going through the code. Do you need something like eclipse to do that? Is it possible to do all that in terminal?
There is a gdb server that comes in the st-link utility and you might get something out of that (called st-util). Please read st-link git repository for info. I do small stuf so debugging isn't that important, but would be welcome. Onboard st debugger is still good for that meaning you dont't need new firmware as Eclipse and another linux version do include break points and variable watch etc. I did work for a company that makes debuggers and trace analyzers called iSystem. They have a free version of their IDE calle winIdea Open. You can give that a look, but mostly is targeted to companies and professionals.
stlink-1.7.0 make command doesn't work in fedora I search it but i didn't see a good result
What is the problem - does the compiler give you an error, make, cmake?
I tested compiling stlink checked out on release v1.7.0 using docker container base on fedora:36 with only the following libraries installed on a bare container:
git, make, cmake, gcc, g++, libusb-devel
Just run "make release -j" inside the repository to compile the project into ./build/Release/bin, where you'll find the executables.
For further install information read the compiling manual from stlink: github.com/stlink-org/stlink/blob/develop/doc/compiling.md#macOS
@ okey Fix it but this time *** No rule to make target '/home/alihan/ARM/STM32F4-Discovery_FW_V1.1.0/Libraries/CMSIS/ST/STM32F4xx/Source/Templates/TrueSTUDIO/startup_stm32f4xx.s', needed by 'Project_0001_test.elf'. this happened
I'm confused. Are you trying to build the project or are you trying to build the tool stlink-1.7.0? The second is what I suspected from your question. Now it looks like you're trying to build the project.
It complained that it cannot find the mentioned file in order to compile the project. Looks like you either have the wrong path or name of the file.
-- Configuring incomplete, errors occurred!
See also "/home/eltj/Embedded/stlink-1.5.1/build/Release/CMakeFiles/CMakeOutput.log".
See also "/home/eltj/Embedded/stlink-1.5.1/build/Release/CMakeFiles/CMakeError.log".
Makefile:42: recipe for target 'build/Release' failed
make: *** [build/Release] Error 1
during the make i got this error, can anybody help. i have installed cmake
Do you have installed make, build-essentials and gcc and g++ and check for libusb-1.0.. Check in the logs to see where it went wrong
Same error with me, try to:
$ sudo apt install cmake
hope it can help you!
我也遇见了同样的问题,试一下:
$ sudo apt install cmake
希望可以帮到你!
I was more looking for how to run linux on the stm32 chip
Can you please tell me what packages you have installed for Sublime text ?
I don't use Sublime much for coding as I use Atom, but I have the stock installation of sublime, no added packages.
@ I was having problems with the auto complete from other files, manange to solve that by installing a package! You'r doing a great job with these videos!
How did you know to use 0x8000000 for st-flash?
You can find the address where the flash memory starts in the datasheet. It's the same for most F and even L series.
@ Thank you. I have a nucleo and was looking in the nucleo-f429zi datasheet and could not find it. What I wanted was the stm32f429zi datasheet.
Memory map is located on page 86/240 for your mcu. First 512MB block (0) is expanded and you can find flash memory as third box from the bottom up. This is where the binary is stored and is the actual address of the physical flash memory.
can i setup this in raspberry pi, orange pi etc. ?
As long as you have make, cmake, gcc and toolchain, everything should work as it is all Linux compatible.
@ what are the system requirments of these tools?
These are basic linux tools that should work if you have linux system.
Hello, i get the error:
st-info: error while loading shared libraries: libstlink.so.1: cannot open shared object file: No such file or directory
I am looking for help in the forum: github.com/texane/stlink/issues/478
How can i solve it?
I got this error too, when I moved st-flash(shuld be same with st-info) to another l folder to be used with python, in my case. I then also copied libstlink.so.1 along with it. So make sure that library is in the same directory as st-flash or st-info. Hope this helps.
@ Hello. I solved the issue, i re-installed the file using `sudo make` instead of `make`
Be carefull when using sudo. If you had to use sudo for just compiling, then you dont have permission to write in that directory. Make sure you have permissions to write that file.
Thank you for this
I'm glad I could help you :)
How to download STM32F446RE (nucleo board) firmware?
If you want to use the old SPL, then you can download one that is for the whole F4 family: www.st.com/content/st_com/en/products/embedded-software/mcu-mpu-embedded-software/stm32-embedded-software/stm32-standard-peripheral-libraries/stsw-stm32065.html
For newer project I would suggest Cube and HAL or LL.
@ Hello Sir
I want build everything (GPIO, I2C, ...) from scratch without Lib or IDE. But I need Flash and startup file for STM32F446. Now, I can handler and build successfully. Thanks sir
Thats a great way to learn and one that I have done as well. For actual development its a bit impractical.
$ arm-none-eabi-gcc --version
arm-none-eabi-gcc (15:6.3.1+svn253039-1build1) 6.3.1 20170620
I installed it via apt. Do you think I can work with this version?
It looks to be an older version, so I would suggest you download a newer one or update repositories in your package manager. I think it should work fine if you're not using any newer architectures and cores, but some bugs might be present that are absent from the newer ones.
@ thanks, I removed the package and installed the latest one
Would this work on a raspbian (raspberry linux)?
This should work on most linux machines as the files downloaded are global for all Linux distros. If you will be able to check this, you could add a comment.
how to install arm-gcc?
I explain that first in the beginning of the video. You can download (0:23) the whole toolchain into a folder and create a global path to it (3:15) or you can use repositories, Ubuntu: apt-get, but direct download is compatible on different distributions. It is also the best way to have the newest version if your package manager's version is not that up to date.
@ I had download arm-gcc package, but i don't know how install, 0:23 or 3:15 don't explain how to install arm-gcc
Just unzip the file and put contents into a folder. You dont "install" it, whatever that means. Installing is just putting some files into specific directories and creating paths to access those files. By using .bashrc you add path to that folder, therefore arm-gcc is accessible globaly.
@ thank you so much, but don't know how to do it like you told me.
you get by this using by following command
go to your home directory and 2nd,
used "sudo apt install gcc-arm-none-eabi
2:00
does not run
nice vedio!
LIKE
Dobr hostname, haha :D
Hvala ;)
@ Hvala tebi, super serija! :)
@timorii Z veseljem! Važno da lahko pomagam, hvala za komentar :)
How to download STM32L433RC (Nucleo board) firmware?
All of the firmware today is managed with CubeMX. Only older F series have standard library packages.
I recommend my video on CubeMX for start.