EmbeddedRelated.com
Forums
The 2026 Embedded Online Conference

Mecrisp on the TI Stellaris Launchpad

Started by rickman April 2, 2015
I am trying out Mecrisp on a TI Stellaris Launchpad I have had for 
sometime.  This is a program to be loaded onto the Launchpad over the 
debug USB port using the on board debugger chip.  The Mecrisp 
instructions are shown here...

;------------------------------------------------------------------------------
Hardware and configuration for LM4F120 and TM4C123:
;------------------------------------------------------------------------------
   Connect your cable to the Debug-USB-Port,
   set "PWR SELECT" switch to DEBUG and
   close VDD jumper.

   Flashing is possible with lm4flash:
   https://github.com/utzig/lm4tools

   On startup, this runs with internal PIOSC at 16 MHz,
   which is specified +-3% over whole temperature range.

I can figure out the switch part and I found the debug port.  But I am 
stumped with the lm4flash tool.  I managed to download the directory 
from github, but I don't see an executable, only sources.  Clearly I am 
expected to be able to compile C code on the PC, but it has likely been 
a decade since I've done that.  I don't even have a C compiler on this 
machine.

I guess the idea is that anyone wanting to use this flashing tool would 
be doing C development and so would be familiar with how to compile the 
sources.  I really don't want to have to figure out where to get C tools 
for the PC and how to get them running.  Heck, it might be easier in the 
long run to transcribe the program into Forth and run it that way.  800 
line of source counting white space, but few comments... oh, the code 
uses libusb-1.0 for USB.  I don't know how to deal with that.  Crap...

-- 

