# How to install Compiler Version 5 on Keil Before starting this document, you need to complete [How to Install Sample Code on STM32CubeMX](https://hackmd.io/@seanwascoding/rJ1pDKMKC) first, because it will only happen on keil when you compile the sample code. ## How the Error Occurred This error is related to the compiler version. When you try to compile the sample code, which is based on Compiler Version 5, the IDE didn't find that version. So, the user needs to install the compiler manually. ![image](https://hackmd.io/_uploads/Sy-W7EHtA.png) You can verify the error by checking `Project -> Options for Target 'XXXX'`. This will show the error, proving that the compiler is missing, which is why the IDE can't find it to compile. ![image](https://hackmd.io/_uploads/rJSnrNBKC.png) ![image](https://hackmd.io/_uploads/SyH0SEHFC.png) --- ### How to Solve this Problem The only way to resolve this is to install compiler by yourself. - Jump to [Arm Compiler downloads index](https://developer.arm.com/documentation/ka005108/latest/). (if link invalid, you can search on the Google by yourself) ![image](https://hackmd.io/_uploads/r1D0YESYC.png) - Scroll down to the `specific version` and click link. ![image](https://hackmd.io/_uploads/BJ7PqNHtA.png) - You may encounter problem shown below, but it will be resolved after `login`. ![image](https://hackmd.io/_uploads/B18p94HtA.png) - Finally, you can select one to install according to your platform. ![image](https://hackmd.io/_uploads/SJ_kn4BK0.png) --- ### The Compiler Installation Path When you install the `Compiler Version 5`, the location need to change to specific path, because the **Keil** cannot read relevant information from other location. The official website also mention this problem on the [link](https://developer.arm.com/documentation/ka005108/latest/), so it can be resolved by selecting installation path. Follow the step shown below to resolve problem and install compiler correctly. ![image](https://hackmd.io/_uploads/ByxpoAvYR.png) ![image](https://hackmd.io/_uploads/S1F9nRwK0.png) In my situation, the installation path is `C:\Users\Sean\AppData\Local\Keil_v5\ARM\compilerv5` whitch is under `C:\Users\Sean\AppData\Local\Keil_v5\ARM\` folder, so it can be accessed by **Keil**. After completing the setting and installation, you can find the data in the `C:\Users\Sean\AppData\Local\Keil_v5\ARM\compilerv5`. ![image](https://hackmd.io/_uploads/r1OGTRPFR.png) Jump to **Keil**, you can directly click the button as shown below. ![image](https://hackmd.io/_uploads/H10-Jkut0.png) Click `...` from `Folders/Extensions` tab. ![image](https://hackmd.io/_uploads/rJEoJ1OKC.png) And then, you can add another compiler by selecting specific path where the `compilerv5` folder. ![image](https://hackmd.io/_uploads/B1Ckly_FA.png) ![image](https://hackmd.io/_uploads/ryxWxJ_F0.png) After the compiler has finished working, you will see the `ArmCC Version` where new information will appear in the window that indicates successful loading. ![image](https://hackmd.io/_uploads/r1GfekdFC.png) Going to `Project -> Options for Target 'XXXX'`, you will see that the `ARM Compiler` is not missing already. ![image](https://hackmd.io/_uploads/SkpSlJdFC.png) Compilation successful! ![image](https://hackmd.io/_uploads/Bk9GfJdYC.png) ## Other Information