Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
14 years ago

Section is not within region.

Hello.

Kind of wierd problem. As i create new new project and bsp from template ("hello world", for example), it seem to work fine. But when i include some external .h files and write some code, the error appears:


address 0xd444 of hello_world.elf section `.bss' is not within region `onchip_ram'	hello_world		 	C/C++ Problem
address 0xd444 of hello_world.elf section `.onchip_ram' is not within region `onchip_ram'	hello_world		 	C/C++ Problem

The code is something like:

#include <stdio.h>
# include "oc_i2c_master.h"
# include "alt_types.h"
# include "system.h"
# include "io.h"
int main()
{
	IOWR_8DIRECT(I2C_MASTER_BASE,OC_I2C_PRER_LO,99);
	printf("PRER=%d\n",IORD_8DIRECT(I2C_MASTER_BASE,OC_I2C_PRER_LO));
	return 0;
}

The weird part is that there is no way to build this project except for the removal of it and creating new one. Neither recovering back default "Hello world" text nor cleaning project seem to help. How can i overcome this error?

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    By the way, im using small C library without C++ support, so it have to match ram... Anyways it worked once, so its not about insufficient memory.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Try commenting out the printf().

    I suspect the image is too large for the specified on-chip memory sizes.

    Also verify the which on-chip memory areas are assigned to code/data etc, and their base address and sizes.

    0xd444 sounds a bit like the size of something using printf() and the standard libraries.