Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation Failed : LED_XXX Not Declared in Scope #2

Open
nuertey opened this issue Dec 13, 2018 · 5 comments
Open

Compilation Failed : LED_XXX Not Declared in Scope #2

nuertey opened this issue Dec 13, 2018 · 5 comments

Comments

@nuertey
Copy link
Contributor

nuertey commented Dec 13, 2018

Hello @coisme ,
Is this sample program ready to be tried out and tested as-is? I tried compiling it for my target but compilation failed on missing defines. See logs below :

~/Workspace/Mbed-to-IBM-Watson-IoT$ mbed compile -m nucleo_f767zi -t GCC_ARM
[mbed] Working path "~/Workspace/Mbed-to-IBM-Watson-IoT" (library)
[mbed] Program path "~/Workspace/Mbed-to-IBM-Watson-IoT"
[Warning] @,: Compiler version mismatch: Have 7.3.1; expected version >= 6.0.0 and < 7.0.0
Building project Mbed-to-IBM-Watson-IoT (NUCLEO_F767ZI, GCC_ARM)
Scan: Mbed-to-IBM-Watson-IoT
Scan: env
Compile [  0.1%]: MQTTConnectClient.c
Compile [  0.3%]: MQTTDeserializePublish.c
Compile [  0.4%]: MQTTSerializePublish.c
Compile [  0.5%]: MQTTConnectServer.c
Compile [  0.7%]: MQTTSubscribeClient.c
Compile [  0.8%]: MQTTFormat.c
[Warning] MQTTFormat.c@123,9: variable 'strindex' set but not used [-Wunused-but-set-variable]
[Warning] MQTTFormat.c@193,9: variable 'strindex' set but not used [-Wunused-but-set-variable]
Compile [  0.9%]: MQTTSubscribeServer.c
Compile [  1.1%]: MQTTPacket.c
Compile [  1.2%]: MQTTUnsubscribeServer.c
Compile [  1.3%]: MQTTUnsubscribeClient.c
Compile [  1.5%]: TLSSocket.cpp
Compile [  1.6%]: MCR20Drv.c
Compile [  1.8%]: at24mac.cpp
Compile [  1.9%]: TLSSocketWrapper.cpp
Compile [  2.0%]: easy-connect.cpp
Compile [  2.2%]: SPIRIT_Aes.c
Compile [  2.3%]: SPIRIT_Commands.c
Compile [  2.4%]: SPIRIT_Calibration.c
Compile [  2.6%]: ESP8266Interface.cpp
Compile [  2.7%]: ESP8266.cpp
Compile [  2.8%]: SPIRIT_DirectRF.c
Compile [  3.0%]: NanostackRfPhySpirit1.cpp
Compile [  3.1%]: SPIRIT_Csma.c
Compile [  3.2%]: SPIRIT_General.c
Compile [  3.4%]: NanostackRfPhyMcr20a.cpp
Compile [  3.5%]: SPIRIT_Gpio.c
Compile [  3.6%]: SPIRIT_Irq.c
Compile [  3.8%]: NanostackRfPhyAtmel.cpp
[Warning] NanostackRfPhyAtmel.cpp@1100,18: variable 'last_is' set but not used [-Wunused-but-set-variable]
[Warning] NanostackRfPhyAtmel.cpp@1100,27: variable 'last_ts' set but not used [-Wunused-but-set-variable]
[Warning] NanostackRfPhyAtmel.cpp@1102,11: unused variable 'orig_xah_ctrl_1' [-Wunused-variable]
[Warning] NanostackRfPhyAtmel.cpp@1106,11: unused variable 'orig_flags' [-Wunused-variable]
[Warning] NanostackRfPhyAtmel.cpp@1377,13: 'void rf_ack_wait_timer_stop()' defined but not used [-Wunused-function]
Compile [  3.9%]: SPIRIT_LinearFifo.c
Compile [  4.0%]: SPIRIT_Management.c
Compile [  4.2%]: SPIRIT_PktMbus.c
Compile [  4.3%]: SPIRIT_PktBasic.c
Compile [  4.4%]: SPIRIT_Types.c
Compile [  4.6%]: SPIRIT_Qi.c
Compile [  4.7%]: SimpleSpirit1.cpp
Compile [  4.9%]: SPIRIT_PktStack.c
Compile [  5.0%]: SPIRIT_Timer.c
Compile [  5.1%]: SPIRIT_PktCommon.c
Compile [  5.3%]: BufferedPrint.c
Compile [  5.4%]: MyBuffer.cpp
Compile [  5.5%]: radio_spi.cpp
Compile [  5.7%]: SPIRIT_Radio.c
Compile [  5.8%]: ATParser.cpp
Compile [  5.9%]: SPWFSA01.cpp
Compile [  6.1%]: BufferedSpi.cpp
Compile [  6.2%]: SPWFSA04.cpp
Compile [  6.3%]: ISM43362.cpp
Compile [  6.5%]: ISM43362Interface.cpp
Compile [  6.6%]: WizFi310.cpp
[Warning] WizFi310.cpp@302,68: format '%d' expects argument of type 'int*', but argument 6 has type 'uint32_t* {aka long unsigned int*}' [-Wformat=]
Compile [  6.7%]: mbed_tz_context.c
Compile [  6.9%]: SpwfSAInterface.cpp
Compile [  7.0%]: WizFi310Interface.cpp
Compile [  7.1%]: WncControllerK64F.cpp
Compile [  7.3%]: SPWFSAxx.cpp
Compile [  7.4%]: AnalogIn.cpp
Compile [  7.5%]: main.cpp
[Warning] MQTTmbed.h@22,28: comparison between signed and unsigned integer expressions [-Wsign-compare]
[Error] main.cpp@74,24: 'LED_RED' was not declared in this scope
[Error] main.cpp@75,26: 'LED_GREEN' was not declared in this scope
[Error] main.cpp@76,25: 'LED_BLUE' was not declared in this scope
[Warning] main.cpp@97,42: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
[Warning] InterruptIn.h@60,7: 'mbed::NonCopyable<T>::NonCopyable(const mbed::NonCopyable<T>&) [with T = mbed::InterruptIn]' is deprecated: Invalid copy construction of a NonCopyable resource. [-Wdeprecated-declarations]
[Warning] MQTTClient.h@582,9: unused variable 'len' [-Wunused-variable]
[Warning] MQTTClient.h@612,47: this statement may fall through [-Wimplicit-fallthrough=]
[ERROR] In file included from ./main.cpp:33:0:
./MQTT/MQTTmbed.h: In member function 'bool Countdown::expired()':
./MQTT/MQTTmbed.h:22:28: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         return t.read_ms() >= interval_end_ms;
                ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
