msp430 flasher in Contiki (exp5438 uploading) - upload

I'm trying to upload the blink.c file in Contiki on a exp5438 board. I'm running Instant Contiki 2.6 on my MacBook inside VirtualBox.
When I try to do the upload to the board, it gives me this error for the msp430 flasher! Is there a work around which can help me run the blink program on the board? I'm really pulling my hair out on this. :D
msp430flasher -n msp430x5438a -e ERASE_MAIN -w blink.hex -v -z [VCC]
/bin/sh: 1: msp430flasher: not found
make: *** [test-blink.upload] Error 127
Help appreciated!

You need to install the MSP430Flasher tool from TI (available for win32 and linux), and also of course a MSP430 FET progammer: http://processors.wiki.ti.com/index.php/MSP430_Flasher_-_Command_Line_Programmer
You might need to edit also the platform/exp5438/Makefile.exp5438 file and change the msp430flasher commands at the bottom for MSP430Flasher (mind the case-sensitiveness!).

Related

How do I resolve this OSError: [Erno 48] Address already in use error while working with the byob botnet on GitHub?

(I have seen other solutions to "Errno 48" issues on StackOverflow, but none have been successful yet.)
I am trying to develop a botnet using byob on github here: https://github.com/malwaredllc/byob
I am encountering a address in use error every time I run the command sudo ./startup.sh. It returns OSError: [Errno 48] Address already in use.
However when I attempt to use the ps -fA | grep python and kill the associated 502 18126 16973 0 9:16PM ttys000 0:00.00 grep python by using kill -9 181216, I get this error: kill: kill 18126 failed: no such process.
Does anyone have any idea what to do?
I am using a "MacOS M1Pro Chip OS V12.0.1 Monterey". Also the program byob is trying to run on port 5000 of IPv4 127.0.0.1 (this is a generic IP not specifically mine). http://127.0.0.1/5000.
In case you try to duplicate the problem you need to install docker.io or the docker desktop app depending on os then navigate to cd <outer-dir>/byob-master/web-gui then execute sudo ./startup.sh. The code will not work without access to docker, and the program needs to be ran with admin perms using the prefix sudo. The actual downloads take a while and it will prompt you to restart once. Then when you run it again, I encounter this problem...
Please let me know if someone was able to fix this. Thanks!

How to burn a program on an EXP5438 platform device in Contiki

I was trying to upload the hello-world program on a Texas Instruments EXP5438 experimenter board using Instant Contiki 2.7 in VMware (Ubuntu12.04). The compilation is done but when I try to upload I get this error
msp430flasher -n msp430x5438a -e ERASE_MAIN -w hello-world.hex -v -z [VCC] /bin/sh: 1: msp430flasher: not found
Then I installed msp430flasher from Texas instruments. But when I try to run it i get another error:
can not load msp430lib.so..no such file or directory
Although I have the missing file in the same folder. I'm stuck with this.

Can not write to '/dev/tty' when build Docker images

I'm building docker images from Dockerfile and when I run a script(CUDA installation script) which has
echo XXX > /dev/tty
in it, then an error "/dev/tty: No such device or address" comes up and the build failed.
I've tried --silent flag but it seems do no help.
My base image is Cent OS 7.
Is there anyway to fix or work around this?
I've fixed this problem: it turns out I didn't install command tar & perl before hand.
And the script wants to write error messages to /dev/tty.
The error information led me to the wrong way to solve this issue.
Thanks.

Is TelosB mote compatible with Contiki-OS?

I found exp5438 and z1 motes, which have TI MSP430x as a MCU, in the Contiki code tree, and we know that TI MSP430 is the TelosB mote's microcontroller.
I would like to know if TelosB motes are compatible with Contiki ?
The telosB mote is compatible with Contiki OS, in fact I am using them with Contiki. To program them, in case you are using Instant Contiki, you will need to install the GCC for the MSP430 micro controller. You can use the next command:
sudo apt-get install gcc-msp430
On the other hand, I think to solve the problem of your answer I think you just need to be root. So try the next:
sudo -s
make TARGET=sky hello-world.upload
I hope that help you out.
Cheers!
currently I am using telosb to run contiki applications. I followed the official site tutorial and apparently if u do make TARGET=sky it compiles the source files. However, doing make TARGET=sky hello-world.upload does not work. Shows
make sky-reset sky-upload
make[1]: Entering directory `/home/user/contiki-2.6/examples/hello-world'
make -k -j 1 sky-reset-sequence
make[2]: Entering directory `/home/user/contiki-2.6/examples/hello-world'
Done
make[2]: Leaving directory `/home/user/contiki-2.6/examples/hello-world'
make -j 1 sky-upload-sequence
make[2]: Entering directory `/home/user/contiki-2.6/examples/hello-world'
Done
make[2]: Leaving directory `/home/user/contiki-2.6/examples/hello-world'
make[1]: Leaving directory `/home/user/contiki-2.6/examples/hello-world'
rm hello-world.ihex
which according to the official site tutorial means that the board is not connected. I am very certain it is connected. Also, make login never shows anything for me since the previous command didnt work.
Eventually, a friend of mine discovered a way to flash contiki applications into telosb. However, you need TinyOS development environment in your Instant Contiki. You can find information on setting up TinyOS environment in Ubuntu on www.eetutorials.com.
This doesn't seem like a proper way of doing it but well so far it works for me when running simple applications
Step 1:
Compile your applications by doing:
make TARGET=sky application-name
Step 2:
msp430-objcopy application-name.sky -O ihex application-name.ihex
sudo tos-bsl --telosb -c /dev/ttyUSB0 -r -e -I -p application-name.ihex
However, make login still doesn't show anything hence I have been seeing my printf outputs
via Serial Port Terminal application which need to be installed. My guess is that contiki supports sky but not really for telosb? I am no expert and I can't tell the difference between the 2 boards. However, hope this information help and hope a contiki expert can further clarify on this.
Cheers
telosb mote is the same as a tmote sky or sky. The name is all the same platform.
I dont know from which vendor you have the board, but they have to work.
I am also using sky motes with contiki and i had no complications from the beginning.
Try to use the code in the following site: Unreadable output results when typing "make login"
This will print a message every second.
PS: Try to update your question if you found more information, dont add an answer since it confuses people.

Practicing buffer overflow attack in Ubuntu

I am trying to learn to use buffer overflow attack in Ubuntu. Unfortunately, I cannot turn off Address Space Layout Randomization (ASLR) feature in this OS, which is turned on by default. I have tried some work around found in some fedora books:
echo "0" > /proc/sys/kernel/randomize_va_space
but for some reason the protection's still there. Please give me some suggestions. Thanks.
[edit]Actually the above command was not successful, it said "Permission Denied", even with sudo. How can I fix that?
[adding] I kept on getting segmetation fault error when it shows an address in stack. Is it related to non-executable stack in ubuntu :(?
You will need root perms before attempting it, and if I'm not mistaken, to restart once you've done it.
sudo -i
echo "0" > /proc/sys/kernel/randomize_va_space
found it myself
you have to compile this way:
gcc -fno-stack-protector -z execstack -o OUTPUT INPUT.c
to echo to files with root acces using sudo you can use the following code:
echo "0" | sudo tee /proc/sys/kernel/randomize_va_space
gcc compile with -fno-stack-protector
You can turn off ASLR for a particular process by launching with setarch
For 32 bit programs:
setarch i386 -R yourProgram
For 64 bit programs:
setarch x86_64 -R yourProgram

Resources