1: Install mdk412 and register it with the Registrar. This process is not described in detail.
2: Create the stm32 project folder named my_stm32 in a local path, create the rvmdk folder under my_stm32, and create the OBJ and list folders in the rvmdk folder.
3: Open keil4.
4: select the project menu-> New uvision project..., select the path of the.../my_stm32/rvmdk folder, name the project file my_stm32, and press ENTER
5: select the device name,
development environment is IAR for ARM 6.4. It will also facilitate the use of eclipse CDT in the future:
1. Download Lua: http://www.lua.org/download.html. This document uses Lua 5.2.2;
2. Copy all the files in/Lua/src to the IAR for stm32 project;
3. In the IAR for stm32 template project, create a Lua folder under workspace and add all source files:
4. Modify the project configuration
5. Remove Lu
Introduction to STM32 clock library function RCC_DeInit, stm32rcc_deinitVoid RCC_DeInit (void){RCC-> CR | = (uint32_t) 0x00000001; // enable the internal 8 MHz clock# Ifndef STM32F10X_CL // STM32F10X_CL indicates the STM32 interconnected series microprocessor.RCC-> CFGR = (uint32_t) 0xF8FF0000; // The 27-31 bits in the CFGR register of Other Processors are reserved bits, and the 24-26 bits are MCO bits.# E
Label: Use for time ad on to design the SP Program Two major functions of systick: 1. Precise latency can be generated; 2. A single HEARTBEAT (clock) cycle can be provided to the operating system; Generally, the method to implement the delay (n) function is as follows: For (I = 0; I ; For the stm32 system microprocessor, it takes only a few dozen NS (nanoseconds) to execute a command and enter the for loop. The X value of N milliseconds is ver
provides:
1 32-bit filter, including: stdid [], extid [], IDE and RTR bit ===used for extended ID (28 BITs) and Standard ID (11 bits)
Two 16-bit filters, including stdid [], IDE, RTR, and extid [] bits ==== are only used for standard IDs
See Figure 126.
In addition, the filter can be configured to block bit mode and identifier list mode.
Bit Blocking ModeIn mask mode, the identifier register and the mask register specify any bit of the message identifier, which should be processed according to
) index_l index_h CRCThe six digits index_l index_h CRC (4B) are useless for the moment. Fill 00, and data_len is the length of the data to be written, and the maximum length is no more than 1 K.Currently, IAP is only 7 kb after compilation, and more functions can be added. It is expected to be added to stm32 CRC. The binfile of the app needs to be split by itself. You can use winhex and then use xcom V2.0 to send the file. I want to write a host comp
Stm32 bootloader and app authoring considerations1, how to allocate bootloader and app space2. How to get data and write Flash3. How to jump from bootloader to app4, how to set the app interrupt vector5. How to generate Bin file in app6. Process of program execution1, how to allocate bootloader and app spaceBecause I'm using STM32F103C8T6, it's flash size is 64k, so divide it up as shown above0x08000000---0x0800 33FF is assigned to bootloader, the siz
The basic steps for using external interrupts in STM32 are as follows:
1. Set up the corresponding clock;
2. Set the corresponding interrupt;
3.IO Port initialization;
4. Set the corresponding IO port as the interrupt line (before setting the external interrupt) and initialize it;
5. Break the function in the response function of the selected interrupt channel.
Configuring Exti Parameters
Pa0-pf0 Common interrupt Line source 0
PA1-PF1 Common interrup
Recently, mainly in writing some STM32 on the development program, because the STM32 firmware library, I2C module is not good to use, so in the use of software simulation method to achieve.
The specific code is as follows (debugged under Keil):
#include "stm32f10x_lib.h"//Conditional Compilation 1: Use software to simulate I2C//#define PIN_SCL gpio_pin_6//#define PIN_SDA gpio_pin_7 static __inli ne void tw
Turn on STM32 's Chinese reference Manual, with detailed labeling of the STM32 low-power mode.
1, sleep mode (CORTEX™-M3 core stop, all peripherals including cortex-m3 core peripherals, such as Nvic, System clock (SysTick) and so on are still running)
2. Stop mode (all clocks are stopped)
3, Standby mode (this is a detailed description of the model, but also the lowest power mode)
In this blog, we use the
STM32 Keil Software Setup program write start address selection
STM32 Series MCU, here take CORTEX-M4 as an example, when we debug online, we usually set the program to write the start address and size. This size is typically 0x08000000, which is the mapping address of the internal flash. But some products start from 0x08020000, which is why. is because in the 0x08000000-0x08020000 this space is the boot p
The pa.8 pin of the STM32 has a multiplexing function-clock output (MCO), which enables the STM32 internal clock to be output through pa.8.
Operation Flow:
1), set pa.8 to multiplex push-pull mode.
Gpio_initstructure.gpio_pin = Gpio_pin_8;
Gpio_initstructure.gpio_speed = Gpio_speed_50mhz;
Gpio_initstructure.gpio_mode = gpio_mode_af_pp;
Gpio_init (Gpioa, gpio_initstructure);
2), select the output clock sourc
First look at a STM32 clock system block diagram
In STM32, there are five clock sources, namely HSI, HSE, LSI, LSE, PLL.
HSI internal high-speed RC oscillator clock, 8mhz;hse, external high-speed clock, 4M__16MHZ;LSI, internal low-speed RC clock, 40KHZ; LSE external low-speed clock, 32.768KHZ;PLL PLL Octave, by the figure, can choose Hse/2, HSI/2, HSE, the multiplier coefficient can be 2--16, but do not e
After my painstaking research, I transplanted the matrix keyboard scanning program on the 51 Single-Chip Microcomputer to the stm32. At the same time, I also made great improvements. The biggest improvement is to shake the image. In the past, the delay latency was always about 10 to 20 ms, but this would cause the MCU to run falsely in the delay and cause the main program to be shelved. Obviously, the real-time performance of the program is greatly re
Stm32 has an interrupt source for the settable of 43 channels; AIRC (Application interrupt and reset register) registers have 4 bits for the specified priority. The four bits are used to assign the preemption priority and sub priority. They are defined in the stm32 Firmware Library as follows:
# Define nvic_prioritygroup_0 (uint32_t) 0x700 )/*! 4 bits for subpriority */# Define nvic_prioritygroup_1 (uint32
Stm32 FSMC Study Notes
FSMC stands for static memory controller ".
After the FSMC controller is used, the fsmc_a [25:0] provided by FSMC can be used as the address line, and the fsmc_d [] provided by FSMC can be used as the data bus.
(1) When the storage data is set to 8 bits, (fsmc_nandinitstructure.fsmc_memorydatawidth = fsmc_memorydatawidth_8b)
The address corresponds to fsmc_a [], and the data bit corresponds to fsmc_d []
(2) When the storage data
, processing EV1, EV2 and EV4 canThe logic Analyzer is as followsThis experiment is the goal of this series of STM32-i²c experiments, because the work item requires me to go to the transplant to optimize the previous project, the project needs to configure the I²c slave device. But the original engineer has left the project, the company has no other position with the engineer can ask, had to step-by-step debugging. In the beginning, I did the verifica
(1) core_cm3.c, core_cm.h: Obtain and set the cm3 kernel, and configure some kernel registers. All cores that use the cm3 kernel are required;
(2) Support files for stm32f10x. H, system_stm32f10x.c, system_stm32f10x.h, and startup_stm32f10x_hd.s: stm32, which are related to specific chips;
① Stm32f10x. h: the entrance to the standard peripheral library. The header file must be included in the Code of the standard peripheral library;
② System_stm32f10x
Do let Stm32 trigger Svc interrupt and pass in parameters and then switch to handler mode and modify the value of the special register, so as to achieve the shutdown interrupt, but in fact this program is directly privileged level, so do not enter handler mode can also modify the special register ...
The following is a call to write the switch interrupt function:
Created a new file asm.c, all of the assembly functions I wrote are in:
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.