This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Retargeting

Hi, I'm a bit of a newbie to C and embedded programming. I'm using the ARM Crossworks IDE right now and trying to get the HRM_RX example working on my PCA10028 board. I've imported the code and when ever I attempt to compile it, I get the following errors from the retarget.c file.

error: storage size of '__stdout' isn't known

error: storage size of '__stdin' isn't known

From my reading I understand I have to define the size of these two as Crossworks doesn't do it for me, but I'm at a bit of a loss as to how to do that correctly. Any help is appreciated!

Parents
  • Remove retarget.c, you don't need it.

    Edit:

    If you want to send output to the UART then there's an example in the Crossworks manual of how to do that, you customise __putchar() you don't need, nor can you use, retarget.c which has definitions for GCC or ARM libraries only. The manual also shows you how to output to the Crossworks console (very useful). It doesn't tell you how to use the Segger "RTT" library, but Crossworks works natively with that as well giving you a very easy way to output data right out of the JLink. You just follow the instructions you can find online at Segger for RTT and that too appears in the console.

  • Many thanks! That got it compiling correctly.

Reply Children
No Data
Related