Home arrow Support arrow Forums

Luminary Micro Forums

JorgeOrlando

Junior Boarder

2008/11/05 13:02

Help with ADC configuring

Well, I've been having problems with some libraries in Code Red. I'm trying to configure de ADC, but when I try to debug it, it says this:

../src/main.c:72: undefined reference to (routine)
../src/main.c:66: undefined reference to (name of the routine)

And so on....
I don't know what I am doing wrong with the pats to the libraries, I took the examples routes as a guide to do my own project, but I'm still having the problem with the libraries,

Can anyone help me ?

Post edited by: JorgeOrlando, at: 2008/11/05 13:02

login or register to reply

LMI Joe

Expert Boarder

2008/11/05 14:28

Re:Help with ADC configuring

What is the name of the undefined routine? Are the libraries set correctly for your project? To get to the library settings, right-click on the project name and then select "Properties" from the context menu. A Properties panel will appear. From the properties panel go to C/C++ Build-->Settings. From there scroll down in the dialog panel to the "MCU Linker" and then "Libraries" settings. You should see some libraries listed there. On mine for an example program I have the following listed under libraries:
driver, gcc, c

Under the library search paths I have:
${workspace_loc:/DriverLib/Debug}

If you need more help, please also post the version of red_suite you are using, and it would also be helpful to paste the console messages that contain the error, especially the lines that show the command line parameters being passed to the compiler/linker.

login or register to reply

JorgeOrlando

Junior Boarder

2008/11/05 17:33

Re:Help with ADC configuring

Thanks LMI Joe, it was the "driver" thingy. I built the project now, the problem is that it doesn't let me "debug" it, via the Run > Open Debug Dialog, although my project is now "clean", I mean, no more errors.
I think it's something about the C MCU application, since my project doesn't even appear in the list to debug the program on my LM3S6965 mic. ev. board.

On the other hand, my red suite's version number is 1.5.2

login or register to reply

JorgeOrlando

Junior Boarder

2008/11/06 18:04

Re:Help with ADC configuring

I have this problem when I run my code in the board, console says this:

Note: automatically using hardware breakpoints for read-only addresses.
main () at ../src/main.c:23
23 SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC);
Can't send signals to this remote system. SIGSTOP not sent.


and here is the code I'm trying to debug, it's almost the same as the ADC configuring application note, I just want to configure it correctly.

#include "hw_memmap.h"
#include "hw_types.h"
#include "adc.h"
#include "sysctl.h"
#include "debug.h"
#include "hw_sysctl.h"
#include "debug.h"

#ifdef DEBUG
void
__error__(char *pcFilename, unsigned long ulLine)
{
}
#endif

int main (void){
//unsigned long SYSCTL_SET0_ADCSPEED_500KSPS; //checar esto, tengo DUDAS CON LA VELOCIDAD
unsigned long ulSeq1DataBuffer;
unsigned long ulSeq3DataBuffer;
//
// Enable the clock to the ADC module
//
SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC);

//
// Configure the ADC to sample at 500KSps
//
//SysCtlADCSpeedSet(SYSCTL_SET0_ADCSPEED_500KSPS);

SysCtlADCSpeedSet(SYSCTL_ADCSPEED_500KSPS);

//
// Disable sample sequences 1 and 3
//
ADCSequenceDisable(ADC_BASE, 1);
ADCSequenceDisable(ADC_BASE, 3);

//
// Configure sample sequence 1: timer trigger, priority = 1
//
ADCSequenceConfigure(ADC_BASE, 1, ADC_TRIGGER_TIMER, 1);
//
// Configure sample sequence 3: processor trigger, priority = 0
//
ADCSequenceConfigure(ADC_BASE, 3, ADC_TRIGGER_PROCESSOR, 0);

//
// Configure sample sequence 3 steps 0, 1 and 2
//
ADCSequenceStepConfigure(ADC_BASE, 1, 0, ADC_CTL_CH0);
ADCSequenceStepConfigure(ADC_BASE, 1, 1, ADC_CTL_CH1);
ADCSequenceStepConfigure(ADC_BASE, 1, 2, ADC_CTL_CH2 | ADC_CTL_IE | ADC_CTL_END);
//
// Configure sample sequence 3 step 0
//
ADCSequenceStepConfigure(ADC_BASE, 3, 0, ADC_CTL_TS | ADC_CTL_END);

//
// Enable the interrupt for sample sequence 1
//
ADCIntEnable(ADC_BASE, 1);

//
// Retrieve data from sample sequence 1 FIFO
//
ADCSequenceDataGet(ADC_BASE, 1, &ulSeq1DataBuffer);
//ADCSequenceDataGet(ADC_BASE, 1, &ulSeq1DataBuffer);
//
// Retrieve data from sample sequence 3 FIFO
//
//ADCSequenceDataGet(ADC_BASE, 1, &ulValue);
ADCSequenceDataGet(ADC_BASE, 3, &ulSeq3DataBuffer);




//DiagExit(0);

}

Please, help me, thanks in advance.

Post edited by: JorgeOrlando, at: 2008/11/06 18:05

login or register to reply

LMI Dave

Platinum Boarder

2008/11/24 08:48

Re:Help with ADC configuring

The output you provide suggests that the debugger has successfully written the application to the board flash and set a breakpoint on the first instruction of main(). The error "Can't send signals to this remote system" is not one that I've seen before, though. Are you debugging on a Luminary evaluation kit using the USB debug connection? The error suggests that the board has crashed or there is a problem with the debugger connection but the connection issue seems unlikely given that the download presumably completed without problems.

I would try debugging this from the reset vector to see if there is something weird going on in the initialization code that is run prior to main() being called. Have you modified the startup code at all or is it exactly as was used with other working examples?

One thing I notice in your code (that is not likely related, unfortunately) is that you don't configure the system clock before setting up the ADC. Make sure you have a call to SysCtlClockSet() at the top of main (typically the very first thing you do) to ensure that you are running at the clock frequency you expect.

login or register to reply