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);
}
}
