You often need to view some specific parameters during the development process. You can use paintf to print the output and observe the specific variable values. The stm32 is integrated with the serial port function of usart, which can be directly output to the computer (host computer) through the serial port ). It is very convenient to use, and you do not need to write code. You only need to configure it.
You can see the above results with simple se
From: http://www.lifetyper.com/archives/000016.html
Maybe you think Io and afio are very simple. In fact, there are several misunderstandings that many people may not have noticed. When you only use the ready-made development board to learn, others have already allocated resources for you, all peripheral functions are learned based on the routines provided by others, which makes you feel strange.
First, ask yourself a question: In stm32, usart2 and t
Redboot IntroductionRedboot is designed for Embedded debugging and startup environments. It is an Ecos-based application that uses the hardware abstraction layer (HAL) of eCos as its basis. It is a basic function as bootloader, but can be used in any embedded system or any embedded real-time operating system. It can also be used for debugging during the product development cycle or for flash or network startup in published products. Features:
STARTUP script support;
Management and control of
comment out, because the official materials are written based on the evaluation board. If it is transplanted to a platform with the stm32 Firmware Library, you need to make some changes, this is based on the user transplant experience. These things that need to be commented out are mainly related to the timer of the specified IC.
The following is a comment.
//void OS_CPU_SysTickInit (void)//{// INT32U cnts;////// cnts = OS_CPU_SysTickClkFreq(
Today in See Stm32 interruption, a time does not understand how the main function of stm32 into the interrupt function, according to the C programming understanding, there will be a specific entry and so on, but see the demo process did not find the entrance.
For example, the serial port interrupt service function void Usart1_irqhandler (void) is used to interrupt the serial port first, the serial port i
STM32 clock System for a skilled microcontroller development should be more familiar, but for the novice without too many basic (such as I one months ago), see such a clock system diagram inevitably have a nod big, But when it comes to understanding the designer's purpose and then looking back at a picture like this, you'll find it's not a difficult thing to understand.
STM32F103 has 5 clock sources, namely external high-speed clock (HSE), internal
Summarize the SPI3 problem, because the SPI3 NSS port has a common pin to the JTAG, so misconfiguration can cause SPI3 to be unusable. The following three points need to be noted:1. Configure the PA15 as a normal IO port, gpio_mode_out_pp2. Turn on the AFIO clock Rcc_apb2periphclockcmd (Rcc_apb2periph_afio, enable);3. Turn off the JTAG function to enable SWDGpio_pinremapconfig (gpio_remap_swj_jtagdisable,enable);
Other SPI port normal configuration, because the default is JTAG mode after the boa
commonly used peripherals: GPIO, UART, etc. the bus structure on the STM32 First look at the bus structure of the F103 series of chips It is important to note that there aretwo APB, their linked peripherals are not the same, so there are definitions of APB1 and APB2 in the STM32 library file:
/** @defgroup apb2_peripheral * @{* * #define RCC_APB2PERIPH_AFIO ((uint32_t) 0x00000001) #define Rcc_ap B2per
Serial port:
Experimental platform: Punctual Atom battleship Development Board
System: Windows 7 64-bit
Compiler: MDK 4.72a
Reference routines: ATK serial port routines, wildfire ISO serial port routines
Serial port is an important peripheral, the basic chip is the only external output of a way, other lighting, keys and so on are small case.
First, introduce the working principle of the next serial port:
Let's take a look at the internal structure diagram
Remark: Pick up the wildfire 0 dea
Research on STM32 memory distribution
2016-2-2
I run Ucos encountered a very strange problem, run a period of time will be inexplicable into the Hardfault function, causing the system to panic. Later, according to the stack debugging, found each call function is not the same, is very puzzling. Through the map file finally concluded that in the system initialization time in the flash read out the system configuration parameters, in the system running p
Ⅰ, write in front
This article uses the current (November 2016) Latest version of the Keil (mdk-arm) V5.21A development environment , taking the STM32 processor as an example to tell you about the detailed process of creating a new software engineering.
Keil (Mdk-arm) V4 and V5 new software engineering are basically the same, this article is also suitable for the V4 version of the new software engineering.
The processor used in this paper is St compa
stm32--Universal Lin Controller
Purpose: The sharing of technology is limited, the spirit of sharing is unlimited.
Demand:
Lin Motor controller: AFS (DHL+AFL)--Corner assist lighting system
DHL: Upper limit, under limit, 0-bit, motor aging cycle;
AFL: Left limit, right limit, 0-bit, motor aging cycle;
All parameters can be configured: upper limit, lower limit, 0-bit, left limit, right limit, motor cycle limit, motor cycle limit, motor cycle
STM32 Timer is a powerful module, the timer is also very high frequency, timer can do some basic timing, also can do PWM output or input capture function.
Clock source problem:
There are eight named Timx, of which TIM1 and TIM8 hang on the APB2 bus, while Tim2-tim7 hangs on
APB1 on the bus. Where TIM1TIM8 is called the Advanced control timer. Their APB2 bus is also better than the APB1 bus. APB2 can work at 72MHz, while APB1 is 36MHz maximum.
The time
address is a and its bit number is n (0 The address in the alias area is:Aliasaddr = 0x42000000 + (a‐0 x 40000000) * 8 + n) * 4 = 0x42000000 + (a‐0 x 40000000) * 32 + N * 4In the above formula, "* 4" indicates that a word is 4 bytes, and "* 8" indicates that one byte contains 8 bytes.*/// Convert "bit with address + bit serial number" to an alias address macro# Define bitband (ADDR, bitnum) (ADDR 0xf0000000) + 0x2000000 + (ADDR 0 xfffff) // Convert the address into a pointer# Define mem_addr
How to configure data transmission using printf in stm32 Serial Communication (Development Environment Keil rvmdk)It is very convenient to use printf to send data in the stm32 serial communication program. You can always encounter problems when using it at the beginning. The common problem is that you cannot enter the main function when accessing the hardware. In fact, you only need to simply configure it.T
(1) Open the main interface of keilmdk and you will see a default project in the project. Click the project name and select project> close project to close the project! In this way, the entire MDK is empty. Next we will create our project template.
(2) Before creating a project, we recommend that you create a directory under a directory on your computer. All the projects created later can be placed under this directory. Here, we create a directory named development code.
(3) Click the "project"
Generally, after the stm32 project is compiled using Keil, the output information appears under the build output column of Keil, showing the code size ro-data, RW-data, and Zi-data. Generally, others do not care much about the size.
Out of curiosity, I gave an introduction to these segments on Baidu. I quoted the introduction from http://mcuos.com/thread-2843-1-1.html:
Arm Program CompositionThe "arm program" mentioned here refers to the program being
The stm32 series CPU has up to 8 timers;
1. Among them, tmi1 and tim8 are advanced timers that can generate three pairs of PWM complementary outputs, which are commonly used in the drive of Three-Phase Motors. Their clock is generated by apb2 output;
2. The other six are common timers, and the clock is generated by the apb1 output;
Timer function:
1. Timing function 2. Counting Function 3. Input capture 4. Matching output 5. PWM pulse wave outputOverv
1. bkp can be used to save data
Bkp contains 42 16-bit registers that can store 84 bytes of content. They are powered by vbat for dimension mounting.
2. Data stored in bkp can be destroyed (if someone wants to maliciously obtain the data, it is more important to lose it than to protect it ). Stm32 provides a mechanism called tamper. Intrusion detection, which occupies an external pin (pc13 ).
3. If no intrusion detection function is required, the exte
DMA:
1. Why can I configure the I/O port to enable the input mode when I/O port is used to output the converted analog signal through the I/O port?
PS: The stm32 Manual defines that pa4 and pa5 are connected to the dac1 channel and the dac2 channel respectively;
Dma1 and dma2 use the following channels:
How is DMA used to transmit waveform data from memory with DAC? :
/* Configure dma2 */Dma_initstructure.dma_peripheralbaseaddr = dac_dhr12rd_address
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.