Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

CCS/AM4378: Periodic Timer Causes Debug Halt

$
0
0

Part Number:AM4378

Tool/software: Code Composer Studio

I am using the EVM board with SDK 4.3.0.5 on linux using CCS7.4. i am a linux newbie coming from RTOS so i am still using CCS for now.

i want to run a periodic timer every 10ms.

looking at these sources:

i ended up with this code:

(inlcuded library rt)

#include <time.h>

#include <sys/signal.h>
#include <sys/errno.h>

#define CLOCKID CLOCK_REALTIME
#define SIG SIGRTMIN

#define errExit(msg) do { perror(msg); exit(EXIT_FAILURE); \
} while (0)

timer_t CodecAudioTimerid;

void Handler(int sig, siginfo_t *si, void *uc);

void CreateCodecTimer(void)
{
struct sigevent sev;
struct itimerspec its;
sigset_t mask;
struct sigaction sa;

/* Establish handler for timer signal */
//printf("Establishing handler for signal %d\n", SIG);
sa.sa_flags = 0;//SA_SIGINFO;
sa.sa_sigaction = Handler;
sigemptyset(&sa.sa_mask);
if (sigaction(SIG, &sa, NULL) == -1)
{
errExit("sigaction");
}

/* Block timer signal temporarily */
//printf("Blocking signal %d\n", SIG);
/*sigemptyset(&mask);
sigaddset(&mask, SIG);
if (sigprocmask(SIG_SETMASK, &mask, NULL) == -1)
errExit("sigprocmask");*/

/* Create the timer */
sev.sigev_notify = SIGEV_SIGNAL;
sev.sigev_signo = SIG;
sev.sigev_value.sival_ptr = CodecAudioTimerid;
if (timer_create(CLOCKID, &sev, &CodecAudioTimerid) == -1)
{
errExit("timer_create");
}

/* Start the timer */
its.it_value.tv_sec = 0;
its.it_value.tv_nsec = 10000000;
its.it_interval.tv_sec = its.it_value.tv_sec;
its.it_interval.tv_nsec = its.it_value.tv_nsec;

if (timer_settime(CodecAudioTimerid, 0, &its, NULL) == -1)
{
errExit("timer_settime");
}

/* Unlock the timer signal, so that timer notification
can be delivered */
//printf("Unblocking signal %d\n", SIG);
/*if (sigprocmask(SIG_UNBLOCK, &mask, NULL) == -1)
errExit("sigprocmask");*/
}

void Handler(int sig, siginfo_t *si, void *uc)
{
//stuff

}

when i run debug in code composer every single time the timer expires my system halts with the message:

Program received signal SIG34, Real-time event 34.
0xb6faf476 in read () at ../sysdeps/unix/syscall-template.S:84
84 in ../sysdeps/unix/syscall-template.S

i do hit my handler breakpoints so it is going to the right place but i can't do anything while debugging in this way.

FYI i followed this webpage for setting up debugging on CCS7.4 (with some tweaks since it's not CCS5):

http://processors.wiki.ti.com/index.php/Linux_Debug_in_CCSv5


Viewing all articles
Browse latest Browse all 262198

Trending Articles