thiagoralves / OpenPLC_Editor

OpenPLC Editor - IDE capable of creating programs for the OpenPLC Runtime
GNU General Public License v2.0
429 stars 207 forks source link

Arduino Uno R3 | Error during build --> PWM_Controller #91

Closed Irrlicht2142 closed 1 year ago

Irrlicht2142 commented 1 year ago

Hey There, I can't compile a testprogramm for the PWM_Controller.

Editor Running on Windows Computer Downloaded the latest masterbranch Target: Arduino Uno R3

Im just added an PWM_Controller to the FUP_Programm and added some Variables matching the Informations to the Block. Here one Screenshot of it: image

When i want to load it onto my Arduino it gives out this Error:

C:\Users\pepe_\AppData\Local\Temp\ccNnGypV.ltrans0.ltrans.o: In function `PWM_CONTROLLER_body__':
C:\Users\pepe_\OpenPLC_Editor/editor\arduino\src\lib/arduino_lib_FB.h:524: undefined reference to `set_hardware_pwm'
collect2.exe: error: ld returned 1 exit status

Error during build: exit status 1

COMPILATION FAILED!

Here the full Compilation Log:

Compiling .st file...
POUS.c
POUS.h
LOCATED_VARIABLES.h
VARIABLES.csv
Config0.c
Config0.h
Res0.c
Generating binary file...

COMPILATION START: arduino:avr:uno
Using board 'uno' from platform in folder: C:\Users\pepe_\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6
Using core 'arduino' from platform in folder: C:\Users\pepe_\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6
Detecting libraries used...
"C:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-Ieditor\\arduino\\src\\lib" "-IC:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "C:\\Users\\pepe_\\AppData\\Local\\Temp\\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\\sketch\\Baremetal.ino.cpp" -o nul
Alternatives for Arduino_OpenPLC.h: [src]
ResolveLibrary(Arduino_OpenPLC.h)
  -> candidates: [src]
