2022-03-27 08:45 AM
I ran system bootloader, I can perform the bootloader process using the STM32CubeProgrammer software via USART. But what I want is to run the bootloader software over TCP or UDP using the USART protocol. Because my UART2 line is connected to a TCP converter.
I wrote a piece of code using Python, but it's very slow and disconnects after a while. Is it possible to enable STM32CubeProgrammer to communicate with UART protocol over TCP?
Softwareally, I used TCP to Uart converters, but STM32CubeRogrammer is getting a time delay error.
My system is as follows;
Solved! Go to Solution.
2022-03-31 02:24 AM
Hi @Ahmet Yasin CİVAN ,
I don't think it can be considered a problem in CubeProgrammer side 😊 .The standard use case (where latency is "normal" ) is working fine.
However I will raise your request internally to enhance the tool to support such use case with high data transfer latency between host and device.
CubeProgrammer team will debug further and see how they can address this modification.
I will keep you posted for any updates.
Houda
2022-03-27 09:06 AM
The system bootloader doesn't support TCP/UDP, nor does STM32CubeProgrammer. You'll need to own the conversion side, or create your own bootloader.
In theory, with a converter, it should be working. I would invest in a logic analyzer to see what part of the system is misbehaving. The bootloader should be solid, probably the converter isn't quite doing what is advertised.
There are also possibilities with a remote debugger able to be connected to the chip (via SWD) and reprogram it that way.
2022-03-27 11:03 AM
The serial protocol is documented, you could dispense with STM32 Cube Programmer, and implement the UART protocol more directly with your own Berkeley Sockets, or equivalent, implementation to talk more directly with your TCP-to-UART device.
You could also use a more common or robust serial based protocol in a loader of your own construction.
ST has previously published Ethernet IAP implementations
2022-03-27 10:13 PM
I know the system bootloader does not support TCP.
I wrote a socket program in python, commands such as Get ID, Extended Erase, Get are working with the commands I send from this software. There is no error on my system and my dialers as the commands work fine.
I connect the STM32CubeProgrammer software to a virtual port on the computer, this virtual port is connected to another virtual port which turns into TCP. I expect this to work. But I am getting errors on STM32CubeProgrammer.
2022-03-27 10:27 PM
Yes, I wrote a socket program in python, commands such as Get ID, Extended Erase, Get are working with the commands I send from this software. When I send the Write Memory command, I have to send it byte by byte, which is very long. If I send the data I want to write as a data packet, the system bootloader cannot detect it.
My socket program sends the commands in AN3155 document over TCP. Coming with TCP, the STM32H7 is converting to UART. There is no error on my system and my dialers as the commands work fine.
2022-03-28 12:54 AM
All I need is to use STM32CubeProgrammer software with UART interface over TCP for system bootloader. Would you help me with this topic?
2022-03-28 10:56 AM
> If I send the data I want to write as a data packet, the system bootloader cannot detect it.
What if you send by shorter packets?
2022-03-28 11:19 AM
Thank you for response,
After the Write Memory (AN3155) command, I start to write the data to the memory address. If this data is 1 byte over TCP, it writes properly. If it is more than 2 bytes in 1 TCP frame, nothing happens. This way python script is running very slow. Because I can send byte by byte.
2022-03-28 11:22 AM
The methods should permit blocks of bytes, although will have size and alignment expectations.
Cannot detect it, or rejects it?
It expects EVEN PARITY (8E1)
Should perhaps scope it, and understand the failure.
Theoretically you should be able to push code into RAM, allowing for a "staged loader" methodology, that way if the current protocol isn't ideal, you can upload something that does the task better.
2022-03-28 11:25 AM
Can you use a VCP/Filter Driver that presents as a COM port in Windows, but uses TCP/IP as a transport to remote serial devices.
I could swear NetBurner, or an immediate partner, offers such a solution.