Re: Trouble with repeating structures on infineon arm cortex-m33 microcontroller (modustoolbox)

27 views
Skip to first unread message
Message has been deleted

Petteri Aimonen

unread,
Feb 28, 2025, 2:34:39 AMFeb 28
to nanopb
Hi,

From the comparison:

24    32 2 32 2
25    14 . 14 .
26    0A . 0D .
27    12 . 0A .
28    08 . 12 .
29    7B { 08 .
30    12 . 7B {

It looks like extra 0x0D byte is being inserted.
This usually happens when stdout is configured in text mode, and some intermediate layer decides to convert LF to CR LF.
On Linux the default is equivalent to binary mode, but apparently not on your MCU.
So you'd have to find some way to change stdout to binary - it may be a build option in your MCU libc.

If that's not it, here are a few more ideas:
  1. Try printing the output data byte-by-byte in hexadecimal format. Then stdout encoding wouldn't change it.
  2. Try changing some of the fields to non-callback by specifying max_size / max_count. This would help rule out any problem with the callback function implementations.
--
Petteri

perjantai 28. helmikuuta 2025 klo 9.20.21 UTC+2 vadim...@gmail.com kirjoitti:
Greetings,
So I am trying to send a handshake message from my mcu-powered doodad to a buntu server and I must be doing something wrong, since when I am running a test program on ubuntu, it produces a correct message that can be decoded with the google protobuf python library, but when I run the same code on the mcu, the result is corrupted.
The problem has to do with the repeated structure, since when I comment it out, the messages become identical. 
The side by side comparison shows that the messages start to deviate at the first instance of the repeated submessage.
Any guidance would be greatly appreciated.


Regards,
Vadim

Reply all
Reply to author
Forward
0 new messages