"C:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-Ieditor\\arduino\\src\\lib" "-IC:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Users\\pepe_\\OpenPLC_Editor\\editor\\arduino\\src" "C:\\Users\\pepe_\\AppData\\Local\\Temp\\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\\sketch\\Baremetal.ino.cpp" -o nul
"C:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-Ieditor\\arduino\\src\\lib" "-IC:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Users\\pepe_\\OpenPLC_Editor\\editor\\arduino\\src" "C:\\Users\\pepe_\\AppData\\Local\\Temp\\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\\sketch\\ModbusSlave.cpp" -o nul
"C:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-Ieditor\\arduino\\src\\lib" "-IC:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Users\\pepe_\\OpenPLC_Editor\\editor\\arduino\\src" "C:\\Users\\pepe_\\OpenPLC_Editor\\editor\\arduino\\src\\Config0.c" -o nul
"C:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-Ieditor\\arduino\\src\\lib" "-IC:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Users\\pepe_\\OpenPLC_Editor\\editor\\arduino\\src" "C:\\Users\\pepe_\\OpenPLC_Editor\\editor\\arduino\\src\\POUS.c" -o nul
"C:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-Ieditor\\arduino\\src\\lib" "-IC:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Users\\pepe_\\OpenPLC_Editor\\editor\\arduino\\src" "C:\\Users\\pepe_\\OpenPLC_Editor\\editor\\arduino\\src\\Res0.c" -o nul
"C:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-Ieditor\\arduino\\src\\lib" "-IC:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Users\\pepe_\\OpenPLC_Editor\\editor\\arduino\\src" "C:\\Users\\pepe_\\OpenPLC_Editor\\editor\\arduino\\src\\arduino.cpp" -o nul
"C:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-Ieditor\\arduino\\src\\lib" "-IC:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Users\\pepe_\\OpenPLC_Editor\\editor\\arduino\\src" "C:\\Users\\pepe_\\OpenPLC_Editor\\editor\\arduino\\src\\debug.c" -o nul
"C:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-Ieditor\\arduino\\src\\lib" "-IC:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Users\\pepe_\\OpenPLC_Editor\\editor\\arduino\\src" "C:\\Users\\pepe_\\OpenPLC_Editor\\editor\\arduino\\src\\glueVars.c" -o nul
Generating function prototypes...
"C:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-Ieditor\\arduino\\src\\lib" "-IC:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Users\\pepe_\\OpenPLC_Editor\\editor\\arduino\\src" "C:\\Users\\pepe_\\AppData\\Local\\Temp\\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\\sketch\\Baremetal.ino.cpp" -o "C:\\Users\\pepe_\\AppData\\Local\\Temp\\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\\preproc\\ctags_target_for_gcc_minus_e.cpp"
"C:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\builtin\\tools\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\Users\\pepe_\\AppData\\Local\\Temp\\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\\preproc\\ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"C:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-Ieditor\\arduino\\src\\lib" "-IC:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Users\\pepe_\\OpenPLC_Editor\\editor\\arduino\\src" "C:\\Users\\pepe_\\AppData\\Local\\Temp\\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\\sketch\\Baremetal.ino.cpp" -o "C:\\Users\\pepe_\\AppData\\Local\\Temp\\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\\sketch\\Baremetal.ino.cpp.o"
"C:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-Ieditor\\arduino\\src\\lib" "-IC:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Users\\pepe_\\OpenPLC_Editor\\editor\\arduino\\src" "C:\\Users\\pepe_\\AppData\\Local\\Temp\\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\\sketch\\ModbusSlave.cpp" -o "C:\\Users\\pepe_\\AppData\\Local\\Temp\\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\\sketch\\ModbusSlave.cpp.o"
Compiling libraries...
Compiling library "src"
"C:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-gcc" -c -g -Os -w -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-Ieditor\\arduino\\src\\lib" "-IC:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Users\\pepe_\\OpenPLC_Editor\\editor\\arduino\\src" "C:\\Users\\pepe_\\OpenPLC_Editor\\editor\\arduino\\src\\Config0.c" -o "C:\\Users\\pepe_\\AppData\\Local\\Temp\\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\\libraries\\src\\Config0.c.o"
"C:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-gcc" -c -g -Os -w -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-Ieditor\\arduino\\src\\lib" "-IC:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Users\\pepe_\\OpenPLC_Editor\\editor\\arduino\\src" "C:\\Users\\pepe_\\OpenPLC_Editor\\editor\\arduino\\src\\Res0.c" -o "C:\\Users\\pepe_\\AppData\\Local\\Temp\\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\\libraries\\src\\Res0.c.o"
"C:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-Ieditor\\arduino\\src\\lib" "-IC:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Users\\pepe_\\OpenPLC_Editor\\editor\\arduino\\src" "C:\\Users\\pepe_\\OpenPLC_Editor\\editor\\arduino\\src\\arduino.cpp" -o "C:\\Users\\pepe_\\AppData\\Local\\Temp\\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\\libraries\\src\\arduino.cpp.o"
"C:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-gcc" -c -g -Os -w -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-Ieditor\\arduino\\src\\lib" "-IC:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Users\\pepe_\\OpenPLC_Editor\\editor\\arduino\\src" "C:\\Users\\pepe_\\OpenPLC_Editor\\editor\\arduino\\src\\POUS.c" -o "C:\\Users\\pepe_\\AppData\\Local\\Temp\\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\\libraries\\src\\POUS.c.o"
"C:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-gcc" -c -g -Os -w -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-Ieditor\\arduino\\src\\lib" "-IC:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Users\\pepe_\\OpenPLC_Editor\\editor\\arduino\\src" "C:\\Users\\pepe_\\OpenPLC_Editor\\editor\\arduino\\src\\glueVars.c" -o "C:\\Users\\pepe_\\AppData\\Local\\Temp\\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\\libraries\\src\\glueVars.c.o"
"C:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-gcc" -c -g -Os -w -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-Ieditor\\arduino\\src\\lib" "-IC:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\cores\\arduino" "-IC:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.6\\variants\\standard" "-IC:\\Users\\pepe_\\OpenPLC_Editor\\editor\\arduino\\src" "C:\\Users\\pepe_\\OpenPLC_Editor\\editor\\arduino\\src\\debug.c" -o "C:\\Users\\pepe_\\AppData\\Local\\Temp\\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\\libraries\\src\\debug.c.o"
Compiling core...
Using precompiled core: C:\Users\pepe_\AppData\Local\Temp\arduino-core-cache\core_arduino_avr_uno_e039d6edda6a5eda88bfda8ca287cc59.a
Linking everything together...
"C:\\Users\\pepe_\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o "C:\\Users\\pepe_\\AppData\\Local\\Temp\\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358/Baremetal.ino.elf" "C:\\Users\\pepe_\\AppData\\Local\\Temp\\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\\sketch\\Baremetal.ino.cpp.o" "C:\\Users\\pepe_\\AppData\\Local\\Temp\\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\\sketch\\ModbusSlave.cpp.o" "C:\\Users\\pepe_\\AppData\\Local\\Temp\\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\\libraries\\src\\Config0.c.o" "C:\\Users\\pepe_\\AppData\\Local\\Temp\\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\\libraries\\src\\POUS.c.o" "C:\\Users\\pepe_\\AppData\\Local\\Temp\\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\\libraries\\src\\Res0.c.o" "C:\\Users\\pepe_\\AppData\\Local\\Temp\\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\\libraries\\src\\arduino.cpp.o" "C:\\Users\\pepe_\\AppData\\Local\\Temp\\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\\libraries\\src\\debug.c.o" "C:\\Users\\pepe_\\AppData\\Local\\Temp\\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\\libraries\\src\\glueVars.c.o" "C:\\Users\\pepe_\\AppData\\Local\\Temp\\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358/..\\arduino-core-cache\\core_arduino_avr_uno_e039d6edda6a5eda88bfda8ca287cc59.a" "-LC:\\Users\\pepe_\\AppData\\Local\\Temp\\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358" -lm
Using library src in folder: C:\Users\pepe_\OpenPLC_Editor\editor\arduino\src (legacy)

