[SOLVED] Getting Started Embedded Studio & Nucleo STM32F103

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

  • [SOLVED] Getting Started Embedded Studio & Nucleo STM32F103

    Hello,

    currently I'm trying to getting started with the Nucleo board and Embedded Studio. Therefor I installed the J-Link firmware on my Nucleo board. As far as I can tell the board is recognized as J-Link. Then I wrote a small blinky program trying to set Pin PC10 as output:

    Source Code

    1. void main(void)
    2. {
    3. RCC->APB2ENR |= (1 << 4); //IOPCEN=1
    4. GPIOC->CRH |= 0x500; //CONF1=0, CONF0=1, MODE1=0, MODE0=1
    5. GPIOC -> ODR |= (1<<10); //Set Pin PC10 high
    6. while(1)
    7. {
    8. }
    9. }
    Display All


    For starting the program I hit F5.

    The pin shows no action, but I can tell that the uC is running because when I set a breakpoint on the koop it get's hit.
  • Hello,

    Thank you for your inquiry.
    The source you posted does not result in a blinking LED as your while(1) is empty so there is no toggle of the LED pin.
    Which eval board are you using exactly? The NUCLEO-F103RB board does not have any LED connected to PC10.
    If you are using an external LED make sure you wire it correctly and use a series resistor to limit the current.

    As a starting project for blinky LED we suggest using the Embedded Studio pacakge manager. Download the STM32F1xx support package.
    Open Tools-> Show Installed Packages-> STMicroelectronics STM32F1xx CPU Support Package-> STM32F1xx Samples Solution

    There you will find a SysTick Interrupt example project.
    This example will print a message every second. Instead of printing the message you can replace the printf with the toggle of your LED pin (e.g. using XOR).
    Now you should have a quick setup of a timed blinky example.

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.