Rick
On Thursday, April 2, 2015 at 6:08:24 PM UTC-7, rickman wrote:
> I am trying out Mecrisp on a TI Stellaris Launchpad I have had for > sometime. This is a program to be loaded onto the Launchpad over the > debug USB port using the on board debugger chip. The Mecrisp > instructions are shown here... > > ;------------------------------------------------------------------------------ > Hardware and configuration for LM4F120 and TM4C123: > ;------------------------------------------------------------------------------ > Connect your cable to the Debug-USB-Port, > set "PWR SELECT" switch to DEBUG and > close VDD jumper. > > Flashing is possible with lm4flash: > https://github.com/utzig/lm4tools > > On startup, this runs with internal PIOSC at 16 MHz, > which is specified +-3% over whole temperature range. > > I can figure out the switch part and I found the debug port. But I am > stumped with the lm4flash tool. I managed to download the directory > from github, but I don't see an executable, only sources. Clearly I am > expected to be able to compile C code on the PC, but it has likely been > a decade since I've done that. I don't even have a C compiler on this > machine. > > I guess the idea is that anyone wanting to use this flashing tool would > be doing C development and so would be familiar with how to compile the > sources. I really don't want to have to figure out where to get C tools > for the PC and how to get them running. Heck, it might be easier in the > long run to transcribe the program into Forth and run it that way. 800 > line of source counting white space, but few comments... oh, the code > uses libusb-1.0 for USB. I don't know how to deal with that. Crap... > > -- > > Rick
Should be very easy to take care of, unless you are hoping to do this on Windows. Assuming you are on Linux and depending which distro you use, either apt-get or yum install libusb-dev and type make from the lm4flash directory off of the github. That should pretty much be all!
On Monday, April 13, 2015 at 4:18:08 PM UTC-7, sbat...@gmail.com wrote:
> On Thursday, April 2, 2015 at 6:08:24 PM UTC-7, rickman wrote: > > I am trying out Mecrisp on a TI Stellaris Launchpad I have had for > > sometime. This is a program to be loaded onto the Launchpad over the > > debug USB port using the on board debugger chip. The Mecrisp > > instructions are shown here... > > > > ;------------------------------------------------------------------------------ > > Hardware and configuration for LM4F120 and TM4C123: > > ;------------------------------------------------------------------------------ > > Connect your cable to the Debug-USB-Port, > > set "PWR SELECT" switch to DEBUG and > > close VDD jumper. > > > > Flashing is possible with lm4flash: > > https://github.com/utzig/lm4tools > > > > On startup, this runs with internal PIOSC at 16 MHz, > > which is specified +-3% over whole temperature range. > > > > I can figure out the switch part and I found the debug port. But I am > > stumped with the lm4flash tool. I managed to download the directory > > from github, but I don't see an executable, only sources. Clearly I am > > expected to be able to compile C code on the PC, but it has likely been > > a decade since I've done that. I don't even have a C compiler on this > > machine. > > > > I guess the idea is that anyone wanting to use this flashing tool would > > be doing C development and so would be familiar with how to compile the > > sources. I really don't want to have to figure out where to get C tools > > for the PC and how to get them running. Heck, it might be easier in the > > long run to transcribe the program into Forth and run it that way. 800 > > line of source counting white space, but few comments... oh, the code > > uses libusb-1.0 for USB. I don't know how to deal with that. Crap... > > > > -- > > > > Rick > > Should be very easy to take care of, unless you are hoping to do this on Windows. > Assuming you are on Linux and depending which distro you use, either apt-get or yum install libusb-dev and type make from the lm4flash directory off of the github. That should pretty much be all!
OK I gave it a quick try on my Ubuntu vm out of curiosity. I already had the libusb-dev package installed, but the makefile is actually set up to depend on the 1.0 specific version of that package. Turns out that's fixed by just doing "sudo apt-get install libusb-1.0-0-dev" which took just a few seconds to do, then typing "make" worked out of the box with the makefile from that repository. Hope that helps! I highly doubt it would work under Windows but I imagine you can use another flasher utility (with an exe out of the box) in place of lm4flash in that case. Steve
On Monday, April 13, 2015 at 4:25:56 PM UTC-7, sbat...@gmail.com wrote:
> On Monday, April 13, 2015 at 4:18:08 PM UTC-7, sbat...@gmail.com wrote: > > On Thursday, April 2, 2015 at 6:08:24 PM UTC-7, rickman wrote: > > > I am trying out Mecrisp on a TI Stellaris Launchpad I have had for > > > sometime. This is a program to be loaded onto the Launchpad over the > > > debug USB port using the on board debugger chip. The Mecrisp > > > instructions are shown here... > > > > > > ;------------------------------------------------------------------------------ > > > Hardware and configuration for LM4F120 and TM4C123: > > > ;------------------------------------------------------------------------------ > > > Connect your cable to the Debug-USB-Port, > > > set "PWR SELECT" switch to DEBUG and > > > close VDD jumper. > > > > > > Flashing is possible with lm4flash: > > > https://github.com/utzig/lm4tools > > > > > > On startup, this runs with internal PIOSC at 16 MHz, > > > which is specified +-3% over whole temperature range. > > > > > > I can figure out the switch part and I found the debug port. But I am > > > stumped with the lm4flash tool. I managed to download the directory > > > from github, but I don't see an executable, only sources. Clearly I am > > > expected to be able to compile C code on the PC, but it has likely been > > > a decade since I've done that. I don't even have a C compiler on this > > > machine. > > > > > > I guess the idea is that anyone wanting to use this flashing tool would > > > be doing C development and so would be familiar with how to compile the > > > sources. I really don't want to have to figure out where to get C tools > > > for the PC and how to get them running. Heck, it might be easier in the > > > long run to transcribe the program into Forth and run it that way. 800 > > > line of source counting white space, but few comments... oh, the code > > > uses libusb-1.0 for USB. I don't know how to deal with that. Crap... > > > > > > -- > > > > > > Rick > >
Last reply to this thread.. if you're on Windows it looks like TI provides what you need here: http://www.ti.com/tool/LMFLASHPROGRAMMER I'd be more than willing to bet it can accomplish the same task, though it's TI proprietary rather than open source for Linux. Whoever wrote up the instructions for that Mecrisp just probably hasn't tried it out or thought about .
On 4/13/2015 7:33 PM, sbattazzo@gmail.com wrote:
> On Monday, April 13, 2015 at 4:25:56 PM UTC-7, sbat...@gmail.com wrote: >> On Monday, April 13, 2015 at 4:18:08 PM UTC-7, sbat...@gmail.com wrote: >>> On Thursday, April 2, 2015 at 6:08:24 PM UTC-7, rickman wrote: >>>> I am trying out Mecrisp on a TI Stellaris Launchpad I have had for >>>> sometime. This is a program to be loaded onto the Launchpad over the >>>> debug USB port using the on board debugger chip. The Mecrisp >>>> instructions are shown here... >>>> >>>> ;------------------------------------------------------------------------------ >>>> Hardware and configuration for LM4F120 and TM4C123: >>>> ;------------------------------------------------------------------------------ >>>> Connect your cable to the Debug-USB-Port, >>>> set "PWR SELECT" switch to DEBUG and >>>> close VDD jumper. >>>> >>>> Flashing is possible with lm4flash: >>>> https://github.com/utzig/lm4tools >>>> >>>> On startup, this runs with internal PIOSC at 16 MHz, >>>> which is specified +-3% over whole temperature range. >>>> >>>> I can figure out the switch part and I found the debug port. But I am >>>> stumped with the lm4flash tool. I managed to download the directory >>>> from github, but I don't see an executable, only sources. Clearly I am >>>> expected to be able to compile C code on the PC, but it has likely been >>>> a decade since I've done that. I don't even have a C compiler on this >>>> machine. >>>> >>>> I guess the idea is that anyone wanting to use this flashing tool would >>>> be doing C development and so would be familiar with how to compile the >>>> sources. I really don't want to have to figure out where to get C tools >>>> for the PC and how to get them running. Heck, it might be easier in the >>>> long run to transcribe the program into Forth and run it that way. 800 >>>> line of source counting white space, but few comments... oh, the code >>>> uses libusb-1.0 for USB. I don't know how to deal with that. Crap... >>>> >>>> -- >>>> >>>> Rick >>> > > Last reply to this thread.. if you're on Windows it looks like TI provides what you need here: http://www.ti.com/tool/LMFLASHPROGRAMMER > > I'd be more than willing to bet it can accomplish the same task, though it's TI proprietary rather than open source for Linux. Whoever wrote up the instructions for that Mecrisp just probably hasn't tried it out or thought about .
Yes, I'm on windows and have downloaded the TI tool, but not yet tried to use it. I would like to run this on a raspberry pi as it is much smaller and suits my lab use better in some respects. I will try installing lm4flash the way you describe. There is a bit of irony in that to use a Forth tool I need to understand how to compile a C program. lol I am rather weary of learning all the ins and outs of complex tool, never knowing for sure what they are doing or if I am using them correctly. That's the main motivator for using Forth on this target. I'm trying to implement a rather simple function and would like to have a simple tool. Even once I get this installed on the host machine and I get Mecrisp installed on the target, I will still need to learn the details of using Mecrisp. At least then I am learning something I expect to use many times in the future. I plan to help with the documentation of Mecrisp. I think that is the big weakness of most open source tools, rather limited docs. -- Rick
On 4/13/2015 9:45 PM, rickman wrote:
> On 4/13/2015 7:33 PM, sbattazzo@gmail.com wrote: >> On Monday, April 13, 2015 at 4:25:56 PM UTC-7, sbat...@gmail.com wrote: >>> On Monday, April 13, 2015 at 4:18:08 PM UTC-7, sbat...@gmail.com wrote: >>>> On Thursday, April 2, 2015 at 6:08:24 PM UTC-7, rickman wrote: >>>>> I am trying out Mecrisp on a TI Stellaris Launchpad I have had for >>>>> sometime. This is a program to be loaded onto the Launchpad over the >>>>> debug USB port using the on board debugger chip. The Mecrisp >>>>> instructions are shown here... >>>>> >>>>> ;------------------------------------------------------------------------------ >>>>> >>>>> Hardware and configuration for LM4F120 and TM4C123: >>>>> ;------------------------------------------------------------------------------ >>>>> >>>>> Connect your cable to the Debug-USB-Port, >>>>> set "PWR SELECT" switch to DEBUG and >>>>> close VDD jumper. >>>>> >>>>> Flashing is possible with lm4flash: >>>>> https://github.com/utzig/lm4tools >>>>> >>>>> On startup, this runs with internal PIOSC at 16 MHz, >>>>> which is specified +-3% over whole temperature range. >>>>> >>>>> I can figure out the switch part and I found the debug port. But I am >>>>> stumped with the lm4flash tool. I managed to download the directory >>>>> from github, but I don't see an executable, only sources. Clearly >>>>> I am >>>>> expected to be able to compile C code on the PC, but it has likely >>>>> been >>>>> a decade since I've done that. I don't even have a C compiler on this >>>>> machine. >>>>> >>>>> I guess the idea is that anyone wanting to use this flashing tool >>>>> would >>>>> be doing C development and so would be familiar with how to compile >>>>> the >>>>> sources. I really don't want to have to figure out where to get C >>>>> tools >>>>> for the PC and how to get them running. Heck, it might be easier >>>>> in the >>>>> long run to transcribe the program into Forth and run it that way. >>>>> 800 >>>>> line of source counting white space, but few comments... oh, the code >>>>> uses libusb-1.0 for USB. I don't know how to deal with that. Crap... >>>>> >>>>> -- >>>>> >>>>> Rick >>>> >> >> Last reply to this thread.. if you're on Windows it looks like TI >> provides what you need here: http://www.ti.com/tool/LMFLASHPROGRAMMER >> >> I'd be more than willing to bet it can accomplish the same task, >> though it's TI proprietary rather than open source for Linux. Whoever >> wrote up the instructions for that Mecrisp just probably hasn't tried >> it out or thought about . > > Yes, I'm on windows and have downloaded the TI tool, but not yet tried > to use it. I would like to run this on a raspberry pi as it is much > smaller and in some respects suits my lab use better than a PC. I will try > installing lm4flash the way you describe. > > There is a bit of irony in that to use a Forth tool I need to understand > how to compile a C program. lol I am rather weary of learning all the > ins and outs of complex tool, never knowing for sure what they are doing > or if I am using them correctly. That's the main motivator for using > Forth on this target. I'm trying to implement a rather simple function > and would like to have a simple tool. Even once I get this installed on > the host machine and I get Mecrisp installed on the target, I will still > need to learn the details of using Mecrisp. At least then I am learning > something I expect to use many times in the future. I plan to help with > the documentation of Mecrisp. I think that is the big weakness of most > open source tools, rather limited docs.
Oh, I forgot to say thanks. Thanks :) -- Rick
> > Oh, I forgot to say thanks. Thanks :) > > -- > > Rick
Sure thing! That's how open source software tends to be a lot of the time, it is built for Linux or similar, and comes with a makefile, maybe a configure script, and not a lot of documentation. If you're on Linux, the C compiler is already there 99% of the time (Raspberry Pi should have a compiler on board as well) so as long as you have the library sources you need you can usually get away with just typing "make" and when you get an error, somebody on one of the Linux forums or stackoverflow has probably asked about it already.
On 4/14/2015 10:33 AM, sbattazzo@gmail.com wrote:
> >> >> Oh, I forgot to say thanks. Thanks :) >> >> -- >> >> Rick > > Sure thing! > > That's how open source software tends to be a lot of the time, it is built for Linux or similar, and comes with a makefile, maybe a configure script, and not a lot of documentation. If you're on Linux, the C compiler is already there 99% of the time (Raspberry Pi should have a compiler on board as well) so as long as you have the library sources you need you can usually get away with just typing "make" and when you get an error, somebody on one of the Linux forums or stackoverflow has probably asked about it already.
Yeah, the rPi was an afterthought. I get tired of lugging my laptop around and there really isn't a lot of space on the work bench. Trouble with the pi is that it is far too slow for useful for web browsing. When I have a problem I still have to go back to the laptop to research it and possibly download something that then has to be transferred to the pi by sneaker net. I guess in theory they could be networked. I had that working on my old Win2K PCs some years back, thanks to World of Windows Networking (which appears to have been sold and is no longer very useful). But with Vista and now Win8 I can't get any of my PCs to talk to each other. Compared to the average person I am very computer literate, but when it comes to dealing with Microsoft, I just can't keep up with them breaking everything all the time. -- Rick
On Monday, April 13, 2015 at 7:18:08 PM UTC-4, sbat...@gmail.com wrote:
> On Thursday, April 2, 2015 at 6:08:24 PM UTC-7, rickman wrote: > > I am trying out Mecrisp on a TI Stellaris Launchpad I have had for > > sometime. This is a program to be loaded onto the Launchpad over the > > debug USB port using the on board debugger chip. The Mecrisp > > instructions are shown here... > > > > ;------------------------------------------------------------------------------ > > Hardware and configuration for LM4F120 and TM4C123: > > ;------------------------------------------------------------------------------ > > Connect your cable to the Debug-USB-Port, > > set "PWR SELECT" switch to DEBUG and > > close VDD jumper. > > > > Flashing is possible with lm4flash: > > https://github.com/utzig/lm4tools > > > > On startup, this runs with internal PIOSC at 16 MHz, > > which is specified +-3% over whole temperature range. > > > > I can figure out the switch part and I found the debug port. But I am > > stumped with the lm4flash tool. I managed to download the directory > > from github, but I don't see an executable, only sources. Clearly I am > > expected to be able to compile C code on the PC, but it has likely been > > a decade since I've done that. I don't even have a C compiler on this > > machine. > > > > I guess the idea is that anyone wanting to use this flashing tool would > > be doing C development and so would be familiar with how to compile the > > sources. I really don't want to have to figure out where to get C tools > > for the PC and how to get them running. Heck, it might be easier in the > > long run to transcribe the program into Forth and run it that way. 800 > > line of source counting white space, but few comments... oh, the code > > uses libusb-1.0 for USB. I don't know how to deal with that. Crap... > > > > -- > > > > Rick > > Should be very easy to take care of, unless you are hoping to do this on Windows. > Assuming you are on Linux and depending which distro you use, either apt-get or yum install libusb-dev and type make from the lm4flash directory off of the github. That should pretty much be all!
I took the 5 minutes to do this today... well, more like 15 with me stumbling around Linux on the rPi. I did manage to get lm4flash to compile, but I can't seem to figure out how to run it. I type lm4flash at the command line, but it says "command not found". The file has no visible extension. Is that expected? What am I missing?
rickman <gnuarm@gmail.com> writes:
> compile, but I can't seem to figure out how to run it. I type > lm4flash at the command line, but it says "command not found". The > file has no visible extension. Is that expected? What am I missing?
Try ./lm4flash
The 2026 Embedded Online Conference