Building with WICED SDK


#1

Hi,
I have been following the example of how to build offline with the WICED SDK. I have loaded WICED-SDK-3.3.1 and the updates from github for the SDK and merged the two together. I issued the make command and this is what I got back:

$ ./make rbl.rgb-RB_DUO
Making config file for first time
./tools/makefiles/wiced_config.mk:193: *** Unknown component: rbl/rgb. Stop.
make: *** No rule to make target build/rbl_rgb-RB_DUO/config.mk', needed bymain_app’. Stop.

Clearly make can’t find the files it needs. What am I missing?

Thanks


#2

Hi @dwsexton,

Your make command from the guide is out of date. The folder .\apps\rbl is renamed to .\apps\redbear. So the make command should be: ./make redbear.rgb-RB_DUO. We will update that guide as soon as possible. Sorry for misleading. :smile:

Regards,
guohui


#3

Thank you very much for your quick reply, I will try that when I can get back to it - hopefully over the weekend. I will post results in this thread.


#4

Hi guohui,
I noticed that you posted the patch for WICED-SDK-3.5.2
I cleared out the previous WICED SDK and started with the new one, here is what I found.

  1. I am using Linux 64 - Ubuntu, after merging the files and before attempting to compile you must change the files to be executable otherwise make does not work (chmod +x -R “your directory”)
  2. After you perform the make you get a couple of errors, here are some snippets without showing my directory structure:

error while loading shared libraries: : Redbear/DUOFirmware/WICED-SDK-3.5.2/tools/ARM_GNU/bin/Linux64/internal/libgmp.so.10: : error while loading shared librariesfile too short: file too short:

make[3]: *** [build/waf.bootloader-NoOS-RB_DUO/Modules/apps/waf/bootloader/bootloader.o] Error 1
make[3]: *** Waiting for unfinished jobs…
make[3]: *** [build/waf.bootloader-NoOS-RB_DUO/Modules/platforms/RB_DUO/platform.o] Error 1
make[3]: *** [build/waf.bootloader-NoOS-RB_DUO/Modules/libraries/filesystems/wicedfs/src/wicedfs.o] Error 1
make[3]: *** [build/waf.bootloader-NoOS-RB_DUO/Modules/./WICED/internal/wiced_core.o] Error 1
make[2]: *** [main_app] Error 2
make[1]: *** [bootloader] Error 2
make: *** [main_app] Error 2

I did not find the binaries in the binary directory as it appears the build failed.

There is one line in the file: libgmp.so.10
libgmp.so.10.1.2

the file libgmp.so.10.1.2 appears to be a binary.


#5

Have you tried building the same snip for an official platform under the WICED-SDK-3.5.2/platforms? So that you can figure out if it is a bug of the pristine SDK or of the patch for Duo.


#6

I get the same error when I try to compile the scan ap either in a pristine SDK or one with the RedBear patch so it seems this is not your issue. The issue is that when the WICED SDK is unzipped the link file libgmp.so.10 in not recognized as a link. Here is how I fixed the problem.

Navigate to <WICED-SDK-3.5.2>/tools/ARM_GNU/bin/Linux64/internal
rename the link file
mv libgmp.so.10 libgmp.so.10-bak
relink the file
ln libgmp.so.10.1.2 libgmp.so.10
Now I can go back up to the top of the SDK structure and execute the make command
./make redbear.rgb-RB_DUO
and it now works properly. Binarys are in place.
Hope this helps.


#7

Still running into issues. Although I was successful in compiling and loading and running the rgb application, when I cycled power or reset the board the application would not restart. It would only start after a loaded it and pressed reset once. I suspected I might have done something to the boot loader or boot sequence so I decided to start using the RBLink to reload the whole image.

The instructions for loading the unlock code worked OK, the drag and drop method of loading binarys through the STlink works well.
The command:
./make readbear.rgb-RB_DUO JTAG=RBLINK download run
did not work, but drag and dropping the binary in worked. After doing that the rgb ap ran and survived a power cycle.

I don’t have time right now to debug this further but it appears to be something in the openocd setup.


#8

How about building the entire binary, including bootloader (WICED’s, not the one for Particle) and DCT:
./make redbear.rgb-RB_DUO
It will generate a binary named redbear.rgb-RB_DUO.bin_MSD.bin under the path WICED-SDK-3.5.2\build\redbear.rgb-RB_DUO\binary. Then drag n drop this entire binary into the Duo using RBLink.

Besides, make sure that the patch you are applying to the SDK is up to date.


#9

Guohui,
Thanks again for getting back to me so fast! You guys are great.
I had pulled down the patch about 4 or 5 days ago but it seems it may have changed, not sure if I have the latest so I will pull it again and report back.


#10

@guohui,
You may want to update the command in the document that describes loading firmware with the RBLink, It still says: ./make rbl_rgb-RB_DUO JTAG=RBLINK download run

The command should be
./make redbear.rgb-RB_DUO JTAG=rblink download run

Note that rblink is not capitalized as it points to the file rblink.cfg.

After a lot of fumbling around I finally got all that to work


#11

Hi @dwsexton, I’m not sure if the upper case matters since I used to always use RBLINK in the comand. Maybe it is OS related – I’m using the Windows. I’ll have it a try on Linux and finally post the result here, as well as modify that document if needed.

Thank you so much for figuring it out!


#12

@guohui, Linux is very case sensitive. BTW, I also have GDB working with openocd for debugging. I am now working on the Eclipse setup. After that I can actually start writing some code.


#13

Glad to hear that! I’ve never tried the GDB working with OpenOCD. Setting up the Eclipse will definitely help a lot on developing application. :heart_eyes: Perhaps you can help the guys suffering the debugging setup in this thread:

You rock! :thumbsup:


#14

@dwsexton, I did test the make command on Linux 64. You are totally right that using the JTAG=RBLINK on Linux will fail to download applications to Duo using OpenOCD. I have changed the rblink.cfg to RBLINK.cfg so that the make variable JTAG=RBLINK will work in common on different OS system, instead of modifying that document by adding redundant description.

Thank you again for catching out the fatal issue. :wink:


#15

I will jump over there and try to help out. I just finished getting the whole thing working Eclipse, I can now build, download and debug all within Eclipse. There is just one last thing I need to figure and that is how to pass compiler directives through the make chain, the WICED make chain is extremely complex. I recently did a writeup for the guys over at Particle on how to set the Photon up with Eclipse, will be glad to do the same for you.


#16

Hello folks!

Thanks a lot for all the work you’ve done and shared with the community. I am also planning to work with the WICED SDK. I am sure that this thread will help me a lot.


#17

I have WICED working within Eclipse now, with Openocd & gdb debugging. However I am having a problem getting Eclipse’s indexer to work properly so I am engaging the Eclipse community to help with that. Once I figure that out I will be able to post a complete solution.


#18

great! looking forward to hearing from you soon. Please let me know if there is anything to do with the documentation side, like figures, or proofreading or anything that would help you


#19

Thank you for your offer to help, when I have something to post and you would like to read it and comment that would be great.


#20

I am attaching a link to the notes I made which should serve as a guide to someone who wants the full blown setup with Eclipse, WICED, Openocd, and gdb. I can now edit source code, make builds, download and run and also do full symbolic debugging with the rblink and the DUO. It’s pretty cool, all I have done so far is some hello world stuff, but now it’s time to start coding.

https://drive.google.com/file/d/0B5D3lsp-yArIUm5fRWlyQ2JOak0/view?usp=sharing