C:\Users\pepe_\AppData\Local\Temp\ccNnGypV.ltrans0.ltrans.o: In function `PWM_CONTROLLER_body__':
C:\Users\pepe_\OpenPLC_Editor/editor\arduino\src\lib/arduino_lib_FB.h:524: undefined reference to `set_hardware_pwm'
collect2.exe: error: ld returned 1 exit status

Error during build: exit status 1

COMPILATION FAILED!

Are there some missing files?

Thanks for the Reply.

Greetings Philipp

thiagoralves commented 1 year ago

This means that the PWM_Controller block was not implemented for your platform. In fact, this block has been implemented to only one platform so far. Any other platform that needs support for this will have to implement the set_hardware_pwm() function

On Mon, Oct 23, 2023 at 4:59 PM Irrlich2142 @.***> wrote:

Hey There, I can't compile a testprogramm for the PWM_Controller.

Editor Running on Windows Computer Downloaded the latest masterbranch Target: Arduino Uno R3

Im just added an PWM_Controller to the FUP_Programm and added some Variables matching the Informations to the Block. Here one Screenshot of it: [image: image] https://user-images.githubusercontent.com/147880617/277474368-69e9ed74-0934-4afc-bb4e-1bbf43f89b40.png

When i want to load it onto my Arduino it gives out this Error:

C:\Users\pepe_\AppData\Local\Temp\ccNnGypV.ltrans0.ltrans.o: In function PWM_CONTROLLER_body__': C:\Users\pepe_\OpenPLC_Editor/editor\arduino\src\lib/arduino_lib_FB.h:524: undefined reference toset_hardware_pwm' collect2.exe: error: ld returned 1 exit status

Error during build: exit status 1

COMPILATION FAILED!

Here the full Compilation Log:

Compiling .st file... POUS.c POUS.h LOCATED_VARIABLES.h VARIABLES.csv Config0.c Config0.h Res0.c Generating binary file...

