2312 views|1 replies

11

Posts

0

Resources
The OP
 

[AT-START-F403A Evaluation] Part 2 FreeRTOS system IAR environment clock configuration and serial port DMA implementation are completely pri... [Copy link]

 This post was last edited by uuxz99 on 2020-10-3 21:08

AT-START-F403A Review】 Part 2: FreeRTOS system implements full printf function based on IAR environment clock configuration and serial port DMA

In the last evaluation, only simple task switching was implemented, and the task interrupt mechanism was not yet implemented. This evaluation implemented the task interrupt switching and other functions. By using DMA and its interrupt mechanism to implement the complete printf function, in order to obtain excellent DMA performance, let's first look at the configuration of the clock system.

Clock Configuration:

  1. The system clock can be configured in system_at32f4xx.c in the Startup directory of the project. Of course, it can also be adjusted at runtime. The evaluation is based on the highest clock setting.

  1. In order to observe the configuration results, set a global variable systemClock of RCC_ClockType type. In the main startup, you can get the configuration of the system clock through RCC_GetClocksFreq(&systemClock).
  2. After starting the debugging breakpoint and stopping, observe the variable systemClock in watch

  1. Confirm the clock configuration

The clock output is described in the RCC CFG register of the datasheet as follows. The register is actually consistent with the description. Currently, the external 8MHz clock is configured as the PLL clock source, and the PLL clock is used as the system clock output 240MHz. It should be noted that if the above configuration is not modified, the default system clock and APB are all 8MHz.

Complete printf function implementation:

  1. The evaluation is implemented by sending print characters in DMA mode through UART. Based on the three tasks of the previous evaluation ("at-start-f403a evaluation one - freeRTOS system construction"), the serial port DMA printing function is added, which is named console function in the evaluation.
  2. Implement serial port DMA printing and drive initialization of gpio, serial port and DMA devices respectively.
    1. Serial port gpio device initialization

    1. Serial port device initialization

    1. DMA device initialization

Enable RCC and DMA interrupt configuration.

    1. console function initialization

    1. DMA Send

    1. Console function implementation

Add the console function to the original three lighting tasks

    1. Functional result example

This post is from Domestic Chip Exchange

Latest reply

Yatli AT-START-F403A Review Summary https://bbs.eeworld.com.cn/thread-1143018-1-1.html   Details Published on 2020-10-9 15:06
 
 

1w

Posts

204

Resources
2
 

Yatli AT-START-F403A Review Summary

https://bbs.eeworld.com.cn/thread-1143018-1-1.html

This post is from Domestic Chip Exchange
Add and join groups EEWorld service account EEWorld subscription account Automotive development circle
Personal signature

玩板看这里:

https://bbs.eeworld.com.cn/elecplay.html

EEWorld测评频道众多好板等你来玩,还可以来频道许愿树许愿说说你想要玩的板子,我们都在努力为大家实现!

 
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Related articles more>>

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list