0% found this document useful (0 votes)
9 views2 pages

STM32 LED Control Task Example

The document defines a TaskLed1 task that blinks an LED connected to pin LED1_Pin of port LED1_GPIO_Port. The task continuously toggles the pin between high and low with a 100ms delay between each change, effectively blinking the LED. The main program creates this TaskLed1 task with priority 1.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views2 pages

STM32 LED Control Task Example

The document defines a TaskLed1 task that blinks an LED connected to pin LED1_Pin of port LED1_GPIO_Port. The task continuously toggles the pin between high and low with a 100ms delay between each change, effectively blinking the LED. The main program creates this TaskLed1 task with priority 1.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

void TaskLed1 (void * pvParameters) // definicao da task

while() {

// liga o led 1

HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, GPIO_PIN_RESET);

HAL_Delay(100);

// desliga o led 1

HAL_GPIO_WritePin(LED1_GPIO_Port, LED1_Pin, GPIO_PIN_SET);

HAL_Delay(100);

int main()

...

// cria a task TaskLed1

xTaskCreate(TaskLed, "TaskLed", 64, NULL, 1, NULL);

Open On-Chip Debugger 0.11.0-rc2+dev-00044-g8340bb0 (2021-06-02-17:29)

Licensed under GNU GPL v2

For bug reports, read

[Link]

Info : Listening on port 6666 for tcl connections

Info : Listening on port 4444 for telnet connections

Info : STLINK V2J41S7 (API v2) VID:PID 0483:3748

Info : Target voltage: 3.231446


Info : Unable to match requested speed 8000 kHz, using 4000 kHz

Info : Unable to match requested speed 8000 kHz, using 4000 kHz

Info : clock speed 4000 kHz

Info : stlink_dap_op_connect(connect)

Info : SWD DPIDR 0x2ba01477

Info : [Link]: hardware has 6 breakpoints, 4 watchpoints

Error: [Link] -- clearing lockup after double fault

Polling target [Link] failed, trying to reexamine

Info : [Link]: hardware has 6 breakpoints, 4 watchpoints

Info : starting gdb server for [Link] on 3333

Info : Listening on port 3333 for gdb connections

Info : accepting 'gdb' connection on tcp/3333

Info : device id = 0x20036410

Info : flash size = 128kbytes

Info : accepting 'gdb' connection on tcp/3333

target halted due to debug-request, current mode: Thread

xPSR: 0x01000000 pc: 0xfffffffe msp: 0xfffffffc

Info : Unable to match requested speed 8000 kHz, using 4000 kHz

Info : Unable to match requested speed 8000 kHz, using 4000 kHz

Info : Padding image section 0 at 0x0800010c with 4 bytes

target halted due to debug-request, current mode: Thread

xPSR: 0x01000000 pc: 0x080003b4 msp: 0x20005000

shutdown command invoked

Info : dropped 'gdb' connection

shutdown command invoked

You might also like