COMPILATION START: arduino:avr:uno Using board 'uno' from platform in folder: C:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6 Using core 'arduino' from platform in folder: C:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6 Detecting libraries used... "C:\Users\pepe_\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCHAVR "-Ieditor\arduino\src\lib" "-IC:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard" "C:\Users\pepe\AppData\Local\Temp\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\sketch\Baremetal.ino.cpp" -o nul Alternatives for Arduino_OpenPLC.h: [src] ResolveLibrary(ArduinoOpenPLC.h) -> candidates: [src] "C:\Users\pepe\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCHAVR "-Ieditor\arduino\src\lib" "-IC:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard" "-IC:\Users\pepe\OpenPLCEditor\editor\arduino\src" "C:\Users\pepe\AppData\Local\Temp\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\sketch\Baremetal.ino.cpp" -o nul "C:\Users\pepe_\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCHAVR "-Ieditor\arduino\src\lib" "-IC:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard" "-IC:\Users\pepe\OpenPLCEditor\editor\arduino\src" "C:\Users\pepe\AppData\Local\Temp\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\sketch\ModbusSlave.cpp" -o nul "C:\Users\pepe_\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCHAVR "-Ieditor\arduino\src\lib" "-IC:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard" "-IC:\Users\pepe\OpenPLCEditor\editor\arduino\src" "C:\Users\pepe\OpenPLCEditor\editor\arduino\src\Config0.c" -o nul "C:\Users\pepe\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCHAVR "-Ieditor\arduino\src\lib" "-IC:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard" "-IC:\Users\pepe\OpenPLCEditor\editor\arduino\src" "C:\Users\pepe\OpenPLCEditor\editor\arduino\src\POUS.c" -o nul "C:\Users\pepe\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCHAVR "-Ieditor\arduino\src\lib" "-IC:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard" "-IC:\Users\pepe\OpenPLCEditor\editor\arduino\src" "C:\Users\pepe\OpenPLCEditor\editor\arduino\src\Res0.c" -o nul "C:\Users\pepe\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCHAVR "-Ieditor\arduino\src\lib" "-IC:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard" "-IC:\Users\pepe\OpenPLCEditor\editor\arduino\src" "C:\Users\pepe\OpenPLCEditor\editor\arduino\src\arduino.cpp" -o nul "C:\Users\pepe\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCHAVR "-Ieditor\arduino\src\lib" "-IC:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard" "-IC:\Users\pepe\OpenPLCEditor\editor\arduino\src" "C:\Users\pepe\OpenPLCEditor\editor\arduino\src\debug.c" -o nul "C:\Users\pepe\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCHAVR "-Ieditor\arduino\src\lib" "-IC:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard" "-IC:\Users\pepe\OpenPLCEditor\editor\arduino\src" "C:\Users\pepe\OpenPLCEditor\editor\arduino\src\glueVars.c" -o nul Generating function prototypes... "C:\Users\pepe\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCHAVR "-Ieditor\arduino\src\lib" "-IC:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard" "-IC:\Users\pepe\OpenPLCEditor\editor\arduino\src" "C:\Users\pepe\AppData\Local\Temp\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\sketch\Baremetal.ino.cpp" -o "C:\Users\pepe_\AppData\Local\Temp\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\preproc\ctags_target_for_gcc_minuse.cpp" "C:\Users\pepe\AppData\Local\Arduino15\packages\builtin\tools\ctags\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\Users\pepe_\AppData\Local\Temp\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\preproc\ctags_target_for_gcc_minuse.cpp" Compiling sketch... "C:\Users\pepe\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCHAVR "-Ieditor\arduino\src\lib" "-IC:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard" "-IC:\Users\pepe\OpenPLCEditor\editor\arduino\src" "C:\Users\pepe\AppData\Local\Temp\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\sketch\Baremetal.ino.cpp" -o "C:\Users\pepe\AppData\Local\Temp\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\sketch\Baremetal.ino.cpp.o" "C:\Users\pepe\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCHAVR "-Ieditor\arduino\src\lib" "-IC:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard" "-IC:\Users\pepe\OpenPLCEditor\editor\arduino\src" "C:\Users\pepe\AppData\Local\Temp\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\sketch\ModbusSlave.cpp" -o "C:\Users\pepe\AppData\Local\Temp\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\sketch\ModbusSlave.cpp.o" Compiling libraries... Compiling library "src" "C:\Users\pepe\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-gcc" -c -g -Os -w -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCHAVR "-Ieditor\arduino\src\lib" "-IC:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard" "-IC:\Users\pepe\OpenPLCEditor\editor\arduino\src" "C:\Users\pepe\OpenPLCEditor\editor\arduino\src\Config0.c" -o "C:\Users\pepe\AppData\Local\Temp\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\libraries\src\Config0.c.o" "C:\Users\pepe_\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-gcc" -c -g -Os -w -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCHAVR "-Ieditor\arduino\src\lib" "-IC:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard" "-IC:\Users\pepe\OpenPLCEditor\editor\arduino\src" "C:\Users\pepe\OpenPLCEditor\editor\arduino\src\Res0.c" -o "C:\Users\pepe\AppData\Local\Temp\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\libraries\src\Res0.c.o" "C:\Users\pepe_\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCHAVR "-Ieditor\arduino\src\lib" "-IC:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard" "-IC:\Users\pepe\OpenPLCEditor\editor\arduino\src" "C:\Users\pepe\OpenPLCEditor\editor\arduino\src\arduino.cpp" -o "C:\Users\pepe\AppData\Local\Temp\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\libraries\src\arduino.cpp.o" "C:\Users\pepe_\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-gcc" -c -g -Os -w -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCHAVR "-Ieditor\arduino\src\lib" "-IC:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard" "-IC:\Users\pepe\OpenPLCEditor\editor\arduino\src" "C:\Users\pepe\OpenPLCEditor\editor\arduino\src\POUS.c" -o "C:\Users\pepe\AppData\Local\Temp\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\libraries\src\POUS.c.o" "C:\Users\pepe_\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-gcc" -c -g -Os -w -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCHAVR "-Ieditor\arduino\src\lib" "-IC:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard" "-IC:\Users\pepe\OpenPLCEditor\editor\arduino\src" "C:\Users\pepe\OpenPLCEditor\editor\arduino\src\glueVars.c" -o "C:\Users\pepe\AppData\Local\Temp\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\libraries\src\glueVars.c.o" "C:\Users\pepe_\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-gcc" -c -g -Os -w -std=gnu11 -ffunction-sections -fdata-sections -MMD -flto -fno-fat-lto-objects -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCHAVR "-Ieditor\arduino\src\lib" "-IC:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino" "-IC:\Users\pepe\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\variants\standard" "-IC:\Users\pepe\OpenPLCEditor\editor\arduino\src" "C:\Users\pepe\OpenPLCEditor\editor\arduino\src\debug.c" -o "C:\Users\pepe\AppData\Local\Temp\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\libraries\src\debug.c.o" Compiling core... Using precompiled core: C:\Users\pepe_\AppData\Local\Temp\arduino-core-cache\core_arduino_avr_unoe039d6edda6a5eda88bfda8ca287cc59.a Linking everything together... "C:\Users\pepe\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o "C:\Users\pepe\AppData\Local\Temp\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358/Baremetal.ino.elf" "C:\Users\pepe\AppData\Local\Temp\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\sketch\Baremetal.ino.cpp.o" "C:\Users\pepe\AppData\Local\Temp\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\sketch\ModbusSlave.cpp.o" "C:\Users\pepe\AppData\Local\Temp\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\libraries\src\Config0.c.o" "C:\Users\pepe\AppData\Local\Temp\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\libraries\src\POUS.c.o" "C:\Users\pepe\AppData\Local\Temp\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\libraries\src\Res0.c.o" "C:\Users\pepe\AppData\Local\Temp\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\libraries\src\arduino.cpp.o" "C:\Users\pepe\AppData\Local\Temp\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\libraries\src\debug.c.o" "C:\Users\pepe\AppData\Local\Temp\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358\libraries\src\glueVars.c.o" "C:\Users\pepe\AppData\Local\Temp\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358/..\arduino-core-cache\core_arduino_avr_unoe039d6edda6a5eda88bfda8ca287cc59.a" "-LC:\Users\pepe\AppData\Local\Temp\arduino-sketch-F608021BE6D63A357997DDB0A5EF2358" -lm Using library src in folder: C:\Users\pepe_\OpenPLC_Editor\editor\arduino\src (legacy)

