Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 8 Replies) Program ist not starting after upload (Read 10633 times)
kwrtz
Junior Member
**
Offline


Posts: 11
Joined: Jul 30th, 2017
Program ist not starting after upload
Jul 30th, 2017 at 1:33pm
Print Post  
Hello, 
I am using  VS2015 Arduino 1.8.3 and the latest VisualMicro Version. 

When I compile and upload the attached program, as release or debug, it is not starting. Looks like setup() will never be called.

When I use the Arduino IDE for compiling and uploading, it works.

Can someone help me?

  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
kwrtz
Junior Member
**
Offline


Posts: 11
Joined: Jul 30th, 2017
Re: Program ist not starting after upload
Reply #1 - Jul 30th, 2017 at 8:18pm
Print Post  
Found a Bug in a file. But same problem.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Program ist not starting after upload
Reply #2 - Jul 30th, 2017 at 8:46pm
Print Post  
Hi,

Thanks for the info. We need to see the build output not the source code.

Please switch on vmicro>compiler>verbose and also "show build properties" then build and email the output as a .txt file to info[at]visualmicro.com or attach to a post here.

If you are new to visual micro I also suggest making sure the tool bar is set to Release and not Debug. Then upload.

Thanks
« Last Edit: Jul 30th, 2017 at 8:46pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Program ist not starting after upload
Reply #3 - Jul 31st, 2017 at 1:22pm
Print Post  
Thanks for the email.

So you have an Arduino Due (Programming Port) with a project called Edison.

Code
Select All
Uploading 'Edison' to 'Arduino Due (Programming Port)' using 'COM9'
Uploader started for board Arduino Due (Programming Port)
Upload method will be: bootloader
Uploading via Bootloader
\bossac.exe -i -d --port=COM9 -U false -e -w -b n.ino.bin" -R
 



Please switch on "file>prefereneces>upload verbose" in the arduino ide, then upload and email or post the output it shows.

  
Back to top
IP Logged
 
kwrtz
Junior Member
**
Offline


Posts: 11
Joined: Jul 30th, 2017
Re: Program ist not starting after upload
Reply #4 - Jul 31st, 2017 at 1:45pm
Print Post  
Here ist the output form ArduinoIDE
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Program ist not starting after upload
Reply #5 - Jul 31st, 2017 at 2:09pm
Print Post  
Thanks, does exactly the same program start with the arduino ide?

  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Program ist not starting after upload
Reply #6 - Jul 31st, 2017 at 2:14pm
Print Post  
Here are the summarized outputs from arduino ide and visual micro. They look the same?

Visual Micro

Code
Select All
Program Edison size: 119.508 bytes (used 23% of a 524.288 byte maximum) (1,10 secs)

Uploading 'Edison' to 'Arduino Due (Programming Port)' using 'COM9'
Uploader started for board Arduino Due (Programming Port)
Upload method will be: bootloader
Uploading via Bootloader
\bossac.exe -i -d --port=COM9 -U false -e -w -b n.ino.bin" -R

[==============================] 100% (477/477 pages)
done in 23.433 seconds
Set boot flash true
readWord(addr=0x400e0a08)=0
readWord(addr=0x400e0c08)=0x1
readWord(addr=0x400e0a08)=0x1
readWord(addr=0x400e0c08)=0x1
writeWord(addr=0x400e0a04,value=0x5a00010b)
readWord(addr=0x400e0a08)=0
readWord(addr=0x400e0c08)=0x1
readWord(addr=0x400e0a08)=0x1
readWord(addr=0x400e0c08)=0x1
CPU reset.
readWord(addr=0)=0x20088000
readWord(addr=0xe000ed00)=0x412fc230
readWord(addr=0x400e0740)=0
readWord(addr=0x400e0940)=0x285e0a60
writeWord(addr=0x400e1a00,value=0xa500000d) 



Arduino

Code
Select All
Der Sketch verwendet 119692 Bytes (22%) des Programmspeicherplatzes. Das Maximum sind 524288 Bytes.
Erzwinge Reset durch öffnen/schließen mit 1200 bps auf dem Port COM9
/bossac.exe -i -d --port=COM9 -U false -e -w -v -b C:\Users\Kai\AppData\Local\Temp\arduino_build_652335/Edison.ino.bin -R


[==============================] 100% (478/478 pages)
Verify successful
done in 21.543 seconds
Set boot flash true
readWord(addr=0x400e0a08)=0x1
readWord(addr=0x400e0c08)=0x1
writeWord(addr=0x400e0a04,value=0x5a00010b)
readWord(addr=0x400e0a08)=0
readWord(addr=0x400e0c08)=0x1
readWord(addr=0x400e0a08)=0x1
readWord(addr=0x400e0c08)=0x1
CPU reset.
readWord(addr=0)=0x20088000
readWord(addr=0xe000ed00)=0x412fc230
readWord(addr=0x400e0740)=0
readWord(addr=0x400e0940)=0x285e0a60
writeWord(addr=0x400e1a00,value=0xa500000d) 

  
Back to top
IP Logged
 
kwrtz
Junior Member
**
Offline


Posts: 11
Joined: Jul 30th, 2017
Re: Program ist not starting after upload
Reply #7 - Jul 31st, 2017 at 2:22pm
Print Post  
Sorry for that. In the meanwhile I changed some code. In the attachments now the files with the same code. First VisualMicr upload and direct after this I did it with the Arduino IDE..
I also changed the DUE board. But same problem.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
kwrtz
Junior Member
**
Offline


Posts: 11
Joined: Jul 30th, 2017
Re: Program ist not starting after upload
Reply #8 - Jul 31st, 2017 at 5:43pm
Print Post  
Hello Tim, 

thank you very much for your help.

Here is a second try a little bit later. Like before, I first compiled and  uploaded the code with VisualMicro. Then I directly opend the .ino file with the Arduino Ide and compiled and uploaded it again. 

  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Program ist not starting after upload
Reply #9 - Jul 31st, 2017 at 10:44pm
Print Post  
Thanks, can you confirm if it works when uploading using arduino ide?
  
Back to top
IP Logged
 
kwrtz
Junior Member
**
Offline


Posts: 11
Joined: Jul 30th, 2017
Re: Program ist not starting after upload
Reply #10 - Aug 1st, 2017 at 6:34am
Print Post  
Yes. When I upload the program with Arduino, then something is print on the screen. Furthermore I can input comands like H for Help. With VisualMicro I don't see anything and the Interface is not working. 

I found out following until know: In Edison.ino I call a function cmd_setup(); which is defined in ui.cpp. If I coment out this functin call, VisualMicro runs also. 
Ib the function  cmd_setup(); I only call the function cmdAdd() a lot of times. cmdAdd() therfore runs over a year now and could not be the problem. Aanyway, I went into the fuction cmdAdd()  and comment all comands out, in order the fucntion cmdAdd() will do nothing. Under this circumstances I only do functioncalls without any command. 
cmd_setup();->cmdAdd((char *)"hello", cmd_hello); ...
And I got hier the same problem. It looks like, that the file ui.cpp is wrong comiled or linked with VisualMicro.

I remember, that VisualStudion ask me, that sometimes the lines are not end wih /r/n. I can correct this. I did this, but then Arduino IDE sayed to me there are no correct UNICODE signs in and I have to correct this. But this was some days before. Maybe it has something to do with the charset.

I put the current code in again. You can try it by you own. Only install it on  a DUE. When starting there are some charchters shown. And when you press H Help will be shown. This works for me only with the Arduino IDE.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
kwrtz
Junior Member
**
Offline


Posts: 11
Joined: Jul 30th, 2017
Re: Program ist not starting after upload
Reply #11 - Aug 1st, 2017 at 7:00am
Print Post  
I tried know the following:

void cmdAdd(char *name, void(*func)(int argc, char **argv))
{
     return;
       ....
}

void cmd_setup()
{
cmdAdd((char *)"hello", cmd_hello);
return;
....
}

In Edison.ino  Setup I call cmd_setup();

And it is not working in VisualMicro.

When I do following:

void cmd_setup()
{
return;
cmdAdd((char *)"hello", cmd_hello);
....
}

It is working.

Could ther be a problem with the charset? I have German language installed.
  
Back to top
 
IP Logged
 
kwrtz
Junior Member
**
Offline


Posts: 11
Joined: Jul 30th, 2017
Re: Program ist not starting after upload
Reply #12 - Aug 1st, 2017 at 9:50am
Print Post  
I compared the cpp.o files regarding different build size between Arduino and VisualMicro. The filesize of some files is different on other not.
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
kwrtz
Junior Member
**
Offline


Posts: 11
Joined: Jul 30th, 2017
Re: Program ist not starting after upload
Reply #13 - Aug 1st, 2017 at 12:15pm
Print Post  
Further information: I put a delay before the first serial.println in hardware.cpp and uncomment cms_setup():

     debug.serial.println(F("cmd_setup"));
     delay(2000);
//      cmd_setup();
     debug.serial.println(F("cmd_setup1"));
     delay(2000);

The output with using VisualMicro is following:

Opening port
Port open
HardwareSetup started
HardwareSetup finished
!03,Mow Motor Sensor Offset: 0.000000
bht->reset diable flagCruiseSpiral
!04,SET BEHAV -> BH_NONE
cmd_setup
cmd_setup1
!03,Mow MotorDisabled: current high

Until here all works fine. Now I put in cmd_setup();

     debug.serial.println(F("cmd_setup"));
     delay(1000);
     cmd_setup();
     debug.serial.println(F("cmd_setup1"));
     delay(1000);

And got following result with VisualMicro:
Opening port
Port open
Hard    <--- now it stops here

This means cmd_setup() is never been called. 
It looks like the compiler or linker makes this problem in VisualMicro

I compile now the same code without changing anything with Arduino and get following result:

HardwareSetup started
HardwareSetup finished
!03,Mow Motor Sensor Offset: 0.000000
bht->reset diable flagCruiseSpiral
!04,SET BEHAV -> BH_NONE
cmd_setup
cmd_setup1
!03,Mow MotorDisabled: current high

Which is correct.

Is there a possibillity that VisualMicro stores information which will be used now instaed of compiling all new?
I compiled all new and deletet C:\Users\Kai\AppData\Local\Temp\VMBuilds\Edison
But this doesn't help.
Then I deleted 
C:\Users\Kai\AppData\Local\Temp\VMBuilds

And have the same problem. Cry
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Program ist not starting after upload
Reply #14 - Aug 1st, 2017 at 12:21pm
Print Post  
Thanks, I will look at the core compile to see what might be different. Due has been working for a long time so it will be interesting to see what has broken.

More in the next day or two.
  
Back to top
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Program ist not starting after upload
Reply #15 - Aug 3rd, 2017 at 10:29pm
Print Post  
Thanks very much for all the great info.

The problem was that the library object file(s), in your case, wire (i2c) was earlier in the linker statement than the object files of some of the project source code. 

The next release is here if you want to try it out.

https://1drv.ms/u/s!AsT00oFsGAmRkcdvRyZ4AtDKAeG_mQ

Thanks again


  
Back to top
IP Logged
 
kwrtz
Junior Member
**
Offline


Posts: 11
Joined: Jul 30th, 2017
Re: Program ist not starting after upload
Reply #16 - Aug 6th, 2017 at 3:54pm
Print Post  
Thank you very much for the help.  Sorry for the late answer, but I was the last days not at home.

I am able to compile and run the program. 

After installation, of your software, I had problems with your  serial interface. I had to change the field where "Echo Off" stands to "com9" than it works. This makes for me no sense. Furthermore, if I don't select one item of the selection box and click in  the field of the selection box, the box stays empty. Maybe there is an initializing problem, in order now after selecting "Echo Off" again it works.
« Last Edit: Aug 6th, 2017 at 4:10pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Program ist not starting after upload
Reply #17 - Aug 6th, 2017 at 4:14pm
Print Post  
Hi, thanks for the update. Good to hear the compile issue is fixed.

For the serial monitor maybe there is some other confusion here. Always leave it at the default of "Echo off" because that is normal. The echo simply writes everything that is read from the serial port to a different port. (I agree that allowing "empty" echo to be selected is invalid and should not be allowed by the software.)

I might be wrong but I suspect the confusion is that you have switched off the DTR? This will prevent the board from rebooting when the serial connects. The arduino ide has the Dtr On all the time.
  
Back to top
IP Logged
 
kwrtz
Junior Member
**
Offline


Posts: 11
Joined: Jul 30th, 2017
Re: Program ist not starting after upload
Reply #18 - Aug 7th, 2017 at 6:35am
Print Post  
Thanks for the Answer. You are right DTR was switched off. I can not remember, that I ever switch it off. But this information was very good. I have switched it on now.

  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint