Developing STM32F10x in Code Blocks

Source: Internet
Author: User

1 download: Sourcery G ++ Lite for ARM EABI

2. Set the compiler path: copy it from the gcc arm and change it to Code Sourcery G ++ Lite.

3. Create an ARM Project

4. Add the STM32 library file, which is similar to mdk.

Note: add the GCC Startup File xxx. s in the gcc_ride7 folder.

5. Add the header file search directory:

6. Add a connection script

 

7. Add a definition macro:

STM32F10X_MD

USE_STDPERIPH_DRIVER

 

-Mthumb (Note: m3 only supports thumb Mode)

Then compile the file and then click OK.

After the compilation step is added, the HEX file and code length are obtained:

Arm-none-eabi-objcopy.exe-O ihex $ (TARGET_OUTPUT_FILE) $ (TARGET_OUTPUT_DIR) $ (TARGET_OUTPUT_BASENAME). hex
Arm-none-eabi-size.exe $ (TARGET_OUTPUT_FILE)

 

 

/*************************************** ***************************/

When _ WFI () and _ WFE () are used, a compilation error occurs: MCPU does not support this statement. It may be necessary to set the MCU to STM32.

 

However, after I add the compilation option-mcpu = stm32f103c8, the compilation prompt is:

Maybe the current Sourcery G ++ Lite does not support STM32

 

 

-Mcpu = cortex-m3-mthumb can be !!

(Http://www.amobbs.com/forum.php? Mod = viewthread & tid = 5538067 & page = 1 # pid6745848 post on the AMO forum for help)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.