2

I work on the Aurix microcontroller on eclipse i need to display unsigned char values on the console, I did like that

  printf ("% hhx", tab [j]);

but I had this error:

  error: AppKit_TC277TFT_TimeDemo.elf section `.inttab' will not fit in 
  region `PMI_PSPR'

  error: region `PMI_PSPR' overflowed by 16788 bytes

Is there anyone who could help me

16
  • so what is the solution?
    – Rbn
    Commented Jul 4, 2019 at 12:35
  • 3
    Download more RAM. Jokes aside, you should have thought about the requirements of your project before buying an MCU.
    – ganymede
    Commented Jul 4, 2019 at 12:37
  • OK so it was not possible to printf with this MCU?
    – Rbn
    Commented Jul 4, 2019 at 12:41
  • 1
    do not use printf. Write tiny own one Commented Jul 4, 2019 at 12:48
  • 1
    @VioAriton It has a huge amount of flash, but the segment being overflowed is only 24 kB in size. Commented Jul 4, 2019 at 12:51

3 Answers 3

4

Searching for PMI_PSPR Aurix in a well-known search service brings up this forum post.

Apparently you are linking your code to run from RAM. Change the linker settings to link it to flash, and run from there.

1

First try to isolate what is the cause. Two thoughts are:

  1. Check if the stdout stream works.
  2. Check if a memory issue (as the error suggests).

1. stdout check:

Try using the stdout stream without using printf formatter. The formatter is bloated as people suggest and generally not a good idea on embedded systems. Also have you setup where the stdout stream goes (is it mapped to some UART code, normally on embedded systems you need to write or configure this)? Test by using putch('.'), putchar('.') or even puts("Hello").

2. memory check:

Try building the code that uses sprintf() by itself without stdout. If that doesn't build either then it is likely the formatter. Some embedded compilers allow configuring the formatter library as smaller options to get around this issue (doesn't support the full implementation).

1

Use printf in embedded c

One way is to use UART communication.

Convert numeric value to printable ascii form and send to UART so that one may see on console.

For simple applications you may consider storing printable characters to some array buffer and at the end of activity print the array buffer to UART

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.