cancel
Showing results for 
Search instead for 
Did you mean: 

I want to load program with system bootloader over TCP/UDP

Ahmet Yasin CİVAN
Associate III

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;

0693W00000LvlO3QAJ.png0693W00000Lw535QAB.png

1 ACCEPTED SOLUTION

Accepted Solutions
Houda GHABRI
ST Employee

Hi @Ahmet Yasin CİVAN​ ,

I don't think it can be considered a problem in CubeProgrammer side :smiling_face_with_smiling_eyes: .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

View solution in original post

24 REPLIES 24
TDK
Guru

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.

If you feel a post has answered your question, please click "Accept as Solution".

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

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

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.

0693W00000Lvv27QAB.png0693W00000Lvv22QAB.png

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.

Ahmet Yasin CİVAN
Associate III

All I need is to use STM32CubeProgrammer software with UART interface over TCP for system bootloader. Would you help me with this topic?

>  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?

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.

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..