Jump to content
43oh

How to make a ROM image of a sketch for distribution


Recommended Posts

The MSP430 flashing command line tools are used in the background by Energia.

You could either write a batch file/shell script to upload the thus acquired binary to the MPS430, or you could "disassemble" the binary into a large string of characters or assembler statements and pack them into a C file. If you're concerned about people figuring out your code, consider using an obfuscator.

Link to post
Share on other sites

Why not zip up your source files so we can all learn something.

 

-rick

Happy to do that (not that I have anything particularly wonderful to pass along). But I suspect some of the folks in my Home Automation group might like to build the project without having to delve into Energia. 

Link to post
Share on other sites

They way I view the world is this. The whole reason to use something like Energia is to share your code so other people can learn from it and probably make it better. Energia and all the libraries people have contributed are free. However, someone had to do that work. If you want to use Energia then you probably should be giving back to the community of people who did work for free so you didn't have to.

 

-rick

Link to post
Share on other sites

The MSP430 flashing command line tools are used in the background by Energia.

You could either write a batch file/shell script to upload the thus acquired binary to the MPS430, or you could "disassemble" the binary into a large string of characters or assembler statements and pack them into a C file. If you're concerned about people figuring out your code, consider using an obfuscator.

Not concerned at all about protecting the code. Just want to make it easy for people who'd like to replicate the project. Your suggestion sounds too complicated for me to tackle. Where can I find info about the command line tools? 

Link to post
Share on other sites

Happy to do that (not that I have anything particularly wonderful to pass along). But I suspect some of the folks in my Home Automation group might like to build the project without having to delve into Energia.

If you give the source, when there are issues, other people can fix them. If you only provide a binary, then you become the critical path.

 

The common way to share embedded binaries is with an Intel HEX file. Enable the verbose compile preference in Energia that will show the path of your .elf file in the temp build directory. Also in that directory is a project.cpp.hex file. All flash loader apps (Elprotronic lite-430, the TI msp430 flash app) will accept an Intel HEX and load it on the msp430f5529.

 

-rick

Link to post
Share on other sites

They way I view the world is this. The whole reason to use something like Energia is to share your code so other people can learn from it and probably make it better. Energia and all the libraries people have contributed are free. However, someone had to do that work. If you want to use Energia then you probably should be giving back to the community of people who did work for free so you didn't have to.

 

-rick

Agreed. See previous response. But as someone with no previous experience with Arduino, I found getting started with Energia to be a nontrivial undertaking, and there are still big gaps in my knowledge (and I don't even know where to go to fill them). I was hoping to spare some folks the pain I went through. 

Link to post
Share on other sites

Agreed. See previous response. But as someone with no previous experience with Arduino, I found getting started with Energia to be a nontrivial undertaking, and there are still big gaps in my knowledge (and I don't even know where to go to fill them). I was hoping to spare some folks the pain I went through. 

Really?

 

1) Install Energia from http://www.energia.nu, follow the on-screen instructions

2) Unpack the source .zip file

3) Open the created folder

3) Double-click on "my-awesome-project.ino"

4) Connect the Launchpad MSP430G2, make sure the jumpers are all installed as when it was shipped

5) Click the "Upload" icon (the circle with the arrow to the right)

6) You're done!

Link to post
Share on other sites

In the "Sketch" menu/drop-down inside of Energia, there are a few simple ways to get to the generated hex file of your compiled sketch. 

- "Copy Hex file as path" will add the directory path to your hex file to your clipboard

- "Show compilation folder" will open up your windows explorer to show where all of the compiled files are, including the .hex file

 

Now that you have the .hex file, users can flash this to a LaunchPad with several tools:

- For MSP users, there is MSP430Flasher @ www.ti.com/msp430flasher // this tool is lightweight, has the ability to create batch files for simple one-click flashing, etc.

- For Tiva C users, there is LMFlasher @ http://www.ti.com/tool/lmflashprogrammer

- There is also the catch-all TI CCS UniFlash @ http://www.ti.com/tool/uniflash

- And also third party tools such as the one flasher from Elprotronic

 

Hope this helps!

Link to post
Share on other sites

Really?

 

Um, it's not quite that easy. Since my project is targeted at the F5529 LaunchPad, which seems to have only spotty support in Energia and its libraries, I had to make a few edits in the library sources (this alone was a bit of a project for a n00b like me). Trying to communicate this to someone with zero knowledge of, well, anything

Link to post
Share on other sites

Um, it's not quite that easy. Since my project is targeted at the F5529 LaunchPad, which seems to have only spotty support in Energia and its libraries, I had to make a few edits in the library sources (this alone was a bit of a project for a n00b like me). Trying to communicate this to someone with zero knowledge of, well, anything

Link to post
Share on other sites

@@RobLewis

Energia supports 'core' libraries, which are supplied with it as well as 'user' libraries. Perhaps if you packaged your modified libraries, renamed so they do not conflict with core's, and saved those in your user libraries, you could distribute those modified libraries with your source code. Instruct the user to copy your libraries to their user library directory, load your sketch and off they go.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...