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
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ Trampoline runs on the following platforms :
| NXP / Freescale MK20DX256 | Cortex-M4 | 1 | Teensy31 |
| NXP / Freescale MPC564xL | Power Architecture | 2 | XPC56XX EVB + XPC56XL MINI-MODULE |
| PULPino | RISC-V | 1 | ZedBoard |
| STMicroelectronics STM32F4xx | Cortex-M4 | 1 | STM32F4DISCOVERY with STM32F407VG |
| STMicroelectronics STM32F4xx | Cortex-M4 | 1 | STM32F4DISCOVERY with STM32F407VG, STM32F429ZI|
| STMicroelectronics STM32F30x | Cortex-M4 | 1 | Nucleo-32 STM32F303K8 |
| STMicroelectronics STM32L432 | Cortex-M4 | 1 | Nucleo-32 STM32L432KC |
| MicroSemi SmartFusion2 | Cortex-M3 | 1 | starterKit |
| MSP430FR5969, MSP430FR5994 | CPUX | 1 | Launchpad MSP-EXP430FR5969, Launchpad MSP-EXP430FR5994 |
| MSP430FR5969, MSP430FR5994 | CPUX | 1 | Launchpad MSP-EXP430FR5969, Launchpad MSP-EXP430FR5994|

Some examples are available (check examples):

Expand All @@ -46,6 +46,14 @@ Some examples are available (check examples):
* **readButton_isr**. Same but the button triggers an ISR.
* **alarms**. It is the same example than readButton_isr but we test the return value of SetRelAlarm for return parameters when in kernel (system call) mode.
* **timer**. ISR2 trigered by timer TIM2.
* Cortex M4 with µC stm32f429: `cortex/armv7em/stm32f429/stf32f4discovery`
* **alarms**. It is the same example than readButton_isr but we test the return value of SetRelAlarm for return parameters when in kernel (system call) mode. [OIL & ARXML]
* **blink**. Blinks a LED using an alarm and a task. [OIL & ARXML]
* **readButton**. The example polls the button to start an alarm that activates a task to blink a LED [OIL]
* **readButton_isr**. Same but the button triggers an ISR category 1. [OIL]
* **readButton_isr1**. Same but the button triggers an ISR category 2. [OIL]
* **testDisableEnable**.This application deals with ISR1 and `DisableAllInterrupts` and `EnableAllInterrupts` services. [OIL]
* **timer**. ISR2 trigered by timer TIM2. [OIL & ARXML]
* Cortex M4 with MCU stm32f303K8: `cortex/armv7em/stm32f303/Nucleo-32`. There are few differences from the `stm32f407` target, and examples should be easily imported.
* **blink**. Blinks a LED using an alarm and a task.
* Cortex M4 with MCU stm32L432KC: `cortex/armv7em/stm32l432/Nucleo-32`.
Expand Down
101 changes: 101 additions & 0 deletions examples/cortex/armv7em/stm32f429/stm32f4discovery/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# Bunch of running examples for Cortex-M4

This directory provides a set of examples ready for use on a
stm32f4-discovery board from ST-microelectronics.

The stm32f4-discovery board is equiped with a st-link/v2 embedded debug tool interface.

## Prerequisite

### Compile

You need a compiler for your plateform.
Trampoline has been previously compiled with industrial compilers and GNU GCC.
The examples have all been compiled with :

`
(GNU Tools for ARM Embedded Processors) 4.9.3 20150529 (release) [ARM/embedded-4_9-branch revision 227977]
from
https://launchpad.net/gcc-arm-embedded
`

### Program and debug

You need `stlink` tool to program and debug with the st-link/v2 embedded debug tool interface.

`stlink` is a tool to communicate with the st-link/v2 in-circuit debugger.
You get `stlink` from [github](https://github.com/texane/stlink).

Read the documentation README form the Github repository.

`stlink` needs the development version of libusb.
For MAC OS X plateform you'll have to install it with [BREW](http://brew.sh)

> brew install libusb

We will use st-util hereafter.

## How to run an example

We present hereafter the successive steps to follow to get the first example [ blink ] run.

1 - Step into the example directory

> cd examples/cortex/armv7em/stm32f407/stm32f4discovery/blink

2 - Generate all source files from a configuration with the command :

> goil --target=cortex/armv7em/stm32f407/stm32f4discovery -v --templates=../../../../../../goil/templates/ blink.oil

3 - Compile

> ./make.py

4 - Connect a stm32f4-discovery board with a USB cable

5 - Flash the binary file

> ./make.py burn

6 - You should see the BLUE led blink

## How to debug an example

1 - Open a terminal [ 0 ] and launch the server for listening on default port

[ 0 ]> st-util

2 - Open another [ 1 ] and initialize the debug session

[ 1 ]> arm-none-eabi-gdb blink_exe

[ 1 ]> source init.gdb

You are now ready to debug blink_exe

## Tips

We have not fully integrated the complete development cycle in makefiles so I advise you to clean your working directory
if you have modified any template file ( i.e. a file ending with ".goilTemplate".
In that case, just do
> make clean
> make
to ensure that all source file a well re-generated.

This shall be corrected in a further version

## The examples

### blink

This example just toggles a led.

### readbutton

This example presents two tasks and two alarms that interact.
It uses polling for reading push button states.

### readbutton_isr

This example presents two tasks and one alarm.
It uses an ISR2 that activates a task. That last task then start or stop an alarm.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
alarms
build
*_exe
*.bin
*.map
*.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
|=-----=[ alarms example ]=-----=|

This application deals with alarms and ISR2.
There are two tasks "blink" and "read_button" and one ISR2 "isr_button".
There is an alarm "blink_alarm".

At start the program does nothing.
Something happens when pushing the button on the board.
A push on the button activates the task "read_button".

The task "read_button" will launch or cancel the alarm "blink_alarm".
This tasks launches the alarm "blink_alarm" whether or not it has already been launched.
It tests the return value of service SetRelAlarm to E_OK. If the value is different from E_OK
then the alarm is canceled with CancelAlarm.
This alarm "blink_alarm" will activate the task "blink" on expiration and start again.

Leds are toggled by the following resources:

* "blink" toggles GREEN led,
* "isr_button" will toggle RED led,

Have a look into "alarms.oil" file.

The system is based scheduled with a 1ms SysTick "SystemCounter".

Configure the application with:
- Oil configuration
```
goil --target=cortex/armv7em/stm32f429/stm32f4discovery --templates=../../../../../../goil/templates/ alarms.oil
```

- ARXML configuration
```
goil --target=cortex/armv7em/stm32f429/stm32f4discovery --templates=../../../../../../goil/templates/ alarms.arxml
```
Loading