C:\Users\pepe_\AppData\Local\Temp\ccNnGypV.ltrans0.ltrans.o: In function PWM_CONTROLLER_body__': C:\Users\pepe_\OpenPLC_Editor/editor\arduino\src\lib/arduino_lib_FB.h:524: undefined reference toset_hardware_pwm' collect2.exe: error: ld returned 1 exit status

Error during build: exit status 1

COMPILATION FAILED!

Are there some missing files?

Thanks for the Reply.

Greetings Philipp

— Reply to this email directly, view it on GitHub https://github.com/thiagoralves/OpenPLC_Editor/issues/91, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB63XPFAMRBSGEINXT6OV2DYA3LEFAVCNFSM6AAAAAA6MVVTUOVHI2DSMVQWIX3LMV43ASLTON2WKOZRHE2TQMBRGQ2DOMA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Irrlicht2142 commented 1 year ago

Do you mean platform (arduino uno) or the platform as windows with openplc? If its the arduino, do you know what arduino is the one who is implemented?

Thanks for the reply

thiagoralves commented 1 year ago

Platform as arduino uno. No arduino board has this implemented. Currently only one prototype platform has code to support it. I can check to see what the effort is to bring this to basic arduino unos (if that's even possible)

On Tue, Oct 24, 2023 at 11:55 AM Irrlich2142 @.***> wrote:

Do you mean platform (arduino uno) or the platform as windows with openplc? If its the arduino, do you know what arduino is the one who is implemented?

Thanks for the reply

— Reply to this email directly, view it on GitHub https://github.com/thiagoralves/OpenPLC_Editor/issues/91#issuecomment-1777539474, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB63XPFRIHG6DYII45RZQLLYA7QG3AVCNFSM6AAAAAA6MVVTUOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZXGUZTSNBXGQ . You are receiving this because you commented.Message ID: @.***>

Irrlicht2142 commented 1 year ago

That would be great. Can you give me feedback if you know if its possible or not?

thiagoralves commented 1 year ago

Just added support for Arduino Uno: https://github.com/thiagoralves/OpenPLC_Editor/commit/bf469e7f2d24835e911c1ea09373fa8161e76129

The code compiles, but I haven't check functionality yet. Channel is mapped to the PWM output pins like %IW0, %IW1, etc. So, if you use channel 0 it will be the same as using %IW0 pin (which on Arduino Uno that's pin 9)

