-
Notifications
You must be signed in to change notification settings - Fork 521
Description
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 fornescc-mig
Description
- I have a header file SerialInteract.h that contains an
nx_struct
type message construct and defines theAM_RADIO_TYPE
- To create a usable Python Class File named
TestSerialMsg.py
with the classTestSerialMsg
, 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.
- 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
- I got the Blink example working and running on my motes.
- When I went ahead with the Serial Interacing example with my edited makefile using mig... It didn't create the TestSerialMsg Python Class File.
- I replaced
mig
withnescc-mig -nescc=ncc
as well, but no dice.Hints to the problem
- 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
withnescc-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