platformio / platform-ststm32

ST STM32: development platform for PlatformIO
https://registry.platformio.org/platforms/platformio/ststm32
Apache License 2.0
394 stars 308 forks source link

Enhanced bilnky does not Work #749

Open tobbad opened 9 months ago

tobbad commented 9 months ago

I tried to set up an enhanced blinky with following installed Frameworks My frameforks are: ########################################################################## contrib-piohome framework-arduino-avr-microcore framework-stm32cubef0 tool-openocd framework-arduino-avr framework-arduino-avr-mightycore framework-stm32cubef4 tool-scons framework-arduino-avr-attiny framework-arduino-avr-minicore tool-avrdude tool-stm32duino framework-arduino-avr-bean framework-arduino-avr-nicai tool-avrdude@1.60300.200527 toolchain-atmelavr framework-arduino-avr-digistump framework-arduino-avr-panstamp tool-cppcheck toolchain-gccarmnoneeabi framework-arduino-avr-dwenguino framework-arduino-avr-prusa_rambo tool-dfuutil toolchain-gccarmnoneeabi@1.70201.0 framework-arduino-avr-majorcore framework-arduinoststm32 tool-dfuutil-arduino framework-arduino-avr-megacore framework-cmsis tool-ldscripts-ststm32 ################################################# I try to run following code: ############################################

include

include

define button PC_13

define led PA_5

define rx PA_3

define tx PA_2

HardwareSerial serial(rx, tx); void setup() { pinMode(button, INPUT); pinMode(led, OUTPUT);

serial.begin(115200); serial.println("Initalization done"); }

void loop() { uint32_t state; delay(200); state = digitalRead(button); serial.println("Loop state "); serial.println(state); if (state) { serial.println("Button pushed"); } digitalWrite(led, !digitalRead(led)); } #######################################################33 platform.ini is ###################################33 ; PlatformIO Project Configuration File [env:nucleo_l476rg] platform = ststm32 board = nucleo_l476rg framework = arduino debug_build_flags = -Og -ggdb -g3 -fno-eliminate-unused-debug-symbols #################################################### The debug options should remove all optimization, but they have no effect. The button does make any effect. It seems, that it can not be read. The docu can be found here: I use a Nucleo-L476 (https://www.st.com/content/ccc/resource/technical/layouts_and_diagrams/schematic_pack/group2/74/18/73/70/3c/70/4a/52/MB1136-DEFAULT-C04_Schematic/files/MB1136-DEFAULT-C04_Schematic.pdf/jcr:content/translations/en.MB1136-DEFAULT-C04_Schematic.pdf, https://www.st.com/resource/en/user_manual/um1724-stm32-nucleo64-boards-mb1136-stmicroelectronics.pdf). The soulution with removing the "_" claimed as my solution does not work. I see the same Error with a [env:nucleo_401rg]. Original Posting is here: See my problem in https://community.platformio.org/t/enhanced-blinky-with-button-and-led-does-not-work/37375 I tried to control the LED (PC_7) on the x-NucleoS2686A2 but the led can not be lit.