This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS v6.1.1, LM3S9B95 CORTEX M3, configuration problem.

Hi guy's, i'm looking for someone who can solve my problem. I've got EasyMXPRO for stellaris, and LM3S9B95 CORTEX M3 microcontroller. I'm begginer, but i want to configure that stuff with Code Composer. I can build project, but debuuger running all the time when  find that line:

GPIOPinTypeGPIOOutput(GPIO_PORTB_BASE, GPIO_PINS_ALL);

there's my example code:

#include<stdint.h>
#include<stdbool.h>
#include <inc/hw_gpio.h>
#include"inc/hw_memmap.h"
#include"driverlib/sysctl.h"
#include"driverlib/gpio.h"
#include"driverlib/rom.h"

#define GPIO_PINS_ALL GPIO_PIN_0|GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3|GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7

int main(void) {

 uint8_t port_val = 0;
    
 ROM_SysCtlClockSet (SYSCTL_SYSDIV_5 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ);
 SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
 GPIOPinTypeGPIOOutput(GPIO_PORTB_BASE, GPIO_PINS_ALL);
 for(;;)
 {
     GPIOPinWrite (GPIO_PORTA_BASE, 0xFF, port_val++);
 }
    return 0;
}
I think that i've got problem with configuration of CCS, but i tried a lot of things, and anything  was worked on. The debugger is turnning on so i think that isn't problem with drivers or communication. My OS is W10.

Thanks for all advice's.

P.S Sorry for my English.

  • Hi,

    This seems an application error instead of a pure CCS problem. In this case, I will move this thread to the Tiva microcontrollers forum, so the experts there will be able to better help you with the application debugging.

    Regards,
    Rafael
  • Hi,

    Put a delay at the for(;;) to see the output. Also, try to output at 1 GPIO pin first.

    - kel
  • Waldemar Knyrek said:
    SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
     GPIOPinTypeGPIOOutput(GPIO_PORTB_BASE, GPIO_PINS_ALL);
     for(;;)
     {
         GPIOPinWrite (GPIO_PORTA_BASE, 0xFF, port_val++);
     }

    That code enables GPIO PORT B, but then calls GPIOPinWrite for GPIO PORT A.

    The GPIOPinWrite (GPIO_PORTA_BASE, 0xFF, port_val++) call will cause a hard fault since GPIO PORT A hasn't been enabled. Not sure if you want to use GPIO PORT A or B, but the same GPIO PORT should be used in all calls.