Irrlicht2142 commented 1 year ago

Awsome, Thanks for the fast support. I'll try it when im back at home. I'll give you feedback afterwards.

Best regards.

Irrlicht2142 commented 1 year ago

As far a s i can tell: Channel 0 --> Pin 9 Address works Channel 1 --> Pin 10 Address works Frequency works also. I tested 500Hz with 25% Duty and it is 2ms from peak to peak. Duty cycle with 50% is correct and 25% is also correct.

Here a Picture of 500Hz with 25% duty cycle on my Oscilloscope: 1

Only Issues: -Channel 2 is'nt working (i guess from the look at the code that this is intentional. Only pins 9 and 10 are defined) -When i try to use 2 Blocks e.g Channel 0 and 1 only one works. Here the program: 1

Over all thank you very much for Implement this feature so quickly.

Best regards Philipp

Irrlicht2142 commented 1 year ago

Just added support for Arduino Uno: bf469e7

The code compiles, but I haven't check functionality yet. Channel is mapped to the PWM output pins like %IW0, %IW1, etc. So, if you use channel 0 it will be the same as using %IW0 pin (which on Arduino Uno that's pin 9)

shouldn't it be %QW0 and %QW1 ...

thiagoralves commented 1 year ago

Just added support for Arduino Uno: bf469e7 The code compiles, but I haven't check functionality yet. Channel is mapped to the PWM output pins like %IW0, %IW1, etc. So, if you use channel 0 it will be the same as using %IW0 pin (which on Arduino Uno that's pin 9)

shouldn't it be %QW0 and %QW1 ...

Yes! My mistake…

thiagoralves commented 1 year ago

As far a s i can tell: Channel 0 --> Pin 9 Address works Channel 1 --> Pin 10 Address works Frequency works also. I tested 500Hz with 25% Duty and it is 2ms from peak to peak. Duty cycle with 50% is correct and 25% is also correct.

Here a Picture of 500Hz with 25% duty cycle on my Oscilloscope: 1

Only Issues: -Channel 2 is'nt working (i guess from the look at the code that this is intentional. Only pins 9 and 10 are defined) -When i try to use 2 Blocks e.g Channel 0 and 1 only one works. Here the program: 1

Over all thank you very much for Implement this feature so quickly.

Best regards Philipp

Pins 9 and 10 share the same timer (Timer1) on ATmega328, which means that they can only run if both are set for the same frequency. I haven’t done a deep dive into the atmega datasheet so I could be wrong on that one, but that’s normally how it works on most microcontrollers. This is probably why it is not working when you try to use two blocks.

About pin 11, I left it out because I thought it was using Timer0 which is reserved for millis() in the Arduino world. But I was wrong, it uses Timer2, so it is safe to bring it in as well

Irrlicht2142 commented 1 year ago

Ive also noticed that i cant go under 250Hz. if i set the variable for the Frequency to e.g. 20.0 or 2.0 the output is still 250Hz.

thiagoralves commented 1 year ago

That probably has to do with a limitation from the ATmega timer. Im using this library to handle all the PWM stuff. This guy wrote the same lib for various architectures, which makes it easy to port over the same code to esp32, stm32, etc...

By the way, my latest commit added pin 11 to arduino uno boards. The problem with pin 11 was for the Leonardo (32u4). I made sure to remove that pin if the board is a Leonardo