Hello,
I recently started using SES (after using Keil). I tried to import an old project from keil to SES but it didn't work. So i tried to make a new project but i cant even get an LED blinking. I had tried the method from this topic:
[SOLVED] Getting Started Embedded Studio & Nucleo STM32F103
My PCB has an LED attached to PB6 which I wanted to toggle to check the GPIO
Display All
I think i may have something wrong configured with SES. I made also the new project according to this page:
segger.com/products/developmen…ology/project-management/
Is there something that I i could omitted?
I recently started using SES (after using Keil). I tried to import an old project from keil to SES but it didn't work. So i tried to make a new project but i cant even get an LED blinking. I had tried the method from this topic:
[SOLVED] Getting Started Embedded Studio & Nucleo STM32F103
My PCB has an LED attached to PB6 which I wanted to toggle to check the GPIO
C Source Code
- //
- // systick.cpp : STM32F1xx SysTick timer interrupt example.
- //
- #include <stdio.h>
- #include <stm32f1xx.h>
- #include <stdlib.h>
- static volatile int ticks = 0;
- extern "C" void SysTick_Handler(void) {
- ticks++;
- }
- static void delay(int n) {
- unsigned endTicks = ticks + n;
- while (ticks < endTicks);
- }
- int main(int argc, char *argv[]) {
- // Make sure SystemCoreClock is up-to-date
- SystemCoreClockUpdate();
- RCC->APB2ENR |= (1 << 4); //IOPCEN=1
- GPIOC->CRL |= 0x03000000; //CONF1=0, CONF0=0, MODE1=1, MODE0=1
- GPIOB -> ODR &= ~(1<<6); //Set Pin PB6 low to sink diode current
- // Enable SysTick timer interrupt
- SysTick->LOAD = (SystemCoreClock / 1000) - 1;
- SysTick->VAL = 0;
- SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_TICKINT_Msk | SysTick_CTRL_ENABLE_Msk;
- // Display tick count
- while (ticks < 100000) {
- printf("ticks = %d\n", ticks);
- GPIOB -> ODR ^= (1<<6); //toggle PB6
- delay(1000);
- }
- // Disable SysTick interrupt
- SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk;
- exit(EXIT_SUCCESS);
- }
I think i may have something wrong configured with SES. I made also the new project according to this page:
segger.com/products/developmen…ology/project-management/
Is there something that I i could omitted?