2
\$\begingroup\$

I've searched around quite a lot, but haven't found an easy(ish) way to load programs onto the Cortex M3 using Linux.

I have tried using the summon-arm-toolchain https://github.com/esden/summon-arm-toolchain/ but it was having problems downloading one of its dependencies.

Does anyone know of any other options?

\$\endgroup\$
  • \$\begingroup\$ What do you need? A C compiler, a flash tool or a debugger? \$\endgroup\$ – Turbo J Jul 27 '12 at 2:17
  • \$\begingroup\$ A c compiler and flash tool I suppose, not so worried about a debugger. \$\endgroup\$ – routeburn Jul 27 '12 at 2:19
2
\$\begingroup\$

The C compiler I use for my Cortex M3 is Soucery Codebench Lite Edition. There are some alternatives like YAGARTO. You need to write (or find) a linker script that fits your MCU.

You also want the CMSIS package for your MCU. That contains all the register definitions.

For flashing and debugging I use OpenOCD, this allows to use GDB as frontend for both tasks. The EKS-LM3S1968 board is shipped with a JTAG-to-USB chip supported by OpenOCD.

\$\endgroup\$
  • \$\begingroup\$ OK, I've finally got this working, so for anyone else looking at this here are the steps for working with OpenOCD under Ubuntu Linux (assuming you have your micro program compiled). 1) sudo apt-get install openocd \$\endgroup\$ – routeburn Sep 8 '12 at 4:55
1
\$\begingroup\$

ARM JTAG is semi-standard and has many open hardware and software implementations.

But, as on many comparable devices you have a lower cost option too:

The Stellaris ® serial flash loader is a preprogrammed flash-resident utility used to download code to the flash memory of a device without the use of a debug interface. The serial flash loader uses a simple packet interface to provide synchronous communication with the device. The flash loader runs off the crystal and does not enable the PLL, so its speed is determined by the crystal used. The two serial interfaces that can be used are the UART0 and SSI0 interfaces. For simplicity, both the data format and communication protocol are identical for both serial interfaces.

In other words, all you really need is a configurable baud rate serial port, and some software which implements the data transfer described in the following portion of the data sheet (which is currently at http://www.ti.com/lit/ds/symlink/lm3s1968.pdf) It would be worth a web search to see if there's is already an open source implementation of a compatible loader utility out there.

For your toolchain problem, code sourcery's GCC download package should probably work, you will just need a linker script suitable for the memory layout of the part, which you can probably find with a web search for projects targeting that part done by other open tools enthusiasts.

\$\endgroup\$
  • \$\begingroup\$ I think I see what you're saying - so seen I'm not interested in debug capability I could just use the serial flash loader and bypass the JTAG altogether? Would it still be possible to do that using the board's USB port? \$\endgroup\$ – routeburn Jul 27 '12 at 3:11
  • \$\begingroup\$ You would probably change some boot mode pins and ignore the USB port, unless it goes to a USB-serial chip. If the board already has a USB debugger built in, then your problem could be needing compatible software - sometimes built in debugger protocols get reverse engineered and re-implemented in open source tools if there is enough interest in the eval board (for example, if it's sold as a loss leader to drum up interest in the chip) \$\endgroup\$ – Chris Stratton Jul 27 '12 at 3:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.