tcl loader programs and UART

193 views
Skip to first unread message

Salman Sheikh

unread,
Jun 27, 2015, 7:27:42 PM6/27/15
to discuss_o...@googlegroups.com
If I am using the UART for connecting to the OpenMSP via the tcl loader program, then how can i do stdout from my program? Do I need another UART for that? Also, is there an alternative to the tcl loader programs? 

Salman Sheikh

unread,
Jul 1, 2015, 12:30:20 PM7/1/15
to discuss_o...@googlegroups.com
I figured it out...for some reason, the tcl script fails to find the UART..so I replaced the line for finding and configuring the UART (never written a tcl script nor no how to :) with these hard coded values. .

set omsp_conf(device)     /dev/ttyS23
set omsp_conf(baudrate)   115200

And after installing X for cygwin, I got the debugger finally working!!! Woo hoo!!! But one thing that seems to fail is the loading of an elf file using the browse and load elf file. But I got that fixed too.  When I let it it populate the path, it has /cygdrive/c/.etc but I went in and replaced the first part of /cygdrive/c to c:\ and kept all the other / slashes in the rest of the path, it worked !!




On Saturday, June 27, 2015 at 7:27:42 PM UTC-4, Salman Sheikh wrote:
If I am using the UART for connecting to the OpenMSP via the tcl loader program, then how can i do stdout from my program? Do I need another UART for that? Also, is there an alternative to the tcl loader programs? 

Olivier Girard

unread,
Jul 3, 2015, 3:53:43 PM7/3/15
to discuss_o...@googlegroups.com, salman...@gmail.com
Hi Salman,

great news :-)
I have to admit that I never tried the tools under Cygwin... only directly Windows or Linux. But it is good to know that it works there as well.

Cheers,
Oliv'

Salman Sheikh

unread,
Jul 3, 2015, 5:02:31 PM7/3/15
to discuss_o...@googlegroups.com

How under Windows? Just cmd line...if that was all my headaches, I should stick to that horrible cmd line of Windows...maybe time to try in linux. What distribution do you use? Some eda tools only play well with Redhat and every other, the company says 'your on your own'..

--
You received this message because you are subscribed to a topic in the Google Groups "openMSP430" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/discuss_openmsp430/VwMFhbSIEV4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to discuss_openmsp...@googlegroups.com.
To post to this group, send email to discuss_o...@googlegroups.com.
Visit this group at http://groups.google.com/group/discuss_openmsp430.
For more options, visit https://groups.google.com/d/optout.

Salman Sheikh

unread,
Jul 3, 2015, 5:05:31 PM7/3/15
to discuss_o...@googlegroups.com

Now I need spi and i2c? Do I have to add them from opencores or has someone done that already? Also, we are looking at adding CAN bus at sometimes because i2c isn't very robust and for spaceflight, people has issues with it on previous cubesats.

Olivier Girard

unread,
Jul 4, 2015, 4:37:56 PM7/4/15
to discuss_o...@googlegroups.com, salman...@gmail.com
For the openmsp430-loader you would have to use the command line. However, for the minidebug and GDB-proxy tools you just need to double click on the tcl file.

Regarding development, I use openSuse since ages without any issue.
But if you want to use professional vendor tools, it is true that most of them are only certified for a few distributions and will only give you some support if you use these (usually RedHat is always supported).

However, it doesn't meant that their tools won't work on other linux distributions :-P


Oliv'

On Friday, July 3, 2015 at 11:02:31 PM UTC+2, Salman Sheikh wrote:

How under Windows? Just cmd line...if that was all my headaches, I should stick to that horrible cmd line of Windows...maybe time to try in linux. What distribution do you use? Some eda tools only play well with Redhat and every other, the company says 'your on your own'..

On Jul 3, 2015 3:53 PM, "Olivier Girard" <olgi...@gmail.com> wrote:
Hi Salman,

great news :-)
I have to admit that I never tried the tools under Cygwin... only directly Windows or Linux. But it is good to know that it works there as well.

Cheers,
Oliv'

On Wednesday, July 1, 2015 at 6:30:20 PM UTC+2, Salman Sheikh wrote:
I figured it out...for some reason, the tcl script fails to find the UART..so I replaced the line for finding and configuring the UART (never written a tcl script nor no how to :) with these hard coded values. .

