Skip to content

Commit

Permalink
[stm32h743] blink is blinking \o/
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikaël BRIDAY committed Feb 23, 2024
1 parent ad10093 commit a70ded8
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 29 deletions.
14 changes: 7 additions & 7 deletions examples/cortex-m/armv7em/stm32h743/Nucleo-144/blink/blink.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@
#define APP_Task_blink_START_SEC_CODE
#include "tpl_memmap.h"

#define LED_GREEN_PORT GPIOB
#define LED_GREEN_PIN 0
#define LED_BLUE_PORT GPIOB
#define LED_BLUE_PIN 7
#define LED_RED_PORT GPIOB
#define LED_RED_PIN 14
#define LED_GREEN_PORT GPIOB
#define LED_GREEN_PIN 0
#define LED_YELLOW_PORT GPIOE
#define LED_YELLOW_PIN 1
#define LED_RED_PORT GPIOB
#define LED_RED_PIN 14

void initUserLed() {
pinMode(LED_GREEN_PORT,LED_GREEN_PIN,OUTPUT);
pinMode(LED_BLUE_PORT,LED_BLUE_PIN,OUTPUT);
pinMode(LED_YELLOW_PORT,LED_YELLOW_PIN,OUTPUT);
pinMode(LED_RED_PORT,LED_RED_PIN,OUTPUT);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ The system is based scheduled with a 1ms SysTick `SystemCounter`.
Configure the application with:

```
goil --target=cortex-m/armv7em/stm32H743 --templates=../../../../../../goil/templates/ readbutton_isr.oil
goil --target=cortex-m/armv7em/stm32h743 --templates=../../../../../../goil/templates/ readbutton_isr.oil
```
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
#define APP_Task_read_button_START_SEC_CODE
#include "tpl_memmap.h"

#define LED_GREEN_PORT GPIOB
#define LED_GREEN_PIN 0
#define LED_BLUE_PORT GPIOB
#define LED_BLUE_PIN 7
#define LED_RED_PORT GPIOB
#define LED_RED_PIN 14
#define LED_GREEN_PORT GPIOB
#define LED_GREEN_PIN 0
#define LED_YELLOW_PORT GPIOE
#define LED_YELLOW_PIN 1
#define LED_RED_PORT GPIOB
#define LED_RED_PIN 14

FUNC(int, OS_APPL_CODE) main(void)
{
pinMode(LED_GREEN_PORT,LED_GREEN_PIN,OUTPUT);
pinMode(LED_BLUE_PORT,LED_BLUE_PIN,OUTPUT);
pinMode(LED_YELLOW_PORT,LED_YELLOW_PIN,OUTPUT);
pinMode(LED_RED_PORT,LED_RED_PIN,OUTPUT);
//We use a jumper between D2 and GND to simulate a push button.

Expand Down Expand Up @@ -62,7 +62,7 @@ ISR(isr_button)
#include "tpl_memmap.h"
ISR(isr_button2)
{
digitalToggle(LED_BLUE_PORT,LED_BLUE_PIN);
pinMode(LED_YELLOW_PORT,LED_YELLOW_PIN,OUTPUT);
}
#define APP_ISR_isr_button2_STOP_SEC_CODE
#include "tpl_memmap.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,30 @@ end if%
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"cwd": "${workspaceFolder}",
"executable": "./build/% !OS::BUILD_S::APP_NAME %",
"name": "Debug on STM32 target",
"request": "launch", //"launch" => reload firmware, "attach" => just start debug session
"type": "cortex-debug",
"showDevDebugOutput": "none",
"servertype": "stutil",
"runToEntryPoint": "main",
"device": "STM32H743ZI",
"v1": false,
"svdFile": "% !basePath %/machines/cortex-m/armv7em/stm32h743/CMSIS/STM32H743.svd",
}
{
"cwd": "${workspaceFolder}",
"executable": "./build/% !OS::BUILD_S::APP_NAME %",
"name": "Debug with ST-Link",
"request": "launch",
"type": "cortex-debug",
"runToEntryPoint": "main",
"showDevDebugOutput": "none",
"servertype": "stlink",
"device": "STM32H743ZI",
"svdFile": "% !basePath %/machines/cortex-m/armv7em/stm32h743/CMSIS/STM32H743.svd",
},
{
"cwd": "${workspaceFolder}",
"executable": "./build/% !OS::BUILD_S::APP_NAME %",
"name": "Debug with ST-Util",
"request": "launch", //"launch" => reload firmware, "attach" => just start debug session
"type": "cortex-debug",
"showDevDebugOutput": "none",
"servertype": "stutil",
"runToEntryPoint": "main",
"device": "STM32H743ZI",
"v1": false,
"svdFile": "% !basePath %/machines/cortex-m/armv7em/stm32h743/CMSIS/STM32H743.svd",
}
]
}

0 comments on commit a70ded8

Please sign in to comment.