Problema gravação LM3S6965

Software e Hardware para linha ARM

Moderadores: 51, guest2003, Renie, gpenga

Problema gravação LM3S6965

Mensagempor denis neves » 07 Jun 2011 14:51

Boa tarde pessoal,

comecei, recentemente, a programar ARM CORTEX M3 da Texas (LM3S6965) e utilizando IAR, que já utilizo para programar MSP430. Estou utilizando um EVALUATION KIT (EKS-LM3S6965) para testar meus programas.

Peguei um exemplinho na net para testar meu Kit:

#include "inc/lm3s6965.h"
#include "inc/hw_ints.h"
#include "inc/hw_memmap.h"
#include "inc/hw_nvic.h"
#include "inc/hw_types.h"
#include "driverlib/debug.h"
#include "driverlib/gpio.h"
#include "driverlib/interrupt.h"
#include "driverlib/systick.h"
#include "driverlib/sysctl.h"
#include "drivers/rit128x96x4.h"


#define BOTAO_SOBE 0x0001
#define BOTAO_DESCE 0x0002
#define BOTAO_ESQ 0x0004
#define BOTAO_DIR 0x0008

void le_botao(void);
void verifica_bt_press(void);

signed char btSobe, btDesce, btDir, btEsq;
unsigned char FbtSobe, FbtDesce, FbtDir, FbtEsq;
unsigned long ulLoop, cntLed;

void
IntGPIOe(void)
{
le_botao();
GPIO_PORTE_ICR_R = 0x0F; // limpo flags de interrupcao
}

int main(void)
{
SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);

SYSCTL_RCGC2_R = SYSCTL_RCGC2_GPIOF+SYSCTL_RCGC2_GPIOE;

GPIO_PORTF_DIR_R = 0x01; // porta como saida
GPIO_PORTF_DEN_R = 0x01; // habilito controle digital
GPIO_PORTE_PUR_R = 0x0F; // habilito pull ups
GPIO_PORTE_DEN_R = 0x0F; // habilito controle digital
GPIO_PORTE_IS_R = 0x00; // interrupcao por borda
GPIO_PORTE_ICR_R = 0x0F; // limpo flags de interrupcao
GPIO_PORTE_IBE_R = 0x00; // controle pelo event
GPIO_PORTE_IEV_R = 0x00; // por borda de descida
GPIO_PORTE_IM_R = 0x0F; // botoes sem mascara de interrupcao

IntPrioritySet(INT_GPIOE, 0x00);
IntEnable(INT_GPIOE);

RIT128x96x4Init(1000000);
RIT128x96x4StringDraw("Teste Display04", 18, 20, 15);

btSobe = 0;
btDesce = 0;
btDir = 0;
btEsq = 0;
FbtSobe = 0;
FbtDesce = 0;
FbtDir = 0;
FbtEsq = 0;


while(1)
{
verifica_bt_press();

}
}

void le_botao(void)
{
unsigned uLoop1;

// delay
for(uLoop1 = 0; uLoop1 < 1000; uLoop1++)
{
}

//----------------------
// verificando botao sobe
if (GPIO_PORTE_DATA_R &= BOTAO_SOBE) {
FbtSobe = 0; // flag do botao desacionado
}
else {
FbtSobe = 1; // flag do botao acionado
}
//----------------------
// verificando botao desce
if (GPIO_PORTE_DATA_R &= BOTAO_DESCE) {
FbtDesce = 0; // flag do botao desacionado
}
else {
FbtDesce = 1; // flag do botao acionado
}
//----------------------
// verificando botao esquerda
if (GPIO_PORTE_DATA_R &= BOTAO_ESQ) {
FbtEsq = 0; // flag do botao desacionado
}
else {
FbtEsq = 1; // flag do botao acionado
}
//----------------------
// verificando botao direita
if (GPIO_PORTE_DATA_R &= BOTAO_DIR) {
FbtDir = 0; // flag do botao desacionado
}
else {
FbtDir = 1; // flag do botao acionado
}
}

void verifica_bt_press(void)
{
// delay do loop
for(ulLoop = 0; ulLoop < 1000; ulLoop++)
{
}

// botao sobe ou desce para ligar o led
if (((FbtSobe)||(FbtDesce))&&(!FbtEsq)&&(!FbtDir)) {
// Turn on the LED.
GPIO_PORTF_DATA_R |= 0x01;
if (FbtSobe)
RIT128x96x4StringDraw("Sobe ", 18, 40, 15);
if (FbtDesce)
RIT128x96x4StringDraw("Desce ", 18, 40, 15);
FbtSobe = 0;
FbtDesce = 0;
}

// botao direita ou esquerda para desligar o led
if ((!FbtSobe)&&(!FbtDesce)&&((FbtEsq)||(FbtDir))) {
// Turn off the LED.
GPIO_PORTF_DATA_R &= ~(0x01);
if (FbtEsq)
RIT128x96x4StringDraw("Esquerda", 18, 40, 15);
if (FbtDir)
RIT128x96x4StringDraw("Direita ", 18, 40, 15);
FbtDir = 0;
FbtEsq = 0;
}
// delay do loop
for(ulLoop = 0; ulLoop < 20000; ulLoop++)
{
}
}

Pois bem, esse exemplo compila perfeitamente no IAR !!!....mas na hora que eu mando o IAR programar o ARM ele mostra alguns erros que eu não estou conseguindo resolver:

Error[Li005]: no definition for "SysCtlClockSet" [referenced from D:\Denis UT\ARM_CM3\Iniciando\Teste\Debug\Obj\main.o]
Error[Li005]: no definition for "SysCtlPeripheralEnable" [referenced from D:\Denis UT\ARM_CM3\Iniciando\Teste\Debug\Obj\main.o]
Error[Li005]: no definition for "IntPrioritySet" [referenced from D:\Denis UT\ARM_CM3\Iniciando\Teste\Debug\Obj\main.o]
Error[Li005]: no definition for "IntEnable" [referenced from D:\Denis UT\ARM_CM3\Iniciando\Teste\Debug\Obj\main.o]
Error[Li005]: no definition for "RIT128x96x4Init" [referenced from D:\Denis UT\ARM_CM3\Iniciando\Teste\Debug\Obj\main.o]
Error[Li005]: no definition for "RIT128x96x4StringDraw" [referenced from D:\Denis UT\ARM_CM3\Iniciando\Teste\Debug\Obj\main.o]
Error while running Linker

Me parece que está dando pau nas funções de CLOCK e do DISPLAY gráfico, mas isso apenas quando eu mando gravar, na compilação ocorre tudo normalmente sem nenhum erro!!!

Ps.:Os drivers do Kit já estão instalados no meu PC e eu ja configurei o DEBUG do IAR para usar o STELLARIS FTDI (driver para debug e gravação)

Peso ajuda aos mais experientes para resolver esse pau.

Muito obrigado,

Denis.
HEY HO LET'S GO !!!
denis neves
Byte
 
Mensagens: 117
Registrado em: 25 Jul 2007 17:16

Voltar para ARM

Quem está online

Usuários navegando neste fórum: Nenhum usuário registrado e 1 visitante

x