www.beck-ipc.com
www.beck-ipc.comwww.beck-ipc.com  | ImprintImprint
FAQFAQ  | SearchSearch  |
RegisterRegister   |LoginLogin

One-Workbench 2.7.0 with SC145 (DK151)

Questions and discussions about the operating system RTOS-LNX and the corresponding C-LIB.
When compiling :
#include <hwAPIGpio.h>
...
gpioEnable(129,1);
or
pfe_enable_pio(129, PIO_O1);

we get the Error message :
Invalid arguments ' Candidates are: int gpioEnable(int, ?) ' main.cpp /TestGPIO/src line 43 Semantic Error

Hello Val123,

why are you including hwAPIGpio.h? You just need to include clib.h when using RTOS-LNX clib API functions. I am not in front of the IDE right now, but this should work:

Code: Select all
#include "clib.h"
int main()
{
   return gpioEnable(129, TRUE);
}


Regards

Michail G. Etairidis
Michael G. Etairidis
Software Development
Beck IPC GmbH

clib.h include hwAPIGpio.h.
But even with clib.h the error did not disappear

Hmm... Weird. Are you sure you have created a project for the right target (which should be SC1x5). Can you copy-paste the entire compiler output here?

I am currently out of office. I will either get back to you on Tuesday or a colleague will get back to you in the meantime.
Michael G. Etairidis
Software Development
Beck IPC GmbH

My colleague just took a look at it. It is just an error message from the linter, not the compiler. You can find the compiler output in the "console" tab.

I will have to look into why the linter complains about valid code, but your code should build without issues.
Michael G. Etairidis
Software Development
Beck IPC GmbH

Thank.
It really works. But the errors remained in "Problems".

My programm:


#include <clib.h>
#include <RTOS.H>

void GPIO_init();

int main() {
int pin=0;

GPIO_init();
for(int i=0;i<10;i++)
{
while(pin==gpioReadInput(135));
pin=gpioReadInput(135);
gpioWriteOutput(129,pin);
printf("pin =%d\r\n",pin);
}
return 0;
}
void GPIO_init()
{
gpioEnable(129,TRUE); // line 28
gpioEnable(135,TRUE); //line 29
gpioSetMode(129, PIO_O0);
gpioSetMode(135, PIO_I);
printf("GPIO 129 135 mode = %d %d\r\n",gpioGetMode(129), gpioGetMode(135));
}

Problems:

Invalid arguments ' Candidates are: int gpioEnable(int, ?) ' main.cpp /TestGPIO/src line 28 Semantic Error
Invalid arguments ' Candidates are: int gpioEnable(int, ?) ' main.cpp /TestGPIO/src line 29 Semantic Error


Console:

**** Build of configuration debug for project TestGPIO ****

make all
Building file: ../src/main.cpp
Invoking: SC1x5 C++ Compiler
sc1x5-g++ -D__RTOS_LNX__ -D_SC1x5_ -D__ARM_LINUX_GNUEABIHF__ -D__ARM_ARCH_7A__ -I"C:\ONE-Workbench\tc-sc1x5/arm-sc1x5-linux-gnueabihf/sysroot/usr/include" -I"C:\ONE-Workbench\tc-sc1x5/arm-sc1x5-linux-gnueabihf/sysroot/usr/local/include" -I"C:\ONE-Workbench\tc-sc1x5/arm-sc1x5-linux-gnueabihf/sysroot/usr/local/include/beck" -I"C:\ONE-Workbench\tc-sc1x5/arm-sc1x5-linux-gnueabihf/sysroot/usr/local/include/beck/stdlib-extension" -O0 -g -Wall -Wcast-align -Werror=implicit-function-declaration -c -fmessage-length=0 -MMD -MP -MF"src/main.d" -MT"src/main.d" -MT"src/main.o" -o src/main.o ../src/main.cpp
Finished building: ../src/main.cpp

Building target: TestGPIO.bex
Invoking: SC1x5 C++ Linker
sc1x5-g++ -static-libstdc++ -lclib-cpp -lclib -lclib-rtxn -lclib-shmapi -lpthread -lrt -lssl -lcrypto -lm -ldl -lsocketcan -lcrypt -Wl,-wrap,access -Wl,-wrap,acct -Wl,-wrap,chdir -Wl,-wrap,chmod -Wl,-wrap,chown -Wl,-wrap,chroot -Wl,-wrap,creat -Wl,-wrap,fopen -Wl,-wrap,fopen64 -Wl,-wrap,freopen -Wl,-wrap,ftok -Wl,-wrap,getcwd -Wl,-wrap,lchown -Wl,-wrap,link -Wl,-wrap,lstat -Wl,-wrap,lstat64 -Wl,-wrap,__lxstat -Wl,-wrap,mkdir -Wl,-wrap,open -Wl,-wrap,remove -Wl,-wrap,rename -Wl,-wrap,rmdir -Wl,-wrap,stat -Wl,-wrap,stat64 -Wl,-wrap,__xstat -Wl,-wrap,swapoff -Wl,-wrap,swapon -Wl,-wrap,unlink -Wl,-wrap,opendir --sysroot="C:\ONE-Workbench\tc-sc1x5\arm-sc1x5-linux-gnueabihf\sysroot" -o TestGPIO.bex "C:\ONE-Workbench\tc-sc1x5\arm-sc1x5-linux-gnueabihf\sysroot\usr\local\lib\rtx-init.o" ./src/main.o
Finished building target: TestGPIO.bex


**** Build Finished ****

Yes, what is displayed under "Problems" is issues the linter finds. For some reason, the linter reports a false positive for the gpioEnable() function (probably because we have configured some include or path wrong).

It is not really a problem, just a misconfiguration from our side. We are looking into it and hope to solve it by the next version of the ONE-Workbench IDE. Your resulting executable should run without problems.

Regards

Michail G. Etairidis
Michael G. Etairidis
Software Development
Beck IPC GmbH

I confirm that the program works correctly, but the "bugs" opposite the functions gpioEnable() are confusing - not beautiful. We will wait for the next version of ONE-Workbench/
Thank.

Hi,

you may try to rebuild the index. Please select the project node and from the right-click context menu choose "Index --> Rebuild". This did solve the problem for me here.

Best regards,
André Pribil
Software Development
Beck IPC GmbH

Thank you, everything is OK, re-indexing worked.

Return to RTOS-LNX


Who is online

Users browsing this forum: No registered users and 1 guest


cron