Part Number: MSP432P401R
Tool/software: Code Composer Studio
I am trying to debug my code.
I have several source files related to a main code.
The below code is my main code.
I want to debug line by line for a source file, not the main code.
Last Friday, I could jump into the source file when I set a break point in the code, but it is not working now.
I think that I did not change anything and just set a break point to check line by line.
If I use step over for debugging, it stops at the while loop in red letter.
Please, advise me for it.
#include "msp.h"
#include "driverlib.h"
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "globals.h"
#include "initializations.h"
#include "peripheralFunctions.h"
#include "utilityFunctions.h"
void main(void)
{
WDT_A_holdTimer(); // Stop watchdog timer
MAP_FPU_enableModule();
MAP_Interrupt_disableMaster();
init_clocks();
init_pins();
init_uart();
init_spi();
init_adc();
init_capture();
init_timers();
MAP_Interrupt_enableSleepOnIsrExit();
MAP_Interrupt_setPriority(INT_TA3_0, 0); // UART message transmission has the highest priority
MAP_Interrupt_setPriority(INT_TA0_N, 1); // 1st magnetic encoder pulse reading
MAP_Interrupt_setPriority(INT_TA1_N, 2); // 2nd and 3rd magnetic encoder pulse reading
MAP_Interrupt_setPriority(INT_PORT6, 3); // ISR to start Timer A counters
MAP_Interrupt_enableMaster();
// Start counters/ISRs (Done in P1 ISR)
//MAP_Timer_A_startCounter(TIMER_A0_BASE, TIMER_A_UP_MODE);
//MAP_Timer_A_startCounter(TIMER_A1_BASE, TIMER_A_UP_MODE);
//MAP_Timer_A_startCounter(TIMER_A3_BASE, TIMER_A_UP_MODE);
while(1){
MAP_PCM_gotoLPM0();
}
}
// ISR that enables peripherals once homing is done on the first MSP and P1.5 is set high
void PORT6_IRQHandler(void)
{
//printf("Homing Done");
uint32_t status;
status = MAP_GPIO_getEnabledInterruptStatus(GPIO_PORT_P6);
MAP_GPIO_clearInterruptFlag(GPIO_PORT_P6, status);
// Start counters/ISRs
MAP_Timer_A_startCounter(TIMER_A0_BASE, TIMER_A_UP_MODE);
MAP_Timer_A_startCounter(TIMER_A1_BASE, TIMER_A_UP_MODE);
MAP_Timer_A_startCounter(TIMER_A3_BASE, TIMER_A_UP_MODE);
MAP_Interrupt_disableInterrupt(INT_PORT6);
}
// Gets the Timer A clock difference between the rising and falling edges of the first magnetic encoder
void TA0_N_IRQHandler(void)
{
//printf("\nTA0_N ISR\n");
if(TIMER_A0->CCTL[1] & 1 == 1){
MAP_Timer_A_clearCaptureCompareInterrupt(TIMER_A0_BASE, TIMER_A_CAPTURECOMPARE_REGISTER_1);
rise_count[0] = MAP_Timer_A_getCaptureCompareCount(TIMER_A0_BASE, TIMER_A_CAPTURECOMPARE_REGISTER_1);
}
if(TIMER_A0->CCTL[2] & 1 == 1){
MAP_Timer_A_clearCaptureCompareInterrupt(TIMER_A0_BASE, TIMER_A_CAPTURECOMPARE_REGISTER_2);
fall_count[0] = MAP_Timer_A_getCaptureCompareCount(TIMER_A0_BASE, TIMER_A_CAPTURECOMPARE_REGISTER_2);
}
pulse_length[0] = fall_count[0] - rise_count[0];
if(pulse_length[0] < 0){
pulse_length[0] += 4061;
}
}
// Gets the Timer A clock difference between the rising and falling edges of the second two magnetic encoders
void TA1_N_IRQHandler(void)
{
//printf("\nTA1 ISR\n");
if(TIMER_A1->CCTL[1] & 1 == 1){
MAP_Timer_A_clearCaptureCompareInterrupt(TIMER_A1_BASE, TIMER_A_CAPTURECOMPARE_REGISTER_1);
rise_count[1] = MAP_Timer_A_getCaptureCompareCount(TIMER_A1_BASE, TIMER_A_CAPTURECOMPARE_REGISTER_1);
}
if(TIMER_A1->CCTL[2] & 1 == 1){
MAP_Timer_A_clearCaptureCompareInterrupt(TIMER_A1_BASE, TIMER_A_CAPTURECOMPARE_REGISTER_2);
fall_count[1] = MAP_Timer_A_getCaptureCompareCount(TIMER_A1_BASE, TIMER_A_CAPTURECOMPARE_REGISTER_2);
}
if(TIMER_A1->CCTL[3] & 1 == 1){
MAP_Timer_A_clearCaptureCompareInterrupt(TIMER_A1_BASE, TIMER_A_CAPTURECOMPARE_REGISTER_3);
rise_count[2] = MAP_Timer_A_getCaptureCompareCount(TIMER_A1_BASE, TIMER_A_CAPTURECOMPARE_REGISTER_3);
}
if(TIMER_A1->CCTL[4] & 1 == 1){
MAP_Timer_A_clearCaptureCompareInterrupt(TIMER_A1_BASE, TIMER_A_CAPTURECOMPARE_REGISTER_4);
fall_count[2] = MAP_Timer_A_getCaptureCompareCount(TIMER_A1_BASE, TIMER_A_CAPTURECOMPARE_REGISTER_4);
}
pulse_length[1] = fall_count[1] - rise_count[1];
if(pulse_length[1] < 0){
pulse_length[1] += 4061;
}
pulse_length[2] = fall_count[2] - rise_count[2];
if(pulse_length[2] < 0){
pulse_length[2] += 4061;
}
}
// ISR to get joint angles, velocities, motor currents, and FSR forces then transmit them via UART
void TA3_0_IRQHandler(void){
//printf("\nTA3 ISR\n");
MAP_Timer_A_clearCaptureCompareInterrupt(TIMER_A3_BASE, TIMER_A_CAPTURECOMPARE_REGISTER_0);
MAP_ADC14_toggleConversionTrigger(); // Trigger ADC conversion
//delay_ms(100); // Delay to allow time for ADC conversions
read_spi();
read_capture();
read_adc();
int ii;
for(ii = 0; ii < 6; ii++){
write_uart(q_s[ii]);
}
for(ii = 0; ii < 6; ii++){
write_uart(qd_s[ii]);
}
for(ii = 0; ii < 3; ii++){
write_uart(i_s[ii]);
}
for(ii = 0; ii < 4; ii++){
write_uart(F_s[ii]);
}
MAP_UART_transmitData(EUSCI_A0_BASE, carriage_return);
}