Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions RTX_Blinky/Abstract.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
The 'RTX_Blinky' project is a simple CMSIS RTOS Kernel based example for
ST 'STM32F072RB' microcontroller using ST 'STM32F072-Discovery' Evaluation Board.
Compliant to Cortex Microcontroller Software Interface Standard (CMSIS).

Example functionality:
- Clock Settings:
- XTAL = HSI = 8.00 MHz
- SYSCLK = 48.00 MHz

- 4 LEDs blink.
- blinking is paused while holding down the USER button.


The Blinky example is available in different targets:

STM32F072 Flash: configured for on-chip Flash
(used for production or target debugging)
56 changes: 56 additions & 0 deletions RTX_Blinky/DAC_DRV.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@

/** @file DAC_DRV.c
* @brief DAC Driver for the STM32F072RB.
* @author Dennis Law
* @date April 2016
*/

#include "DAC_DRV.h"

/** @brief Reads the output register of channel 1.
* @returns The value of DAC_DOR1 register.
*/
uint32_t DAC_read(void)
{
return (DAC->DOR1 & 0x00000FFF);
}

/** @brief Writes an analog value to channel 1.
* @param data The data to be written to the data register.
*
* @details The user input value is written to the 12 bit right aligned
* register, DAC_DHR12R1. The output voltage is calculated using the formula
*
* DAC(output) = V(DDA) * DOR / 4095
*
*/
void DAC_write(uint32_t data)
{
DAC->DHR12R1 = (data & 0x00000FFF);
}

/** @brief Enables channel 1.
*/
void DAC_enable(void)
{
DAC->CR |= DAC_CR_EN1;
}

/** @brief Initializes channel 1 in Single Mode with no triggerring.
*/
void DAC_init(void)
{
/* Enable clock for DAC peripheral */
RCC->APB1ENR |= RCC_APB1ENR_DACEN;

/* Set corresponding GPIO pin as analog input with no pull
resistors */
GPIOA->MODER |= GPIO_MODER_MODER4;
GPIOA->PUPDR &= ~(GPIO_PUPDR_PUPDR4);

/* Disable triggerring */
DAC->CR &= ~(DAC_CR_TEN1);

/* Enable output buffer */
DAC->CR |= DAC_CR_BOFF1;
}
20 changes: 20 additions & 0 deletions RTX_Blinky/DAC_DRV.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

/** @file DAC_DRV.h
* @brief DAC Driver include file for the STM32F072RB.
* @author Dennis Law
* @date April 2016
*/

#ifndef DAC_DRV_H
#define DAC_DRV_H

#include "stm32f0xx.h"
#include <stdint.h>

uint32_t DAC_read(void);
void DAC_write(uint32_t data);
void DAC_load_data_buffer(uint32_t data);
void DAC_enable(void);
void DAC_init(void);

#endif /* DAC_DRV_H */
Binary file added RTX_Blinky/Flash/RTX_Blinky.axf
Binary file not shown.
113 changes: 113 additions & 0 deletions RTX_Blinky/Flash/RTX_Blinky.build_log.htm
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
<html>
<body>
<pre>
<h1>�Vision Build Log</h1>
<h2>Tool Versions:</h2>
IDE-Version: �Vision V5.17.0.0
Copyright (C) 2015 ARM Ltd and ARM Germany GmbH. All rights reserved.
License Information: Patrick Tiong, DNA , LIC=----

Tool Versions:
Toolchain: MDK-Lite Version: 5.17
Toolchain Path: C:\Keil_v5\ARM\ARMCC\Bin
C Compiler: Armcc.exe V5.06 update 1 (build 61)
Assembler: Armasm.exe V5.06 update 1 (build 61)
Linker/Locator: ArmLink.exe V5.06 update 1 (build 61)
Library Manager: ArmAr.exe V5.06 update 1 (build 61)
Hex Converter: FromElf.exe V5.06 update 1 (build 61)
CPU DLL: SARMCM3.DLL V5.17
Dialog DLL: DARMCM1.DLL V1.12.0.0
Target DLL: STLink\ST-LINKIII-KEIL_SWO.dll V2.0.18.0
Dialog DLL: TARMCM1.DLL V1.9.0.0

<h2>Project:</h2>
C:\Users\tiongpatrick\Documents\STM32F0\Example\Boards\ST\STM32F072-Discovery\RTX_Blinky\RTX_Blinky.uvprojx
Project File Date: 04/24/2016

<h2>Output:</h2>
*** Using Compiler 'V5.06 update 1 (build 61)', folder: 'C:\Keil_v5\ARM\ARMCC\Bin'
Rebuild target 'STM32F072 Flash'
compiling Buttons_STM32F072-Discovery.c...
compiling DAC_DRV.c...
compiling RTX_Blinky.c...
compiling RTX_Conf_CM.c...
assembling startup_stm32f072xb.s...
compiling LED_STM32F072-Discovery.c...
compiling system_stm32f0xx.c...
linking...
Program Size: Code=6332 RO-data=360 RW-data=624 ZI-data=2688
".\Flash\RTX_Blinky.axf" - 0 Error(s), 0 Warning(s).

<h2>Software Packages used:</h2>

Package Vendor: ARM
http://www.keil.com/pack/ARM.CMSIS.4.5.0.pack
::CMSIS:RTOS:1.0 (API)
CMSIS (Cortex Microcontroller Software Interface Standard)
* Component: RTOS Version: 1.0
* Component: Keil RTX Version: 4.80.0
* Component: CORE Version: 4.3.0

Package Vendor: Keil
http://www.keil.com/pack/Keil.MDK-Middleware.7.0.0.pack
::Board Support:LED:1.00 (API)
Keil MDK-ARM Professional Middleware for ARM Cortex-M based devices
* Component: LED Version: 1.00
* Component: Buttons Version: 1.00

Package Vendor: Keil
http://www.keil.com/pack/Keil.STM32F0xx_DFP.1.5.0.pack
Keil.STM32F072-Discovery::Board Support:LED:1.0.0
STMicroelectronics STM32F0 Series Device Support and Examples
* Component: LED Version: 1.0.0
* Component: Buttons Version: 1.0.0
* Component: Startup Version: 2.2.3

<h2>Collection of Component include folders:</h2>
C:\Users\tiongpatrick\Documents\STM32F0\Example\Boards\ST\STM32F072-Discovery\RTX_Blinky\RTE
C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\Include
C:\Keil_v5\ARM\PACK\ARM\CMSIS\4.5.0\CMSIS\RTOS\RTX\INC
C:\Keil_v5\ARM\PACK\Keil\MDK-Middleware\7.0.0\Board
C:\Keil_v5\ARM\PACK\Keil\STM32F0xx_DFP\1.5.0\Device\Include

<h2>Collection of Component Files used:</h2>

* Component: ::CMSIS:RTOS:1.0 (API)

* Component: ARM::CMSIS:RTOS:Keil RTX:4.80.0
Source file: CMSIS\RTOS\RTX\UserCodeTemplates\MemPool.c
Include file: CMSIS\RTOS\RTX\UserCodeTemplates\osObjects.h
Source file: CMSIS\RTOS\RTX\Templates\RTX_Conf_CM.c
Source file: CMSIS\RTOS\RTX\UserCodeTemplates\Mutex.c
Source file: CMSIS\RTOS\RTX\UserCodeTemplates\main.c
Source file: CMSIS\RTOS\RTX\UserCodeTemplates\MailQueue.c
Source file: CMSIS\RTOS\RTX\UserCodeTemplates\Semaphore.c
Source file: CMSIS\RTOS\RTX\SRC\ARM\SVC_Table.s
Source file: CMSIS\RTOS\RTX\UserCodeTemplates\Thread.c
Include file: CMSIS\RTOS\RTX\INC\cmsis_os.h
Source file: CMSIS\RTOS\RTX\UserCodeTemplates\MsgQueue.c
Source file: CMSIS\RTOS\RTX\UserCodeTemplates\Timer.c
Library file: CMSIS\RTOS\RTX\LIB\ARM\RTX_CM0.lib

* Component: ARM::CMSIS:CORE:4.3.0

* Component: ::Board Support:LED:1.00 (API)
Include file: Board\Board_LED.h

* Component: ::Board Support:Buttons:1.00 (API)
Include file: Board\Board_Buttons.h

* Component: Keil.STM32F072-Discovery::Board Support:LED:1.0.0
Source file: Boards\ST\STM32F072-Discovery\Common\LED_STM32F072-Discovery.c

* Component: Keil.STM32F072-Discovery::Board Support:Buttons:1.0.0
Source file: Boards\ST\STM32F072-Discovery\Common\Buttons_STM32F072-Discovery.c

* Component: Keil::Device:Startup:2.2.3
Source file: Device\Source\ARM\startup_stm32f072xb.s
Source file: Device\Source\system_stm32f0xx.c
Source file: Device\Source\ARM\STM32F0xx_OPT.s
Build Time Elapsed: 00:00:01
</pre>
</body>
</html>
Loading