[ABANDONED] Start with SES stm32f103vc

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • [ABANDONED] Start with SES stm32f103vc

      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

      C Source Code

      1. //
      2. // systick.cpp : STM32F1xx SysTick timer interrupt example.
      3. //
      4. #include <stdio.h>
      5. #include <stm32f1xx.h>
      6. #include <stdlib.h>
      7. static volatile int ticks = 0;
      8. extern "C" void SysTick_Handler(void) {
      9. ticks++;
      10. }
      11. static void delay(int n) {
      12. unsigned endTicks = ticks + n;
      13. while (ticks < endTicks);
      14. }
      15. int main(int argc, char *argv[]) {
      16. // Make sure SystemCoreClock is up-to-date
      17. SystemCoreClockUpdate();
      18. RCC->APB2ENR |= (1 << 4); //IOPCEN=1
      19. GPIOC->CRL |= 0x03000000; //CONF1=0, CONF0=0, MODE1=1, MODE0=1
      20. GPIOB -> ODR &= ~(1<<6); //Set Pin PB6 low to sink diode current
      21. // Enable SysTick timer interrupt
      22. SysTick->LOAD = (SystemCoreClock / 1000) - 1;
      23. SysTick->VAL = 0;
      24. SysTick->CTRL = SysTick_CTRL_CLKSOURCE_Msk | SysTick_CTRL_TICKINT_Msk | SysTick_CTRL_ENABLE_Msk;
      25. // Display tick count
      26. while (ticks < 100000) {
      27. printf("ticks = %d\n", ticks);
      28. GPIOB -> ODR ^= (1<<6); //toggle PB6
      29. delay(1000);
      30. }
      31. // Disable SysTick interrupt
      32. SysTick->CTRL &= ~SysTick_CTRL_ENABLE_Msk;
      33. exit(EXIT_SUCCESS);
      34. }
      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?