set omsp_conf(device)     /dev/ttyS23
set omsp_conf(baudrate)   115200

And after installing X for cygwin, I got the debugger finally working!!! Woo hoo!!! But one thing that seems to fail is the loading of an elf file using the browse and load elf file. But I got that fixed too.  When I let it it populate the path, it has /cygdrive/c/.etc but I went in and replaced the first part of /cygdrive/c to c:\ and kept all the other / slashes in the rest of the path, it worked !!




On Saturday, June 27, 2015 at 7:27:42 PM UTC-4, Salman Sheikh wrote:
If I am using the UART for connecting to the OpenMSP via the tcl loader program, then how can i do stdout from my program? Do I need another UART for that? Also, is there an alternative to the tcl loader programs? 

--
You received this message because you are subscribed to a topic in the Google Groups "openMSP430" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/discuss_openmsp430/VwMFhbSIEV4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to discuss_openmsp430+unsub...@googlegroups.com.
To post to this group, send email to discuss_openmsp430@googlegroups.com.

Olivier Girard

unread,
Jul 4, 2015, 4:42:34 PM7/4/15
to discuss_o...@googlegroups.com, salman...@gmail.com

Regarding the place we you could find these I'm afraid I can't help you much :-/
SPI is trivial to implement so here you could probably design it yourself easily. Depending on what you want to support I2C can be much complex to design so it is probably not a bad idea to look around.

I agree that CAN is much more robust, but I don't know if there is any opensource project out there showing a robust implementation.

Cheers,
Oliv'
To unsubscribe from this group and all its topics, send an email to discuss_openmsp430+unsub...@googlegroups.com.
To post to this group, send email to discuss_openmsp430@googlegroups.com.

Salman Sheikh

unread,
Jul 8, 2015, 2:34:27 AM7/8/15
to discuss_o...@googlegroups.com
What about a second UART? Does the openmsp430 support using stdio (printf and gets functions)?

Olivier Girard

unread,
Jul 8, 2015, 2:36:46 PM7/8/15
to discuss_o...@googlegroups.com, salman...@gmail.com
Yes, if you add a UART peripheral you can definitely use stdio.
If you have a look at the FPGA examples you can also find a uart peripheral and some example C code.

Cheers,
Oliv'

Salman Sheikh

unread,
Jul 9, 2015, 2:42:03 PM7/9/15
to discuss_o...@googlegroups.com, salman...@gmail.com

Okay there is a 2nd uart in my top level file and its connected and programmed. I copied the hw_uart s/w project from the xilinx_avnet_lx9 board into my nano-de0 directory and got it compiled, but for some reason, I don't see anything on the output of the 2nd uart nor any of the leds flashing..but the memled_test (modified by me to display a binary led count works fine)...is there something in one of those files that might be specific to the LX9...my UART is at 0x80 which it looks like the software program expects.

Salman Sheikh

unread,
Jul 9, 2015, 2:44:35 PM7/9/15
to discuss_o...@googlegroups.com
And I don't think it could be the printf being too large could it? I get no errors when trying to load it from the cmd line.  I have the default of a 4K pmem and 1K dmem on my system.

Salman

Olivier Girard

unread,
Jul 9, 2015, 3:52:40 PM7/9/15
to discuss_o...@googlegroups.com
Hi Salman,

Well, the best would be to simulate your program to see if the issue comes from the hardware or software... but this would require you to create a testbench for your project.

A second option would be to use the minidebuger or GDB to debug the software... however it might not be super helpful to debug hardware issues.

Oliv'


--
You received this message because you are subscribed to the Google Groups "openMSP430" group.
To unsubscribe from this group and stop receiving emails from it, send an email to discuss_openmsp...@googlegroups.com.
To post to this group, send email to discuss_o...@googlegroups.com.

Salman Sheikh

