AndreL

REALLY? main() not found ? MSP432 Launchpad

11 posts in this topic

Everyone,

 

I am new to the Energia platform. I am a professional embedded developer, so rarely use Arduino like tools, well never :) Unless I am trying to teach someone how to get started. That said, I have a project that I was coding in TI Code Studio for a client, then I thought on this next project, much simpler, I would use Energia, so they could actually make changes to it -- 

 

Anyway, I downloaded the Energia ZIP latest, there is no installer, so unzipped into directory. I then set it up, board selected MSP432 Launchpad, then started trying examples. Everything works perfectly.

 

However, when I take ANY project, blink, you name it and save as and place into another directory, ANYWHERE -- then re-compile, I get:

 

C:\Users\Andre\AppData\Local\Energia15\packages\energia\hardware\msp432\1.3.3\cores\msp432\gnu/targets/arm/rtsv7M/lib/boot.am4fg(startup.om4fg): In function `startupC':
 
/db/vtree/library/trees/zumaprod/zumaprod-n06/exports/tirtos_full_2_20_00_06/products/bios_6_46_00_23/packages/gnu/targets/arm/rtsv7M/startup.c:76: undefined reference to `main'
 
collect2.exe: error: ld returned 1 exit status
 
exit status 1
Error compiling for board LaunchPad w/ msp432 EMT (48MHz).
 
In other words, the linker can't find main() -- so I am thinking, someone HARD coded a path somewhere and at this point, I can't save anything and then run it. Currently my work around is:
 
1. Open any example project, compile, upload, test it, works.
2. Take my source and copy into IDE, then compile, upload, it works.
3. IF I then try to save, I get read only, since the examples are flagged read-only, thus I save as another name, in a number of directories, no matter what, THEN when I try to compile I always get:
 
C:\Users\Andre\AppData\Local\Energia15\packages\energia\hardware\msp432\1.3.3\cores\msp432\gnu/targets/arm/rtsv7M/lib/boot.am4fg(startup.om4fg): In function `startupC':
 
/db/vtree/library/trees/zumaprod/zumaprod-n06/exports/tirtos_full_2_20_00_06/products/bios_6_46_00_23/packages/gnu/targets/arm/rtsv7M/startup.c:76: undefined reference to `main'
 
collect2.exe: error: ld returned 1 exit status
 
exit status 1
Error compiling for board LaunchPad w/ msp432 EMT (48MHz).
 
 
I am getting frustrated here, the whole point of this was to try and give the customers something they might be able to put hands on, but this IDE needs to be solid -- 
 
Anyway, any help or suggestions would be appreciated. 
 
This should work out of box, "saving" the project should NOT break the application and IDE loose track of the build process, etc. 
 
Andre'
 
 
 
bluehash likes this

Share this post


Link to post
Share on other sites

Thanks for reporting this and sorry for the inconvenience this is causing. This should be straight forward and would very much like to get to the bottom of this. So please bear with me while we try to get to the bottom of this.

 

I tried to reproduce it on Windows 10. But am not able to reproduce the issue (see steps below). You might have hit a corner case that we might not have caught. Would really appreciate it if you could provide details such as Sketch name, Sketch folder saved to, what is in that folder, etc. Anything helps. I'll then use those details to try and reproduce it. Would be great if you could try the below and see if that works.

 

Can you please also copy paste the entire output of the black log window in this thread for both the fail and success case? Before you do so, please turn on "Show verbose output during [ ] compilation". Hopefully that will provide additional clues.

 

This is what I did in an attempt to reproduce the issue.

 

  1. Open File->Examples->01.Basic->Blink
  2. File->Save As...
  3. Saved it to Desktop/Blink. This should produce a folder Blink on your Desktop with a file Blink.ino in it.
  4. Then Sketch->Verify/Compile

This works as expected, the file compiles and produces an .elf file but obviously I am missing something in my steps that makes it fail in your case.

 

Robert

bluehash likes this

Share this post


Link to post
Share on other sites

Thanks -- I will do some runs and show with a screen cast. But, you are saving to the desktop, this is a very magical place, and a good place to hardcode something, I wonder if you try saving in a C:\testing\Blink  -- what would happen?

 

Anyway, I will show with video -- right now, just fighting the serial system without debugging :)

 

Andre'

Share this post


Link to post
Share on other sites

None of the paths should be hardcoded and as far as I can see aren't. Saving to C:\testing\Blink still works for me.

 

Screencasts and log output pasts would be great to have.

Share this post


Link to post
Share on other sites

You said, any path but still I must ask. Does your windows user name have any weird characters like (how are they called in english), the:

Share this post


Link to post
Share on other sites

You said, any path but still I must ask. Does your windows user name have any weird characters like (how are they called in english), the:

Share this post


Link to post
Share on other sites

Hi there,

I´m having the same problem, with Energia 1.6.10E18 an my launchpad CC1350. I´m working with Windows 7 VM over Mac OS X Sierra.

This happens when I start Engergía the first time. To solve the problem I comment the 70 - 80 % of code and then the compilation is OK. After that I remove 

the comments (/* ...*/) and all is ok again. Now I can make changes for all day and no error.

How can I solve this issue ??

Thank´s a lot.

Litos 97

Share this post


Link to post
Share on other sites

Energia has had some sensitivity to not only unusual characters that might be in the path but also very long paths.  What has worked in the past to is to move the Energia folder to the root of your drive (or one or two folders away from the root) and to use text based folder names, avoiding special characters.  

Share this post


Link to post
Share on other sites

Thank you dubnet.

I´ve tried to short the paths and delete some blank spaces and so, but it doesn't work. 

I´ve attached a screenshot where you can see the compilation error log window.

My project path now is C:\energia_1_6_10E18\MGG\

Thank´s a lot.

Litos97

ERROR_UNDEFINED_MAIN.jpg

Share this post


Link to post
Share on other sites

Something is certainly wrong with your setup. In the picture you posted, I see it trying to compile using the -mcpu=cortex-m3 flag.  That is wrong it would be -mcpu=cortex-m4.  Looking at the stuff that is checked into github.com (those seem to be right) However, you can't really trust what is out on github. So who knows. You might look in the Energia15\package directory and find the platform.txt file and verify it has cortex-m4.

Never mind ignore this post I read the topic title and it was msp432 .. I didn't look closely at your post. You are using a cc1350 which is a cortex-m3.  I'm not sure what is wrong.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now