Keil MDK5 why I can not build simple LED blink demo?

Very disapointed with the software from first use, used microchip for last 5 years. Version 5.43

I have a target device MM32F003 and want to write same code for this device; cortex M0. From manufacturer website I saw it is suppoortel by arm Keil and IAR.
So First try with a Keil.

Pack installer gives me LED blink demo which I want to build, then later run.

With out of the box compiler, V6.24 I am getting 57 errors: first one is

C:/Users/Administrator/AppData/Local/Arm/Packs/ARM/CMSIS/6.2.0/CMSIS/Core/Include\cmsis_armclang.h(308): error: unknown type name 'inline'

My guess to modern compiler for such device, then I tried to install and build with compiler V5.06

5 errors after building:

Build target 'Target 1'
compiling led.c...
Error: C9555E: Failed to check out a license.

WTF ? MDK-Lite evaluation version out of the box in single user License tab active.

They do not allow to run simple code with blinking LED, joke. How they can invite new users or students to use their IDE ?

OK, maybe I want to much..I  made second try, the user-based license was activated

1st error after build:

*** Warning: The configured compiler version '5.06 update 7 (build 960)' does not support the selected User Based Licensing technology.

Build target 'Target 1'
compiling led.c...
Error: C9555E: Failed to check out a license.

Closed endless loop, either compiler to modern or licensing problem.

Anyone have idea how to build simple LED blink demo?

Parents
  • John

    I will first point you to the Arm Community Guidelines regarding use of this forum.
    Community Guidelines 

    The issue is not with the tools but rather this project, which uses an older version of CMSIS.

    If not installed (likely not if this is your first use), go to Arm Pack Manager, locate Arm::CMSIS, and expand down to locate version 5.9 (the latest 5.x version). Download and install.

    In your project, open the Manage Run-Time Environment view, and click Select Packs at the bottom.

    Deselect "Use latest versions of all installed Software Packs" and locate Arm::CMSIS.
    Select 5.9 (and deselect 6.2). Click OK.

    The project can now build with Arm Compiler 6.24.


    Rebuild started: Project: BLINK
    *** Using Compiler 'V6.24', folder: 'C:\Arm\Keil_v5\ARM\ARMCLANG\Bin'
    Rebuild target 'armclang'
    assembling startup_MM32F003.s...
    compiling system_MM32F003.c...
    compiling led.c...
    compiling test.c...
    linking...
    Program Size: Code=744 RO-data=196 RW-data=0 ZI-data=1120
    FromELF: creating hex file...
    "..\OBJ\test.axf" - 0 Error(s), 0 Warning(s).
    Build Time Elapsed: 00:00:01


    Regarding Arm Compiler 5, this is a very old toolchain, and is not supported any more by the Arm Community license.
    Usage requires purchase of a Professional Edition license.
    Also for completeness CMSIS 6.x does not support use of this compiler.

    However with the above CMSIS pack change, the project can also build without issue.

    Rebuild started: Project: BLINK
    *** Using Compiler 'V5.06 update 7 (build 960)', folder: 'C:\Arm\Compilers\ARM_Compiler_5.06u7\Bin'
    Rebuild target 'Target 1'
    assembling startup_MM32F003.s...
    compiling led.c...
    compiling test.c...
    compiling system_MM32F003.c...
    linking...
    Program Size: Code=904 RO-data=196 RW-data=0 ZI-data=1120
    FromELF: creating hex file...
    "..\OBJ\test.axf" - 0 Error(s), 0 Warning(s).
    Build Time Elapsed: 00:00:03

Reply
  • John

    I will first point you to the Arm Community Guidelines regarding use of this forum.
    Community Guidelines 

    The issue is not with the tools but rather this project, which uses an older version of CMSIS.

    If not installed (likely not if this is your first use), go to Arm Pack Manager, locate Arm::CMSIS, and expand down to locate version 5.9 (the latest 5.x version). Download and install.

    In your project, open the Manage Run-Time Environment view, and click Select Packs at the bottom.

    Deselect "Use latest versions of all installed Software Packs" and locate Arm::CMSIS.
    Select 5.9 (and deselect 6.2). Click OK.

    The project can now build with Arm Compiler 6.24.


    Rebuild started: Project: BLINK
    *** Using Compiler 'V6.24', folder: 'C:\Arm\Keil_v5\ARM\ARMCLANG\Bin'
    Rebuild target 'armclang'
    assembling startup_MM32F003.s...
    compiling system_MM32F003.c...
    compiling led.c...
    compiling test.c...
    linking...
    Program Size: Code=744 RO-data=196 RW-data=0 ZI-data=1120
    FromELF: creating hex file...
    "..\OBJ\test.axf" - 0 Error(s), 0 Warning(s).
    Build Time Elapsed: 00:00:01


    Regarding Arm Compiler 5, this is a very old toolchain, and is not supported any more by the Arm Community license.
    Usage requires purchase of a Professional Edition license.
    Also for completeness CMSIS 6.x does not support use of this compiler.

    However with the above CMSIS pack change, the project can also build without issue.

    Rebuild started: Project: BLINK
    *** Using Compiler 'V5.06 update 7 (build 960)', folder: 'C:\Arm\Compilers\ARM_Compiler_5.06u7\Bin'
    Rebuild target 'Target 1'
    assembling startup_MM32F003.s...
    compiling led.c...
    compiling test.c...
    compiling system_MM32F003.c...
    linking...
    Program Size: Code=904 RO-data=196 RW-data=0 ZI-data=1120
    FromELF: creating hex file...
    "..\OBJ\test.axf" - 0 Error(s), 0 Warning(s).
    Build Time Elapsed: 00:00:03

Children
  • This reply was deleted.
  • Ronan thanks for the comprehensive answer. I will give it another chance. Oliver You know whats disaponiting, bouncing from one problem to the other. So famous IDE how would I know that. When building project in mplab they just display me which Device Pack and compiler was used to build the project. When something is missing they just display what is needed to install.

    Project was built sucessfully, again thanks to Ronan.

  • Does the ctrl + click works here? I tried and it does not jump to the function definition. Respective files are inluded.

  • I think that is F12, or from the context-sensitive menu that pops up when you right-click a function.

  • Example has been built, i can even debug the code step by step via J-link adapter. However the LEDs are not toggling. The ports PA15 and PB5 in provided example is not accesible on this device package, but PB4, PB5 are and they are not toggling.

    I expected that simple example should works, are they ready to use? anybody checks them?

    Simple own spider proto board, 2 LEDs and two serial resitors from output to ground. Example is set to run on internal clock, I can debug it, Jlink works. Port checked with the scope, always 0, low. Two chips tested.

    int main(void)
    {
        u32 i;
        LED_Init();
        while(1) {
            LED1_TOGGLE();
            LED2_TOGGLE();
            LED3_TOGGLE();
            LED4_TOGGLE();
            i = 90000;
            while(i--);
        }
    }

    void LED_Init(void)
    {
    
        RCC->AHBENR |= RCC_AHBENR_GPIOAEN | RCC_AHBENR_GPIOBEN;
    
        GPIOA->CRH |= GPIO_CRH_MODE15;
        GPIOA->ODR |= GPIO_ODR_ODR15;
    
        GPIOB->CRL |= GPIO_CRL_MODE3 | GPIO_CRL_MODE4 | GPIO_CRL_MODE5;
        GPIOB->ODR |= GPIO_ODR_ODR3 | GPIO_ODR_ODR4 | GPIO_ODR_ODR5;
    
        GPIOA->BSRR |= GPIO_BSRR_BS4;  //OFF
        GPIOB->BSRR |= GPIO_BSRR_BS3;
        GPIOB->BSRR |= GPIO_BSRR_BS4;
        GPIOB->BSRR |= GPIO_BSRR_BS5;
    
    }

    #ifndef __LED_H
    #define __LED_H
    
    #define LED1ON()  GPIOA->BRR |= GPIO_BRR_BR4
    #define LED2ON()  GPIOB->BRR |= GPIO_BRR_BR3
    #define LED3ON()  GPIOB->BRR |= GPIO_BRR_BR4
    #define LED4ON()  GPIOB->BRR |= GPIO_BRR_BR5
    
    #define LED1OFF()  GPIOA->BSRR |= GPIO_BSRR_BS4
    #define LED2OFF()  GPIOB->BSRR |= GPIO_BSRR_BS3
    #define LED3OFF()  GPIOB->BSRR |= GPIO_BSRR_BS4
    #define LED4OFF()  GPIOB->BSRR |= GPIO_BSRR_BS5
    
    #define LED1_TOGGLE()   ((GPIOA->ODR & GPIO_BRR_BR4) ? (GPIOA->BRR |= GPIO_BRR_BR4) : (GPIOA->BSRR |= GPIO_BSRR_BS4))
    #define LED2_TOGGLE()   ((GPIOB->ODR & GPIO_BRR_BR3) ? (GPIOB->BRR |= GPIO_BRR_BR3) : (GPIOB->BSRR |= GPIO_BSRR_BS3))
    #define LED3_TOGGLE()   ((GPIOB->ODR & GPIO_BRR_BR4) ? (GPIOB->BRR |= GPIO_BRR_BR4) : (GPIOB->BSRR |= GPIO_BSRR_BS4))
    #define LED4_TOGGLE()   ((GPIOB->ODR & GPIO_BRR_BR5) ? (GPIOB->BRR |= GPIO_BRR_BR5) : (GPIOB->BSRR |= GPIO_BSRR_BS5))
    
    void LED_Init(void);
    #endif
    

  • These examples are provided by the silicon vendor. Please contact them directly.