This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LAUNCHXL-F28379D: Error in printing message on console

Part Number: LAUNCHXL-F28379D

Hello,

I am new to embedded systems.

I imported a example code to blink an onboard LED and it works fine, but as soon as I include <stdio.h> header and try to write printf statement in the same program it throws an error.

Can anyone explain why?

ERROR is as follows:

"../2837xD_RAM_lnk_cpu1.cmd", line 87: error #10099-D: program will not fit into available memory, or the section contains a call site that requires a trampoline that can't be generated for this section. run placement with alignment/blocking fails for section ".bss" size 0x1ca page 1.  Available memory ranges:

CODE is as follows:

#include "F28x_Project.h"
#include "stdio.h"

//
// Defines
//
#define BLINKY_LED_GPIO 31

void main(void)
{
//
// Step 1. Initialize System Control:
// PLL, WatchDog, enable Peripheral Clocks
// This example function is found in the F2837xD_SysCtrl.c file.
//
InitSysCtrl();

//
// Step 2. Initialize GPIO:
// This example function is found in the F2837xD_Gpio.c file and
// illustrates how to set the GPIO to it's default state.
//
InitGpio();
GPIO_SetupPinMux(BLINKY_LED_GPIO, GPIO_MUX_CPU1, 0);
GPIO_SetupPinOptions(BLINKY_LED_GPIO, GPIO_OUTPUT, GPIO_PUSHPULL);

//
// Step 3. Clear all interrupts and initialize PIE vector table:
// Disable CPU interrupts
//
DINT;

//
// Initialize the PIE control registers to their default state.
// The default state is all PIE interrupts disabled and flags
// are cleared.
// This function is found in the F2837xD_PieCtrl.c file.
//
InitPieCtrl();

//
// Disable CPU interrupts and clear all CPU interrupt flags:
//
IER = 0x0000;
IFR = 0x0000;


InitPieVectTable();

//
// Enable global Interrupts and higher priority real-time debug events:
//
EINT; // Enable Global interrupt INTM
ERTM; // Enable Global realtime interrupt DBGM

//
// Step 6. IDLE loop. Just sit and loop forever (optional):
//
for(;;)
{
//
// Turn on LED
//
GPIO_WritePin(BLINKY_LED_GPIO, 0);
printf("Hi");

//
// Delay for a bit.
//
DELAY_US(1000*500);

//
// Turn off LED
//
GPIO_WritePin(BLINKY_LED_GPIO, 1);
printf("Hello");

//
// Delay for a bit.
DELAY_US(1000*500);
}
}

  • Hello Guarav,

    As a note, please do not paste code as plaintext, use the Insert > Code option so that it's easier to view the post.

    error #10099-D: program will not fit into available memory

    This more than likely means that your program is too large for the RAM or Flash module in which it is allocated, in this case adding the stdio header file adds a lot to the program. To fix this, you need to open the relevant linker command (.cmd) file and allocate more RAM/Flash to the .text section (you must add whichever the program is on, so if it's on RAM you need to add more RAM) like so:

    Additionally, if you go to View > Memory Allocation on the top menu bar of CCS, you can view what is failing to be allocated to memory and how large it is.

    Best regards,

    Omer Amir