./main.cpp: In function 'int main(int, char**)':
./main.cpp:74:24: error: 'LED_RED' was not declared in this scope
     DigitalOut led_red(LED_RED, LED_OFF);
                        ^~~~~~~
./main.cpp:74:24: note: suggested alternative: 'READ_REG'
     DigitalOut led_red(LED_RED, LED_OFF);
                        ^~~~~~~
                        READ_REG
./main.cpp:75:26: error: 'LED_GREEN' was not declared in this scope
     DigitalOut led_green(LED_GREEN, LED_OFF);
                          ^~~~~~~~~
./main.cpp:75:26: note: suggested alternative: 'LED_ON'
     DigitalOut led_green(LED_GREEN, LED_OFF);
                          ^~~~~~~~~
                          LED_ON
./main.cpp:76:25: error: 'LED_BLUE' was not declared in this scope
     DigitalOut led_blue(LED_BLUE, LED_OFF);
                         ^~~~~~~~
./main.cpp:76:25: note: suggested alternative: 'ENABLE'
     DigitalOut led_blue(LED_BLUE, LED_OFF);
                         ^~~~~~~~
                         ENABLE
./main.cpp:97:42: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
     ntp.set_server("time.google.com", 123);
                                          ^
In file included from ./mbed-os/drivers/UARTSerial.h:26:0,
                 from ./mbed-os/mbed.h:73,
                 from ./easy-connect/easy-connect.h:21,
                 from ./main.cpp:31:
