andersond 0 Posted December 31, 2017 Share Posted December 31, 2017 Is it possible to use asm in energia? I would like to see some short and simple example of how to use it and compile it. I found THIS very nice and useful guide to make it work in code composer studio, but unfortunalley I could not put this code it to work in Energia, and I dont have CCS.. (I downloaded the version 7, but for some reason it did not install, just give errors, tried in 2 pcs) In the other hand, I found something about asm in Energia here in the forum, but is was intended for a more complex stuff, and I could not put it to work, too.. Could someone give me a light? I just want to do something very simple like blink a red led, then a green led, like in the example in the link, just to know how to handle asm in msp430. But in Energia, not CCS.. I am using the msp430g2553 launchpad. I have also a g2452 chip.. ps. my final objective is to make something like THIS in msp430 (the guy provides the emulator asm code for the atmel chip, I guess it would be possible to port it to msp, if you know asm and study the chips very well.... once tha arm emulator runs, I guess the rest will work...) Quote Link to post Share on other sites
Rei Vilo 695 Posted December 31, 2017 Share Posted December 31, 2017 Because Energia relies on Arduino, check assembler with Arduino. For example: https://ucexperiment.wordpress.com/2016/03/04/arduino-inline-assembly-tutorial-1/ Obviously, opcodes should be MSP430, not AVR. Quote Link to post Share on other sites
Rickta59 589 Posted December 31, 2017 Share Posted December 31, 2017 https://gist.github.com/RickKimball/ead0b3b0f28f0dbf426c51f46ced59ab Not exactly energia compatible but the blink code in asm is there. It is written to work with msp430-elf-gcc (the compiler used by energia) If you dig back in the history you can find a previous version that worked with msp430-gcc Quote Link to post Share on other sites
Rickta59 589 Posted December 31, 2017 Share Posted December 31, 2017 Also it really depends on which msp430 chip you want to use .. Have you looked in dev.ti.com for asm examples .. plenty there Quote Link to post Share on other sites
andersond 0 Posted January 1, 2018 Author Share Posted January 1, 2018 Thank you guys! I'll follow your tips and post my progress here! Regards! Quote Link to post Share on other sites
Peabody 15 Posted January 1, 2018 Share Posted January 1, 2018 Can I ask a related question? Recently I posted here about an alternate G2553 BSL entry mechanism that I had developed and posted on Github. This involves a very short code segment buried in INFOA in between the calibration data blocks. There are two requirements for it to work. The first is that the Reset vector at 0xFFFE must point to 0x10C0, which is where the boot entry code resides at the beginning of INFOA. The second is that the firmware which will be running on the chip after flashing must begin at 0xC000, which is the beginning of MAIN memory. The code in INFOA tests whether USB is connected, and if not it BRanches to 0xC000. So the application must begin there, and it must be an instruction, not .dw stuff. This is easy in assembler, but it has occurred to me that the two requirements might not be easy, or even possible, to satisfy in plain C or in Energia, about which I know very little. What do you think? Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.