LwIP: set IP address, mask, and Gateway address of stm32 remotely
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-03-27 1:49 AM - last edited on ‎2025-03-27 1:59 AM by Andrew Neil
hii every one
i have a question about setting up the ip of the STM32 MCU remotely
when we want to do client server in udp or tcp on stm32 controller , we are used to set the ip address manually in the ioc file in general settings in the lwip section in the middleware tab .
and i was wondering if there is a way to set up any default ip of mine , and is there a way to change this ip remotly after i am connected to the stm32 .
my goal is to design an application that can give me the ability to access and change the ip and mask and gateway of my stm32 controller , i be very thankful for help and to know if there is a method to do that
Solved! Go to Solution.
- Labels:
-
Ethernet
-
LwIP
-
STM32F7 Series
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-03-27 2:12 AM - edited ‎2025-03-27 2:12 AM
You said, "we are used to set the ip address manually in the ioc file in general settings in the lwip section in the middleware tab" - so you already have this working?
So that code is your example!
That is the code that you browse, find the settings, then modify...
Did you try the internet search?
eg, https://www.google.com/search?q=LwIP+set+IP+address
A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-03-27 1:56 AM - edited ‎2025-03-27 1:57 AM
The ioc file from cubeMx as i understood is just a point and click User Interface that generates code.
Here is what i would do:
- Just put your project inside the version control of your choice (git?)
- Change the ip and generate code with cubeMx
- do a git diff and take a look what cubeMx actually changed in your sourcefiles
- Now you know what file/s you should go to for changing the ip yourself :D
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-03-27 2:04 AM
This is going to be more down to the IP stack that you use (LwIP) rather than specific to STM32 - so try searching in general for "LwIP set IP address" and similar ...
Also, as @Javier1 said, browse the generated code to see where these things get set - then change them from compile-time constants to run-time settings ...
A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-03-27 2:06 AM
can yo guys give an example code where to look for thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-03-27 2:12 AM - edited ‎2025-03-27 2:12 AM
You said, "we are used to set the ip address manually in the ioc file in general settings in the lwip section in the middleware tab" - so you already have this working?
So that code is your example!
That is the code that you browse, find the settings, then modify...
Did you try the internet search?
eg, https://www.google.com/search?q=LwIP+set+IP+address
A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-03-27 2:24 AM
@Javier1 wrote:
- Just put your project inside the version control of your choice (git?)
@abeba.1 If you don't already have version control, then I would certainly recommend that you should.
But you don't actually need it to do this - you can just use a simple copy:
- Generate your code in the normal way, with a fixed IP address specified via CubeMX
- Copy your entire project so a separate folder - where it will not get overwritten by re-generating.
- Now modify your project, via CubeMX, for a different IP address, and re-generate
- Now perform a diff between this project, and the copy of your original project
If you don't already have a diff utility, try WinMerge: https://winmerge.org/?lang=en
A diff utility is an invaluable tool.
A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-03-27 3:34 AM
hii guyes thanks for help :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-03-30 7:58 AM - last edited on ‎2025-03-31 2:09 AM by Andrew Neil
Duplicate - merged.
Please don't start multiple threads on the same topic.
hii everyone
in the stm32 in the middleware section we can set the ip address manually in general settings in static dhcp section
and compile the project and program it on my stm32 board .
lets say i manually set the ip to 198.162.127.100 so my server that is running on the stm32 board will be working with this ip .
lets say i want to remotly change the ip of the board (without compiling the project again ) to 198.162.127.101
and my question is this possible
my need is to be able to give the board a desired ip without compiling and downloading the new firmware to the stm32 controller
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-03-30 9:00 AM - edited ‎2025-03-30 9:00 AM
Use DHCP. Tell the DHCP server to allocate specific address to your board.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-03-30 9:40 AM
hii i researched this topic and i saw that in order for the dhcp server to assign ip address
this process is called reservation , and its done at the level of the dhcp server
from what i see i need to know the mac address of my stm32 and then to search for a section in my dhcp server where i can enter the mac and the ip that i want so my stm32 boar will always get the same ip .
lets say that my board is connected to the network the dhcp server is out of my reach , i am not the administrator of the dhcp server on the network in order to set up the mac with the desired ip that i want .
beside of that lets say my board doesn't have an access to the network that means that my local network needs to have a dhcp server in order to do the ip reservation , am i right ?
second -is there away of accessing the configurations of the dhcp server on my network with terminal commands to put my stm32 mac address and my desired ip
