DSPRelated.com
Forums

Including table as data section using section pragma (Codewarrior 56F800)

Started by Lee May 4, 2004
Hi.

I'm using CodeWarrior for the 56F800 and I'm trying to get a table
included as part of the code section (.text) rather than as data. It
seems like the .section related pragmas should do this, but so far
nothings worked.

I'm trying to get the following code included as part of the .text
section, since we do a destructive memory test at boot. So far none
of the combinations of pragmas I've tried have shown up in the link
map as being included. Here's what I have at the moment:

#pragma define_section pintab ".pintab.text" R

#pragma section pintab begin

/* Define port and pin numbers for IO pins */
struct pintbl pintable[] = {
// port A pins
A_GPIO_A_DR, 0x0001, // A_GPIOA0 - BFOK
A_GPIO_A_DR, 0x0002, // A_GPIOA1 - FANON
A_GPIO_A_DR, 0x0040, // A_GPIOA6 - ARST
A_GPIO_A_DR, 0x0080, // A_GPIOA7 - FAN
A_GPIO_A_DR, 0x0200, // A_GPIOA9 - SPSEL
A_GPIO_A_DR, 0x0400, // A_GPIOA10 - FAULT1
A_GPIO_A_DR, 0x0800, // A_GPIOA11 - AMUXA
A_GPIO_A_DR, 0x1000, // A_GPIOA12 - AMUXB
A_GPIO_A_DR, 0x2000, // A_GPIOA13 - AMUXC
A_GPIO_A_DR, 0x4000, // A_GPIOA14 - FAULT2
A_GPIO_A_DR, 0x8000, // A_GPIOA15 - TWARN2

// port B pins

// port C pins
A_GPIO_C_DR, 0x0008, // A_GPIOC3 - SPDA
A_GPIO_C_DR, 0x0010, // A_GPIOC4 - SPFS,
A_GPIO_C_DR, 0x0020, // A_GPIOC5 - SPCLK,

// port D pins
A_GPIO_D_DR, 0x0001, // A_GPIOD0 - VMODE
A_GPIO_D_DR, 0x0002, // A_GPIOD1 - VCL
A_GPIO_D_DR, 0x0004, // A_GPIOD2 - VDA
A_GPIO_D_DR, 0x0040, // A_GPIOD6 - LATCH259_D
A_GPIO_D_DR, 0x0080, // A_GPIOD7 - LATCH259_G

// port E pins

// port F pins
A_GPIO_F_DR, 0x0010, // A_GPIOF4 - FAULT4
A_GPIO_F_DR, 0x0020, // A_GPIOF5 - TWARN4,
A_GPIO_F_DR, 0x0040, // A_GPIOF6 - FAULT3,
A_GPIO_F_DR, 0x0080, // A_GPIOF7 - TWARN3,

// port G pins
A_GPIO_G_DR, 0x0010, // A_GPIOG4 - LED1
A_GPIO_G_DR, 0x0020, // A_GPIOG5 - LED2

// Eval board definitions
A_GPIO_B_DR, 0x0002, // A_GPIOB1 - YELLOW LED
A_GPIO_B_DR, 0x0004 // A_GPIOB2 - GREEN LED

};

#pragma section pintab end

I then modified the linker command file as follows:

.executing_code :
{
# .text sections

* (.text)
* (rtlib.text)
* (fp_engine.text)
* (user.text)
* (pintab.text)
} > .p_flash_ROM

Any suggestions for what I might be missing? Thanks

Lee