unread,
Jul 9, 2015, 5:20:19 PM7/9/15
to discuss_o...@googlegroups.com
Yes, its weird..when I ran it through the debugger and stepped it,  I saw the leds flash on (which is part of the program) and then it goes to the putchar (block of code in assembly with that header) and then when I turned it back to run, it seemed to be stuck at a certain instruction...I will mess around with the debug again..but the debugger when one loads elf only shows assembly line code, right, no way to see it in C text file mode stepping while running the debugger is there?



--
You received this message because you are subscribed to a topic in the Google Groups "openMSP430" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/discuss_openmsp430/VwMFhbSIEV4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to discuss_openmsp...@googlegroups.com.

To post to this group, send email to discuss_o...@googlegroups.com.
Visit this group at http://groups.google.com/group/discuss_openmsp430.
For more options, visit https://groups.google.com/d/optout.



--
Even a Smile is charity :)
- Prophet Muhammad


Salman Sheikh

unread,
Jul 10, 2015, 11:53:23 AM7/10/15
to discuss_o...@googlegroups.com
It seems that when I run the debugger and also turned on a program called device monitor (free windows serial port monitor)..I have monitors on COM24 (my debug port) and COM25 (my hw uart), but when I step through the program, I see only activity on the COM24 port..so it seems like its on the wrong port. What is the base address of the debug uart in the hw space?

Salman

xiao...@gmail.com

unread,
Jul 11, 2015, 10:55:56 AM7/11/15
to discuss_o...@googlegroups.com
Hello.Do you have the SPI module for openMSP430? I need this module and there are some bugs in the SPI module i am writting.Thank you in advance!

Salman Sheikh

unread,
Jul 11, 2015, 11:16:08 AM7/11/15
to discuss_o...@googlegroups.com
No..I have added an I2C and SPI modules to other CPUs using opencores but not this one...I will attempt to port and attach one to this..because we need both interfaces for our projects and needs...

--
You received this message because you are subscribed to a topic in the Google Groups "openMSP430" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/discuss_openmsp430/VwMFhbSIEV4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to discuss_openmsp...@googlegroups.com.
To post to this group, send email to discuss_o...@googlegroups.com.
Visit this group at http://groups.google.com/group/discuss_openmsp430.
For more options, visit https://groups.google.com/d/optout.

Olivier Girard

unread,
Jul 15, 2015, 5:12:28 PM7/15/15
to discuss_o...@googlegroups.com, salman...@gmail.com
Hi Salman,

it is perfectly normal to see some activity on the debug port when you step through the program... the communication you see is your PC telling the oMSP to step to the next instruction.
The only weird thing here is that you see nothing on the HW uart port when you step over the instructions writing to the HW UART registers.

Cheers,
Oliv'

PS: Another point that might be worth to double check is the result of the compiler. If you use a GCC version from Redhat/TI, I noticed a lot of issues with the startup procedure and code density... so it could be that some variables are not properly initialized or something (I have to admit that I didn't check their latest version so they might have fixed their issues).

Salman Sheikh

unread,
Jul 15, 2015, 5:41:03 PM7/15/15
to discuss_o...@googlegroups.com
I don't think its the gcc version..I will look at it more closely and possibly try simulating it in vhdl...

Salman


$ msp430-gcc.exe -v
Using built-in specs.
Reading specs from c:/cygwin/opt/mspgcc/bin/../lib/gcc/msp430/4.6.3/../../../../msp430/lib/msp430mcu.spec
COLLECT_GCC=C:\cygwin\opt\mspgcc\bin\msp430-gcc.exe
COLLECT_LTO_WRAPPER=c:/cygwin/opt/mspgcc/bin/../libexec/gcc/msp430/4.6.3/lto-wrapper.exe
Target: msp430
Configured with: ../../gcc-4.6.3/configure --target=msp430 --enable-languages=c,c++ --prefix=/usr/local/msp430 --disable-nls --host=i686-pc-mingw32
Thread model: single
gcc version 4.6.3 20120301 (mspgcc LTS 20120406 patched to 20120502) (GCC)


--
You received this message because you are subscribed to a topic in the Google Groups "openMSP430" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/discuss_openmsp430/VwMFhbSIEV4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to discuss_openmsp...@googlegroups.com.
To post to this group, send email to discuss_o...@googlegroups.com.
Visit this group at http://groups.google.com/group/discuss_openmsp430.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages