Aleksandr
Aleksandr

Reputation: 1465

Uses protobuf-c 0.15 on an embedded ARM system (STM32 F4)

Is it possible to develop a system which uses protobuf-c 0.15 on an embedded ARM system (STM32 F4) and communicates with a java server, which uses protobuf?

protobuf-c 0.15 uses dynamic memory allocation. And compiling throw error:

/opt/arm/sourcery-arm-none-eabi-2011.09/bin/../lib/gcc/arm-none-eabi/4.6.1/../../../../arm-none-eabi/lib/thumb2/libc.a(lib_a-abort.o): In function `abort':
abort.c:(.text+0xa): undefined reference to `_exit'
/opt/arm/sourcery-arm-none-eabi-2011.09/bin/../lib/gcc/arm-none-eabi/4.6.1/../../../../arm-none-eabi/lib/thumb2/libc.a(lib_a-sbrkr.o): In function `_sbrk_r':
sbrkr.c:(.text+0x12): undefined reference to `_sbrk'
...

I know about nanopb and protobuf-embedded-c. But they have limited support protobuf.

Upvotes: 3

Views: 3726

Answers (1)

jpa
jpa

Reputation: 12156

The undefined reference to _sbrk is from newlib, the libc that comes with CodeSourcery. You will need to provide system call functions to properly interface it to your system. See for example: https://sites.google.com/site/stm32discovery/open-source-development-with-the-stm32-discovery/getting-newlib-to-work-with-stm32-and-code-sourcery-lite-eabi

(With regards to nanopb's limited support of protobuf, I would like to hear more about what features you would need. I'm the author of nanopb.)

Upvotes: 6

Related Questions