From a70ded835f053196ea35e8304d3a71d15b80f62b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20BRIDAY?= Date: Fri, 23 Feb 2024 09:27:06 +0100 Subject: [PATCH] [stm32h743] blink is blinking \o/ --- .../stm32h743/Nucleo-144/blink/blink.c | 14 +++---- .../Nucleo-144/readbutton_isr/README.md | 2 +- .../readbutton_isr/readbutton_isr.c | 16 ++++---- .../stm32h743/vscode_launch_json.goilTemplate | 38 ++++++++++++------- 4 files changed, 41 insertions(+), 29 deletions(-) diff --git a/examples/cortex-m/armv7em/stm32h743/Nucleo-144/blink/blink.c b/examples/cortex-m/armv7em/stm32h743/Nucleo-144/blink/blink.c index 532c1e1d8..df1fd6526 100644 --- a/examples/cortex-m/armv7em/stm32h743/Nucleo-144/blink/blink.c +++ b/examples/cortex-m/armv7em/stm32h743/Nucleo-144/blink/blink.c @@ -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); } diff --git a/examples/cortex-m/armv7em/stm32h743/Nucleo-144/readbutton_isr/README.md b/examples/cortex-m/armv7em/stm32h743/Nucleo-144/readbutton_isr/README.md index 554c7b69b..c32b7e5d3 100644 --- a/examples/cortex-m/armv7em/stm32h743/Nucleo-144/readbutton_isr/README.md +++ b/examples/cortex-m/armv7em/stm32h743/Nucleo-144/readbutton_isr/README.md @@ -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 ``` diff --git a/examples/cortex-m/armv7em/stm32h743/Nucleo-144/readbutton_isr/readbutton_isr.c b/examples/cortex-m/armv7em/stm32h743/Nucleo-144/readbutton_isr/readbutton_isr.c index 98f5d41a8..d93dc6d0e 100644 --- a/examples/cortex-m/armv7em/stm32h743/Nucleo-144/readbutton_isr/readbutton_isr.c +++ b/examples/cortex-m/armv7em/stm32h743/Nucleo-144/readbutton_isr/readbutton_isr.c @@ -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. @@ -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" diff --git a/goil/templates/build/cortex-m/armv7em/stm32h743/vscode_launch_json.goilTemplate b/goil/templates/build/cortex-m/armv7em/stm32h743/vscode_launch_json.goilTemplate index 3e6e0ddc5..d254dbcbe 100644 --- a/goil/templates/build/cortex-m/armv7em/stm32h743/vscode_launch_json.goilTemplate +++ b/goil/templates/build/cortex-m/armv7em/stm32h743/vscode_launch_json.goilTemplate @@ -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", + } ] }