Loading...
 

Zephyr project on STM32

   Zephyr Workbench, a VSCode extension to manage Zephyr on STM32.
It enables users to easily create, develop, and debug Zephyr applications.
Main features:
  • Install host dependencies.
  • Import toolchain and SDK.
  • Create, configure, build and manage apps.
  • Debug STM32.
You can directly download it from the VSCode marketplace
For more details, visit the Zephyr Workbench

System Workbench for STM32


Nucleo32: can't blink LED

I just want to blink an LED. I’m using a Nucleo 32 dev board. (F042K6) It compiles without any errors, but when I program the code, the LED does not change state. The code is below. I program the test4.bin using STM32 ST-Link Utility Are there any other settings for the GPIO I need to set? Any help is greatly appreciated.

  1. include “stm32f0xx.h”
  2. include “stm32f0xx_nucleo_32.h”


int main(void)
{
RCC->AHBENR |= RCC_AHBENR_GPIOBEN;
GPIOB->MODER |= GPIO_MODER_MODER3_0;
GPIOB->PUPDR &= ~GPIO_PUPDR_PUPDR3;

for(;;)
{
HAL_GPIO_TogglePin(GPIOB, GPIO_PIN_3);
HAL_Delay(500);
}
}

22:13:05 **** Incremental Build of configuration Release for project test4 ****
make all
‘Building file: ../src/main.c’
‘Invoking: MCU GCC Compiler’
C:\Users\Brent\workspace\test4\Release
arm-none-eabi-gcc -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -DSTM32F0 -DNUCLEO_F042K6 -DSTM32F042K6Tx -DSTM32 -DUSE_HAL_DRIVER -DSTM32F042x6 -I”C:/Users/Brent/workspace/nucleo-f042k6_hal_lib” -I”C:/Users/Brent/workspace/test4/inc” -I”C:/Users/Brent/workspace/nucleo-f042k6_hal_lib/CMSIS/core” -I”C:/Users/Brent/workspace/nucleo-f042k6_hal_lib/CMSIS/device” -I”C:/Users/Brent/workspace/nucleo-f042k6_hal_lib/HAL_Driver/Inc/Legacy” -I”C:/Users/Brent/workspace/nucleo-f042k6_hal_lib/HAL_Driver/Inc” -I”C:/Users/Brent/workspace/nucleo-f042k6_hal_lib/Utilities/STM32F0xx_Nucleo_32” -O3 -Wall -fmessage-length=0 -ffunction-sections -c -MMD -MP -MF”src/main.d” -MT”src/main.o” -o “src/main.o” “../src/main.c”
‘Finished building: ../src/main.c’
’ ’
‘Building target: test4.elf’
‘Invoking: MCU GCC Linker’
arm-none-eabi-gcc -mcpu=cortex-m0 -mthumb -mfloat-abi=soft -L”C:\Users\Brent\workspace\nucleo-f042k6_hal_lib\Release” -T”C:\Users\Brent\workspace\test4\LinkerScript.ld” -Wl,-Map=output.map -Wl,--gc-sections -lm -o “test4.elf” @”objects.list” -lnucleo-f042k6_hal_lib
‘Finished building target: test4.elf’
’ ’
make --no-print-directory post-build
‘Generating binary and Printing size information:’
arm-none-eabi-objcopy -O binary “test4.elf” “test4.bin”
arm-none-eabi-size -B “test4.elf”
text data bss dec hex filename
1140 1076 1056 3272 cc8 test4.elf
’ ’