./mbed-os/drivers/InterruptIn.h: In copy constructor 'mbed::InterruptIn::InterruptIn(const mbed::InterruptIn&)':
./mbed-os/drivers/InterruptIn.h:60:7: warning: 'mbed::NonCopyable<T>::NonCopyable(const mbed::NonCopyable<T>&) [with T = mbed::InterruptIn]' is deprecated: Invalid copy construction of a NonCopyable resource. [-Wdeprecated-declarations]
 class InterruptIn : private NonCopyable<InterruptIn> {
       ^~~~~~~~~~~
In file included from ./mbed-os/rtos/Thread.h:31:0,
                 from ./mbed-os/rtos/rtos.h:30,
                 from ./mbed-os/mbed.h:22,
                 from ./easy-connect/easy-connect.h:21,
                 from ./main.cpp:31:
./mbed-os/platform/NonCopyable.h:172:5: note: declared here
     NonCopyable(const NonCopyable &)
     ^~~~~~~~~~~
./main.cpp: In function 'int main(int, char**)':
./main.cpp:176:43: note: synthesized method 'mbed::InterruptIn::InterruptIn(const mbed::InterruptIn&)' first required here 
     InterruptIn btn1 = InterruptIn(BUTTON1);
                                           ^
In file included from ./main.cpp:34:0:
./MQTT/MQTTClient.h: In instantiation of 'int MQTT::Client<Network, Timer, MAX_MQTT_PACKET_SIZE, MAX_MESSAGE_HANDLERS>::cycle(Timer&) [with Network = MQTTNetwork; Timer = Countdown; int MAX_MQTT_PACKET_SIZE = 1024; int MAX_MESSAGE_HANDLERS = 5]':
./MQTT/MQTTClient.h:567:18:   required from 'int MQTT::Client<Network, Timer, MAX_MQTT_PACKET_SIZE, MAX_MESSAGE_HANDLERS>::yield(long unsigned int) [with Network = MQTTNetwork; Timer = Countdown; int MAX_MQTT_PACKET_SIZE = 1024; int MAX_MESSAGE_HANDLERS = 5]'
./main.cpp:188:33:   required from here
./MQTT/MQTTClient.h:582:9: warning: unused variable 'len' [-Wunused-variable]
     int len = 0,
         ^~~
./MQTT/MQTTClient.h: In member function 'int MQTT::Client<Network, Timer, MAX_MQTT_PACKET_SIZE, MAX_MESSAGE_HANDLERS>::cycle(Timer&) [with Network = MQTTNetwork; Timer = Countdown; int MAX_MQTT_PACKET_SIZE = 1024; int MAX_MESSAGE_HANDLERS = 5]':
./MQTT/MQTTClient.h:612:47: warning: this statement may fall through [-Wimplicit-fallthrough=]
                 deliverMessage(topicName, msg);
                                               ^
./MQTT/MQTTClient.h:660:9: note: here
         case PINGRESP:
         ^~~~

[mbed] ERROR: "/usr/bin/python" returned error.
       Code: 1
       Path: "~/Workspace/Mbed-to-IBM-Watson-IoT"
       Command: "/usr/bin/python -u ~/Workspace/my-mbed-projects/mbed-os/tools/make.py -t GCC_ARM -m nucleo_f767zi --source . --build ./BUILD/NUCLEO_F767ZI/GCC_ARM"
       Tip: You could retry the last command with "-v" flag for verbose output
~/Workspace/Mbed-to-IBM-Watson-IoT$ mbed ls
[mbed] Working path "~/Workspace/Mbed-to-IBM-Watson-IoT" (library)
[mbed] Program path "~/Workspace/Mbed-to-IBM-Watson-IoT"
Mbed-to-IBM-Watson-IoT (#7299cd94ecd8)
|- MQTT (#9cff7b6bbd01, tag: tip)
|  |- FP (#3c62ba1807ac, tag: tip)
|  `- MQTTPacket (#aedcaf7984d5, tag: tip)
|- TLSSocket (#723094a6ff84)
|- easy-connect (#48fe1f874292)
|  |- atmel-rf-driver (#ca9782e68f5f)
|  |- esp8266-driver (#5a0a2cba8c12)
|  |- mcr20a-rf-driver (#93661a696735)
|  |- stm-spirit1-rf-driver (#ce9e2f81f95f, tag: v1.0.1)
|  |- wifi-ism43362 (#e847364be044)
|  |- wifi-x-nucleo-idw01m1 (#376b457a8463)
|  |- wizfi310-driver (#e0f7b9355e7e)
|  `- wnc14a2a-driver (#90928b81747e)
|- mbed-os (#1e676f6eda27)
`- ntp-client (#72a3f00ca7c1)
@coisme
Copy link
Owner

coisme commented Dec 13, 2018

I tested this program on FRDM-K64F. You may need some changes to run on other targets.

FYI, if you can try AWS, the following program is maintained better than this program.
https://github.com/coisme/Mbed-to-AWS-IoT

@nuertey
Copy link
Contributor Author

nuertey commented Dec 14, 2018

Thanks @coisme . I have made some changes to the code to be able to run it on the NUCLEO_F767ZI. I also implemented your commented // TODO. Do you want me to push my branch upstream so that other people can also benefit from it?

I will try your AWS one next once I am done testing this one.

@coisme
Copy link
Owner

coisme commented Dec 18, 2018

@nuertey Thank you. If you can make a pull request, I'll merge your change with my program.

@nuertey
Copy link
Contributor Author

nuertey commented Dec 19, 2018

Thanks @coisme . Created the pull-request.

@nuertey
Copy link
Contributor Author

nuertey commented Dec 27, 2018

FYI @coisme , I tried your Mbed-to-AWS-IoT example. It works perfectly. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants