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

Problems with MIG for Python in new Make System #352

Open
zang3t5u opened this issue Sep 8, 2015 · 0 comments
Open

Problems with MIG for Python in new Make System #352

zang3t5u opened this issue Sep 8, 2015 · 0 comments

Comments

@zang3t5u
Copy link

zang3t5u commented Sep 8, 2015

Hi. Since I am not good at Java, I was trying to work with MIG and Python for Serial Interfacing with the XM1000 motes.

In the tinyos-release I had enabled support for XM1000 (steps here)

ISSUES

  • Recipes for new targets do not get executed everywhere
  • Attribute -fnesc-target does not work for nescc-mig

Description

  1. I have a header file SerialInteract.h that contains an nx_struct type message construct and defines the AM_RADIO_TYPE
  2. To create a usable Python Class File named TestSerialMsg.py with the class TestSerialMsg , I added the following lines to my Makefile:
TestSerialMsg.py: SerialInteract.h
    @mig python -target=$(TARGET) $(CFLAGS) -python-classname=TestSerialMsg SerialInteract.h test_serial_msg -o TestSerialMsg.py

Here, MIG perfectly created a working Python Class with Definitions. (I used it later by creating a Python file on my own and copying the content, so I know it was working)

But after trying several workarounds, I was facing some issues with Serial interfacing for Python in the tinyos-release.

  1. So, I went ahead and downloaded the tinyos-main, enabled support for XM1000 again after making the changes advised here: https://github.com/tinyos/tinyos-main/tree/master/support/make
  2. I got the Blink example working and running on my motes.
  3. When I went ahead with the Serial Interacing example with my edited makefile using mig... It didn't create the TestSerialMsg Python Class File.
  4. I replaced mig with nescc-mig -nescc=ncc as well, but no dice.

    Hints to the problem

  5. Finally after some scavenging, I found that the recipe for build_dir in $(TINYOS_ROOT_DIR)/support/make/Makerules (line 375) always worked.

When I added the command to the build_dir recipe:

@mig python -target=$(TARGET) $(CFLAGS) -python-classname=TestSerialMsg SerialInteract.h test_serial_msg -o TestSerialMsg.py

and did make xm1000 in my Project/src directory, it created the required Python Class file.

  • When I replaced mig with nescc-mig -nescc=ncc, it still worked. Though replacing -target with -fnesc-target shot an error parsing the SerialInteract.h headerfile

Conclusion

I have no idea why Make is not accepting Recipes and Dependencies in the rest of the Makefile or Makerules or Makerules.include

As we can see, it might not be an issue with mig at all. Since if I deleted the Python Class file, tried adding the following lines right after the build_dir recipe:

TestSerialMsg.py: SerialInteract.h FORCE
    @mig python -target=$(TARGET) $(CFLAGS) -python-classname=TestSerialMsg SerialInteract.h test_serial_msg -o TestSerialMsg.py

FORCE:

And used make xm1000, it built the project but it did not create the Python Class File.
Please help me out here.

Finally, if anyone has a better solution to get Serial, Python/C++ and TinyOS-release or TinyOS-main working together, please let me know

TLDR:

Recipes for targets not working everywhere in new Make system

Thanking you in advance

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

1 participant